From: Jan Schneider Date: Wed, 22 Sep 2010 19:32:40 +0000 (+0200) Subject: Inject Horde_Group. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=474382a60011932d21b626aae790da872f1e041e;p=horde.git Inject Horde_Group. --- diff --git a/ansel/lib/Storage.php b/ansel/lib/Storage.php index 8b428c279..fc9ae21e8 100644 --- a/ansel/lib/Storage.php +++ b/ansel/lib/Storage.php @@ -204,7 +204,7 @@ class Ansel_Storage } if ($perms) { - $groups = Horde_Group::singleton(); + $groups = $GLOBALS['injector']->getInstance('Horde_Group'); $group_list = $groups->getGroupMemberships($GLOBALS['registry']->getAuth()); if (count($group_list)) { foreach ($group_list as $group_id => $group_name) { diff --git a/ansel/perms.php b/ansel/perms.php index af4442a01..9eab7594e 100644 --- a/ansel/perms.php +++ b/ansel/perms.php @@ -18,7 +18,7 @@ $fieldsList = array( require_once dirname(__FILE__) . '/lib/Application.php'; Horde_Registry::appInit('ansel'); -$groups = Horde_Group::singleton(); +$groups = $injector->getInstance('Horde_Group'); $auth = $injector->getInstance('Horde_Auth')->getAuth(); $form = null; diff --git a/folks/config/hooks.php.dist b/folks/config/hooks.php.dist index ae1eba3ac..6dae6c3e1 100644 --- a/folks/config/hooks.php.dist +++ b/folks/config/hooks.php.dist @@ -207,7 +207,7 @@ class Folks_Hooks public function prelogin($app) { - $group = Horde_Group::singleton(); + $group = $GLOBALS['injector']->getInstance('Horde_Group'); $user_uid = $GLOBALS['registry']->getAuth(); switch ($app) { diff --git a/folks/perms.php b/folks/perms.php index 6cfc718d1..d2141fe07 100644 --- a/folks/perms.php +++ b/folks/perms.php @@ -11,8 +11,8 @@ require_once dirname(__FILE__) . '/lib/base.php'; -$shares = $GLOBALS['injector']->getInstance('Horde_Share')->getScope(); -$groups = Horde_Group::singleton(); +$shares = $injector->getInstance('Horde_Share')->getScope(); +$groups = $injector->getInstance('Horde_Group'); $auth = $injector->getInstance('Horde_Auth')->getAuth(); $reload = false; diff --git a/framework/Core/lib/Horde/Core/Ajax/Application.php b/framework/Core/lib/Horde/Core/Ajax/Application.php index 4f25e8393..7d71804fd 100644 --- a/framework/Core/lib/Horde/Core/Ajax/Application.php +++ b/framework/Core/lib/Horde/Core/Ajax/Application.php @@ -137,7 +137,7 @@ abstract class Horde_Core_Ajax_Application { $result = new stdClass; try { - $horde_groups = Horde_Group::singleton(); + $horde_groups = $GLOBALS['injector']->getInstance('Horde_Group'); $groups = empty($GLOBALS['conf']['share']['any_group']) ? $horde_groups->getGroupMemberships($GLOBALS['registry']->getAuth(), true) : $horde_groups->listGroups(); diff --git a/framework/Core/lib/Horde/Core/Binder/Group.php b/framework/Core/lib/Horde/Core/Binder/Group.php new file mode 100644 index 000000000..fc52277a9 --- /dev/null +++ b/framework/Core/lib/Horde/Core/Binder/Group.php @@ -0,0 +1,36 @@ +query('horde_group'); + } + + if (!$group) { + $driver = $GLOBALS['conf']['group']['driver']; + $params = Horde::getDriverConfig('group', $driver); + if ($driver == 'ldap') { + $params['ldap'] = $injector->getInstance('Horde_Ldap')->getLdap('horde', 'group'); + } + $group = Horde_Group::factory($driver, $params); + } + + if (!empty($GLOBALS['conf']['group']['cache'])) { + register_shutdown_function(array($group, 'shutdown')); + } + + return $group; + } + + public function equals(Horde_Injector_Binder $binder) + { + return false; + } +} diff --git a/framework/Core/lib/Horde/Core/Factory/KolabStorage.php b/framework/Core/lib/Horde/Core/Factory/KolabStorage.php index 766c50193..1dd8b5177 100644 --- a/framework/Core/lib/Horde/Core/Factory/KolabStorage.php +++ b/framework/Core/lib/Horde/Core/Factory/KolabStorage.php @@ -105,7 +105,7 @@ class Horde_Core_Factory_KolabStorage $master = new Horde_Kolab_Storage_Driver_Imap( $imap, - Horde_Group::singleton() + $GLOBALS['injector']->getInstance('Horde_Group') ); return new Horde_Kolab_Storage( diff --git a/framework/Core/lib/Horde/Core/Perms/Ui.php b/framework/Core/lib/Horde/Core/Perms/Ui.php index 625711edb..3f5b280e9 100644 --- a/framework/Core/lib/Horde/Core/Perms/Ui.php +++ b/framework/Core/lib/Horde/Core/Perms/Ui.php @@ -349,7 +349,7 @@ class Horde_Core_Perms_Ui $perm_val = $permission->getGroupPermissions(); $this->_form->setSection('groups', _("Groups"), Horde::img('group.png'), false); try { - $groups = Horde_Group::singleton(); + $groups = $GLOBALS['injector']->getInstance('Horde_Group'); $group_list = $groups->listGroups(); } catch (Horde_Group_Exception $e) { $GLOBALS['notification']->push($e); diff --git a/framework/Core/package.xml b/framework/Core/package.xml index 2e6195a7d..20ba995a1 100644 --- a/framework/Core/package.xml +++ b/framework/Core/package.xml @@ -123,6 +123,7 @@ Application Framework. + @@ -452,6 +453,7 @@ Application Framework. + diff --git a/framework/Group/lib/Horde/Group.php b/framework/Group/lib/Horde/Group.php index a9a5eacbc..aedd5c4c1 100644 --- a/framework/Group/lib/Horde/Group.php +++ b/framework/Group/lib/Horde/Group.php @@ -119,64 +119,16 @@ class Horde_Group $params = Horde::getDriverConfig('group', $driver); } - $class = self::_loadDriver($driver); - if (class_exists($class)) { - return new $class($params); - } - - throw new Horde_Group_Exception('Class definition of ' . $class . ' not found.'); - } - - /** - * Attempts to return a reference to a concrete Group instance. - * It will only create a new instance if no Group instance - * currently exists. - * - * @return Group The concrete Group reference, or false on an error. - */ - public static function singleton() - { - static $group; - - if (isset($group)) { - return $group; - } - - $group_driver = $GLOBALS['conf']['group']['driver']; - $group_params = Horde::getDriverConfig('group', $group_driver); - self::_loadDriver($group_driver); - - $group = null; - if (!empty($GLOBALS['conf']['group']['cache'])) { - $session = new Horde_SessionObjects(); - $group = $session->query('horde_group'); - } - - if (!$group) { - $group = self::factory($group_driver, $group_params); - } - - if (!empty($GLOBALS['conf']['group']['cache'])) { - register_shutdown_function(array($group, 'shutdown')); - } - - return $group; - } - - /** - */ - protected static function _loadDriver($driver) - { if (!$driver) { $class = __CLASS__; } else { - $driver = ucfirst(strtolower(basename($driver))); - $class = __CLASS__ . '_' . $driver; - if (!class_exists($class)) { - } + $class = __CLASS__ . '_' . Horde_String::ucfirst(Horde_String::lower(basename($driver))); + } + if (class_exists($class)) { + return new $class($params); } - return $class; + throw new Horde_Group_Exception('Class definition of ' . $class . ' not found.'); } /** diff --git a/framework/Perms/lib/Horde/Perms.php b/framework/Perms/lib/Horde/Perms.php index d91592b0a..550860bf1 100644 --- a/framework/Perms/lib/Horde/Perms.php +++ b/framework/Perms/lib/Horde/Perms.php @@ -388,7 +388,7 @@ class Horde_Perms if (isset($permission->data['groups']) && is_array($permission->data['groups']) && count($permission->data['groups'])) { - $groups = Horde_Group::singleton(); + $groups = $GLOBALS['injector']->getInstance('Horde_Group'); $composite_perm = null; $type = $permission->get('type'); diff --git a/framework/Share/lib/Horde/Share/Datatree.php b/framework/Share/lib/Horde/Share/Datatree.php index 9e973da3d..eedb13efa 100644 --- a/framework/Share/lib/Horde/Share/Datatree.php +++ b/framework/Share/lib/Horde/Share/Datatree.php @@ -301,7 +301,7 @@ class Horde_Share_Datatree extends Horde_Share // If the user has any group memberships, check for those also. // @TODO: inject try { - $group = Horde_Group::singleton(); + $group = $GLOBALS['injector']->getInstance('Horde_Group'); $groups = $group->getGroupMemberships($userid, true); if ($groups) { // (name == perm_groups and key in ($groups) and val & $perm) diff --git a/framework/Share/lib/Horde/Share/Sql.php b/framework/Share/lib/Horde/Share/Sql.php index 607f507e3..2a2e5ccc2 100644 --- a/framework/Share/lib/Horde/Share/Sql.php +++ b/framework/Share/lib/Horde/Share/Sql.php @@ -728,7 +728,7 @@ class Horde_Share_Sql extends Horde_Share // If the user has any group memberships, check for those also. // @TODO: Inject the group driver try { - $group = Horde_Group::singleton(); + $group = $GLOBALS['injector']->getInstance('Horde_Group'); $groups = $group->getGroupMemberships($userid, true); if ($groups) { // (name == perm_groups and key in ($groups) and val & $perm) diff --git a/framework/Share/lib/Horde/Share/Sql/Hierarchical.php b/framework/Share/lib/Horde/Share/Sql/Hierarchical.php index 866a1d075..ce630c73a 100644 --- a/framework/Share/lib/Horde/Share/Sql/Hierarchical.php +++ b/framework/Share/lib/Horde/Share/Sql/Hierarchical.php @@ -215,7 +215,7 @@ class Horde_Share_Sql_Hierarchical extends Horde_Share_Sql // If the user has any group memberships, check for those also. // @TODO: Inject the group driver try { - $group = Horde_Group::singleton(); + $group = $GLOBALS['injector']->getInstance('Horde_Group'); $groups = $group->getGroupMemberships($userid, true); if ($groups) { // (name == perm_groups and key in ($groups) and val & $perm) diff --git a/horde/admin/groups.php b/horde/admin/groups.php index 8355991c7..60b828a37 100644 --- a/horde/admin/groups.php +++ b/horde/admin/groups.php @@ -11,7 +11,7 @@ require_once dirname(__FILE__) . '/../lib/Application.php'; Horde_Registry::appInit('horde', array('admin' => true)); -$groups = Horde_Group::singleton(); +$groups = $injector->getInstance('Horde_Group'); $auth = $injector->getInstance('Horde_Auth')->getAuth(); $form = null; diff --git a/horde/lib/Api.php b/horde/lib/Api.php index b0c2741d5..4d230bb2d 100644 --- a/horde/lib/Api.php +++ b/horde/lib/Api.php @@ -230,7 +230,7 @@ class Horde_Api extends Horde_Registry_Api } /* Remove user from all groups */ - $groups = Horde_Group::singleton(); + $groups = $GLOBALS['injector']->getInstance('Horde_Group'); try { $allGroups = $groups->getGroupMemberships($user); foreach (array_keys($allGroups) as $id) { @@ -306,7 +306,7 @@ class Horde_Api extends Horde_Registry_Api } try { - $groups = Horde_Group::singleton(); + $groups = $GLOBALS['injector']->getInstance('Horde_Group'); $group = $groups->newGroup($name, $parent); $groups->addGroup($group); } catch (Horde_Group_Exception $e) { @@ -328,7 +328,7 @@ class Horde_Api extends Horde_Registry_Api } try { - $groups = Horde_Group::singleton(); + $groups = $GLOBALS['injector']->getInstance('Horde_Group'); $group = $groups->getGroup($name); $groups->removeGroup($group, true); } catch (Horde_Group_Exception $e) { @@ -351,7 +351,7 @@ class Horde_Api extends Horde_Registry_Api } try { - $groups = Horde_Group::singleton(); + $groups = $GLOBALS['injector']->getInstance('Horde_Group'); $group = $groups->getGroup($name); $group->addUser($user); } catch (Horde_Group_Exception $e) { @@ -374,7 +374,7 @@ class Horde_Api extends Horde_Registry_Api } try { - $groups = Horde_Group::singleton(); + $groups = $GLOBALS['injector']->getInstance('Horde_Group'); $group = $groups->getGroup($name); foreach ($users as $user) { $group->addUser($user, false); @@ -400,7 +400,7 @@ class Horde_Api extends Horde_Registry_Api } try { - $groups = Horde_Group::singleton(); + $groups = $GLOBALS['injector']->getInstance('Horde_Group'); $group = $groups->getGroup($name); $group->removeUser($user); } catch (Horde_Group_Exception $e) { @@ -423,7 +423,7 @@ class Horde_Api extends Horde_Registry_Api } try { - $groups = Horde_Group::singleton(); + $groups = $GLOBALS['injector']->getInstance('Horde_Group'); $group = $groups->getGroup($name); foreach ($users as $user) { $group->removeUser($user, false); @@ -449,7 +449,7 @@ class Horde_Api extends Horde_Registry_Api } try { - $groups = Horde_Group::singleton(); + $groups = $GLOBALS['injector']->getInstance('Horde_Group'); $group = $groups->getGroup($name); return $group->listUsers(); } catch (Horde_Group_Exception $e) { @@ -605,7 +605,7 @@ class Horde_Api extends Horde_Registry_Api } try { - $groups = Horde_Group::singleton(); + $groups = $GLOBALS['injector']->getInstance('Horde_Group'); $groupId = $groups->getGroupId($groupName); } catch (Horde_Group_Exception $e) { throw new Horde_Exception($e); @@ -674,7 +674,7 @@ class Horde_Api extends Horde_Registry_Api } try { - $groups = Horde_Group::singleton(); + $groups = $GLOBALS['injector']->getInstance('Horde_Group'); $groupId = $groups->getGroupId($groupName); } catch (Horde_Group_Exception $e) { throw new Horde_Exception($e); diff --git a/horde/services/shares/edit.php b/horde/services/shares/edit.php index 44a11d77a..1209a7d98 100644 --- a/horde/services/shares/edit.php +++ b/horde/services/shares/edit.php @@ -25,7 +25,7 @@ $fieldsList = array( $app = Horde_Util::getFormData('app'); $shares = $injector->getInstance('Horde_Share')->getScope($app); -$groups = Horde_Group::singleton(); +$groups = $injector->getInstance('Horde_Group'); $auth = $injector->getInstance('Horde_Auth')->getAuth(); $help = $registry->hasMethod('shareHelp', $app) ? $registry->callByPackage($app, 'shareHelp') diff --git a/kronolith/lib/Api.php b/kronolith/lib/Api.php index ea767cb79..8409f0228 100644 --- a/kronolith/lib/Api.php +++ b/kronolith/lib/Api.php @@ -1176,7 +1176,7 @@ class Kronolith_Api extends Horde_Registry_Api throw new Horde_Exception_PermissionDenied(); } - $group = Horde_Group::singleton(); + $group = $GLOBALS['injector']->getInstance('Horde_Group'); $alarm_list = array(); $time = new Horde_Date($time); $calendars = is_null($user) ? array_keys($GLOBALS['kronolith_shares']->listAllShares()) : $GLOBALS['display_calendars']; diff --git a/kronolith/lib/Kronolith.php b/kronolith/lib/Kronolith.php index e1348ce21..567d78315 100644 --- a/kronolith/lib/Kronolith.php +++ b/kronolith/lib/Kronolith.php @@ -1177,7 +1177,7 @@ class Kronolith } try { - $groups = Horde_Group::singleton(); + $groups = $GLOBALS['injector']->getInstance('Horde_Group'); $group_list = $groups->getGroupMemberships($GLOBALS['registry']->getAuth()); if (count($group_list)) { $perm = $share->getPermission(); @@ -1962,7 +1962,7 @@ class Kronolith // Notify users that have been added. if ($GLOBALS['conf']['share']['notify'] && !isset($current[$group]) && $has_perms) { - $groupOb = Horde_Group::singleton()->getGroupById($group); + $groupOb = $GLOBALS['injector']->getInstance('Horde_Group')->getGroupById($group); if (!empty($groupOb->data['email'])) { try { $message = Horde::callHook('shareGroupNotification', array($group, $share)); @@ -2390,7 +2390,7 @@ class Kronolith throw new Kronolith_Exception('Unknown event action: ' . $action); } - $groups = Horde_Group::singleton(); + $groups = $GLOBALS['injector']->getInstance('Horde_Group'); $calendar = $event->calendar; $recipients = array(); try { diff --git a/kronolith/perms.php b/kronolith/perms.php index fd03fb4c0..66b157c3b 100644 --- a/kronolith/perms.php +++ b/kronolith/perms.php @@ -21,8 +21,8 @@ if (!empty($conf['share']['no_sharing'])) { throw new Horde_Exception('Permission denied.'); } -$shares = $GLOBALS['injector']->getInstance('Horde_Share')->getScope(); -$groups = Horde_Group::singleton(); +$shares = $injector->getInstance('Horde_Share')->getScope(); +$groups = $injector->getInstance('Horde_Group'); $auth = $injector->getInstance('Horde_Auth')->getAuth(); $reload = false; diff --git a/kronolith/templates/chunks/calendar.php b/kronolith/templates/chunks/calendar.php index b182394a9..3ba9e5d09 100644 --- a/kronolith/templates/chunks/calendar.php +++ b/kronolith/templates/chunks/calendar.php @@ -1,6 +1,6 @@ getInstance('Horde_Auth')->getAuth(); -$horde_groups = Horde_Group::singleton(); +$horde_groups = $GLOBALS['injector']->getInstance('Horde_Group'); $groups = array(); try { diff --git a/nag/lib/Api.php b/nag/lib/Api.php index a23a3c902..9b3540807 100644 --- a/nag/lib/Api.php +++ b/nag/lib/Api.php @@ -1428,7 +1428,7 @@ class Nag_Api extends Horde_Registry_Api } $storage = Nag_Driver::singleton(); - $group = Horde_Group::singleton(); + $group = $GLOBALS['injector']->getInstance('Horde_Group'); $alarm_list = array(); $tasklists = is_null($user) ? array_keys($GLOBALS['nag_shares']->listAllShares()) : $GLOBALS['display_tasklists']; diff --git a/nag/lib/Forms/task.php b/nag/lib/Forms/task.php index 4d6b4e57d..801959fa6 100644 --- a/nag/lib/Forms/task.php +++ b/nag/lib/Forms/task.php @@ -53,7 +53,7 @@ class Nag_TaskForm extends Horde_Form { $users = $share->listUsers(Horde_Perms::READ); $groups = $share->listGroups(Horde_Perms::READ); if (count($groups)) { - $horde_group = Horde_Group::singleton(); + $horde_group = $GLOBALS['injector']->getInstance('Horde_Group'); foreach ($groups as $group) { $users = array_merge($users, $horde_group->listAllUsers($group)); diff --git a/nag/lib/Nag.php b/nag/lib/Nag.php index 654aa5219..2dcad84bd 100644 --- a/nag/lib/Nag.php +++ b/nag/lib/Nag.php @@ -823,7 +823,7 @@ class Nag throw new Nag_Exception($e); } - $groups = Horde_Group::singleton(); + $groups = $GLOBALS['injector']->getInstance('Horde_Group'); $recipients = array(); $identity = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity(); $from = $identity->getDefaultFromAddress(true); diff --git a/trean/lib/Bookmarks.php b/trean/lib/Bookmarks.php index 9c74b2a78..cdbc127ee 100644 --- a/trean/lib/Bookmarks.php +++ b/trean/lib/Bookmarks.php @@ -628,7 +628,7 @@ class Trean_Bookmarks array('field' => 'value', 'op' => '&', 'test' => $perm))))); // If the user has any group memberships, check for those also. - $group = Horde_Group::singleton(); + $group = $GLOBALS['injector']->getInstance('Horde_Group'); $groups = $group->getGroupMemberships($userid, true); if (is_array($groups) && count($groups)) { // (name == perm_groups and key in ($groups) and val & $perm) diff --git a/turba/lib/Driver/Group.php b/turba/lib/Driver/Group.php index f18148cd5..16d1b6c4d 100644 --- a/turba/lib/Driver/Group.php +++ b/turba/lib/Driver/Group.php @@ -134,7 +134,7 @@ class Turba_Driver_Group extends Turba_Driver */ protected function _getAddressBook() { - $groups = Horde_Group::singleton(); + $groups = $GLOBALS['injector']->getInstance('Horde_Group'); $members = $groups->listAllUsers($this->_gid); $addressbook = array(); foreach ($members as $member) { diff --git a/whups/lib/Forms/AddComment.php b/whups/lib/Forms/AddComment.php index 175c606cf..48befb5cb 100644 --- a/whups/lib/Forms/AddComment.php +++ b/whups/lib/Forms/AddComment.php @@ -25,7 +25,7 @@ class AddCommentForm extends Horde_Form { /* Group restrictions. */ if ($GLOBALS['registry']->isAdmin(array('permission' => 'whups:admin')) || $GLOBALS['injector']->getInstance('Horde_Perms')->hasPermission('whups:hiddenComments', $GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) { - $groups = Horde_Group::singleton(); + $groups = $GLOBALS['injector']->getInstance('Horde_Group'); $mygroups = $groups->getGroupMemberships($GLOBALS['registry']->getAuth()); if ($mygroups) { foreach (array_keys($mygroups) as $gid) { diff --git a/whups/lib/Forms/CreateTicket.php b/whups/lib/Forms/CreateTicket.php index 343fe0970..060228428 100644 --- a/whups/lib/Forms/CreateTicket.php +++ b/whups/lib/Forms/CreateTicket.php @@ -211,7 +211,7 @@ class CreateStep4Form extends Horde_Form { $this->addHidden('', 'deferred_attachment', 'text', false); /* Groups. */ - $groups = Horde_Group::singleton(); + $groups = $GLOBALS['injector']->getInstance('Horde_Group'); if ($conf['prefs']['assign_all_groups']) { $mygroups = $groups->listGroups(); } else { diff --git a/whups/lib/Forms/EditTicket.php b/whups/lib/Forms/EditTicket.php index 1e80d443f..0d9708867 100644 --- a/whups/lib/Forms/EditTicket.php +++ b/whups/lib/Forms/EditTicket.php @@ -95,7 +95,7 @@ class EditTicketForm extends Horde_Form { case 'owner': if (Whups::hasPermission($vars->get('queue'), 'queue', 'assign')) { - $groups = Horde_Group::singleton(); + $groups = $GLOBALS['injector']->getInstance('Horde_Group'); if ($GLOBALS['conf']['prefs']['assign_all_groups']) { $mygroups = $groups->listGroups(); } else { @@ -181,7 +181,7 @@ class EditTicketForm extends Horde_Form { } /* Comment permissions. */ - $groups = Horde_Group::singleton(); + $groups = $GLOBALS['injector']->getInstance('Horde_Group'); $mygroups = $groups->getGroupMemberships($GLOBALS['registry']->getAuth()); if ($mygroups) { foreach (array_keys($mygroups) as $gid) { diff --git a/whups/lib/Forms/Query.php b/whups/lib/Forms/Query.php index d7dba6769..b8ec9fac2 100644 --- a/whups/lib/Forms/Query.php +++ b/whups/lib/Forms/Query.php @@ -90,7 +90,7 @@ class GroupCriterionForm extends Horde_Form { $this->addHidden('', 'edit', 'boolean', false); try { - $groups = Horde_Group::singleton(); + $groups = $GLOBALS['injector']->getInstance('Horde_Group'); $grouplist = $groups->listGroups(); } catch (Horde_Group_Exception $e) { $grouplist = array(); diff --git a/whups/lib/Whups.php b/whups/lib/Whups.php index 1dfbe0f1e..ce0180bfd 100644 --- a/whups/lib/Whups.php +++ b/whups/lib/Whups.php @@ -500,7 +500,7 @@ class Whups { function getOwnerCriteria($user) { $criteria = array('user:' . $user); - $groups = Horde_Group::singleton(); + $groups = $GLOBALS['injector']->getInstance('Horde_Group'); $mygroups = $groups->getGroupMemberships($GLOBALS['registry']->getAuth()); foreach ($mygroups as $id => $group) { $criteria[] = 'group:' . $id; @@ -576,7 +576,7 @@ class Whups { } } elseif ($type == 'group') { try { - $groups = Horde_Group::singleton(); + $groups = $GLOBALS['injector']->getInstance('Horde_Group'); $group = $groups->getGroupById($user); $results[$user]['user'] = $group->getShortName(); diff --git a/whups/ticket/queue.php b/whups/ticket/queue.php index f4021b895..e8a4d0d7a 100644 --- a/whups/ticket/queue.php +++ b/whups/ticket/queue.php @@ -34,7 +34,7 @@ class SetQueueStep1Form extends Horde_Form { if ($GLOBALS['registry']->isAdmin(array('permission' => 'whups:admin', 'permlevel' => Horde_Perms::EDIT)) || $GLOBALS['injector']->getInstance('Horde_Perms')->hasPermission('whups:hiddenComments', $GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) { - $groups = Horde_Group::singleton(); + $groups = $injector->getInstance('Horde_Group'); $mygroups = $groups->getGroupMemberships($GLOBALS['registry']->getAuth()); if ($mygroups) { foreach (array_keys($mygroups) as $gid) { diff --git a/whups/ticket/type.php b/whups/ticket/type.php index 616d11ada..1a6df2c12 100644 --- a/whups/ticket/type.php +++ b/whups/ticket/type.php @@ -28,7 +28,7 @@ class SetTypeStep1Form extends Horde_Form { $this->addVariable(_("Comment"), 'newcomment', 'longtext', false); /* Group restrictions. */ - $groups = Horde_Group::singleton(); + $groups = $injector->getInstance('Horde_Group'); $mygroups = $groups->getGroupMemberships($GLOBALS['registry']->getAuth()); if ($mygroups) { foreach (array_keys($mygroups) as $gid) {