From: Ben Klang Date: Wed, 2 Jun 2010 20:47:30 +0000 (-0400) Subject: Hermes: Yet more H4 fixes X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=3b7552b0e7a499f45d29ff60bc974c35edd46f5b;p=horde.git Hermes: Yet more H4 fixes --- diff --git a/hermes/admin.php b/hermes/admin.php index 6b324eec7..77fb8d492 100644 --- a/hermes/admin.php +++ b/hermes/admin.php @@ -12,7 +12,7 @@ require_once dirname(__FILE__) . '/lib/Application.php'; $hermes = Horde_Registry::appInit('hermes'); require_once HERMES_BASE . '/lib/Admin.php'; -if (!Horde_Auth::isAdmin()) { +if (!$registry->isAdmin()) { exit('forbidden.'); } diff --git a/hermes/lib/Admin.php b/hermes/lib/Admin.php index b51c985ae..d77923ad4 100644 --- a/hermes/lib/Admin.php +++ b/hermes/lib/Admin.php @@ -44,7 +44,7 @@ class EditJobTypeStep1Form extends Horde_Form { parent::Horde_Form($vars, 'editjobtypestep1form'); $values = array(); - $jobtypes = $hermes->listJobTypes(); + $jobtypes = $hermes->driver->listJobTypes(); if (!is_a($jobtypes, 'PEAR_Error')) { foreach ($jobtypes as $id => $jobtype) { $values[$id] = $jobtype['name']; @@ -79,7 +79,7 @@ class EditJobTypeStep2Form extends Horde_Form { parent::Horde_Form($vars, 'editjobtypestep2form'); $jobtype = $vars->get('jobtype'); - $info = $hermes->getJobTypeByID($jobtype); + $info = $hermes->driver->getJobTypeByID($jobtype); if (!$info || is_a($info, 'PEAR_Error')) { $stype = 'invalid'; $type_params = array(_("This is not a valid job type.")); @@ -117,7 +117,7 @@ class DeleteJobTypeForm extends Horde_Form { parent::Horde_Form($vars, 'deletejobtypeform'); $jobtype = $vars->get('jobtype'); - $info = $hermes->getJobTypeByID($jobtype); + $info = $hermes->driver->getJobTypeByID($jobtype); $yesnotype = 'enum'; $type_params = array(array(0 => _("No"), 1 => _("Yes"))); @@ -139,8 +139,6 @@ class EditClientStep1Form extends Horde_Form { function EditClientStep1Form(&$vars) { - global $hermes; - parent::Horde_Form($vars, 'editclientstep1form'); $clients = Hermes::listClients(); @@ -172,7 +170,7 @@ class EditClientStep2Form extends Horde_Form { parent::Horde_Form($vars, 'editclientstep2form'); $client = $vars->get('client'); - $info = $hermes->getClientSettings($client); + $info = $hermes->driver->getClientSettings($client); if (!$info || is_a($info, 'PEAR_Error')) { $stype = 'invalid'; $type_params = array(_("This is not a valid client.")); diff --git a/hermes/lib/Hermes.php b/hermes/lib/Hermes.php index e18856641..70367ee87 100644 --- a/hermes/lib/Hermes.php +++ b/hermes/lib/Hermes.php @@ -60,11 +60,11 @@ class Hermes { $menu->add(Horde::applicationUrl('entry.php'), _("_New Time"), 'hermes.png', null, null, null, Horde_Util::getFormData('id') ? '__noselection' : null); $menu->add(Horde::applicationUrl('search.php'), _("_Search"), Horde_Themes::img('search.png')); - if ($conf['time']['deliverables'] && Horde_Auth::isAdmin('hermes:deliverables')) { + if ($conf['time']['deliverables'] && $registry->isAdmin('hermes:deliverables')) { $menu->add(Horde::applicationUrl('deliverables.php'), _("_Deliverables"), 'hermes.png'); } - if ($conf['invoices']['driver'] && Horde_Auth::isAdmin('hermes:invoicing')) { + if ($conf['invoices']['driver'] && $registry->isAdmin('hermes:invoicing')) { $menu->add(Horde::applicationUrl('invoicing.php'), _("_Invoicing"), 'invoices.png'); } @@ -93,7 +93,7 @@ class Hermes { return true; } - $hours = $hermes->getHours(array('id' => $id)); + $hours = $hermes->driver->getHours(array('id' => $id)); if (!is_array($hours) || count($hours) != 1) { return false; } @@ -111,7 +111,7 @@ class Hermes { * Rewrite an hours array into a format useable by Horde_Data:: * * @param array $hours This is an array of the results from - * $hermes->getHours(). + * $hermes->driver->getHours(). * @return array an array suitable for Horde_Data:: */ function makeExportHours($hours)