require_once SHOUT_BASE . '/lib/Forms/AccountForm.php';
$action = Horde_Util::getFormData('action');
-$curaccount = $_SESSION['shout']['curaccount'];
+$curaccount = $_SESSION['shout']['curaccount']['code'];
$RENDERER = new Horde_Form_Renderer();
require_once SHOUT_BASE . '/lib/Forms/ConferenceForm.php';
-$curaccount = $_SESSION['shout']['curaccount'];
+$curaccount = $_SESSION['shout']['curaccount']['code'];
$action = Horde_Util::getFormData('action');
$vars = Horde_Variables::getDefaultVariables();
require_once SHOUT_BASE . '/lib/Forms/DeviceForm.php';
-$curaccount = $_SESSION['shout']['curaccount'];
+$curaccount = $_SESSION['shout']['curaccount']['code'];
$action = Horde_Util::getFormData('action');
$vars = Horde_Variables::getDefaultVariables();
$action = Horde_Util::getFormData('action');
$menu = Horde_Util::getFormData('menu');
-$curaccount = $_SESSION['shout']['curaccount'];
+$curaccount = $_SESSION['shout']['curaccount']['code'];
$menus = $shout->storage->getMenus($curaccount);
require_once SHOUT_BASE . '/lib/Forms/ExtensionForm.php';
$action = Horde_Util::getFormData('action');
-$curaccount = $_SESSION['shout']['curaccount'];
+$curaccount = $_SESSION['shout']['curaccount']['code'];
$RENDERER = new Horde_Form_Renderer();
*
* @author Ben Klang <ben@alkaloid.net>
*/
+require_once dirname(__FILE__) . '/lib/Application.php';
+$shout = Horde_Registry::appInit('shout');
+$curaccount = $_SESSION['shout']['curaccount'];
+if (empty($curaccount)) {
+ die("Permission denied.");
+}
+$menus = $shout->storage->getMenus($curaccount);
-require dirname(__FILE__) . '/dialplan.php';
+if (empty($menus)) {
+ print_r($curaccount);
+} else {
+ header('Location: ' . Horde::applicationUrl('dialplan.php', true));
+ exit;
+}
\ No newline at end of file
{
$vars = $this->_vars;
$shout = $GLOBALS['registry']->getApiInstance('shout', 'application');
- $account = $_SESSION['shout']['curaccount'];
+ $account = $_SESSION['shout']['curaccount']['code'];
try {
$shout = $GLOBALS['registry']->getApiInstance('shout', 'application');
$shout->extensions->addDestination($account, $vars->extension, $vars->type, $vars->destination);
{
$vars = $this->_vars;
$shout = $GLOBALS['registry']->getApiInstance('shout', 'application');
- $account = $_SESSION['shout']['curaccount'];
+ $account = $_SESSION['shout']['curaccount']['code'];
try {
// FIXME: Use Form?
$shout = $GLOBALS['registry']->getApiInstance('shout', 'application');
try {
$vars = $this->_vars;
$shout = $GLOBALS['registry']->getApiInstance('shout', 'application');
- $account = $_SESSION['shout']['curaccount'];
+ $account = $_SESSION['shout']['curaccount']['code'];
return $shout->extensions->getExtensions($account);
} catch (Exception $e) {
//FIXME: Create a way to notify the user of the failure.
try {
$vars = $this->_vars;
$shout = $GLOBALS['registry']->getApiInstance('shout', 'application');
- $account = $_SESSION['shout']['curaccount'];
+ $account = $_SESSION['shout']['curaccount']['code'];
return $shout->devices->getDevices($account);
} catch (Exception $e) {
//FIXME: Create a way to notify the user of the failure.
{
try {
$shout = $GLOBALS['registry']->getApiInstance('shout', 'application');
- $account = $_SESSION['shout']['curaccount'];
+ $account = $_SESSION['shout']['curaccount']['code'];
$menus = $shout->storage->getMenus($account);
if (empty($menus)) {
return false;
{
try {
$shout = $GLOBALS['registry']->getApiInstance('shout', 'application');
- $account = $_SESSION['shout']['curaccount'];
+ $account = $_SESSION['shout']['curaccount']['code'];
$menu = $this->_vars->get('menu');
if (empty($menu)) {
throw new Shout_Exception('Must specify a menu to delete.');
{
try {
$shout = $GLOBALS['registry']->getApiInstance('shout', 'application');
- $account = $_SESSION['shout']['curaccount'];
+ $account = $_SESSION['shout']['curaccount']['code'];
return $shout->storage->getConferences($account);
} catch (Exception $e) {
//FIXME: Create a way to notify the user of the failure.
{
try {
$shout = $GLOBALS['registry']->getApiInstance('shout', 'application');
- $account = $_SESSION['shout']['curaccount'];
+ $account = $_SESSION['shout']['curaccount']['code'];
$vars = &$this->_vars;
$info = array(
'name' => $vars->get('name'),
if (!($action = $vars->get('action'))) {
throw new Shout_Exception("Invalid action requested.");
}
- $account = $_SESSION['shout']['curaccount'];
+ $account = $_SESSION['shout']['curaccount']['code'];
$digit = $vars->get('digit');
$menu = $vars->get('menu');
$action = $vars->get('action');
$account = Horde_Util::getFormData('account');
if (empty($account) && !empty($_SESSION['shout']['curaccount'])) {
- $account = $_SESSION['shout']['curaccount'];
+ $account = $_SESSION['shout']['curaccount']['code'];
}
if (!empty($account) && !in_array($account, array_keys($accounts))) {
}
}
- $_SESSION['shout']['accounts'] = $accounts;
- $_SESSION['shout']['curaccount'] = $account;
+ $_SESSION['shout']['curaccount'] = $accounts[$account];
}
/**
public function getRecordings()
{
- $account = $_SESSION['shout']['curaccount'];
+ $account = $_SESSION['shout']['curaccount']['code'];
$rlist = $this->vfs->listFolder($account);
// In Asterisk, filenames the same basename and different extension are
*/
function __construct(&$vars)
{
- $account = $_SESSION['shout']['curaccount'];
+ $account = $_SESSION['shout']['curaccount']['code'];
$action = $vars->get('action');
if ($action == 'edit') {
$formtitle = "Edit Account";
$formtitle = "Add Account";
}
- $accountname = $_SESSION['shout']['accounts'][$curaccount]['name'];
+ $accountname = $_SESSION['shout']['curaccount']['name'];
$title = sprintf(_("$formtitle %s"), $accountname);
parent::__construct($vars, $title);
$edit = false;
}
- $curaccount = $_SESSION['shout']['curaccount'];
+ $curaccount = $_SESSION['shout']['curaccount']['code'];
$accountname = $vars->account;
$title = sprintf(_("$formtitle"));
parent::__construct($vars, $title);
$edit = false;
}
- $curaccount = $_SESSION['shout']['curaccount'];
- $accountname = $_SESSION['shout']['accounts'][$curaccount]['name'];
+ $curaccount = $_SESSION['shout']['curaccount']['code'];
+ $accountname = $_SESSION['shout']['curaccount']['name'];
$title = sprintf(_("$formtitle - Account: %s"), $accountname);
parent::__construct($vars, $title);
*/
function __construct(&$vars)
{
- $curaccount = $_SESSION['shout']['curaccount'];
+ $curaccount = $_SESSION['shout']['curaccount']['code'];
$action = $vars->get('action');
if ($action == 'edit') {
$formtitle = "Edit User";
$formtitle = "Add User";
}
- $accountname = $_SESSION['shout']['accounts'][$curaccount]['name'];
+ $accountname = $_SESSION['shout']['curaccount']['name'];
$title = sprintf(_("$formtitle - Account: %s"), $accountname);
parent::__construct($vars, $title);
$account = $vars->get('account');
$title = _("Delete Extension %s - Account: %s");
- $title = sprintf($title, $extension, $_SESSION['shout']['accounts'][$account]['name']);
+ $title = sprintf($title, $extension, $_SESSION['shout']['curaccount']['name']);
parent::__construct($vars, $title);
$this->addHidden('', 'account', 'text', true);
$edit = false;
}
- $curaccount = $_SESSION['shout']['curaccount'];
- $accountname = $_SESSION['shout']['accounts'][$curaccount]['name'];
+ $curaccount = $_SESSION['shout']['curaccount']['code'];
+ $accountname = $_SESSION['shout']['curaccount']['name'];
$title = sprintf(_("%s - Account: %s"), $formtitle, $accountname);
parent::__construct($vars, $title);
{
$shout = $GLOBALS['registry']->getApiInstance('shout', 'application');
- $account = $_SESSION['shout']['curaccount'];
+ $account = $_SESSION['shout']['curaccount']['code'];
$details = array(
'name' => $this->_vars->get('name'),
$account = $vars->get('account');
$title = _("Delete Menu %s - Account: %s");
- $title = sprintf($title, $menu, $_SESSION['shout']['accounts'][$account]['name']);
+ $title = sprintf($title, $menu, $_SESSION['shout']['curaccount']['name']);
parent::__construct($vars, $title);
$this->setButtons(array(_("Delete"), _("Cancel")));
$formtitle = "Create Recording";
- $curaccount = $_SESSION['shout']['curaccount'];
+ $curaccount = $_SESSION['shout']['curaccount']['code'];
$accountname = $vars->account;
$title = sprintf(_("$formtitle"));
parent::__construct($vars, $title);
$account = $vars->get('account');
$title = _("FIXME Delete Recording %s - Account: %s");
- $title = sprintf($title, $devid, $_SESSION['shout']['accounts'][$account]['name']);
+ $title = sprintf($title, $devid, $_SESSION['shout']['curaccount']['name']);
parent::__construct($vars, $title);
$this->addHidden('', 'account', 'text', true);
static public function getMenuActions()
{
$shout = $GLOBALS['registry']->getApiInstance('shout', 'application');
- $account = $_SESSION['shout']['curaccount'];
+ $account = $_SESSION['shout']['curaccount']['code'];
return array(
'jump' => array(
require_once SHOUT_BASE . '/lib/Forms/RecordingForm.php';
$action = Horde_Util::getFormData('action');
-$curaccount = $_SESSION['shout']['curaccount'];
+$curaccount = $_SESSION['shout']['curaccount']['code'];
$recordings = $shout->storage->getRecordings($curaccount);
switch($action) {
<div class="header">
- Account: <?php echo $_SESSION['shout']['accounts'][$curaccount]['name']; ?>
+ Account: <?php echo $_SESSION['shout']['curaccount']['name']; ?>
</div>
<div id="extensionList">
<div class="header">
- Account: <?php echo $_SESSION['shout']['accounts'][$curaccount]['name']; ?>
+ Account: <?php echo $_SESSION['shout']['curaccount']['name']; ?>
</div>
<div id="conferenceList">
<div class="header">
- Account: <?php echo $_SESSION['shout']['accounts'][$curaccount]['name']; ?>
+ Account: <?php echo $_SESSION['shout']['curaccount']['name']; ?>
</div>
<div id="extensionList">
<div class="header">
- Account: <?php echo $_SESSION['shout']['accounts'][$curaccount]['name']; ?>
+ Account: <?php echo $_SESSION['shout']['curaccount']['name']; ?>
</div>
<div id="extensionList">
<div class="header">
- Account: <?php echo $_SESSION['shout']['accounts'][$curaccount]['name']; ?>
+ Account: <?php echo $_SESSION['shout']['curaccount']['name']; ?>
</div>
<div id="extensionList">