phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] api/class.acl_mgr.php, 1.1.2.10


From: nomail
Subject: [Phpgroupware-cvs] api/class.acl_mgr.php, 1.1.2.10
Date: Fri, 9 Jul 2004 08:44:56 +0200

Update of /api
Modified Files:
        Branch: proposal-branch
          class.acl_mgr.php

date: 2004/07/09 06:44:56;  author: jengo;  state: Exp;  lines: +33 -1

Log Message:
Created a method to add duplicate keys to a history item, simply create your 
keys like <key>##TOBEREMOVED##<unique_value> and it will be stripped to <key>
=====================================================================
Index: api/class.acl_mgr.php
diff -u api/class.acl_mgr.php:1.1.2.9 api/class.acl_mgr.php:1.1.2.10
--- api/class.acl_mgr.php:1.1.2.9       Tue Jul  6 07:23:58 2004
+++ api/class.acl_mgr.php       Fri Jul  9 06:44:56 2004
@@ -252,6 +252,38 @@
                        }
                }
 
+               // safeargs currently is broken for arrays
+               function _add_history($location,$history_data)
+               {
+                       $i = 0;
+                       foreach 
($_SESSION['phpgw_session']['phpgw_data']['statecache'][$location . ':acl'] as 
$acl)
+                       {
+                               $a = array
+                               (
+                                       'user_id' => $acl['acl_user_id'],
+                                       'rights'  => $acl['allow_total']
+                               );
+                               // We need a unique key, 
acl_mgr->_history_label will remove it
+                               $history_data['acl##TOBEREMOVED##' . ++$i] = 
serialize($a);
+                       }
+
+                       return $history_data;
+               }
+
+               function _history_value()
+               {
+                       $args = new safe_args();
+                       $args->set('values',NOTSET,'any');
+                       extract($args->get(func_get_args()));
+
+                       $acl = @unserialize($values);
+                       if (is_array($acl))
+                       {
+                               $text = 
execMethod('api.prefs._display_account_fullname',$acl['user_id']) . ' - ' . 
@implode(', ',$this->__create_text($acl['rights']));
+                               return ($text ? $text : '-');
+                       }
+               }
+
                function account()
                {
                        /*




reply via email to

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