Fix variable name.
authorJan Schneider <jan@horde.org>
Wed, 8 Dec 2010 18:21:06 +0000 (19:21 +0100)
committerJan Schneider <jan@horde.org>
Wed, 8 Dec 2010 18:21:06 +0000 (19:21 +0100)
vilma/lib/Forms/DeleteDomainForm.php
vilma/lib/Forms/EditAliasForm.php
vilma/lib/Forms/EditDomainForm.php
vilma/lib/Forms/EditForwardForm.php
vilma/lib/Forms/EditUserForm.php
vilma/scripts/create_mailboxes.php

index ad8cace..ff50da7 100644 (file)
@@ -14,7 +14,7 @@ class DeleteDomainForm extends Horde_Form {
     {
         parent::Horde_Form($vars, _("Delete Domain"));
 
-        $domain_record = $GLOBALS['vilma_driver']->getDomain($vars->get('domain_id'));
+        $domain_record = $GLOBALS['vilma']->driver->getDomain($vars->get('domain_id'));
         if (is_a($domain_record, 'PEAR_Error')) {
             return $domain_record;
         }
index e5c1c45..f3e1ddf 100644 (file)
@@ -13,8 +13,6 @@ class EditAliasForm extends Horde_Form {
 
     function EditAliasForm(&$vars)
     {
-        global $vilma_driver;
-
         $type = $vars->get('type');
         $editing = ($vars->get('mode') == 'edit');
         if ($editing) {
index f86f152..550ba2a 100644 (file)
@@ -18,7 +18,7 @@ class EditDomainForm extends Horde_Form {
         $domain = $GLOBALS['session']->get('vilma', 'domain');
         parent::Horde_Form($vars, $editing ? _("Edit Domain") : _("New Domain"));
         if ($editing && !$this->isSubmitted()) {
-            $domain = $GLOBALS['vilma_driver']->getDomain($vars->get('domain_id'));
+            $domain = $GLOBALS['vilma']->driver->getDomain($vars->get('domain_id'));
             if (is_a($domain, 'PEAR_Error')) {
                 return $domain;
             }
index 7fc2e6e..cd3a4f3 100644 (file)
@@ -13,8 +13,6 @@ class EditForwardForm extends Horde_Form {
 
     function EditForwardForm(&$vars)
     {
-        global $vilma_driver;
-
         $type = $vars->get('type');
         $editing = ($vars->get('mode') == 'edit');
         if ($editing) {
index a4e4d48..e04f301 100644 (file)
@@ -13,8 +13,6 @@ class EditUserForm extends Horde_Form {
 
     function EditUserForm(&$vars)
     {
-        global $vilma_driver;
-
         $type = $vars->get('type');
         $editing = ($vars->get('mode') == 'edit');
         if ($editing) {
@@ -53,7 +51,7 @@ class EditUserForm extends Horde_Form {
             $this->addVariable(_("Password"), 'password', 'passwordconfirm', true);
         }
         $this->addVariable(_("Full Name"), 'user_full_name', 'text', true);
-        $attrs = $vilma_driver->getUserFormAttributes();
+        $attrs = $GLOBALS['vilma']->driver->getUserFormAttributes();
         foreach ($attrs as $attr) {
             $v = &$this->addVariable($attr['label'], $attr['name'],
                                 $attr['type'], $attr['required'],
index e5e34e1..b3199f0 100644 (file)
@@ -5,11 +5,8 @@
  * system for any new users. A cron job can be set up to run this periodically.
  */
 
-// No auth.
-@define('AUTH_HANDLER', true);
-
-@define('VILMA_BASE', dirname(__FILE__) . '/..');
-require_once VILMA_BASE . '/lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+$vilma = Horde_Registry::appInit('vilma', array('authentication' => 'none'));
 
 // Make sure no one runs this from the web.
 if (!Horde_Cli::runningFromCLI()) {
@@ -23,7 +20,7 @@ Horde_Cli::init();
 /* Make sure there's no compression. */
 @ob_end_clean();
 
-$users_by_domain = $vilma_driver->getAllUsers();
+$users_by_domain = $vilma->driver->getAllUsers();
 
 foreach ($users_by_domain as $domain => $users) {
     foreach ($users as $user) {