phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] property/inc/class.acl2.inc.php, 1.2.2.4


From: nomail
Subject: [Phpgroupware-cvs] property/inc/class.acl2.inc.php, 1.2.2.4
Date: Tue, 7 Dec 2004 10:04:28 +0100

Update of /property/inc
Modified Files:
        Branch: proposed-0_9_18-branch
          class.acl2.inc.php

date: 2004/12/07 09:04:28;  author: sigurdne;  state: Exp;  lines: +16 -5

Log Message:
Using ilike if pgsql
=====================================================================
Index: property/inc/class.acl2.inc.php
diff -u property/inc/class.acl2.inc.php:1.2.2.3 
property/inc/class.acl2.inc.php:1.2.2.4
--- property/inc/class.acl2.inc.php:1.2.2.3     Thu Nov 18 22:12:08 2004
+++ property/inc/class.acl2.inc.php     Tue Dec  7 09:04:28 2004
@@ -52,6 +52,17 @@
                        $this->account_id = $args['account_id'];
                        $this->host_id = $args['host_id'];
                        $this->app_id = $args['app_id'];
+
+                       if 
($GLOBALS['phpgw_info']['server']['db_type']=='pgsql')
+                       {
+                               $this->like = "ILIKE";
+                       }
+                       else
+                       {
+                               $this->like = "LIKE";
+                       }
+
+
                }
 
                function get_memberships ()
@@ -303,7 +314,7 @@
                                
$updated_locations[]=$this->db->f('acl_location');
                        }
 
-                       $sql = "SELECT id FROM fm_acl_location WHERE (id like 
'%".$args['location']."%') AND allow_grant=1";
+                       $sql = "SELECT id FROM fm_acl_location WHERE (id 
$this->like '%".$args['location']."%') AND allow_grant=1";
                        $this->db->query($sql,__LINE__,__FILE__);
                        while($this->db->next_record())
                        {
@@ -387,7 +398,7 @@
                                
$updated_locations[]=$this->db->f('acl_location');
                        }
 
-                       $sql = "SELECT id FROM fm_acl_location WHERE (id like 
'%".$args['location']."%')";
+                       $sql = "SELECT id FROM fm_acl_location WHERE (id 
$this->like '%".$args['location']."%')";
                        $this->db->query($sql,__LINE__,__FILE__);
                        while($this->db->next_record())
                        {
@@ -467,7 +478,7 @@
                                {
                                        $sql = "DELETE FROM fm_acl2";
                                }
-                               $sql .= " WHERE acl_host=".$this->host_id." AND 
acl_appid=".$args['app_id']." AND acl_account=".$args['account_id']." AND 
acl_location LIKE '%".$args['location']."%' AND acl_type=".$args['type'] . ' 
and grantor is NULL';
+                               $sql .= " WHERE acl_host=".$this->host_id." AND 
acl_appid=".$args['app_id']." AND acl_account=".$args['account_id']." AND 
acl_location $this->like '%".$args['location']."%' AND acl_type=".$args['type'] 
. ' and grantor is NULL';
                                $this->db->query($sql,__LINE__,__FILE__);
                                $this->rights_cache = Array();
                                $this->masks_cache = Array();
@@ -511,7 +522,7 @@
                                {
                                        $sql = "DELETE FROM fm_acl2";
                                }
-                               $sql .= " WHERE acl_host=".$this->host_id." AND 
acl_appid=".$args['app_id']." AND acl_account=".$args['account_id']." AND 
acl_location LIKE '%".$args['location']."%' AND acl_type=".$args['type'] . " 
and grantor = $grantor";
+                               $sql .= " WHERE acl_host=".$this->host_id." AND 
acl_appid=".$args['app_id']." AND acl_account=".$args['account_id']." AND 
acl_location $this->like '%".$args['location']."%' AND acl_type=".$args['type'] 
. " and grantor = $grantor";
                                $this->db->query($sql,__LINE__,__FILE__);
                                $this->rights_cache = Array();
                                $this->masks_cache = Array();




reply via email to

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