Changeset 35 for trunk/preferences
- Timestamp:
- 06/29/07 15:18:40 (17 years ago)
- Location:
- trunk/preferences
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/preferences/changepassword.php
r32 r35 26 26 if(!$GLOBALS['phpgw']->acl->check('changepassword', 1) || $_POST['cancel']) 27 27 { 28 $GLOBALS['phpgw']->redirect_link('/preferences/index.php'); 28 if ($GLOBALS['phpgw_info']['server']['use_https'] == 1) 29 Header('Location: http://' . $_SERVER['HTTP_HOST'] . $GLOBALS['phpgw_info']['server']['webserver_url'] . '/preferences/index.php'); 30 else 31 $GLOBALS['phpgw']->redirect_link('/preferences/index.php'); 32 29 33 $GLOBALS['phpgw']->common->phpgw_exit(); 30 34 } … … 48 52 if ($_POST['change']) 49 53 { 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 55 if ($n_passwd != $n_passwd_2)56 {57 $errors[] = lang('The two passwords are not the same');58 }59 60 if (! $n_passwd)61 {62 $errors[] = lang('You must enter a password');63 }64 65 54 // Default number of letters = 3 66 55 if (!$GLOBALS['phpgw_info']['server']['num_letters_userpass']) … … 69 58 if (!$GLOBALS['phpgw_info']['server']['num_special_letters_userpass']) 70 59 $GLOBALS['phpgw_info']['server']['num_special_letters_userpass'] = 0; 71 72 if ( strlen( $n_passwd ) < $GLOBALS['phpgw_info']['server']['num_letters_userpass'] ) 60 if (! $GLOBALS['phpgw']->auth->authenticate($GLOBALS['phpgw_info']['user']['account_lid'], $a_passwd)) 73 61 { 74 $errors[] = lang('Your password must contain %1 or more letters', $GLOBALS['phpgw_info']['server']['num_letters_userpass']);62 $errors[] = lang('Your actual password is wrong'); 75 63 } 76 64 else if ($n_passwd != $n_passwd_2) 65 { 66 $errors[] = lang('The two passwords are not the same'); 67 } 68 else if (! $n_passwd) 69 { 70 $errors[] = lang('You must enter a password'); 71 } 72 else 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 } 77 76 # password that start with a-Z or 0-9 and contain _.-!@#$%&*+=| will be accepted. 78 if (! ereg ("^([-a-zA-Z0-9_.\-!@#$%&*+=|])*$", $n_passwd ) )79 { 77 else if (! ereg ("(^[a-zA-Z0-9_.\-\!@#$%&*+=|]*)$", $n_passwd ) ) 78 { 80 79 $errors[] = lang('Your password contains characters not allowed'); 81 } 82 80 } 83 81 # 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 ) )82 else if ($GLOBALS['phpgw_info']['server']['num_special_letters_userpass'] && ! ereg ("([0-9_.\-!@#$%&*+=|]){".$GLOBALS['phpgw_info']['server']['num_special_letters_userpass'].",}", $n_passwd ) ) 85 83 { 86 84 $errors[] = lang('Your password must contain at least %1 numbers or characters special', $GLOBALS['phpgw_info']['server']['num_special_letters_userpass']); … … 114 112 $GLOBALS['hook_values']['new_passwd'] = $n_passwd; 115 113 $GLOBALS['phpgw']->hooks->process('changepassword'); 116 $GLOBALS['phpgw']->redirect_link('/preferences/index.php','cd=18'); 114 115 if ($GLOBALS['phpgw_info']['server']['use_https'] == 1) 116 Header('Location: http://' . $_SERVER['HTTP_HOST'] . $GLOBALS['phpgw_info']['server']['webserver_url'] . '/preferences/index.php'); 117 else 118 $GLOBALS['phpgw']->redirect_link('/preferences/index.php','cd=18'); 117 119 } 118 120 } -
trunk/preferences/index.php
r2 r35 132 132 while(list($text,$url) = each($file)) 133 133 { 134 if (($text == 'Change your Password') && ($GLOBALS['phpgw_info']['server']['use_https'] == 1)) 135 { 136 $url = 'https://' . $_SERVER['HTTP_HOST'] . $GLOBALS['phpgw_info']['server']['webserver_url'] . '/preferences/changepassword.php'; 137 } 134 138 section_item($url,lang($text)); 135 139 }
Note: See TracChangeset
for help on using the changeset viewer.