summaryrefslogtreecommitdiff
path: root/httemplate/pref/pref-process.html
diff options
context:
space:
mode:
authorivan <ivan>2007-01-26 08:04:37 +0000
committerivan <ivan>2007-01-26 08:04:37 +0000
commitf01e2ce0aa6c1925e6266d78797025ec68bfac07 (patch)
tree4b2efa16a130989e97eee59bfc72621d4d7a53fe /httemplate/pref/pref-process.html
parent4d68624491e3500a0bdb737a421c3711e5defebf (diff)
top bar option!
Diffstat (limited to 'httemplate/pref/pref-process.html')
-rw-r--r--httemplate/pref/pref-process.html41
1 files changed, 28 insertions, 13 deletions
diff --git a/httemplate/pref/pref-process.html b/httemplate/pref/pref-process.html
index a342a51ec..221edc682 100644
--- a/httemplate/pref/pref-process.html
+++ b/httemplate/pref/pref-process.html
@@ -1,26 +1,41 @@
% my $error = '';
%
-% my $access_user = qsearchs( 'access_user', {
-% 'username' => getotaker,
-% '_password' => $cgi->param('_password'),
-% } );
+% my $access_user;
+% if ( grep { $cgi->param($_) !~ /^\s*$/ }
+% qw(_password new_password new_password2)
+% ) {
%
-% $error = 'Current password incorrect; password not changed'
-% unless $access_user;
+% my $access_user = qsearchs( 'access_user', {
+% 'username' => getotaker,
+% '_password' => $cgi->param('_password'),
+% } );
%
-% $error ||= "New passwords don't match"
-% unless $cgi->param('new_password') eq $cgi->param('new_password2');
+% $error = 'Current password incorrect; password not changed'
+% unless $access_user;
%
-% $error ||= "No new password entered"
-% unless length($cgi->param('new_password'));
+% $error ||= "New passwords don't match"
+% unless $cgi->param('new_password') eq $cgi->param('new_password2');
%
-% $access_user->_password($cgi->param('new_password')) unless $error;
-% $error ||= $access_user->replace;
+% $error ||= "No new password entered"
+% unless length($cgi->param('new_password'));
+%
+% $access_user->_password($cgi->param('new_password')) unless $error;
+%
+% } else {
+%
+% $access_user = $FS::CurrentUser::CurrentUser;
+%
+% }
+%
+% $error ||= $access_user->replace( { map { $_ => scalar($cgi->param($_)) }
+% qw( menu_position ) #XXX autogen
+% }
+% );
%
% if ( $error ) {
% $cgi->param('error', $error);
% print $cgi->redirect(popurl(1). "pref.html?". $cgi->query_string );
% } else {
-<% include('/elements/header.html', 'Password changed') %>
+<% include('/elements/header.html', 'Preferences updated') %>
<% include('/elements/footer.html') %>
% }