phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] phpgwapi/inc/accounts class.accounts_.inc.php c...


From: Caeies
Subject: [Phpgroupware-cvs] phpgwapi/inc/accounts class.accounts_.inc.php c...
Date: Tue, 24 Oct 2006 09:20:17 +0000

CVSROOT:        /cvsroot/phpgwapi
Module name:    phpgwapi
Changes by:     Caeies <Caeies> 06/10/24 09:20:17

Modified files:
        inc/accounts   : class.accounts_.inc.php 
                         class.accounts_ldap.inc.php 
                         class.accounts_sql.inc.php 

Log message:
        Fix Quota for LDAP + E_ALL Fixes for Quota + merging code (if not 
working you know who to blame)

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/accounts/class.accounts_.inc.php?cvsroot=phpgwapi&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/accounts/class.accounts_ldap.inc.php?cvsroot=phpgwapi&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/accounts/class.accounts_sql.inc.php?cvsroot=phpgwapi&r1=1.19&r2=1.20

Patches:
Index: class.accounts_.inc.php
===================================================================
RCS file: /cvsroot/phpgwapi/phpgwapi/inc/accounts/class.accounts_.inc.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- class.accounts_.inc.php     20 Oct 2006 13:15:27 -0000      1.10
+++ class.accounts_.inc.php     24 Oct 2006 09:20:17 -0000      1.11
@@ -8,7 +8,7 @@
        * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General 
Public License
        * @package phpgwapi
        * @subpackage accounts
-       * @version $Id: class.accounts_.inc.php,v 1.10 2006/10/20 13:15:27 
skwashd Exp $
+       * @version $Id: class.accounts_.inc.php,v 1.11 2006/10/24 09:20:17 
Caeies Exp $
        */
        if (empty($GLOBALS['phpgw_info']['server']['account_repository']))
        {
@@ -873,6 +873,7 @@
                */
                function add_account2Group($groupID)
                {
+                       return true;
                }
                
                /**
@@ -885,6 +886,7 @@
                */
                function delete_account4Group($groupID)
                {
+                       return true;
                }
                
                function create($data, $default_prefs = true)
@@ -908,6 +910,7 @@
                        $data['account_expires']= !$data['account_expires'] ? 
$data['expires'] : $data['account_expires'];
                        $this->expires                  = 
$data['account_expires'] ? $data['account_expires'] : $this->expires;
                        $this->person_id                = $data['person_id'] ? 
$data['person_id'] : $this->person_id;
+                       $this->quota                    = isset($data['quota']) 
? (int)$data['quota'] : $this->quota;
                        return true;
                }
                

Index: class.accounts_ldap.inc.php
===================================================================
RCS file: /cvsroot/phpgwapi/phpgwapi/inc/accounts/class.accounts_ldap.inc.php,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- class.accounts_ldap.inc.php 25 Sep 2006 14:10:04 -0000      1.13
+++ class.accounts_ldap.inc.php 24 Oct 2006 09:20:17 -0000      1.14
@@ -11,7 +11,7 @@
        * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General 
Public License
        * @package phpgwapi
        * @subpackage accounts
-       * @version $Id: class.accounts_ldap.inc.php,v 1.13 2006/09/25 14:10:04 
Caeies Exp $
+       * @version $Id: class.accounts_ldap.inc.php,v 1.14 2006/10/24 09:20:17 
Caeies Exp $
        */
 
        /**
@@ -129,6 +129,14 @@
                        {
                                $this->person_id        = 
$this->data['person_id'] = $entries[0]['phpgwcontactid'][0];
                        }
+                       if ( !isset($entries[0]['phpgwquota']) || 
$entries[0]['phpgwquota'] === '')
+                       {
+                               $this->data['quota'] = $this->quota; // set to 
0 by default
+                       }
+                       else
+                       {
+                               $this->quota = $this->data['quota'] = 
$entries[0]['phpgwquota'];
+                       }
                        return $this->data;
                }
 
@@ -824,7 +832,7 @@
                        $entry['objectclass'][]       = 'phpgwAccount';
                        $entry['phpgwaccountid']      = 
$account_info['account_id'];
                        $entry['phpgwaccountexpires'] = 
isset($account_info['account_expires'])  ? $account_info['account_expires'] : 
$account_info['expires'];
-                       if ($account_info['account_status'] || 
$account_info['status'])
+                       if (isset($account_info['account_status']) || 
isset($account_info['status']))
                        {
                                $entry['phpgwaccountstatus'] = 
isset($account_info['account_status']) ? $account_info['account_status'] : 
$account_info['status'];
                        }
@@ -832,21 +840,28 @@
                        {
                                $entry['phpgwaccountstatus'] = 'I'; // 'I' for 
inactiv
                        }
-                       if ($account_info['lastlogin'])
+                       if (isset($account_info['lastlogin']))
                        {
                                $entry['phpgwlastlogin'] = 
$account_info['lastlogin'];
                        }
-                       if ($account_info['lastloginfrom'])
+                       if (isset($account_info['lastloginfrom']))
                        {
                                $entry['phpgwlastloginfrom'] = 
$account_info['lastloginfrom'];
                        }
-                       if ($account_info['lastpasswd_change'])
+                       if (isset($account_info['lastpasswd_change']))
                        {
                                $entry['phpgwlastpasswordchange'] = 
$account_info['lastpasswd_change'];
                        }
-                               
+                       if (isset($account_info['quota']))
+                       {
+                               $entry['phpgwquota'] = $account_info['quota'];
+                       }
+                       else
+                       {
+                               $entry['phpgwquota'] = isset($this->quota) ? 
$this->quota : 0;
+                       }
                        $structural_modification = false;
-                       if((int) $account_info['person_id'])
+                       if(isset($account_info['person_id']) && (int) 
$account_info['person_id'])
                        {
                                $entry['objectclass'][] = 'phpgwContact'; // 
shouldn't be structural
                                $entry['phpgwcontactid'] = 
(int)$account_info['person_id'];
@@ -862,11 +877,11 @@
                        $entry['uidnumber']           = 
$account_info['account_id'];
                        $entry['uid']                 = 
$account_info['account_lid'];
                        $entry['description']         = 
str_replace('*','',lang('phpgw-created account'));
-                       if ( $account_info['account_firstname'] )
+                       if ( isset($account_info['account_firstname']) )
                        {
                                $entry['givenname'] = 
$account_info['account_firstname'];
                        }
-                       if ( $account_info['account_lastname'] )
+                       if ( isset($account_info['account_lastname']) )
                        {
                                $entry['sn'] = 
$account_info['account_lastname'];
                        }
@@ -874,7 +889,7 @@
                        {
                                $entry['sn'] = ' ';
                        }
-                       if ($account_info['account_passwd'])
+                       if ( isset($account_info['account_passwd']) )
                        {
                                $entry['userpassword'] = 
$GLOBALS['phpgw']->common->encrypt_password($account_info['account_passwd']);
                        }
@@ -1033,6 +1048,14 @@
                        {
                                unset ($entry['memberuid']);
                        }
+                       if (isset($account_info['quota']))
+                       {
+                               $entry['phpgwquota'] = $account_info['quota'];
+                       }
+                       else
+                       {
+                               $entry['phpgwquota'] = isset($this->quota) ? 
$this->quota : 0;
+                       }
 
                        $oldEntry = 
$this->group_exists($account_info['account_id'], $dn);
 

Index: class.accounts_sql.inc.php
===================================================================
RCS file: /cvsroot/phpgwapi/phpgwapi/inc/accounts/class.accounts_sql.inc.php,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- class.accounts_sql.inc.php  20 Oct 2006 13:43:45 -0000      1.19
+++ class.accounts_sql.inc.php  24 Oct 2006 09:20:17 -0000      1.20
@@ -8,7 +8,7 @@
        * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General 
Public License
        * @package phpgwapi
        * @subpackage accounts
-       * @version $Id: class.accounts_sql.inc.php,v 1.19 2006/10/20 13:43:45 
skwashd Exp $
+       * @version $Id: class.accounts_sql.inc.php,v 1.20 2006/10/24 09:20:17 
Caeies Exp $
        */
 
        /**
@@ -78,7 +78,7 @@
                        $this->status                   = $this->data['status'] 
        = $this->db->f('account_status');
                        $this->expired                  = 
$this->data['expires']        = $this->db->f('account_expires');
                        $this->person_id                = 
$this->data['person_id']      = $this->db->f('person_id');
-                       $this->data['quota']                            = 
$this->db->f('account_quota');
+                       $this->quota                    = $this->data['quota']  
        = $this->db->f('account_quota');
                        return $this->data;
                }
 
@@ -395,7 +395,6 @@
                function set_data($data)
                {
                        parent::set_data($data);
-                       $this->quota = isset($data['quota']) ? 
(int)$data['quota'] : $this->quota;
                        if(!isset($this->person_id) || $this->person_id == '' )
                        {
                                // is there a reason to write 'NULL' into 
database?




reply via email to

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