phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] phpgwapi/inc class.acl.inc.php


From: Sigurd Nes
Subject: [Phpgroupware-cvs] phpgwapi/inc class.acl.inc.php
Date: Wed, 28 Mar 2007 09:54:28 +0000

CVSROOT:        /sources/phpgwapi
Module name:    phpgwapi
Changes by:     Sigurd Nes <sigurdne>   07/03/28 09:54:28

Modified files:
        inc            : class.acl.inc.php 

Log message:
        Clean shm if change rights

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/class.acl.inc.php?cvsroot=phpgwapi&r1=1.109&r2=1.110

Patches:
Index: class.acl.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/class.acl.inc.php,v
retrieving revision 1.109
retrieving revision 1.110
diff -u -b -r1.109 -r1.110
--- class.acl.inc.php   25 Mar 2007 12:49:59 -0000      1.109
+++ class.acl.inc.php   28 Mar 2007 09:54:28 -0000      1.110
@@ -6,7 +6,7 @@
        * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General 
Public License
        * @package phpgwapi
        * @subpackage accounts
-       * @version $Id: class.acl.inc.php,v 1.109 2007/03/25 12:49:59 sigurdne 
Exp $
+       * @version $Id: class.acl.inc.php,v 1.110 2007/03/28 09:54:28 sigurdne 
Exp $
        */
 
        /**
@@ -461,24 +461,7 @@
 
                        $this->db->transaction_commit();
 
-                       if($this->load_from_shm())
-                       {
-                               
$GLOBALS['phpgw']->shm->delete_key($GLOBALS['phpgw_info']['user']['domain'] . 
'acl_data_groups_' . $this->account_id);
-                               
$GLOBALS['phpgw']->shm->delete_key($GLOBALS['phpgw_info']['user']['domain'] . 
'acl_data_accounts_' . $this->account_id);
-                               
$GLOBALS['phpgw']->shm->delete_key($GLOBALS['phpgw_info']['user']['domain'] . 
'acl_data_both_' . $this->account_id);
-
-                               $members = 
$this->get_ids_for_location($this->account_id, 1, 'phpgw_group');
-
-                               if (is_array($members) && count($members) > 0)
-                               {
-                                       foreach ( $members as $account_id )
-                                       {
-                                               
$GLOBALS['phpgw']->shm->delete_key($GLOBALS['phpgw_info']['user']['domain'] . 
'acl_data_groups_' . $account_id);
-                                               
$GLOBALS['phpgw']->shm->delete_key($GLOBALS['phpgw_info']['user']['domain'] . 
'acl_data_accounts_' . $ccount_id);
-                                               
$GLOBALS['phpgw']->shm->delete_key($GLOBALS['phpgw_info']['user']['domain'] . 
'acl_data_both_' . $account_id);
-                                       }
-                               }
-                       }
+                       $this->clean_shm($this->account_id);
 
 //                     return $unique_data;
                }
@@ -784,6 +767,9 @@
                                $sql .= " values ('" . $app . "','" . 
$acl_location . "','" . $account_id . "','" . intval($rights) . "', NULL ,'0')";
                                $this->db->query($sql ,__LINE__,__FILE__);
                        }
+
+                       $this->clean_shm($account_id);
+
                        return true;
                }
 
@@ -818,6 +804,9 @@
 
                        $sql = "DELETE FROM phpgw_acl WHERE acl_appname LIKE 
'{$app}' AND acl_location LIKE '{$location}' $account_sel";
                        $this->db->query($sql ,__LINE__,__FILE__);
+
+                       $this->clean_shm($account_id);
+                       
                        return $this->db->num_rows();
                }
                        
@@ -1324,4 +1313,32 @@
 
                        return $acl_accounts;
                }
+
+               /**
+               * Delete ACL information from shared memory
+               *
+               * @param integer $account_id
+               */
+               function clean_shm($account_id)
+               {
+                       if($this->load_from_shm())
+                       {
+                               
$GLOBALS['phpgw']->shm->delete_key($GLOBALS['phpgw_info']['user']['domain'] . 
'acl_data_groups_' . $account_id);
+                               
$GLOBALS['phpgw']->shm->delete_key($GLOBALS['phpgw_info']['user']['domain'] . 
'acl_data_accounts_' . $account_id);
+                               
$GLOBALS['phpgw']->shm->delete_key($GLOBALS['phpgw_info']['user']['domain'] . 
'acl_data_both_' . $account_id);
+
+                               $members = 
$this->get_ids_for_location($account_id, 1, 'phpgw_group');
+
+                               if (is_array($members) && count($members) > 0)
+                               {
+                                       foreach ( $members as $account_id )
+                                       {
+                                               
$GLOBALS['phpgw']->shm->delete_key($GLOBALS['phpgw_info']['user']['domain'] . 
'acl_data_groups_' . $account_id);
+                                               
$GLOBALS['phpgw']->shm->delete_key($GLOBALS['phpgw_info']['user']['domain'] . 
'acl_data_accounts_' . $ccount_id);
+                                               
$GLOBALS['phpgw']->shm->delete_key($GLOBALS['phpgw_info']['user']['domain'] . 
'acl_data_both_' . $account_id);
+                                       }
+                               }
+                       }
+
+               }
        }




reply via email to

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