diff --git a/preferences/changepassword.php b/preferences/changepassword.php index 99dd9e9db0..213785b8bb 100755 --- a/preferences/changepassword.php +++ b/preferences/changepassword.php @@ -26,64 +26,41 @@ $phpgw->common->phpgw_exit(); } - if (! $submit) - { - $phpgw->common->phpgw_header(); - echo parse_navbar(); + $phpgw->template->set_file(array( + 'form' => 'changepassword.tpl' + )); + $phpgw->template->set_var('lang_changepassword',lang('Change password')); + $phpgw->template->set_var('lang_enter_password',lang('Enter your new password')); + $phpgw->template->set_var('lang_reenter_password',lang('Re-enter your password')); + $phpgw->template->set_var('lang_change',lang('Change')); + $phpgw->template->set_var('form_action',$phpgw->link('/preferences/changepassword.php')); - ?> -
- - - - - - - - - - - - -
- - - -
- - - -
- -
-
-
- ' . lang('note: This feature does *not* change your email password. This will ' - . 'need to be done manually.') . ''; - } - $phpgw->common->phpgw_footer(); - + if ($phpgw_info['server']['auth_type'] != 'ldap') + { + $phpgw->template->set_var('sql_message',lang('note: This feature does *not* change your email password. This will ' + . 'need to be done manually.')); } - else + + + if ($submit) { if ($n_passwd != $n_passwd_2) { - $error = lang('The two passwords are not the same'); + $errors[] = lang('The two passwords are not the same'); } if (! $n_passwd) { - $error = lang('You must enter a password'); + $errors[] = lang('You must enter a password'); } - if ($error) + if (is_array($errors)) { + $phpgw->common->phpgw_header(); echo parse_navbar(); - echo '


' . $error . '

'; - $phpgw->common->phpgw_exit(); + $phpgw->template->set_var('messages',$phpgw->common->error_list($errors)); + $phpgw->template->pfp('out','form'); + $phpgw->common->phpgw_exit(True); } $o_passwd = $phpgw_info['user']['passwd']; @@ -96,8 +73,16 @@ else { $phpgw_info['user']['passwd'] = $phpgw->auth->change_password($o_passwd, $n_passwd); - //$phpgw->accounts->sync(); Header('Location: ' . $phpgw->link('/preferences/index.php','cd=18')); } + + } + else + { + $phpgw->common->phpgw_header(); + echo parse_navbar(); + + $phpgw->template->pfp('out','form'); + $phpgw->common->phpgw_footer(); } ?> diff --git a/preferences/templates/default/changepassword.tpl b/preferences/templates/default/changepassword.tpl new file mode 100644 index 0000000000..009172efb1 --- /dev/null +++ b/preferences/templates/default/changepassword.tpl @@ -0,0 +1,31 @@ +{lang_changepassword}

+ +

{messages}
+ +
+ + + + + + + + + + + + +
+ {lang_enter_password} + + +
+ {lang_reenter_password} + + +
+ +
+
+
+
{sql_message}
\ No newline at end of file