lib/kolab_client_task.php

Jeroen van Meeuwen vanmeeuwen at kolabsys.com
Sat Apr 7 12:25:46 CEST 2012


 lib/kolab_client_task.php |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit bf21a4203449f0b88f5d650b9215e215e09010e4
Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen at kolabsys.com>
Date:   Sat Apr 7 12:25:01 2012 +0200

    Allow the configuration of whether an administrator user can override automatically generated fields, using a boolean kolab_wap/admin_auto_fields_rw setting.

diff --git a/lib/kolab_client_task.php b/lib/kolab_client_task.php
index 797e153..4ccb5a4 100644
--- a/lib/kolab_client_task.php
+++ b/lib/kolab_client_task.php
@@ -860,11 +860,17 @@ class kolab_client_task
             'entry'     => $entry_rights,
         );
 
+        // See if "administrators" (those who can delete and add back on the entry
+        // level) may override the automatically generated contents of auto_form_fields.
+        $admin_auto_fields_rw = $this->config_get('admin_auto_fields_rw', false);
+
         foreach ($fields as $idx => $field) {
             if (!array_key_exists($idx, $attribute_rights)) {
                 // If the entry level rights contain 'add' and 'delete', well, you're an admin
                 if (in_array('add', $entry_rights) && in_array('delete', $entry_rights)) {
-                    $fields[$idx]['readonly'] = false;
+                    if ($admin_auto_fields_rw) {
+                        $fields[$idx]['readonly'] = false;
+                    }
                 }
                 else {
                     $fields[$idx]['readonly'] = true;





More information about the commits mailing list