Last change
on this file since 252 was
38,
checked in by sebas, 17 years ago
|
La patch que martin hizo, gracias a el :)
|
File size:
1.3 KB
|
Rev | Line | |
---|
[38] | 1 | --- phpgwapi/inc/class.auth_mail.inc.php-orig 2007-09-19 19:53:31.000000000 -0300 |
---|
| 2 | +++ phpgwapi/inc/class.auth_mail.inc.php 2007-04-20 13:13:11.000000000 -0300 |
---|
| 3 | @@ -87,6 +87,40 @@ |
---|
| 4 | |
---|
| 5 | function change_password($old_passwd, $new_passwd) |
---|
| 6 | { |
---|
| 7 | - return False; |
---|
| 8 | + |
---|
| 9 | + include('/var/alternc/bureau/class/functions.php'); |
---|
| 10 | + $db_host=$GLOBALS['mail_change_pwd']['db_host']; |
---|
| 11 | + $db_port=$GLOBALS['mail_change_pwd']['db_port']; |
---|
| 12 | + $db_pwd_user=$GLOBALS['mail_change_pwd']['db_user']; |
---|
| 13 | + $db_pwd_name=$GLOBALS['mail_change_pwd']['db_name']; |
---|
| 14 | + $db_pwd_pass=$GLOBALS['mail_change_pwd']['db_pass']; |
---|
| 15 | + |
---|
| 16 | + $table=$GLOBALS['mail_change_pwd']['table_users']; |
---|
| 17 | + |
---|
| 18 | + $username =$GLOBALS['egw_info']['user']['account_lid']; |
---|
| 19 | + $username_=str_replace("@","_",$GLOBALS['egw_info']['user']['account_lid']); |
---|
| 20 | + $crypted_passwd=_md5cr($new_passwd); |
---|
| 21 | + |
---|
| 22 | + $connect_sql=mysql_connect($db_host.":".$db_port,$db_pwd_user,$db_pwd_pass); |
---|
| 23 | + if ($connect_sql) |
---|
| 24 | + { |
---|
| 25 | + $db=mysql_select_db($db_pwd_name,$connect_sql); |
---|
| 26 | + if($db) |
---|
| 27 | + { |
---|
| 28 | + $query="UPDATE $table SET password=\"$crypted_passwd\" |
---|
| 29 | + WHERE alias in (\"$username\",\"$username_\")"; |
---|
| 30 | + |
---|
| 31 | + //print "<br /><br /><br />".$query; |
---|
| 32 | + |
---|
| 33 | + $result=mysql_query($query, $connect_sql); |
---|
| 34 | + |
---|
| 35 | + if ($result) |
---|
| 36 | + {return true;}else return false; |
---|
| 37 | + }else |
---|
| 38 | + {return false;} |
---|
| 39 | + |
---|
| 40 | + }else |
---|
| 41 | + {return false;} |
---|
| 42 | + |
---|
| 43 | } |
---|
| 44 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.