User the Injector to get Horde_Auth instances
authorBen Klang <ben@alkaloid.net>
Tue, 20 Jul 2010 18:26:31 +0000 (14:26 -0400)
committerBen Klang <ben@alkaloid.net>
Tue, 20 Jul 2010 18:27:53 +0000 (14:27 -0400)
hermes/lib/Forms/Search.php
hermes/lib/Forms/Time.php

index e8f9b24..0dd4005 100644 (file)
@@ -164,8 +164,8 @@ class SearchForm extends Horde_Form {
         $criteria = array();
         if ($perms->hasPermission('hermes:review', $GLOBALS['registry']->getAuth(), Horde_Perms::SHOW)) {
             if (!empty($info['employees'])) {
-                $auth = Horde_Auth::singleton($GLOBALS['conf']['auth']['driver']);
-                if (!$auth->capabilities['list']) {
+                $auth = $GLOBALS['injector']->getInstance('Horde_Auth')->getAuth();
+                if (!$auth->hasCapability('list')) {
                     $criteria['employee'] = explode(',', $info['employees']);
                 } else {
                     $criteria['employee'] = $info['employees'];
index b12661f..f74ba01 100644 (file)
@@ -285,7 +285,7 @@ class TimeReviewForm extends TimeForm {
         $employees = array();
 
         require_once 'Horde/Identity.php';
-        $auth = Horde_Auth::singleton($conf['auth']['driver']);
+        $auth = $GLOBALS['injector']->getInstance('Horde_Auth')->getAuth();
         $users = $auth->listUsers();
         if (!is_a($users, 'PEAR_Error')) {
             foreach ($users as $user) {