Changeset 775 for trunk


Ignore:
Timestamp:
Sep 16, 2016, 4:06:02 PM (8 years ago)
Author:
autocommit@…
Message:

la idea es de probar si podemos tener algo simple premiero, saco casi todo ahora

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/egroupware/CTA/inc/class.uiCTA.inc.php

    r774 r775  
    99        function changepassword ($data)
    1010        {
    11         // print ($GLOBALS['egw_info']['user']['account_lid']);
    12         // print "<br>";
     11        print ($GLOBALS['egw_info']['user']['account_lid']);
     12        print "<br>";
    1313        // print_r($data);
    1414        // print "<br>GET :";
     
    1717        // print_r ($_POST);
    1818
    19                 include_once('/var/alternc/bureau/class/functions.php');               
    20                 $db_host=$GLOBALS['mail_change_pwd']['db_host'];
    21                 $db_port=$GLOBALS['mail_change_pwd']['db_port'];
    22                 $db_pwd_user=$GLOBALS['mail_change_pwd']['db_user'];
    23                 $db_pwd_name=$GLOBALS['mail_change_pwd']['db_name'];
    24                 $db_pwd_pass=$GLOBALS['mail_change_pwd']['db_pass'];
    25 
    26                 $table=$GLOBALS['mail_change_pwd']['table_users'];
    27                 $username =$GLOBALS['egw_info']['user']['account_lid'];
    28        
    29                 //para cuando se cambia una cuenta desde admin
    30                 if ($_GET['menuaction'] =='admin.uiaccounts.edit_user')
    31                 {       
    32                         $username =$_REQUEST['account_lid'];
    33                 }
    34 
    35                 $username_=str_replace("@","_",$username);
    36                 $crypted_passwd=_md5cr($data['new_passwd']);
    37 
    38                 $connect_sql=mysql_connect($db_host.":".$db_port,$db_pwd_user,$db_pwd_pass);
    39                 if ($connect_sql)
    40                 {
    41                         $db=mysql_select_db($db_pwd_name,$connect_sql);
    42                         if($db)
    43                         {
    44                                 $query="UPDATE $table SET password=\"$crypted_passwd\"
    45                                         WHERE alias in (\"$username\",\"$username_\")";
    46 
    47                         // print "<br /><br /><br />".$query;
    48 
    49                                 $result=mysql_query($query, $connect_sql);
    50 
    51                                 if ($result)
    52                                         {return true;}else return false;
    53                                 }else
    54                                         {return false;}
    55 
    56                 }else
    57                 {return false;}
    5819        }
    5920}
Note: See TracChangeset for help on using the changeset viewer.