Example #1
0
 function __construct()
 {
     if (!WYSIJA::current_user_can('wysija_config')) {
         die("Action is forbidden.");
     }
     parent::__construct();
 }
Example #2
0
 function __construct()
 {
     if (!WYSIJA::current_user_can('wysija_newsletters')) {
         die('Action is forbidden.');
     }
     parent::__construct();
 }
Example #3
0
 function __construct($extension = "wysija-newsletters")
 {
     $this->extension = $extension;
     parent::__construct();
     $_REQUEST = stripslashes_deep($_REQUEST);
     $_POST = stripslashes_deep($_POST);
     if (isset($_REQUEST['action'])) {
         $this->action = preg_replace('|[^a-z0-9_\\-]|i', '', $_REQUEST['action']);
     } else {
         $this->action = 'index';
     }
 }
Example #4
0
 function __construct($extension = "wysija-newsletters")
 {
     $this->extension = $extension;
     parent::__construct();
     global $wysija_msg, $wysija_queries, $wysija_queries_errors;
     $wysija_msgTemp = get_option('wysija_msg');
     if (is_array($wysija_msgTemp) && count($wysija_msgTemp) > 0) {
         $wysija_msg = $wysija_msgTemp;
     }
     $wysija_qryTemp = get_option('wysija_queries');
     $wysija_qryErrors = get_option('wysija_queries_errors');
     if (is_array($wysija_qryTemp) && count($wysija_qryTemp) > 0) {
         $wysija_queries = $wysija_qryTemp;
     }
     if (is_array($wysija_qryErrors) && count($wysija_qryErrors) > 0) {
         $wysija_queries_errors = $wysija_qryErrors;
     }
     WYSIJA::update_option('wysija_queries', '');
     WYSIJA::update_option('wysija_queries_errors', '');
     WYSIJA::update_option('wysija_msg', '');
     global $wysija_installing;
     if ($wysija_installing === true) {
         return;
     }
     $this->pref = get_user_meta(WYSIJA::wp_get_userdata('ID'), 'wysija_pref', true);
     $prefupdate = false;
     if ($this->pref) {
         $prefupdate = true;
         $this->pref = unserialize(base64_decode($this->pref));
     } else {
         $this->pref = array();
     }
     if (!isset($_GET['action'])) {
         $action = 'default';
     } else {
         $action = $_GET['action'];
     }
     if (isset($_REQUEST['limit_pp'])) {
         $this->pref[$_REQUEST['page']][$action]['limit_pp'] = $_REQUEST['limit_pp'];
     }
     if (!empty($_REQUEST['orderby'])) {
         $_REQUEST['orderby'] = preg_replace('|[^a-z0-9#_.-]|i', '', $_REQUEST['orderby']);
     }
     if (!empty($_REQUEST['ordert']) && !in_array(strtoupper($_REQUEST['ordert']), array('DESC', 'ASC'))) {
         $_REQUEST['ordert'] = 'DESC';
     }
     if (!empty($_REQUEST['id'])) {
         $_REQUEST['id'] = (int) $_REQUEST['id'];
     }
     if (!empty($_REQUEST['search'])) {
         $_REQUEST['search'] = esc_attr($_REQUEST['search']);
     }
     if ($this->pref && isset($_REQUEST['page']) && $_REQUEST['page'] && isset($this->pref[$_REQUEST['page']][$action]['limit_pp'])) {
         $this->viewObj->limit_pp = $this->pref[$_REQUEST['page']][$action]['limit_pp'];
         $this->modelObj->limit_pp = $this->pref[$_REQUEST['page']][$action]['limit_pp'];
     }
     if ($prefupdate) {
         update_user_meta(WYSIJA::wp_get_userdata('ID'), 'wysija_pref', base64_encode(serialize($this->pref)));
     } else {
         add_user_meta(WYSIJA::wp_get_userdata('ID'), 'wysija_pref', base64_encode(serialize($this->pref)));
     }
     add_action('wysija_various_check', array($this, 'variousCheck'));
     do_action('wysija_various_check');
 }
 function main()
 {
     $this->messages['insert'][true] = __('Subscriber has been saved.', WYSIJA);
     $this->messages['insert'][false] = __('Subscriber has not been saved.', WYSIJA);
     $this->messages['update'][true] = __('Subscriber has been modified. [link]Edit again[/link].', WYSIJA);
     $this->messages['update'][false] = __('Subscriber has not been modified.', WYSIJA);
     $this->_cleanup_form();
     parent::__construct();
     //we change the default model of the controller based on the action
     if (isset($_REQUEST['action'])) {
         switch ($_REQUEST['action']) {
             case 'listsedit':
             case 'savelist':
             case 'lists':
                 $this->model = 'list';
                 break;
             default:
                 $this->model = 'user';
         }
     }
     WYSIJA_control::__construct();
     if (!isset($_REQUEST['action']) || !$_REQUEST['action']) {
         $this->defaultDisplay();
         $this->checkTotalSubscribers();
     } else {
         $this->_tryAction($_REQUEST['action']);
     }
 }
Example #6
0
 function __construct()
 {
     parent::__construct();
     $this->viewObj = WYSIJA::get('tmce', 'view');
 }