[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] hrm/inc class.acl2.inc.php
From: |
Sigurd Nes |
Subject: |
[Phpgroupware-cvs] hrm/inc class.acl2.inc.php |
Date: |
Fri, 21 Apr 2006 19:08:15 +0000 |
CVSROOT: /sources/phpgroupware
Module name: hrm
Branch:
Changes by: Sigurd Nes <address@hidden> 06/04/21 19:08:15
Modified files:
inc : class.acl2.inc.php
Log message:
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/hrm/inc/class.acl2.inc.php.diff?tr1=1.10&tr2=1.11&r1=text&r2=text
Patches:
Index: hrm/inc/class.acl2.inc.php
diff -u hrm/inc/class.acl2.inc.php:1.10 hrm/inc/class.acl2.inc.php:1.11
--- hrm/inc/class.acl2.inc.php:1.10 Sat Apr 15 19:04:13 2006
+++ hrm/inc/class.acl2.inc.php Fri Apr 21 19:08:15 2006
@@ -6,7 +6,7 @@
* @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General
Public License
* @package phpgwapi
* @subpackage accounts
- * @version $Id: class.acl2.inc.php,v 1.10 2006/04/15 19:04:13 sigurdne
Exp $
+ * @version $Id: class.acl2.inc.php,v 1.11 2006/04/21 19:08:15 sigurdne
Exp $
*/
/**
@@ -54,20 +54,21 @@
*/
function acl2($account_id = '')
{
- // $this->db = $GLOBALS['phpgw']->db;
- $this->db = CreateObject('phpgwapi.db');
+ $this->db =& $GLOBALS['phpgw']->db;
+ /* $this->db = CreateObject('phpgwapi.db');
$this->db->Host =
$GLOBALS['phpgw_info']['server']['db_host'];
$this->db->Type =
$GLOBALS['phpgw_info']['server']['db_type'];
$this->db->Database =
$GLOBALS['phpgw_info']['server']['db_name'];
$this->db->User =
$GLOBALS['phpgw_info']['server']['db_user'];
$this->db->Password =
$GLOBALS['phpgw_info']['server']['db_pass'];
- $this->db2 = CreateObject('phpgwapi.db');
- $this->db2->Host =
$GLOBALS['phpgw_info']['server']['db_host'];
- $this->db2->Type =
$GLOBALS['phpgw_info']['server']['db_type'];
- $this->db2->Database =
$GLOBALS['phpgw_info']['server']['db_name'];
- $this->db2->User =
$GLOBALS['phpgw_info']['server']['db_user'];
- $this->db2->Password =
$GLOBALS['phpgw_info']['server']['db_pass'];
+ $this->db = CreateObject('phpgwapi.db');
+ $this->db->Host =
$GLOBALS['phpgw_info']['server']['db_host'];
+ $this->db->Type =
$GLOBALS['phpgw_info']['server']['db_type'];
+ $this->db->Database =
$GLOBALS['phpgw_info']['server']['db_name'];
+ $this->db->User =
$GLOBALS['phpgw_info']['server']['db_user'];
+ $this->db->Password =
$GLOBALS['phpgw_info']['server']['db_pass'];
+ */
if (!($this->account_id = intval($account_id)))
{
@@ -785,8 +786,6 @@
$cache_accountid[$accountid] = $account_id;
}
-
- // $db2 = $this->db;
$memberships =
$GLOBALS['phpgw']->accounts->membership($account_id);
$sql = "select acl_appname, acl_rights from
phpgw_hrm_acl where acl_location = 'run' and "
. 'acl_account in ';
@@ -797,25 +796,25 @@
$security .= ','.$group[1]['account_id'];
}
$security .= ')';
- $this->db2->query($sql . $security ,__LINE__,__FILE__);
+ $this->db->query($sql . $security ,__LINE__,__FILE__);
- if ($this->db2->num_rows() == 0)
+ if ($this->db->num_rows() == 0)
{
return False;
}
- while ($this->db2->next_record())
+ while ($this->db->next_record())
{
- if(isset($apps[$this->db2->f('acl_appname')]))
+ if(isset($apps[$this->db->f('acl_appname')]))
{
- $rights =
$apps[$this->db2->f('acl_appname')];
+ $rights =
$apps[$this->db->f('acl_appname')];
}
else
{
$rights = 0;
- $apps[$this->db2->f('acl_appname')] = 0;
+ $apps[$this->db->f('acl_appname')] = 0;
}
- $rights |= $this->db2->f('acl_rights');
- $apps[$this->db2->f('acl_appname')] |= $rights;
+ $rights |= $this->db->f('acl_rights');
+ $apps[$this->db->f('acl_appname')] |= $rights;
}
return $apps;
}
@@ -851,8 +850,6 @@
function get_grants_type($app='',$location='',$type = '')
{
-// $db2 = $this->db;
-
if ($app=='')
{
$app =
$GLOBALS['phpgw_info']['flags']['currentapp'];
@@ -874,18 +871,18 @@
$security .= ",'" . $group['account_id'] . "'";
}
$security .= ')';
- $this->db2->query($sql . $security ,__LINE__,__FILE__);
+ $this->db->query($sql . $security ,__LINE__,__FILE__);
$rights = 0;
$accounts = Array();
- if ($this->db2->num_rows() == 0 && $type==0)
+ if ($this->db->num_rows() == 0 && $type==0)
{
$grants[$GLOBALS['phpgw_info']['user']['account_id']] = 31;
return $grants;
}
- while ($this->db2->next_record())
+ while ($this->db->next_record())
{
- $grantor = $this->db2->f('acl_grantor');
- $rights = $this->db2->f('acl_rights');
+ $grantor = $this->db->f('acl_grantor');
+ $rights = $this->db->f('acl_rights');
if(!isset($accounts[$grantor]))
// cache the group-members for performance
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] hrm/inc class.acl2.inc.php,
Sigurd Nes <=