gunnar: server/patches/horde/3.2-rc3/turba HK-GW-Config_turba-3.2-rc3.patch, NONE, 1.1 HK-GW-Fix_editing_contacts_turba-3.2-rc3.patch, NONE, 1.1 HK-GW-Fix_share_id_change_turba-3.2-rc3.patch, NONE, 1.1 HK-GW-Ldap_read_only_fix_turba-3.2-rc3.patch, NONE, 1.1

cvs at kolab.org cvs at kolab.org
Thu Mar 13 16:37:28 CET 2008


Author: gunnar

Update of /kolabrepository/server/patches/horde/3.2-rc3/turba
In directory doto:/tmp/cvs-serv17251/turba

Added Files:
	HK-GW-Config_turba-3.2-rc3.patch 
	HK-GW-Fix_editing_contacts_turba-3.2-rc3.patch 
	HK-GW-Fix_share_id_change_turba-3.2-rc3.patch 
	HK-GW-Ldap_read_only_fix_turba-3.2-rc3.patch 
Log Message:
Horde patches for horde-3.2-rc3

--- NEW FILE: HK-GW-Config_turba-3.2-rc3.patch ---
diff -r 723ba1b92537 turba/config/conf.php
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/turba/config/conf.php	Thu Mar 13 14:16:55 2008 +0100
@@ -0,0 +1,10 @@
+<?php
+/* CONFIG START. DO NOT CHANGE ANYTHING IN OR AFTER THIS LINE. */
+// $Horde: turba/config/conf.xml,v 1.6.2.4 2007/12/20 14:34:24 jan Exp $
+$conf['menu']['import_export'] = true;
+$conf['menu']['apps'] = array();
+$conf['client']['addressbook'] = 'kolab_local';
+$conf['shares']['source'] = 'kolab';
+$conf['comments']['allow'] = true;
+$conf['documents']['type'] = 'horde';
+/* CONFIG END. DO NOT CHANGE ANYTHING IN OR BEFORE THIS LINE. */
diff -r 723ba1b92537 turba/config/sources.php.dist
--- a/turba/config/sources.php.dist	Thu Mar 13 14:16:40 2008 +0100
+++ b/turba/config/sources.php.dist	Thu Mar 13 14:16:55 2008 +0100
@@ -120,8 +120,8 @@
  *
  * approximate: Only applies to LDAP servers. If set, should be an
  *              array of native field/attribute names to search
- *              "approximately" (for example, "Sánchez", "Sanchez",
- *              and "Sanchéz" will all match a search string of
+ *              "approximately" (for example, "Sánchez", "Sanchez",
+ *              and "Sanchéz" will all match a search string of
  *              "sanchez").
  *
  * export:      If set to true, this source will appear on the Export menu,
@@ -148,6 +148,8 @@
  *                  field.
  * Here are some example configurations:
  */
+
+if (empty($GLOBALS['conf']['kolab']['enabled'])) {
 
 /**
  * A local address book in an SQL database. This implements a private
@@ -748,6 +750,8 @@ if (!empty($GLOBALS['conf']['imsp']['ena
 }
 /* End IMSP sources. */
 
+}
+
 /* Begin Kolab sources. */
 if (!empty($GLOBALS['conf']['kolab']['enabled'])) {
 
@@ -783,6 +787,8 @@ if (!empty($GLOBALS['conf']['kolab']['en
                 'version' => 3,
                 'bind_dn' => '',
                 'bind_password' => '',
+                'bind_password' => '',
+                'read_only'     => true,
             ),
             'map' => array(
                 '__key'             => 'dn',

--- NEW FILE: HK-GW-Fix_editing_contacts_turba-3.2-rc3.patch ---
Fixes editing contacts.

diff -r de15e2f26408 turba/lib/Driver/share.php
--- a/turba/lib/Driver/share.php	Tue Oct 02 12:25:42 2007 +0200
+++ b/turba/lib/Driver/share.php	Tue Oct 02 12:38:50 2007 +0200
@@ -58,7 +58,7 @@ class Turba_Driver_share extends Turba_D
      */
     function getName()
     {
-        $share_parts = explode(':', $this->_share->getName());
+        $share_parts = explode(':', $this->_share->getId());
         return array_pop($share_parts);
     }
 

--- NEW FILE: HK-GW-Fix_share_id_change_turba-3.2-rc3.patch ---
This fixes a problem with the way the Kolab share driver handles ids.

diff -r 765b7ae705a1 turba/lib/Turba.php
--- a/turba/lib/Turba.php	Thu Mar 13 13:28:11 2008 +0100
+++ b/turba/lib/Turba.php	Thu Mar 13 13:29:35 2008 +0100
@@ -439,7 +439,7 @@ class Turba {
 
                         $source_config = $sources[$source];
                         $source_config['params']['share'] = &$share;
-                        $sources[$sourceKey] = $source_config;
+                        $sources[$share->getId()] = $source_config;
                     } else {
                         $notification->push($driver, 'horde.error');
                     }
@@ -564,7 +564,7 @@ class Turba {
         /* Add the new addressbook to the user's list of visible
          * address books. */
         $prefs = explode("\n", $GLOBALS['prefs']->getValue('addressbooks'));
-        if (array_search($share_id, $prefs) === false) {
+        if (array_search($share->getId(), $prefs) === false) {
             $GLOBALS['prefs']->setValue('addressbooks', $GLOBALS['prefs']->getValue('addressbooks') . "\n" . $share_id);
         }
         return $share;

--- NEW FILE: HK-GW-Ldap_read_only_fix_turba-3.2-rc3.patch ---
This is a temporary fix to mark the ldap addressbook as read-only. This should be solved with the Horde Perms package but this needs a new driver.

diff -r 7712d454fb57 turba/lib/Driver/ldap.php
--- a/turba/lib/Driver/ldap.php	Mon Feb 18 08:51:51 2008 +0100
+++ b/turba/lib/Driver/ldap.php	Mon Feb 18 09:51:07 2008 +0100
@@ -53,6 +53,9 @@ class Turba_Driver_ldap extends Turba_Dr
         }
         if (empty($params['deref'])) {
             $params['deref'] = LDAP_DEREF_NEVER;
+        }
+        if (empty($params['read_only'])) {
+            $params['read_only'] = false;
         }
 
         parent::Turba_Driver($params);
@@ -750,4 +753,25 @@ class Turba_Driver_ldap extends Turba_Dr
         return $dn;
     }
 
+    /**
+     * Checks if the current user has the requested permission
+     * on this source.
+     *
+     * @param integer $perm  The permission to check for.
+     *
+     * @return boolean  true if user has permission, false otherwise.
+     */
+     function hasPermission($perm)
+    {
+        if ($this->_params['read_only'] === false) {
+            return parent::hasPermission($perm);
+        } else {
+            switch ($perm) {
+                case PERMS_EDIT: return false;
+                case PERMS_DELETE: return false;
+                default: return parent::hasPermission($perm);
+            }
+        }
+    }
+
 }





More information about the commits mailing list