Changeset 32 for trunk/preferences
- Timestamp:
- 06/08/07 15:18:19 (17 years ago)
- Location:
- trunk/preferences
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/preferences/changepassword.php
r2 r32 20 20 include('../header.inc.php'); 21 21 22 $a_passwd = $_POST['a_passwd']; 22 23 $n_passwd = $_POST['n_passwd']; 23 24 $n_passwd_2 = $_POST['n_passwd_2']; … … 32 33 'form' => 'changepassword.tpl' 33 34 )); 35 $GLOBALS['phpgw']->template->set_var('lang_enter_actual_password',lang('Enter your actual password')); 34 36 $GLOBALS['phpgw']->template->set_var('lang_enter_password',lang('Enter your new password')); 35 37 $GLOBALS['phpgw']->template->set_var('lang_reenter_password',lang('Re-enter your password')); … … 46 48 if ($_POST['change']) 47 49 { 50 if (! $GLOBALS['phpgw']->auth->authenticate($GLOBALS['phpgw_info']['user']['account_lid'], $a_passwd)) 51 { 52 $errors[] = lang('Your actual password is wrong'); 53 } 54 48 55 if ($n_passwd != $n_passwd_2) 49 56 { … … 55 62 $errors[] = lang('You must enter a password'); 56 63 } 64 65 // Default number of letters = 3 66 if (!$GLOBALS['phpgw_info']['server']['num_letters_userpass']) 67 $GLOBALS['phpgw_info']['server']['num_letters_userpass'] = 3; 68 // Default number of special letters = 0 69 if (!$GLOBALS['phpgw_info']['server']['num_special_letters_userpass']) 70 $GLOBALS['phpgw_info']['server']['num_special_letters_userpass'] = 0; 57 71 72 if ( strlen( $n_passwd ) < $GLOBALS['phpgw_info']['server']['num_letters_userpass'] ) 73 { 74 $errors[] = lang('Your password must contain %1 or more letters', $GLOBALS['phpgw_info']['server']['num_letters_userpass']); 75 } 76 77 # password that start with a-Z or 0-9 and contain _.-!@#$%&*+=| will be accepted. 78 if (! ereg ("^([-a-zA-Z0-9_.\-!@#$%&*+=|])*$", $n_passwd ) ) 79 { 80 $errors[] = lang('Your password contains characters not allowed'); 81 } 82 83 # password must contain 2 special letters, numbers or special characters 84 if (! ereg ("([0-9_.\-!@#$%&*+=|]){".$GLOBALS['phpgw_info']['server']['num_special_letters_userpass'].",}", $n_passwd ) ) 85 { 86 $errors[] = lang('Your password must contain at least %1 numbers or characters special', $GLOBALS['phpgw_info']['server']['num_special_letters_userpass']); 87 } 88 58 89 if(is_array($errors)) 59 90 { -
trunk/preferences/templates/default/changepassword.tpl
r2 r32 5 5 <form method="POST" action="{form_action}"> 6 6 <table border="0"> 7 <tr> 8 <td> 9 {lang_enter_actual_password} 10 </td> 11 <td> 12 <input type="password" name="a_passwd"> 13 </td> 14 </tr> 7 15 <tr> 8 16 <td>
Note: See TracChangeset
for help on using the changeset viewer.