phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] api/auth/class.auth_sql.php, 1.1.1.1.2.12


From: nomail
Subject: [Phpgroupware-cvs] api/auth/class.auth_sql.php, 1.1.1.1.2.12
Date: Tue, 6 Jul 2004 09:20:11 +0200

Update of /api/auth
Modified Files:
        Branch: proposal-branch
          class.auth_sql.php

date: 2004/07/06 07:20:11;  author: jengo;  state: Exp;  lines: +17 -3

Log Message:
- Changing a password now updates the last password change field
- The "home" page now checks for your last password change
=====================================================================
Index: api/auth/class.auth_sql.php
diff -u api/auth/class.auth_sql.php:1.1.1.1.2.11 
api/auth/class.auth_sql.php:1.1.1.1.2.12
--- api/auth/class.auth_sql.php:1.1.1.1.2.11    Mon Jun 28 21:40:58 2004
+++ api/auth/class.auth_sql.php Tue Jul  6 07:20:11 2004
@@ -73,7 +73,7 @@
                        
$args->set('account_id',$GLOBALS['phpgw_data']['user']['id'],'integer');
                        $args = $args->get(func_get_args());
 
-                       if (! strlen($args['current_password']) && ! 
$GLOBALS['phpgw']->acl->check('api.account_mgr.edit'))
+                       if ((! strlen($args['current_password']) || 
$args['account_id'] != $GLOBALS['phpgw_data']['user']['id']) && ! 
$GLOBALS['phpgw']->acl->check('api.account_mgr.edit'))
                        {
                                return false;
                        }
@@ -85,12 +85,26 @@
                                                account_pwd='" . 
$this->_create_password($args['new_passwd']) . "',
                                                account_lastpwd_change=now()
                                        WHERE
-                                               account_id='" . 
$args['account_id'] . "'
+                                               account_id=" . 
$args['account_id'] . "
                        ");
 
                        return ($GLOBALS['phpgw']->db->affected_rows() ? true : 
false);
                }
 
+               function last_password_change()
+               {
+                       $dbresult = $GLOBALS['phpgw']->db->execute("
+                               SELECT
+                                       account_lastpwd_change
+                               FROM
+                                       phpgw_accounts
+                               WHERE
+                                       account_id=" . 
$GLOBALS['phpgw_data']['user']['id']             
+                       );
+
+                       return 
$GLOBALS['phpgw']->db->unixtimestamp($dbresult->fields['account_lastpwd_change']);
+               }
+
                function update_lastlogin($account_id, $ip)
                {
 




reply via email to

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