6.0.0-beta1
11/22/25

[#1928] when using hooks as Group backend doesn't work correctly
Summary when using hooks as Group backend doesn't work correctly
Queue Horde Framework Packages
Type Bug
State Resolved
Priority 3. High
Owners Horde Developers (at)
Requester m.zdila (at) episoftware (dot) com
Created 05/07/2005 (7504 days ago)
Due
Updated 05/09/2005 (7502 days ago)
Assigned 05/09/2005 (7502 days ago)
Resolved 05/09/2005 (7502 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
05/09/2005 05:31:12 PM Chuck Hagenbuch Comment #2
State ⇒ Resolved
Reply to this comment
Fixed, thanks.
05/09/2005 08:03:48 AM Jan Schneider Assigned to Horde DevelopersHorde Developers
State ⇒ Assigned
 
05/07/2005 06:50:33 PM m (dot) zdila (at) episoftware (dot) com Comment #1
State ⇒ Unconfirmed
Priority ⇒ 3. High
Type ⇒ Bug
Summary ⇒ when using hooks as Group backend doesn't work correctly
Queue ⇒ Horde Framework Packages
Reply to this comment
There are different default values in Group.php and Group/hooks.php 
methods causing invalid method retun values (for groups and premission 
methods). For example, when using hooks and group B is subgroup of A 
and user U is in the group B, then userIsInGroup("U", "A", true) 
returns false. Please apply following patch (++ modify method comments 
;-) ):



diff -u ../horde-portal/lib/Horde/Group/hooks.php lib/Horde/Group/hooks.php

--- ../horde-portal/lib/Horde/Group/hooks.php   Fri Jan  7 01:23:57 2005

+++ lib/Horde/Group/hooks.php   Sat May  7 20:36:25 2005

@@ -33,9 +33,9 @@

       *

       * @return array  An array of all groups the user is in.

       */

-    function getGroupMemberships($user)

+    function getGroupMemberships($user, $parentGroups = false)

      {

-        $memberships = parent::getGroupMemberships($user);

+        $memberships = parent::getGroupMemberships($user, $parentGroups);

          $funcs = get_defined_functions();

          foreach ($funcs['user'] as $funcName) {

              if (strpos($funcName, '_group_hook_') === 0) {

@@ -62,7 +62,7 @@

       * @access public

       * @return boolean

       */

-    function userIsInGroup($user, $group, $subgroups = false)

+    function userIsInGroup($user, $group, $subgroups = true)

      {

          if ($this->hasHook($group)) {

              if (call_user_func($this->_getGroupHookName($group), $user)) {


Saved Queries