Shout: I think this is the last of the context -> account break-fix work
authorBen Klang <ben@alkaloid.net>
Mon, 8 Mar 2010 23:21:52 +0000 (18:21 -0500)
committerBen Klang <ben@alkaloid.net>
Mon, 8 Mar 2010 23:24:21 +0000 (18:24 -0500)
shout/lib/Forms/DeviceForm.php
shout/lib/Forms/ExtensionForm.php
shout/lib/Shout.php

index c24d93a..97d32e4 100644 (file)
@@ -26,8 +26,10 @@ class DeviceDetailsForm extends Horde_Form {
             $edit = false;
         }
 
-        $account = $vars->get('account');
-        parent::__construct($vars, _("$formtitle - Account: $account"));
+        $accountname = $_SESSION['shout']['accounts'][$curaccount];
+        $title = sprintf(_("$formtitle - Account: %s"), $accountname);
+        parent::__construct($vars, $title);
+
         $this->addHidden('', 'action', 'text', true);
         if ($edit) {
             $this->addHidden('', 'devid', 'text', true);
@@ -100,7 +102,7 @@ class DeviceDeleteForm extends Horde_Form
         $account = $vars->get('account');
 
         $title = _("Delete Device %s - Account: %s");
-        $title = sprintf($title, $devid, $account);
+        $title = sprintf($title, $devid, $_SESSION['shout']['accounts'][$account]);
         parent::__construct($vars, $title);
 
         $this->addHidden('', 'account', 'text', true);
index eb97dbd..5fa6797 100644 (file)
@@ -25,7 +25,7 @@ class ExtensionDetailsForm extends Horde_Form {
     {
         global $shout;
 
-        $account = $_SESSION['shout']['account'];
+        $account = $_SESSION['shout']['curaccount'];
         $action = $vars->get('action');
         if ($action == 'edit') {
             $formtitle = "Edit User";
@@ -33,7 +33,10 @@ class ExtensionDetailsForm extends Horde_Form {
             $formtitle = "Add User";
         }
 
-        parent::__construct($vars, _("$formtitle - Account: $account"));
+        $accountname = $_SESSION['shout']['accounts'][$curaccount];
+        $title = sprintf(_("$formtitle - Account: %s"), $accountname);
+        parent::__construct($vars, $title);
+
 
         $extension = $vars->get('extension');
 
@@ -83,7 +86,7 @@ class ExtensionDeleteForm extends Horde_Form
         $account = $vars->get('account');
 
         $title = _("Delete Extension %s - Account: %s");
-        $title = sprintf($title, $extension, $account);
+        $title = sprintf($title, $extension, $_SESSION['shout']['accounts'][$account]);
         parent::__construct($vars, $title);
 
         $this->addHidden('', 'account', 'text', true);
index aa78d6c..626dc3a 100644 (file)
@@ -140,7 +140,7 @@ class Shout
     static public function getMenuActions()
     {
         global $shout;
-        $account = $_SESSION['shout']['account'];
+        $account = $_SESSION['shout']['curaccount'];
 
         return array(
             'jump' => array(