Rev | Line | |
---|
[47] | 1 | <? |
---|
| 2 | |
---|
| 3 | class uiCTA { |
---|
| 4 | |
---|
| 5 | var $public_functions = array( |
---|
| 6 | "changepassword" => True |
---|
| 7 | ); |
---|
| 8 | |
---|
| 9 | function changepassword ($data) |
---|
| 10 | { |
---|
| 11 | //print ($GLOBALS['egw_info']['user']['account_lid']); |
---|
| 12 | //print_r($data); |
---|
| 13 | |
---|
| 14 | include('/var/alternc/bureau/class/functions.php'); |
---|
| 15 | $db_host=$GLOBALS['mail_change_pwd']['db_host']; |
---|
| 16 | $db_port=$GLOBALS['mail_change_pwd']['db_port']; |
---|
| 17 | $db_pwd_user=$GLOBALS['mail_change_pwd']['db_user']; |
---|
| 18 | $db_pwd_name=$GLOBALS['mail_change_pwd']['db_name']; |
---|
| 19 | $db_pwd_pass=$GLOBALS['mail_change_pwd']['db_pass']; |
---|
| 20 | |
---|
| 21 | $table=$GLOBALS['mail_change_pwd']['table_users']; |
---|
| 22 | |
---|
| 23 | $username =$GLOBALS['egw_info']['user']['account_lid']; |
---|
| 24 | $username_=str_replace("@","_",$GLOBALS['egw_info']['user']['account_lid']); |
---|
| 25 | $crypted_passwd=_md5cr($data['Åew_passwd']); |
---|
| 26 | |
---|
| 27 | $connect_sql=mysql_connect($db_host.":".$db_port,$db_pwd_user,$db_pwd_pass); |
---|
| 28 | if ($connect_sql) |
---|
| 29 | { |
---|
| 30 | $db=mysql_select_db($db_pwd_name,$connect_sql); |
---|
| 31 | if($db) |
---|
| 32 | { |
---|
| 33 | $query="UPDATE $table SET password=\"$crypted_passwd\" |
---|
| 34 | WHERE alias in (\"$username\",\"$username_\")"; |
---|
| 35 | |
---|
| 36 | //print "<br /><br /><br />".$query; |
---|
| 37 | |
---|
| 38 | $result=mysql_query($query, $connect_sql); |
---|
| 39 | |
---|
| 40 | if ($result) |
---|
| 41 | {return true;}else return false; |
---|
| 42 | }else |
---|
| 43 | {return false;} |
---|
| 44 | |
---|
| 45 | }else |
---|
| 46 | {return false;} |
---|
| 47 | |
---|
| 48 | } |
---|
| 49 | } |
---|
| 50 | |
---|
| 51 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.