From: Michael M Slusarz Date: Wed, 17 Nov 2010 20:51:46 +0000 (-0700) Subject: Convert Shout to Horde_Session X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=52ed916ba45cb03a94966f9b94caf0f7def91f3a;p=horde.git Convert Shout to Horde_Session --- diff --git a/shout/admin.php b/shout/admin.php index 9d7e866bd..28c08b608 100644 --- a/shout/admin.php +++ b/shout/admin.php @@ -14,9 +14,6 @@ $shout = Horde_Registry::appInit('shout'); require_once SHOUT_BASE . '/lib/Forms/AccountForm.php'; - -$curaccount = $_SESSION['shout']['curaccount']; - $RENDERER = new Horde_Form_Renderer(); $title = _("Accounts: "); diff --git a/shout/admin/accounts.php b/shout/admin/accounts.php index 45f486930..67c6addca 100644 --- a/shout/admin/accounts.php +++ b/shout/admin/accounts.php @@ -15,7 +15,7 @@ $shout = Horde_Registry::appInit('shout'); require_once SHOUT_BASE . '/lib/Forms/AccountForm.php'; $action = Horde_Util::getFormData('action'); -$curaccount = $_SESSION['shout']['curaccount']; +$curaccount = $GLOBALS['session']->get('shout', 'curaccount'); $RENDERER = new Horde_Form_Renderer(); @@ -25,7 +25,7 @@ switch ($action) { case 'add': case 'edit': $vars = Horde_Variables::getDefaultVariables(); - $vars->set('account', $curaccount['code']); + $vars->set('account', $curaccount); $Form = new AccountDetailsForm($vars); if ($Form->isSubmitted() && $Form->validate($vars, true)) { @@ -58,7 +58,7 @@ case 'delete': $extension = Horde_Util::getFormData('extension'); $vars = Horde_Variables::getDefaultVariables(); - $vars->set('account', $curaccount['code']); + $vars->set('account', $curaccount); $Form = new ExtensionDeleteForm($vars); $FormValid = $Form->validate($vars, true); @@ -77,7 +77,7 @@ case 'delete': } $vars = Horde_Variables::getDefaultVariables(array()); - $vars->set('account', $curaccount['code']); + $vars->set('account', $curaccount); $Form = new ExtensionDeleteForm($vars); break; diff --git a/shout/admin/numbers.php b/shout/admin/numbers.php index 7bf341d83..8ebb6f5f9 100644 --- a/shout/admin/numbers.php +++ b/shout/admin/numbers.php @@ -15,7 +15,7 @@ $shout = Horde_Registry::appInit('shout'); require_once SHOUT_BASE . '/lib/Forms/NumberForm.php'; $action = Horde_Util::getFormData('action'); -$curaccount = $_SESSION['shout']['curaccount']; +$curaccount = $GLOBALS['session']->get('shout', 'curaccount_code'); $RENDERER = new Horde_Form_Renderer(); @@ -59,7 +59,7 @@ case 'delete': $extension = Horde_Util::getFormData('extension'); $vars = Horde_Variables::getDefaultVariables(); - $vars->set('account', $curaccount['code']); + $vars->set('account', $curaccount); $Form = new ExtensionDeleteForm($vars); $FormValid = $Form->validate($vars, true); @@ -78,7 +78,7 @@ case 'delete': } $vars = Horde_Variables::getDefaultVariables(array()); - $vars->set('account', $curaccount['code']); + $vars->set('account', $curaccount); $Form = new ExtensionDeleteForm($vars); break; diff --git a/shout/conferences.php b/shout/conferences.php index 39daec33f..a9f2cf30b 100644 --- a/shout/conferences.php +++ b/shout/conferences.php @@ -14,7 +14,7 @@ $shout = Horde_Registry::appInit('shout'); require_once SHOUT_BASE . '/lib/Forms/ConferenceForm.php'; -$curaccount = $_SESSION['shout']['curaccount']; +$curaccount = $GLOBALS['session']->get('shout', 'curaccount_code'); $action = Horde_Util::getFormData('action'); $vars = Horde_Variables::getDefaultVariables(); @@ -26,7 +26,7 @@ switch ($action) { case 'add': case 'edit': $vars = Horde_Variables::getDefaultVariables(); - $vars->set('account', $curaccount['code']); + $vars->set('account', $curaccount); $Form = new ConferenceDetailsForm($vars); // Show the list if the save was successful, otherwise back to edit. @@ -49,7 +49,7 @@ case 'edit': // Create a new add/edit form $roomno = Horde_Util::getFormData('roomno'); - $conferences = $shout->storage->getConferences($curaccount['code']); + $conferences = $shout->storage->getConferences($curaccount); $vars = new Horde_Variables($conferences[$roomno]); $vars->set('action', $action); @@ -65,7 +65,7 @@ case 'delete': $devid = Horde_Util::getFormData('devid'); $vars = Horde_Variables::getDefaultVariables(); - $vars->set('account', $curaccount['code']); + $vars->set('account', $curaccount); $Form = new DeviceDeleteForm($vars); $FormValid = $Form->validate($vars, true); @@ -83,7 +83,7 @@ case 'delete': } $vars = Horde_Variables::getDefaultVariables(array()); - $vars->set('account', $curaccount['code']); + $vars->set('account', $curaccount); $Form = new DeviceDeleteForm($vars); break; @@ -95,7 +95,7 @@ default: // Fetch the (possibly updated) list of extensions try { - $conferences = $shout->devices->getConferences($curaccount['code']); + $conferences = $shout->devices->getConferences($curaccount); } catch (Exception $e) { $notification->push($e); $devices = array(); diff --git a/shout/devices.php b/shout/devices.php index fc6e0b54c..61e4c117d 100644 --- a/shout/devices.php +++ b/shout/devices.php @@ -14,7 +14,7 @@ $shout = Horde_Registry::appInit('shout'); require_once SHOUT_BASE . '/lib/Forms/DeviceForm.php'; -$curaccount = $_SESSION['shout']['curaccount']; +$curaccount = $GLOBALS['session']->get('shout', 'curaccount_code'); $action = Horde_Util::getFormData('action'); $vars = Horde_Variables::getDefaultVariables(); @@ -26,7 +26,7 @@ switch ($action) { case 'add': case 'edit': $vars = Horde_Variables::getDefaultVariables(); - $vars->set('account', $curaccount['code']); + $vars->set('account', $curaccount); $Form = new DeviceDetailsForm($vars); // Show the list if the save was successful, otherwise back to edit. @@ -51,7 +51,7 @@ case 'edit': // Create a new add/edit form $devid = Horde_Util::getFormData('devid'); - $devices = $shout->devices->getDevices($curaccount['code']); + $devices = $shout->devices->getDevices($curaccount); $vars = new Horde_Variables($devices[$devid]); $vars->set('action', $action); @@ -66,7 +66,7 @@ case 'delete': $devid = Horde_Util::getFormData('devid'); $vars = Horde_Variables::getDefaultVariables(); - $vars->set('account', $curaccount['code']); + $vars->set('account', $curaccount); $Form = new DeviceDeleteForm($vars); $FormValid = $Form->validate($vars, true); @@ -84,7 +84,7 @@ case 'delete': } $vars = Horde_Variables::getDefaultVariables(array()); - $vars->set('account', $curaccount['code']); + $vars->set('account', $curaccount); $Form = new DeviceDeleteForm($vars); break; @@ -97,7 +97,7 @@ default: // Fetch the (possibly updated) list of extensions try { - $devices = $shout->devices->getDevices($curaccount['code']); + $devices = $shout->devices->getDevices($curaccount); } catch (Exception $e) { $notification->push($e); $devices = array(); diff --git a/shout/dialplan.php b/shout/dialplan.php index 966971314..cdd1585e7 100644 --- a/shout/dialplan.php +++ b/shout/dialplan.php @@ -16,9 +16,9 @@ require_once SHOUT_BASE . '/lib/Forms/MenuForm.php'; $action = Horde_Util::getFormData('action'); $menu = Horde_Util::getFormData('menu'); -$curaccount = $_SESSION['shout']['curaccount']; +$curaccount = $GLOBALS['session']->get('shout', 'curaccount_code'); -$menus = $shout->storage->getMenus($curaccount['code']); +$menus = $shout->storage->getMenus($curaccount); if (empty($menus)) { Horde::url('wizard.php', true)->redirect(); } @@ -26,7 +26,7 @@ if (empty($menus)) { switch($action) { case 'add': $vars = Horde_Variables::getDefaultVariables(); - $vars->set('account', $curaccount['code']); + $vars->set('account', $curaccount); $Form = new MenuForm($vars); if ($Form->isSubmitted() && $Form->validate($vars, true)) { @@ -35,7 +35,7 @@ case 'add': $Form->execute(); $notification->push(_("Menu added."), 'horde.success'); - $menus = $shout->storage->getMenus($curaccount['code']); + $menus = $shout->storage->getMenus($curaccount); $action = 'edit'; } catch (Exception $e) { @@ -62,9 +62,9 @@ default: // after a successful add. if ($action == 'edit') { try { - $destinations = $shout->extensions->getExtensions($curaccount['code']); - $conferences = $shout->storage->getConferences($curaccount['code']); - $recordings = $shout->storage->getRecordings($curaccount['code']); + $destinations = $shout->extensions->getExtensions($curaccount); + $conferences = $shout->storage->getConferences($curaccount); + $recordings = $shout->storage->getRecordings($curaccount); // If any of these are empty, we need to coerce them to null. // Otherwise we end up with a Prototype.js $H([]) (Hash of an empty // Array) which causes confusion inside the library. diff --git a/shout/extensions.php b/shout/extensions.php index 1080c24cd..f3600968d 100644 --- a/shout/extensions.php +++ b/shout/extensions.php @@ -14,17 +14,14 @@ $shout = Horde_Registry::appInit('shout'); require_once SHOUT_BASE . '/lib/Forms/ExtensionForm.php'; -$curaccount = $_SESSION['shout']['curaccount']; - $RENDERER = new Horde_Form_Renderer(); $section = 'extensions'; $title = _("Extensions: "); - // Fetch the (possibly updated) list of extensions try { - $extensions = $shout->extensions->getExtensions($curaccount['code']); + $extensions = $shout->extensions->getExtensions($session->get('shout', 'curaccount_code')); } catch (Exception $e) { $notification->push($e); $extensions = array(); diff --git a/shout/index.php b/shout/index.php index 1dd9fd443..df4ae93e4 100644 --- a/shout/index.php +++ b/shout/index.php @@ -11,12 +11,11 @@ require_once dirname(__FILE__) . '/lib/Application.php'; $shout = Horde_Registry::appInit('shout'); -if (empty($_SESSION['shout']['curaccount'])) { +if (!($curaccount = $GLOBALS['session']->get('shout', 'curaccount_code'))) { die("Permission denied."); } -$curaccount = $_SESSION['shout']['curaccount']; -$menus = $shout->storage->getMenus($curaccount['code']); +$menus = $shout->storage->getMenus($curaccount); if (empty($menus)) { Horde::url('wizard.php', true)->redirect(); diff --git a/shout/lib/Ajax/Application.php b/shout/lib/Ajax/Application.php index 96b8b8f1f..eefe40177 100644 --- a/shout/lib/Ajax/Application.php +++ b/shout/lib/Ajax/Application.php @@ -17,9 +17,9 @@ class Shout_Ajax_Application extends Horde_Core_Ajax_Application { try { $shout = $GLOBALS['registry']->getApiInstance('shout', 'application'); - $curaccount = $_SESSION['shout']['curaccount']; + $curaccount = $GLOBALS['session']->get('shout', 'curaccount_code'); require_once SHOUT_BASE . '/lib/Forms/ExtensionForm.php'; - $this->_vars->set('account', $curaccount['code']); + $this->_vars->set('account', $curaccount); $Form = new ExtensionDetailsForm($this->_vars); $Form->setSubmitted(); if ($Form->isValid()) { @@ -40,7 +40,7 @@ class Shout_Ajax_Application extends Horde_Core_Ajax_Application { $vars = $this->_vars; $shout = $GLOBALS['registry']->getApiInstance('shout', 'application'); - $account = $_SESSION['shout']['curaccount']['code']; + $account = $GLOBALS['session']->get('shout', 'curaccount_code'); try { $shout = $GLOBALS['registry']->getApiInstance('shout', 'application'); $shout->extensions->addDestination($account, $vars->extension, $vars->type, $vars->destination); @@ -60,7 +60,7 @@ class Shout_Ajax_Application extends Horde_Core_Ajax_Application { $vars = $this->_vars; $shout = $GLOBALS['registry']->getApiInstance('shout', 'application'); - $account = $_SESSION['shout']['curaccount']['code']; + $account = $GLOBALS['session']->get('shout', 'curaccount_code'); try { // FIXME: Use Form? $shout = $GLOBALS['registry']->getApiInstance('shout', 'application'); @@ -82,7 +82,7 @@ class Shout_Ajax_Application extends Horde_Core_Ajax_Application try { $vars = $this->_vars; $shout = $GLOBALS['registry']->getApiInstance('shout', 'application'); - $account = $_SESSION['shout']['curaccount']['code']; + $account = $GLOBALS['session']->get('shout', 'curaccount_code'); return $shout->extensions->getExtensions($account); } catch (Exception $e) { //FIXME: Create a way to notify the user of the failure. @@ -96,7 +96,7 @@ class Shout_Ajax_Application extends Horde_Core_Ajax_Application try { $vars = $this->_vars; $shout = $GLOBALS['registry']->getApiInstance('shout', 'application'); - $account = $_SESSION['shout']['curaccount']['code']; + $account = $GLOBALS['session']->get('shout', 'curaccount_code'); $devices = $shout->devices->getDevices($account); if (empty($devices)) { return false; @@ -117,7 +117,7 @@ class Shout_Ajax_Application extends Horde_Core_Ajax_Application { try { $shout = $GLOBALS['registry']->getApiInstance('shout', 'application'); - $account = $_SESSION['shout']['curaccount']['code']; + $account = $GLOBALS['session']->get('shout', 'curaccount_code'); $menus = $shout->storage->getMenus($account); if (empty($menus)) { return false; @@ -138,7 +138,7 @@ class Shout_Ajax_Application extends Horde_Core_Ajax_Application { try { $shout = $GLOBALS['registry']->getApiInstance('shout', 'application'); - $account = $_SESSION['shout']['curaccount']['code']; + $account = $GLOBALS['session']->get('shout', 'curaccount_code'); $menu = $this->_vars->get('menu'); if (empty($menu)) { throw new Shout_Exception('Must specify a menu to delete.'); @@ -156,7 +156,7 @@ class Shout_Ajax_Application extends Horde_Core_Ajax_Application { try { $shout = $GLOBALS['registry']->getApiInstance('shout', 'application'); - $account = $_SESSION['shout']['curaccount']['code']; + $account = $GLOBALS['session']->get('shout', 'curaccount_code'); return $shout->storage->getConferences($account); } catch (Exception $e) { //FIXME: Create a way to notify the user of the failure. @@ -169,7 +169,7 @@ class Shout_Ajax_Application extends Horde_Core_Ajax_Application { try { $shout = $GLOBALS['registry']->getApiInstance('shout', 'application'); - $account = $_SESSION['shout']['curaccount']['code']; + $account = $GLOBALS['session']->get('shout', 'curaccount_code'); $vars = &$this->_vars; $info = array( 'name' => $vars->get('name'), @@ -193,7 +193,7 @@ class Shout_Ajax_Application extends Horde_Core_Ajax_Application if (!($action = $vars->get('action'))) { throw new Shout_Exception("Invalid action requested."); } - $account = $_SESSION['shout']['curaccount']['code']; + $account = $GLOBALS['session']->get('shout', 'curaccount_code'); $digit = $vars->get('digit'); $menu = $vars->get('menu'); $action = $vars->get('action'); diff --git a/shout/lib/Application.php b/shout/lib/Application.php index 936ed74c5..ed044d935 100644 --- a/shout/lib/Application.php +++ b/shout/lib/Application.php @@ -90,8 +90,8 @@ class Shout_Application extends Horde_Registry_Application } $account = Horde_Util::getFormData('account'); - if (empty($account) && !empty($_SESSION['shout']['curaccount'])) { - $account = $_SESSION['shout']['curaccount']['code']; + if (empty($account)) { + $account = $GLOBALS['session']->get('shout', 'curaccount_code'); } if (!empty($account) && !in_array($account, array_keys($accounts))) { @@ -111,7 +111,8 @@ class Shout_Application extends Horde_Registry_Application } } - $_SESSION['shout']['curaccount'] = $accounts[$account]; + $session->set('shout', 'curaccount_code', $accounts[$account]['code']); + $session->set('shout', 'curaccount_name', $accounts[$account]['name']); } /** @@ -155,7 +156,7 @@ class Shout_Application extends Horde_Registry_Application public function getRecordings() { - $account = $_SESSION['shout']['curaccount']['code']; + $account = $GLOBALS['session']->get('shout', 'curaccount_code'); $rlist = $this->vfs->listFolder($account); // In Asterisk, filenames the same basename and different extension are diff --git a/shout/lib/Forms/AccountForm.php b/shout/lib/Forms/AccountForm.php index 0ddb09c33..492b10f1f 100644 --- a/shout/lib/Forms/AccountForm.php +++ b/shout/lib/Forms/AccountForm.php @@ -22,7 +22,7 @@ class AccountDetailsForm extends Horde_Form { */ function __construct(&$vars) { - $account = $_SESSION['shout']['curaccount']['code']; + $account = $GLOBALS['session']->get('shout', 'curaccount_code'); $action = $vars->get('action'); if ($action == 'edit') { $formtitle = "Edit Account"; @@ -31,7 +31,7 @@ class AccountDetailsForm extends Horde_Form { $formtitle = "Add Account"; } - $accountname = $_SESSION['shout']['curaccount']['name']; + $accountname = $GLOBALS['session']->get('shout', 'curaccount_name'); $title = sprintf(_("$formtitle %s"), $accountname); parent::__construct($vars, $title); @@ -71,7 +71,8 @@ class AccountDeleteForm extends Horde_Form $account = $vars->get('account'); $title = _("Delete Extension %s - Account: %s"); - $title = sprintf($title, $extension, $_SESSION['shout']['accounts'][$account]['name']); + $account_config = $GLOBALS['session']->get('shout', 'accounts/' . $account); + $title = sprintf($title, $extension, $account_config['name']); parent::__construct($vars, $title); $this->addHidden('', 'account', 'text', true); diff --git a/shout/lib/Forms/ConferenceForm.php b/shout/lib/Forms/ConferenceForm.php index 739c09808..49df62dd2 100644 --- a/shout/lib/Forms/ConferenceForm.php +++ b/shout/lib/Forms/ConferenceForm.php @@ -13,7 +13,7 @@ class ConferenceDetailsForm extends Horde_Form { function __construct(&$vars) { - $accountname = $_SESSION['shout']['curaccount']['name']; + $accountname = $GLOBALS['session']->get('shout', 'curaccount_name'); if ($vars->exists('roomno')) { $title = sprintf(_("Edit Conference Room - Account: %s"), $accountname); $roomno = $vars->get('roomno'); @@ -75,7 +75,8 @@ class ConferenceDeleteForm extends Horde_Form $account = $vars->get('account'); $title = _("FIXME Delete Device %s - Account: %s"); - $title = sprintf($title, $devid, $_SESSION['shout']['accounts'][$account]['name']); + $account_config = $GLOBALS['session']->get('shout', 'accounts/' . $account); + $title = sprintf($title, $devid, $account_config['name']); parent::__construct($vars, $title); $this->addHidden('', 'account', 'text', true); @@ -91,4 +92,4 @@ class ConferenceDeleteForm extends Horde_Form $devid = $this->_vars->get('devid'); $shout->devices->deleteDevice($account, $devid); } -} \ No newline at end of file +} diff --git a/shout/lib/Forms/DeviceForm.php b/shout/lib/Forms/DeviceForm.php index ed568ca8c..a851b2888 100644 --- a/shout/lib/Forms/DeviceForm.php +++ b/shout/lib/Forms/DeviceForm.php @@ -22,7 +22,7 @@ class DeviceDetailsForm extends Horde_Form { $edit = false; } - $accountname = $_SESSION['shout']['curaccount']['name']; + $accountname = $GLOBALS['session']->get('shout', 'curaccount_name'); $title = sprintf(_("$formtitle - Account: %s"), $accountname); parent::__construct($vars, $title); @@ -98,7 +98,8 @@ class DeviceDeleteForm extends Horde_Form $account = $vars->get('account'); $title = _("Delete Device %s - Account: %s"); - $title = sprintf($title, $devid, $_SESSION['shout']['accounts'][$account]['name']); + $account_config = $GLOBALS['session']->get('shout', 'accounts/' . $account); + $title = sprintf($title, $devid, $account_config['name']); parent::__construct($vars, $title); $this->addHidden('', 'account', 'text', true); @@ -114,4 +115,4 @@ class DeviceDeleteForm extends Horde_Form $devid = $this->_vars->get('devid'); $shout->devices->deleteDevice($account, $devid); } -} \ No newline at end of file +} diff --git a/shout/lib/Forms/ExtensionForm.php b/shout/lib/Forms/ExtensionForm.php index 0fa681495..617bb3c59 100644 --- a/shout/lib/Forms/ExtensionForm.php +++ b/shout/lib/Forms/ExtensionForm.php @@ -28,7 +28,7 @@ class ExtensionDetailsForm extends Horde_Form { $formtitle = "Add User"; } - $accountname = $_SESSION['shout']['curaccount']['name']; + $accountname = $GLOBALS['session']->get('shout', 'curaccount_name'); $title = sprintf(_("$formtitle - Account: %s"), $accountname); parent::__construct($vars, $title); @@ -81,7 +81,7 @@ class ExtensionDeleteForm extends Horde_Form $account = $vars->get('account'); $title = _("Delete Extension %s - Account: %s"); - $title = sprintf($title, $extension, $_SESSION['shout']['curaccount']['name']); + $title = sprintf($title, $extension, $GLOBALS['session']->get('shout', 'curaccount_name')); parent::__construct($vars, $title); $this->addHidden('', 'account', 'text', true); diff --git a/shout/lib/Forms/MenuForm.php b/shout/lib/Forms/MenuForm.php index d64c948a2..872e8bec2 100644 --- a/shout/lib/Forms/MenuForm.php +++ b/shout/lib/Forms/MenuForm.php @@ -22,12 +22,12 @@ class MenuForm extends Horde_Form { $edit = false; } - $accountname = $_SESSION['shout']['curaccount']['name']; + $accountname = $GLOBALS['session']->get('shout', 'curaccount_name'); $title = sprintf(_("%s - Account: %s"), $formtitle, $accountname); parent::__construct($vars, $title); $this->addHidden('', 'action', 'text', true); - + if ($edit) { $this->addHidden('', 'oldname', 'text', true); $vars->set('oldname', $menu); @@ -36,7 +36,7 @@ class MenuForm extends Horde_Form { $this->addVariable(_("Description"), 'description', 'text', false); $shout = $GLOBALS['registry']->getApiInstance('shout', 'application'); - $recordings = $shout->storage->getRecordings($_SESSION['shout']['curaccount']['code']); + $recordings = $shout->storage->getRecordings($GLOBALS['session']->get('shout', 'curaccount_code')); $list = array(); foreach ($recordings as $id => $info) { $list[$id] = $info['filename']; @@ -51,7 +51,7 @@ class MenuForm extends Horde_Form { { $shout = $GLOBALS['registry']->getApiInstance('shout', 'application'); - $account = $_SESSION['shout']['curaccount']['code']; + $account = $GLOBALS['session']->get('shout', 'curaccount_code'); $details = array( 'name' => $this->_vars->get('name'), @@ -76,7 +76,7 @@ class DeviceMenuForm extends Horde_Form $account = $vars->get('account'); $title = _("Delete Menu %s - Account: %s"); - $title = sprintf($title, $menu, $_SESSION['shout']['curaccount']['name']); + $title = sprintf($title, $menu, $GLOBALS['session']->get('shout', 'curaccount_name')); parent::__construct($vars, $title); $this->setButtons(array(_("Delete"), _("Cancel"))); @@ -89,4 +89,4 @@ class DeviceMenuForm extends Horde_Form $menu = $this->_vars->get('menu'); $shout->devices->deleteMenu($account, $menu); } -} \ No newline at end of file +} diff --git a/shout/lib/Forms/NumberForm.php b/shout/lib/Forms/NumberForm.php index d1a25e87c..c6ae7b39b 100644 --- a/shout/lib/Forms/NumberForm.php +++ b/shout/lib/Forms/NumberForm.php @@ -84,7 +84,8 @@ class NumberDeleteForm extends Horde_Form $account = $vars->get('account'); $title = _("Delete Extension %s - Account: %s"); - $title = sprintf($title, $extension, $_SESSION['shout']['accounts'][$account]['name']); + $account_config = $GLOBALS['session']->get('shout', 'accounts/' . $account); + $title = sprintf($title, $extension, $account_config['name']); parent::__construct($vars, $title); $this->addHidden('', 'account', 'text', true); diff --git a/shout/lib/Forms/RecordingForm.php b/shout/lib/Forms/RecordingForm.php index 984ad83d9..25a9b09af 100644 --- a/shout/lib/Forms/RecordingForm.php +++ b/shout/lib/Forms/RecordingForm.php @@ -48,7 +48,8 @@ class ConferenceDeleteForm extends Horde_Form $account = $vars->get('account'); $title = _("FIXME Delete Recording %s - Account: %s"); - $title = sprintf($title, $devid, $_SESSION['shout']['curaccount']['name']); + $title = sprintf($title, $devid, $GLOBALS['session']->get('shout', 'curaccount_name')); + parent::__construct($vars, $title); $this->addHidden('', 'account', 'text', true); @@ -65,4 +66,4 @@ class ConferenceDeleteForm extends Horde_Form $devid = $this->_vars->get('devid'); $shout->devices->deleteDevice($account, $devid); } -} \ No newline at end of file +} diff --git a/shout/lib/Shout.php b/shout/lib/Shout.php index c6131d53d..5adf81c34 100644 --- a/shout/lib/Shout.php +++ b/shout/lib/Shout.php @@ -156,7 +156,7 @@ class Shout static public function getMenuActions() { $shout = $GLOBALS['registry']->getApiInstance('shout', 'application'); - $account = $_SESSION['shout']['curaccount']['code']; + $account = $GLOBALS['session']->get('shout', 'curaccount_code'); return array( 'jump' => array( diff --git a/shout/recordings.php b/shout/recordings.php index a2d67949f..b53874dfc 100644 --- a/shout/recordings.php +++ b/shout/recordings.php @@ -15,13 +15,13 @@ $shout = Horde_Registry::appInit('shout'); require_once SHOUT_BASE . '/lib/Forms/RecordingForm.php'; $action = Horde_Util::getFormData('action'); -$curaccount = $_SESSION['shout']['curaccount']; -$recordings = $shout->storage->getRecordings($curaccount['code']); +$curaccount = $GLOBALS['session']->get('shout', 'curaccount_code'); +$recordings = $shout->storage->getRecordings($curaccount); switch($action) { case 'add': $vars = Horde_Variables::getDefaultVariables(); - $vars->set('account', $curaccount['code']); + $vars->set('account', $curaccount); $Form = new RecordingDetailsForm($vars); if ($Form->isSubmitted() && $Form->validate($vars, true)) { @@ -30,7 +30,7 @@ case 'add': $Form->execute(); $notification->push(_("Recording added."), 'horde.success'); - $recordings = $shout->storage->getRecordings($curaccount['code']); + $recordings = $shout->storage->getRecordings($curaccount); $action = 'list'; } catch (Exception $e) { $notification->push($e); diff --git a/shout/templates/conferences/list.inc b/shout/templates/conferences/list.inc index 82f3ed81b..97cffa43e 100644 --- a/shout/templates/conferences/list.inc +++ b/shout/templates/conferences/list.inc @@ -1,5 +1,5 @@
- Account: + Account: get('shout', 'curaccount_name'); ?>
diff --git a/shout/templates/devices/list.inc b/shout/templates/devices/list.inc index d36bf7aae..376c6de62 100644 --- a/shout/templates/devices/list.inc +++ b/shout/templates/devices/list.inc @@ -1,5 +1,5 @@
- Account: + Account: get('shout', 'curaccount_name'); ?>
diff --git a/shout/templates/extensions.inc.php b/shout/templates/extensions.inc.php index 2fdbf6a6f..4bac6c612 100644 --- a/shout/templates/extensions.inc.php +++ b/shout/templates/extensions.inc.php @@ -1,5 +1,5 @@
- Account: + Account: get('shout', 'curaccount_name'); ?>
diff --git a/shout/templates/menu.inc b/shout/templates/menu.inc index 233a0384c..8d383cb37 100644 --- a/shout/templates/menu.inc +++ b/shout/templates/menu.inc @@ -33,9 +33,11 @@ function accountSubmit(clear)