phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] property/inc class.boadmin.inc.php class.soadmi...


From: Sigurd Nes
Subject: [Phpgroupware-cvs] property/inc class.boadmin.inc.php class.soadmi...
Date: Sun, 22 Oct 2006 19:28:55 +0000

CVSROOT:        /sources/phpgroupware
Module name:    property
Changes by:     Sigurd Nes <sigurdne>   06/10/22 19:28:55

Modified files:
        inc            : class.boadmin.inc.php class.soadmin.inc.php 

Log message:
        

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/property/inc/class.boadmin.inc.php?cvsroot=phpgroupware&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/property/inc/class.soadmin.inc.php?cvsroot=phpgroupware&r1=1.9&r2=1.10

Patches:
Index: class.boadmin.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/class.boadmin.inc.php,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- class.boadmin.inc.php       12 Oct 2006 09:09:27 -0000      1.15
+++ class.boadmin.inc.php       22 Oct 2006 19:28:55 -0000      1.16
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage admin
-       * @version $Id: class.boadmin.inc.php,v 1.15 2006/10/12 09:09:27 
sigurdne Exp $
+       * @version $Id: class.boadmin.inc.php,v 1.16 2006/10/22 19:28:55 
sigurdne Exp $
        */
 
        /**
@@ -41,7 +41,6 @@
                                $this->use_session = True;
                        }
 
-
                        $start  = get_var('start',array('POST','GET'));
                        $query  = get_var('query',array('POST','GET'));
                        $sort   = get_var('sort',array('POST','GET'));
@@ -53,7 +52,7 @@
                        $module = get_var('module',array('POST','GET'));
                        $granting_group = 
get_var('granting_group',array('POST','GET'));
                        $allrows        = 
get_var('allrows',array('POST','GET'));
-                       $acl_app        = 
get_var('acl_app',array('POST','GET'));
+                       $acl_app        = $this->currentapp; 
//get_var('acl_app',array('POST','GET'));
 
                        if ($start)
                        {
@@ -198,7 +197,7 @@
                {
                        if ( !is_array($values) )
                        {
-                               return;
+//                             return;
                        }
 
                        $totalacl = array();
@@ -223,7 +222,7 @@
                                $this->acl->read_repository();
                                $this->acl->delete($this->acl_app, 
$this->location, $grantor, $type);
                                $this->acl->add($this->acl_app, 
$this->location, $rights, $grantor, $type);
-                               $this->acl->save_repository();
+                               $this->acl->save_repository($this->acl_app, 
$this->location);
                        }
 
                        if (is_array($r_processed) && count($user_checked))
@@ -234,14 +233,20 @@
                        {
                                $user_delete = $r_processed;
                        }
+
+                       $users_at_location = 
$this->so->get_accounts_at_location($this->acl_app, $this->location, $grantor 
,$type);
+
                        if(is_array($user_delete) && count($user_delete)>0)
                        {
                                while(list(,$user_id) = each($user_delete))
                                {
+                                       if($users_at_location[$user_id])
+                                       {
                                        $this->acl->account_id = $user_id;
                                        $this->acl->read_repository();
                                        $this->acl->delete($this->acl_app, 
$this->location, $grantor, $type);
-                                       $this->acl->save_repository();
+                                               
$this->acl->save_repository($this->acl_app, $this->location);
+                                       }
                                }
                        }
                }
@@ -368,7 +373,6 @@
                                                        
unset($user_list[$j]['result'][$right[$i]]);
                                                }
                                        }
-
                                        $j++;
                                }
                        }

Index: class.soadmin.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/class.soadmin.inc.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- class.soadmin.inc.php       5 Oct 2006 11:33:53 -0000       1.9
+++ class.soadmin.inc.php       22 Oct 2006 19:28:55 -0000      1.10
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage admin
-       * @version $Id: class.soadmin.inc.php,v 1.9 2006/10/05 11:33:53 
sigurdne Exp $
+       * @version $Id: class.soadmin.inc.php,v 1.10 2006/10/22 19:28:55 
sigurdne Exp $
        */
 
        /**
@@ -101,14 +101,40 @@
                                {
                                        $n=$entry[0];
 
-
                                        $sql = "update  fm_idgenerator set 
value='$values[$n]' where name='$field[$n]'";
                                        
$this->db->query($sql,__LINE__,__FILE__);
-
                                }
 
                        $receipt['message'][] = array('msg' => lang('ID is 
updated'));
                        return $receipt;
                }
+               
+               function get_accounts_at_location($appname = '', $location ='', 
$grantor=0 ,$type ='')
+               {
+                       if (!$appname)
+                       {
+                               settype($appname,'string');
+                               $appname = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       }
+                       
+                       if($grantor > 0)
+                       {
+                               $filter_grants = ' AND acl_grantor IS NOT NULL';
+                       }
+                       else
+                       {
+                               $filter_grants = ' AND acl_grantor IS NULL';
+                       }
+
+                       $sql = "SELECT acl_account from phpgw_acl WHERE 
acl_appname = '$appname' AND acl_location $this->like '$location%' 
$filter_grants AND acl_type = '$type' GROUP BY acl_account";
+                       $this->db->query($sql,__LINE__,__FILE__);
+
+                       while ($this->db->next_record())
+                       {
+                               $acl_accounts[$this->db->f('acl_account')] = 
true;
+                       }
+
+                       return $acl_accounts;
+               }
        }
 ?>




reply via email to

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