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: Tue, 21 Mar 2006 12:56:47 +0000

CVSROOT:        /sources/phpgwapi
Module name:    phpgwapi
Branch:         
Changes by:     Sigurd Nes <address@hidden>     06/03/21 12:56:47

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

Log message:
        Inserting missing top-location for apps

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/phpgwapi/inc/class.acl.inc.php.diff?tr1=1.72&tr2=1.73&r1=text&r2=text

Patches:
Index: phpgwapi/inc/class.acl.inc.php
diff -u phpgwapi/inc/class.acl.inc.php:1.72 phpgwapi/inc/class.acl.inc.php:1.73
--- phpgwapi/inc/class.acl.inc.php:1.72 Sun Mar 19 18:44:56 2006
+++ phpgwapi/inc/class.acl.inc.php      Tue Mar 21 12:56:47 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.acl.inc.php,v 1.72 2006/03/19 18:44:56 sigurdne 
Exp $
+       * @version $Id: class.acl.inc.php,v 1.73 2006/03/21 12:56:47 sigurdne 
Exp $
        */
 
        /**
@@ -323,7 +323,7 @@
                                        'grantor' => 
$this->db->f('acl_grantor'),
                                        'type' => $this->db->f('acl_type')
                                        );
-               }
+                       }
 
                        if(is_array($unique_data))
                        {
@@ -829,6 +829,7 @@
 
                function get_grants($app='',$location='')
                {
+
                        $grant_rights = 
$this->get_grants_type($app,$location,0);
                        $grant_mask = $this->get_grants_type($app,$location,1);
                        if(is_array($grant_mask))
@@ -857,13 +858,11 @@
                */
                function get_grants_type($app='',$location='',$type = '')
                {
-
-//                     $db2 = $this->db;
-
-                       if ($app=='')
+                       if (!$app)
                        {
                                $app = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        }
+
                        if ($location)
                        {
                                $at_location = " AND acl_location = 
'$location'";
@@ -945,4 +944,19 @@
 
                        return $grants;
                }
+
+               function verify_location($apps_with_acl)
+               {
+                       while($apps_with_acl && (list($appname,$value) = 
each($apps_with_acl)))
+                       {
+                               $sql = "SELECT appname from phpgw_acl_location 
WHERE appname = '$appname' AND id = '.'";
+                               $this->db->query($sql ,__LINE__,__FILE__);
+
+                               if ($this->db->num_rows()==0)
+                               {
+                                       $sql = "INSERT into phpgw_acl_location 
(appname,id,descr,allow_grant) VALUES ('$appname','.','Top','" . 
intval($value['top_grant']) . "')";
+                                       $this->db->query($sql 
,__LINE__,__FILE__);
+                               }
+                       }
+               }
        }




reply via email to

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