phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] CVS: phpgwapi/inc class.auth_sql.inc.php,1.13,1.13.4.


From: Joseph Engo <address@hidden>
Subject: [Phpgroupware-cvs] CVS: phpgwapi/inc class.auth_sql.inc.php,1.13,1.13.4.1
Date: Wed, 23 Apr 2003 20:32:00 -0400

Update of /cvsroot/phpgroupware/phpgwapi/inc
In directory subversions:/tmp/cvs-serv23268

Modified Files:
      Tag: Version-0_9_16-branch
        class.auth_sql.inc.php 
Log Message:
- Added method to change password via XML-RPC
- Added checks to confirm old password before changing to new one


Index: class.auth_sql.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/class.auth_sql.inc.php,v
retrieving revision 1.13
retrieving revision 1.13.4.1
diff -C2 -r1.13 -r1.13.4.1
*** class.auth_sql.inc.php      2 Oct 2001 05:37:26 -0000       1.13
--- class.auth_sql.inc.php      24 Apr 2003 00:31:58 -0000      1.13.4.1
***************
*** 28,31 ****
--- 28,40 ----
        {
                var $previous_login = -1;
+               var $xmlrpc_methods = array();
+ 
+               function auth()
+               {
+                       $this->xmlrpc_methods[] = array(
+                               'name'       => 'change_password',
+                               'decription' => 'Change the current users 
password'
+                       );
+               }
  
                function authenticate($username, $passwd, $passwd_type)
***************
*** 60,66 ****
                function change_password($old_passwd, $new_passwd, $account_id 
= '')
                {
!                       if (! $account_id)
                        {
                                $account_id = 
$GLOBALS['phpgw_info']['user']['account_id'];
                        }
  
--- 69,76 ----
                function change_password($old_passwd, $new_passwd, $account_id 
= '')
                {
!                       if (! $account_id || 
$GLOBALS['phpgw_info']['flags']['currentapp'] == 'login')
                        {
                                $account_id = 
$GLOBALS['phpgw_info']['user']['account_id'];
+                               $pwd_check  = " and account_pwd='" . 
md5($old_passwd) . "'";
                        }
  
***************
*** 68,76 ****
  
                        $GLOBALS['phpgw']->db->query("update phpgw_accounts set 
account_pwd='" . md5($new_passwd) . "',"
!                               . "account_lastpwd_change='" . time() . "' 
where account_id='" . $account_id . "'",__LINE__,__FILE__);
  
!                       
$GLOBALS['phpgw']->session->appsession('password','phpgwapi',$new_passwd);
! 
!                       return $encrypted_passwd;
                }
  
--- 78,92 ----
  
                        $GLOBALS['phpgw']->db->query("update phpgw_accounts set 
account_pwd='" . md5($new_passwd) . "',"
!                               . "account_lastpwd_change='" . time() . "' 
where account_id='" . $account_id . "'" . $pwd_check,__LINE__,__FILE__);
  
!                       if ($GLOBALS['phpgw']->db->affected_rows())
!                       {
!                               
$GLOBALS['phpgw']->session->appsession('password','phpgwapi',$new_passwd);
!                               return $encrypted_passwd;
!                       }
!                       else
!                       {
!                               return False;
!                       }
                }
  





reply via email to

[Prev in Thread] Current Thread [Next in Thread]