source:
trunk/egroupware/egw-pwd-mysql-external.patch
@
147
Last change on this file since 147 was 38, checked in by , 17 years ago | |
---|---|
File size: 1.3 KB |
-
phpgwapi/inc/class.auth_mail.inc.
old new 87 87 88 88 function change_password($old_passwd, $new_passwd) 89 89 { 90 return False; 90 91 include('/var/alternc/bureau/class/functions.php'); 92 $db_host=$GLOBALS['mail_change_pwd']['db_host']; 93 $db_port=$GLOBALS['mail_change_pwd']['db_port']; 94 $db_pwd_user=$GLOBALS['mail_change_pwd']['db_user']; 95 $db_pwd_name=$GLOBALS['mail_change_pwd']['db_name']; 96 $db_pwd_pass=$GLOBALS['mail_change_pwd']['db_pass']; 97 98 $table=$GLOBALS['mail_change_pwd']['table_users']; 99 100 $username =$GLOBALS['egw_info']['user']['account_lid']; 101 $username_=str_replace("@","_",$GLOBALS['egw_info']['user']['account_lid']); 102 $crypted_passwd=_md5cr($new_passwd); 103 104 $connect_sql=mysql_connect($db_host.":".$db_port,$db_pwd_user,$db_pwd_pass); 105 if ($connect_sql) 106 { 107 $db=mysql_select_db($db_pwd_name,$connect_sql); 108 if($db) 109 { 110 $query="UPDATE $table SET password=\"$crypted_passwd\" 111 WHERE alias in (\"$username\",\"$username_\")"; 112 113 //print "<br /><br /><br />".$query; 114 115 $result=mysql_query($query, $connect_sql); 116 117 if ($result) 118 {return true;}else return false; 119 }else 120 {return false;} 121 122 }else 123 {return false;} 124 91 125 } 92 126 }
Note: See TracBrowser
for help on using the repository browser.