Changeset 35
- Timestamp:
- 06/29/07 15:18:40 (17 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/login.php
r25 r35 273 273 // the users browser accepts. 274 274 list($lang) = explode(',',$_SERVER['HTTP_ACCEPT_LANGUAGE']); 275 /* 275 276 if(strlen($lang) > 2) 276 277 { 277 278 $lang = substr($lang,0,2); 278 279 } 280 */ 279 281 $GLOBALS['phpgw_info']['user']['preferences']['common']['lang'] = $lang; 280 282 } -
trunk/phpgwapi/inc/class.sector_search_ldap.inc.php
r31 r35 139 139 array_pop ( $array_dn_reverse ); 140 140 141 $inverted_dn[$dn] = implode ( " ;", $array_dn_reverse );141 $inverted_dn[$dn] = implode ( "#", $array_dn_reverse ); 142 142 } 143 143 … … 151 151 $display = ''; 152 152 153 $array_dn_reverse = explode ( " ;", $invert_ufn );153 $array_dn_reverse = explode ( "#", $invert_ufn ); 154 154 $array_dn = array_reverse ( $array_dn_reverse, true ); 155 155 … … 158 158 if ($level == 0) 159 159 $display .= '+'; 160 else { 161 for ($i=0; $i<$level; $i++) 162 $display .= '---'; 160 else 161 { 162 for ($i=0; $i<$level; $i++) 163 $display .= '---'; 163 164 } 164 165 … … 181 182 return $options; 182 183 } 184 185 // Retorna os setores (somente OUs de primeiro nivel) com as options prontas 186 function get_sectors($selected='', $referral=false ,$show_invisible_ou=false) 187 { 188 $dn = $GLOBALS['phpgw_info']['server']['ldap_root_dn']; 189 $passwd = $GLOBALS['phpgw_info']['server']['ldap_root_pw']; 190 $context = $GLOBALS['phpgw_info']['server']['ldap_context']; 191 $ldap_conn = ldap_connect($GLOBALS['phpgw_info']['server']['ldap_host']); 192 193 ldap_set_option($ldap_conn, LDAP_OPT_PROTOCOL_VERSION, 3); 194 195 if ($referral) 196 ldap_set_option($ldap_conn, LDAP_OPT_REFERRALS, 1); 197 else 198 ldap_set_option($ldap_conn, LDAP_OPT_REFERRALS, 0); 199 200 ldap_bind($ldap_conn,$dn,$passwd); 201 202 $justthese = array("dn", "ou"); 203 $filter = $show_invisible_ou ? "(ou=*)" : "(&(ou=*)(!(phpgwAccountVisible=-1)))"; 204 205 $search=ldap_list($ldap_conn, $context, $filter, $justthese); 206 207 ldap_sort($ldap_conn, $search, "ou"); 208 $info = ldap_get_entries($ldap_conn, $search); 209 210 ldap_close($ldap_conn); 211 $options = ''; 212 for ($i=0; $i<$info["count"]; $i++) 213 { 214 $dn = trim(strtolower($info[$i]['dn'])); 215 if ( $dn == $selected ) 216 $select = ' selected'; 217 else 218 $select = ''; 219 $display = strtoupper($info[$i]['ou'][0]); 220 $options .= "<option value='$dn'$select>$display </option>"; 221 } 222 223 return $options; 224 } 183 225 } 184 226 ?> -
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.