function __construct($params) { parent::__construct($params); $this->type = 'options'; $this->setRequiredCapability('edit_settings'); return; }
function __construct($params) { parent::__construct($params); $this->type = 'options'; $this->setRequiredCapability('edit_settings'); $this->setNonceRequired(); $goal = $this->getParam('goal'); // check that goal number is present $v1 = owa_coreAPI::validationFactory('required'); $v1->setValues($goal['goal_number']); $this->setValidation('goal_number', $v1); // check that goal status is present $v1 = owa_coreAPI::validationFactory('required'); $v1->setValues($goal['goal_status']); $this->setValidation('goal_status', $v1); // check that goal status is present $v1 = owa_coreAPI::validationFactory('required'); $v1->setValues($goal['goal_group']); $this->setValidation('goal_group', $v1); // check that goal type is present $v1 = owa_coreAPI::validationFactory('required'); $v1->setValues($goal['goal_type']); $this->setValidation('goal_type', $v1); if ($goal['goal_type'] === 'url_destination') { // check that match_type is present $v1 = owa_coreAPI::validationFactory('required'); $v1->setValues($goal['details']['match_type']); $this->setValidation('match_type', $v1); // check that goal_url is present $v1 = owa_coreAPI::validationFactory('required'); $v1->setValues($goal['details']['goal_url']); $this->setValidation('goal_url', $v1); } $steps = $goal['details']['funnel_steps']; if (isset($goal['details']['funnel_steps'])) { foreach ($goal['details']['funnel_steps'] as $num => $step) { if (!empty($step['name']) || !empty($step['url'])) { // check that step name is present $v1 = owa_coreAPI::validationFactory('required'); $v1->setValues($step['name']); $this->setValidation('step_name_' . $num, $v1); // check that step url is present $v1 = owa_coreAPI::validationFactory('required'); $v1->setValues($step['url']); $this->setValidation('step_url_' . $num, $v1); } $check = owa_lib::array_values_assoc($step); if (!empty($check)) { $step['step_number'] = $num; $this->params['goal']['details']['funnel_steps'][$num] = $step; } else { // remove the array as it only contains empty values. // this can happen when the use adds a step but does not fill in any // values. unset($this->params['goal']['details']['funnel_steps'][$num]); } } } }
/** * Constructor * * @param array $params * @return owa_controller */ function __construct($params) { if (owa_coreAPI::getSetting('base', 'cli_mode')) { return parent::__construct($params); } else { owa_coreAPI::notice("Controller not called from CLI"); exit; } }
/** * Constructor * * @param array $params * @return */ function __construct($params) { $this->setControllerType('report'); $this->setRequiredCapability('view_reports'); parent::__construct($params); // set a siteId is none is set on the request params $siteId = $this->getCurrentSiteId(); if (!$siteId) { //$siteId = $this->getDefaultSiteId(); } $this->setParam('siteId', $siteId); }
function __construct($params) { parent::__construct($params); $this->setRequiredCapability('edit_users'); $this->setNonceRequired(); // check that user_id is present $v1 = owa_coreAPI::validationFactory('required'); $v1->setValues($this->getParam('user_id')); $this->setValidation('user_id', $v1); // Check user name exists $v2 = owa_coreAPI::validationFactory('entityExists'); $v2->setConfig('entity', 'base.user'); $v2->setConfig('column', 'user_id'); $v2->setValues($this->getParam('user_id')); $v2->setErrorMessage($this->getMsg(3001)); $this->setValidation('user_id', $v2); }
function __construct($params) { parent::__construct($params); $this->setRequiredCapability('edit_sites'); $this->setNonceRequired(); // validations // check that siteId is present $v1 = owa_coreAPI::validationFactory('required'); $v1->setValues($this->getParam('siteId')); $this->setValidation('siteId', $v1); // Check site exists $v2 = owa_coreAPI::validationFactory('entityExists'); $v2->setConfig('entity', 'base.site'); $v2->setConfig('column', 'site_id'); $v2->setValues($this->getParam('siteId')); $v2->setErrorMessage($this->getMsg(3208)); $this->setValidation('siteId', $v2); }
function __construct($params) { parent::__construct($params); $this->setRequiredCapability('edit_sites'); // Config for the domain validation $domain_conf = array('substring' => 'http', 'position' => 0, 'operator' => '!=', 'errorMsgTemplate' => 'Please remove the "http://" from your beginning of your domain.'); // Add validations to the run $this->addValidation('domain', $this->params['domain'], 'subStringPosition', $domain_conf); $this->addValidation('domain', $this->params['domain'], 'required'); // Check user name exists $v2 = owa_coreAPI::validationFactory('entityDoesNotExist'); $v2->setConfig('entity', 'base.site'); $v2->setConfig('column', 'domain'); $v2->setValues($this->getParam('protocol') . $this->getParam('domain')); $v2->setErrorMessage($this->getMsg(3206)); $this->setValidation('domain', $v2); // require nonce for this action $this->setNonceRequired(); }
function __construct($params) { parent::__construct($params); $this->setRequiredCapability('edit_users'); $this->setNonceRequired(); // Check for user with the same email address // this is needed or else the change password feature will not know which account // to chane the password for. $v1 = owa_coreAPI::validationFactory('entityDoesNotExist'); $v1->setConfig('entity', 'base.user'); $v1->setConfig('column', 'email_address'); $v1->setValues(trim($this->getParam('email_address'))); $v1->setErrorMessage($this->getMsg(3009)); $this->setValidation('email_address', $v1); // Check user name. $v2 = owa_coreAPI::validationFactory('entityDoesNotExist'); $v2->setConfig('entity', 'base.user'); $v2->setConfig('column', 'user_id'); $v2->setValues(trim($this->getParam('user_id'))); $v2->setErrorMessage($this->getMsg(3001)); $this->setValidation('user_id', $v2); }
function __construct($params) { $this->setRequiredCapability('edit_sites'); return parent::__construct($params); }
/** * Constructor * * @param array $params * @return */ function __construct($params) { $this->setControllerType('report'); $this->_setCapability('view_reports'); return parent::__construct($params); }
function __construct($params) { $this->setRequiredCapability('edit_settings'); $this->setNonceRequired(); return parent::__construct($params); }
function __construct($params) { parent::__construct($params); $this->setRequiredCapability('edit_sites'); $this->setNonceRequired(); }