public function processAction(&$controller, $params) { $this->assignEmptyParams($params, 2); list($uuid, $classType) = $params; $input = Input::instance(); if (is_array($input->post('submit'))) { if ($input->post('uuid') == '' || current($input->post('submit')) == 'cancel') { $controller->exitQtipAjaxForm(); exit; } $controller->template->content = new View('callmanager/commandresponse'); try { $destobj = Doctrine::getTable('Number')->findOneByforeign_idAndclass_type($input->post('destlot'), $classType); $commandresponse = $this->executeAction(array($input->post('uuid'), $destobj->number)); $controller->view->commandresponse = 'Call successfully transfered'; } catch (ESLException $e) { $controller->view->commandresponse = '<div class="error">An error has occured: ' . $e->getMessage() . '</div>'; } catch (callmanagerException $e) { $controller->view->commandresponse = '<div class="error">An error has occured: ' . $e->getMessage() . '</div>'; } } else { $controller->template->content = new View('callmanager/transfer'); $controller->view->classType = $classType; $controller->view->uuid = $uuid; $currentuser = users::getCurrentUser(); $userobj = Doctrine::getTable('user')->find($currentuser['user_id']); if (isset($userobj->Device[0]->Number[0])) { $controller->view->userext = $userobj->Device[0]->Number[0]->number; } else { $controller->view->userext = null; } } }
protected function deleteOnSubmit($base) { $currentuser = users::getCurrentUser(); if ($currentuser['user_type'] < $this->feature['ftr_edit_user_type']) { message::set('You do not have rights to delete this feature', 'alert'); url::redirect(Router_Core::$controller); } parent::deleteOnSubmit($base); }
public static function initializeMasterTenant() { $session = Session::instance(); Doctrine::getTable('Location')->getRecordListener()->get('MultiTenant')->setOption('disabled', true); Doctrine::getTable('User')->getRecordListener()->get('MultiTenant')->setOption('disabled', true); $options = array(); $options['account'] = array('name' => 'Master Account', 'type' => Account::TYPE_NORMAL); $options['location'] = array('name' => 'Main Location'); $options['user'] = array('username' => $session->get('installer.adminEmailAddress'), 'password' => $session->get('installer.adminPassword'), 'user_type' => User::TYPE_SYSTEM_ADMIN); Bluebox_Tenant::initializeTenant($options); Bluebox_Tenant::initializeSite('localhost', 1); // Force a login of the master/admin user for the remainder of the install Auth::instance()->force_login($session->get('installer.adminEmailAddress')); users::isUserAuthentic(); users::getCurrentUser(); }
public function index() { $this->template->content = new View('generic/grid'); // Setup the base grid object $this->grid = jgrid::grid($this->baseModel, array('caption' => 'Agents')); // Add the base model columns to the grid $this->grid->add('cca_id', 'ID', array('hidden' => true, 'key' => true)); $this->grid->add('cca_displayname', 'Display Name'); $this->grid->add('cca_loginid', 'Login ID'); $this->grid->add('agentLocation/name', 'Location', array('width' => '150', 'search' => false)); // Add the actions to the grid $this->grid->addAction('callcenter_agents/edit', 'Edit', array('arguments' => 'cca_id')); $this->grid->addAction('callcenter_agents/delete', 'Delete', array('arguments' => 'cca_id')); plugins::views($this); // Produce a grid in the view $this->view->grid = $this->grid->produce(); $currentuser = users::getCurrentUser(); if ($currentuser['user_type'] == User::TYPE_SYSTEM_ADMIN) { navigation::getNavTree(); $submenu = navigation::getCurrentSubMenu(); navigation::addSubmenuOption('callcenter_agents', 'Re-Install Features', 'callcenter_agents/installFeatures'); } }
/** * This step finalizes the installation (whatever that means) * * @return subview */ private function finalize() { $subview = new View('installer/finalize'); $this->template->title = __('Complete!'); $this->template->allowPrev = FALSE; $this->template->allowNext = FALSE; // Force a login of the master/admin user for the remainder of the install Auth::instance()->force_login($this->session->get('installer.adminEmailAddress')); users::isUserAuthentic(); users::getCurrentUser(); $created = $this->session->get('Bluebox_installer.created'); Bluebox_Tenant::createUserExtension($created['userId']); if (Session::instance()->get('installer.samples', FALSE)) { $sampleUsers = array(array('first' => 'Peter', 'last' => 'Gibbons', 'username' => '*****@*****.**', 'password' => inflector::generatePassword(), 'user_type' => User::TYPE_NORMAL_USER), array('first' => 'Michael', 'last' => 'Bolton', 'username' => '*****@*****.**', 'password' => inflector::generatePassword(), 'user_type' => User::TYPE_NORMAL_USER), array('first' => 'Samir', 'last' => 'Nagheenanajar', 'username' => '*****@*****.**', 'password' => inflector::generatePassword(), 'user_type' => User::TYPE_NORMAL_USER), array('first' => 'Bill', 'last' => 'Lumbergh', 'username' => '*****@*****.**', 'password' => inflector::generatePassword(), 'user_type' => User::TYPE_NORMAL_USER), array('first' => 'Milton', 'last' => 'Waddams', 'username' => '*****@*****.**', 'password' => inflector::generatePassword(), 'user_type' => User::TYPE_NORMAL_USER)); foreach ($sampleUsers as $sampleUser) { $userId = Bluebox_Tenant::initializeUser($created['accountId'], $created['locationId'], $sampleUser); Bluebox_Tenant::createUserExtension($userId); } } if ($this->session->get('installer.tel_driver') == 'freeswitch') { Event::run('freeswitch.reload.xml'); Event::run('freeswitch.reload.acl'); Event::run('freeswitch.reload.sofia'); } self::_resetWizard(); $this->session->delete('Bluebox_message'); // Disable the installer after a successful installtion self::updateConfig(array('installer_enabled' => 'FALSE'), 'config'); Kohana::log('info', 'Installer wizard terminated'); return $subview; }