phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] property/inc class.socommon.inc.php


From: Sigurd Nes
Subject: [Phpgroupware-cvs] property/inc class.socommon.inc.php
Date: Fri, 06 Oct 2006 08:33:25 +0000

CVSROOT:        /sources/phpgroupware
Module name:    property
Changes by:     Sigurd Nes <sigurdne>   06/10/06 08:33:25

Modified files:
        inc            : class.socommon.inc.php 

Log message:
        Switched to the API's ACL

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/property/inc/class.socommon.inc.php?cvsroot=phpgroupware&r1=1.27&r2=1.28

Patches:
Index: class.socommon.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/class.socommon.inc.php,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -b -r1.27 -r1.28
--- class.socommon.inc.php      5 Oct 2006 11:33:53 -0000       1.27
+++ class.socommon.inc.php      6 Oct 2006 08:33:25 -0000       1.28
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage core
-       * @version $Id: class.socommon.inc.php,v 1.27 2006/10/05 11:33:53 
sigurdne Exp $
+       * @version $Id: class.socommon.inc.php,v 1.28 2006/10/06 08:33:25 
sigurdne Exp $
        */
 
        /**
@@ -121,23 +121,25 @@
 
                        foreach ($active_accounts as $entry)
                        {
-                               
if($acl->check($acl_location,$right,$entry['acl_account']))
+                               $acl->account_id = $entry['acl_account'];
+                               if($acl->check($acl_location,$right))
                                {
                                        if($entry['account_type']=='g')
                                        {
                                                $members = 
$myaccounts->member($entry['account_id']);
+
                                                if (isset($members) AND 
is_array($members))
                                                {
                                                        foreach($members as 
$user)
                                                        {
-                                                               
$accounts[$user['account_id']] = array($user['account_id']);
+                                                               
$accounts[$user['account_id']] = $user['account_id'];
                                                        }
                                                        unset($members);
                                                }
                                        }
                                        else
                                        {
-                                               
$accounts[$entry['acl_account']] = array($entry['acl_account']);
+                                               
$accounts[$entry['acl_account']] = $entry['acl_account'];
                                        }
                                }
                        }
@@ -156,10 +158,11 @@
                        {
                                foreach($accounts as $account_id)
                                {
+                                       $acl->account_id = $account_id;
                                        $i=0;
-                                       
if(!$acl->check($acl_location,$right,$account_id[0]))
+                                       if(!$acl->check($acl_location,$right))
                                        {
-                                               
unset($accounts[$account_id[0]]);
+                                               unset($accounts[$account_id]);
                                        }
 
                                        $i++;
@@ -174,8 +177,9 @@
                                $in_list[] = $accounts[$i];
                        }
 
-                       if($in_list)
+                       if(isset($in_list) && is_array($in_list))
                        {
+
                                $sql = 'SELECT * FROM phpgw_accounts where 
account_id in ('. implode(',',$in_list) . ') order by account_lastname';
                                $this->db->query($sql,__LINE__,__FILE__);
                                while ($this->db->next_record())
@@ -191,25 +195,10 @@
                                                );
 
                                }
-                       }
-/*                     for ($i=0;$i<$k;$i++)
-                       {
-                               $sql = 'SELECT * FROM phpgw_accounts where 
account_id=' . (int)$accounts[$i];
-                               $this->db->query($sql,__LINE__,__FILE__);
-                               $this->db->next_record();
-                               $employees[] = Array(
-                                       'account_id'        => 
$this->db->f('account_id'),
-                                       'account_lid'       => 
$this->db->f('account_lid'),
-                                       'account_type'      => 
$this->db->f('account_type'),
-                                       'account_firstname' => 
$this->db->f('account_firstname'),
-                                       'account_lastname'  => 
$this->db->f('account_lastname'),
-                                       'account_status'    => 
$this->db->f('account_status'),
-                                       'account_expires'   => 
$this->db->f('account_expires')
-                                       );
-                       }
-*/
+
                        return $employees;
                }
+               }
 
                function read_single_tenant($id)
                {




reply via email to

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