本文整理汇总了PHP中Permissions::getTests方法的典型用法代码示例。如果您正苦于以下问题:PHP Permissions::getTests方法的具体用法?PHP Permissions::getTests怎么用?PHP Permissions::getTests使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Permissions
的用法示例。
在下文中一共展示了Permissions::getTests方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: indexAction
public function indexAction()
{
$this->view->breadcrumb = Snep_Breadcrumb::renderPath(array($this->view->translate("Status"), $this->view->translate("System Logs")));
$config = Zend_Registry::get('config');
include $config->system->path->base . "/inspectors/Permissions.php";
$test = new Permissions();
$response = $test->getTests();
$form = new Snep_Form(new Zend_Config_Xml('./modules/default/forms/logs.xml', 'general', true));
$form->setAction($this->getFrontController()->getBaseUrl() . '/logs/view');
$locale = Snep_Locale::getInstance()->getLocale();
$now = Zend_Date::now();
if ($locale == 'en_US') {
$now = $now->toString('YYYY-MM-dd HH:mm');
} else {
$now = $now->toString('dd/MM/YYYY HH:mm');
}
$initDay = $form->getElement('init_day');
$initDay->setValue($now);
$endDay = $form->getElement('end_day');
$endDay->setValue($now);
$status = $form->getElement('status');
$status->setValue('ALL');
$realtime = $form->getElement('real_time');
$realtime->setValue('no');
$submit = $form->getElement("submit");
$submit->setLabel("Log Search");
$this->initLogFile();
$this->view->form = $form;
}
示例2: indexAction
public function indexAction()
{
// Title
$this->view->breadcrumb = Snep_Breadcrumb::renderPath(array($this->view->translate("Reports"), $this->view->translate("Services Use")));
$config = Zend_Registry::get('config');
// Include Inpector class, for permission test
include_once $config->system->path->base . "/inspectors/Permissions.php";
$test = new Permissions();
$response = $test->getTests();
$form = $this->getForm();
if ($this->_request->getPost()) {
$formIsValid = $form->isValid($_POST);
$formData = $this->_request->getParams();
$locale = Snep_Locale::getInstance()->getLocale();
if ($locale == 'en_US') {
$format = 'yyyy-MM-dd';
} else {
$format = Zend_Locale_Format::getDateFormat($locale);
}
$ini_date = explode(" ", $formData['period']['init_day']);
$final_date = explode(" ", $formData['period']['till_day']);
$ini_date_valid = Zend_Date::isDate($ini_date[0], $format);
$final_date_valid = Zend_Date::isDate($final_date[0], $format);
if (!$ini_date_valid) {
$iniDateElem = $form->getSubForm('period')->getElement('init_day');
$iniDateElem->addError($this->view->translate('Invalid Date'));
$formIsValid = false;
}
if (!$final_date_valid) {
$finalDateElem = $form->getSubForm('period')->getElement('till_day');
$finalDateElem->addError($this->view->translate('Invalid Date'));
$formIsValid = false;
}
if ($formIsValid) {
$reportType = $formData['service']['out_type'];
if ($reportType == 'csv') {
$this->csvAction();
} else {
$this->viewAction();
}
}
}
$this->view->form = $form;
}
示例3: indexAction
public function indexAction()
{
$this->view->breadcrumb = Snep_Breadcrumb::renderPath(array($this->view->translate("Reports"), $this->view->translate("Calls")));
$config = Zend_Registry::get('config');
include $config->system->path->base . "/inspectors/Permissions.php";
$test = new Permissions();
$response = $test->getTests();
$form = $this->getForm();
if ($this->_request->getPost()) {
$formIsValid = $form->isValid($_POST);
$locale = Snep_Locale::getInstance()->getLocale();
if ($locale == 'en_US') {
$format = 'yyyy-MM-dd';
} else {
$format = Zend_Locale_Format::getDateFormat($locale);
}
$ini_date = explode(" ", $_POST['period']['initDay']);
$final_date = explode(" ", $_POST['period']['finalDay']);
$ini_date_valid = Zend_Date::isDate($ini_date[0], $format);
$final_date_valid = Zend_Date::isDate($final_date[0], $format);
if (!$ini_date_valid) {
$iniDateElem = $form->getSubForm('period')->getElement('initDay');
$iniDateElem->addError($this->view->translate('Invalid Date'));
$formIsValid = false;
}
if (!$final_date_valid) {
$finalDateElem = $form->getSubForm('period')->getElement('finalDay');
$finalDateElem->addError($this->view->translate('Invalid Date'));
$formIsValid = false;
}
if ($formIsValid) {
$this->createAction();
}
}
$this->view->form = $form;
}
示例4: indexAction
public function indexAction()
{
// Title
$this->view->breadcrumb = Snep_Breadcrumb::renderPath(array($this->view->translate("Configure"), $this->view->translate("Parameters")));
// Get configuration properties from Zend_Registry
$config = Zend_Registry::get('config');
// Include Inpector class, for permission test
include_once $config->system->path->base . "/inspectors/Permissions.php";
$test = new Permissions();
$response = $test->getTests();
// Verify if there's any error, and if it's related to the setup.conf file
if ($response['error'] && strpos($response['message'], "setup.conf") > 0) {
// seta variavel verificada no template
$this->view->error = $this->view->translate("The File includes/setup.conf does not have permission to be modified.");
}
// Create object Snep_Form
$form = new Snep_Form();
// Set form action
$form->setAction($this->getFrontController()->getBaseUrl() . '/parameters/index');
$form_xml = new Zend_Config_Xml('./modules/default/forms/setup.conf.xml');
// Section General
$general = new Snep_Form_SubForm($this->view->translate("General Configuration"), $form_xml->general);
// Setting propoertie values
$empName = $general->getElement('emp_nome');
$empName->setValue($config->ambiente->emp_nome);
$debug = $general->getElement('debug');
$debug->setValue($config->system->debug);
$ipSock = $general->getElement('ip_sock');
$ipSock->setValue($config->ambiente->ip_sock);
$userSock = $general->getElement('user_sock');
$userSock->setValue($config->ambiente->user_sock);
$passSock = $general->getElement('pass_sock');
$passSock->setValue($config->ambiente->pass_sock);
$email = $general->getElement('mail');
$email->setValue($config->system->mail);
$lineLimit = $general->getElement('linelimit');
$lineLimit->setValue($config->ambiente->linelimit);
$dstExceptions = $general->getElement('dst_exceptions');
$dstExceptions->setValue($config->ambiente->dst_exceptions);
$conferenceApp = $general->getElement('conference_app');
$conferenceApp->setValue($config->ambiente->conference_app);
$form->addSubForm($general, "general");
$locale_form = new Snep_Form_SubForm($this->view->translate("Locale Configuration"), $form_xml->locale);
$locale = Snep_Locale::getInstance()->getZendLocale();
$locales = array();
foreach ($locale->getTranslationList("territory", Snep_Locale::getInstance()->getLanguage(), 2) as $ccode => $country) {
$locales[$country] = $locale->getLocaleToTerritory($ccode);
}
ksort($locales, SORT_LOCALE_STRING);
foreach ($locales as $country => $ccode) {
$locale_form->getElement("locale")->addMultiOption($ccode, $country);
}
$locale_form->getElement("locale")->setValue(Snep_Locale::getInstance()->getLocale());
foreach ($locale->getTranslationList("territorytotimezone", Snep_Locale::getInstance()->getLanguage()) as $timezone => $territory) {
$locale_form->getElement("timezone")->addMultiOption($timezone, $timezone);
}
$locale_form->getElement("timezone")->setValue(Snep_Locale::getInstance()->getTimezone());
$languages = array();
$languageElement = $locale_form->getElement("language");
$available_languages = Snep_Locale::getInstance()->getAvailableLanguages();
foreach ($locale->getTranslationList("language", Snep_Locale::getInstance()->getLanguage()) as $lcode => $language) {
if (in_array($lcode, $available_languages)) {
$languageElement->addMultiOption($lcode, ucfirst($language));
}
}
$languageElement->setValue(Snep_Locale::getInstance()->getLanguage());
$form->addSubForm($locale_form, "locale");
// Section Recording
$recording = new Snep_Form_SubForm($this->view->translate("Call Recording Configuration"), $form_xml->recording);
// Setting propoertie values
$application = $recording->getElement('application');
$application->setValue($config->general->record->application);
$flag = $recording->getElement('flag');
$flag->setValue($config->general->record->flag);
$recordMp3 = $recording->getElement('record_mp3');
$recordMp3->setValue($config->general->record_mp3);
$pathVoice = $recording->getElement('path_voz');
$pathVoice->setValue($config->ambiente->path_voz);
$pathVoiceBkp = $recording->getElement('path_voz_bkp');
$pathVoiceBkp->setValue($config->ambiente->path_voz_bkp);
$form->addSubForm($recording, "gravacao");
// Section Trunks
$trunks = new Snep_Form_SubForm($this->view->translate("Trunks Configuration"), $form_xml->trunks);
// Setting propoertie values
$qualControlValue = $trunks->getElement('valor_controle_qualidade');
$qualControlValue->setValue($config->ambiente->valor_controle_qualidade);
$form->addSubForm($trunks, "troncos");
// Verify if the request is a post
if ($this->_request->getPost()) {
$formIsValid = $form->isValid($_POST);
$formData = $this->getRequest()->getParams();
// Specific verification for propertie path_voice
if (!file_exists($formData['gravacao']['path_voz'])) {
$recording->getElement('path_voz')->addError($this->view->translate("Invalid path"));
$formIsValid = false;
}
//Validates form, then sets propertie values and records it on the configuration file
if ($formIsValid) {
$configFile = APPLICATION_PATH . "/includes/setup.conf";
$config = new Zend_Config_Ini($configFile, null, true);
//.........这里部分代码省略.........