Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:12.1:Update
horde3-turba
HK-GW-turba_2.2_RC1-Ldap_read_only_fix.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File HK-GW-turba_2.2_RC1-Ldap_read_only_fix.patch of Package horde3-turba
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 449ef255c5ff turba/lib/Driver/ldap.php --- a/turba/lib/Driver/ldap.php Wed Nov 28 17:24:17 2007 +0100 +++ b/turba/lib/Driver/ldap.php Wed Nov 28 17:26:17 2007 +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); @@ -749,4 +752,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); + } + } + } + }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor