# Copyright (c) 2001-2005 bivio Software, Inc. All rights reserved. # # Visit http://www.bivio.biz for more info. # # This library is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation; either version 2.1 of the # License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; If not, you may get a copy from: # http://www.opensource.org/licenses/lgpl-license.html # # $Id: account.bview,v 2.7 2007/09/10 21:02:21 nagler Exp $ # # Account editing # view_parent('menu'); view_put(header_title => 'Account'); # returns true if the account is being edited my($edit_mode_condition) = sub { return shift->get_request->get('task_id') == Bivio::Agent::TaskId->USER_ACCOUNT_EDIT; }; view_put(menu_content => Form('UserAccountForm', Grid([ [ String(<<'EOF', 'warning', {cell_colspan => 2}), This a demonstration site. DO NOT ENTER REAL DATA. EOF ], [ If(['auth_user'], Link( If([['auth_user'], '->require_otp'], 'Reset OTP', 'Convert your account to OTP', ), 'USER_OTP')), ], [ vs_blank_cell(), ], [ String('Account Information:', 'page_heading', { cell_colspan => 2, }), ], [ vs_form_field('UserAccountForm.Email.email'), ], [ Link('Click here to change your password', 'USER_PASSWORD', { cell_colspan => 2, }), ], [ vs_form_field('UserAccountForm.RealmOwner.password', {}, ['!', $edit_mode_condition]), ], [ String('Address:', 'page_heading', {cell_colspan => 2}), ], [ vs_form_field('UserAccountForm.User.first_name'), ], [ vs_form_field('UserAccountForm.User.last_name'), ], vs_address_fields('UserAccountForm', ''), [ ImageFormButton({ image => 'submit', field => 'ok_button', alt => 'Submit', }), ], ], { pad => 2, }, ), { string_font => 'page_text', }));