Esempio n. 1
0
 function __construct()
 {
     if (!WYSIJA::current_user_can('wysija_config')) {
         die("Action is forbidden.");
     }
     parent::__construct();
 }
Esempio n. 2
0
 function WYSIJA_control_back_campaigns()
 {
     if (!WYSIJA::current_user_can('wysija_newsletters')) {
         die("Action is forbidden.");
     }
     parent::WYSIJA_control();
 }
Esempio n. 3
0
 function WYSIJA_control_back_config()
 {
     if (!WYSIJA::current_user_can('wysija_config')) {
         die("Action is forbidden.");
     }
     parent::WYSIJA_control();
 }
Esempio n. 4
0
 function WYSIJA_control_front($extension="wysija-newsletters"){
     $this->extension=$extension;
     parent::WYSIJA_control();
     $_REQUEST   = stripslashes_deep($_REQUEST);
     $_POST   = stripslashes_deep($_POST);
     $this->action = (isset($_REQUEST['action'])) ? $_REQUEST['action'] : 'index';
 }
Esempio n. 5
0
 function __construct()
 {
     if (!WYSIJA::current_user_can('wysija_newsletters')) {
         die('Action is forbidden.');
     }
     parent::__construct();
 }
Esempio n. 6
0
 function WYSIJA_control_front($extension = "wysija-newsletters")
 {
     $this->extension = $extension;
     parent::WYSIJA_control();
     $_REQUEST = stripslashes_deep($_REQUEST);
     $_POST = stripslashes_deep($_POST);
 }
Esempio n. 7
0
 function WYSIJA_control_back_tmce()
 {
     if (!WYSIJA::current_user_can('wysija_subscriwidget')) {
         die("Action is forbidden.");
     }
     parent::WYSIJA_control();
     $this->viewObj =& WYSIJA::get('tmce', 'view');
 }
Esempio n. 8
0
 function WYSIJA_control_back_campaigns()
 {
     $modelC =& WYSIJA::get("config", "model");
     if (!WYSIJA::current_user_can('wysija_newsletters')) {
         die("Action is forbidden.");
     }
     parent::WYSIJA_control();
 }
Esempio n. 9
0
    function WYSIJA_control_back(){
        parent::WYSIJA_control();
        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($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');

        // check if the plugin has an update available
        $updateH=WYSIJA::get('update','helper');
        $updateH->checkForNewVersion();
        $this->target_action_form = $this->data['target_action_form'] = $this->_getTargetActionForm(); // set default value of any form action
    }
Esempio n. 10
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';
     }
 }
Esempio n. 11
0
 function WYSIJA_control_back()
 {
     parent::WYSIJA_control();
     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;
     }
     $modelEmail =& WYSIJA::get('email', 'model');
     $campaign = $modelEmail->getOne('params', array('email_id' => 12));
     $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", "");
     $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 ($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');
     /*check if the plugin has an update available */
     $updateH =& WYSIJA::get('update', 'helper');
     $updateH->checkForNewVersion();
 }
Esempio n. 12
0
 function WYSIJA_control_back()
 {
     parent::WYSIJA_control();
     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');
 }
Esempio n. 13
0
 function WYSIJA_control_back_tmce()
 {
     parent::WYSIJA_control();
     $this->viewObj = WYSIJA::get('tmce', 'view');
 }
Esempio n. 14
0
 function WYSIJA_control_back()
 {
     parent::WYSIJA_control();
     global $wysija_msg, $wysija_queries;
     $wysija_msgTemp = get_option("wysija_msg");
     if (is_array($wysija_msgTemp) && count($wysija_msgTemp) > 0) {
         $wysija_msg = $wysija_msgTemp;
     }
     $modelEmail =& WYSIJA::get('email', 'model');
     $campaign = $modelEmail->getOne('params', array('email_id' => 12));
     $wysija_qryTemp = get_option("wysija_queries");
     if (is_array($wysija_qryTemp) && count($wysija_qryTemp) > 0) {
         $wysija_queries = $wysija_qryTemp;
     }
     WYSIJA::update_option("wysija_queries", "");
     WYSIJA::update_option("wysija_msg", "");
     $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 ($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)));
     }
     /* check the licence if we have a premium user once in a while like every 24hrs*/
     $modelC =& WYSIJA::get('config', 'model');
     if (get_option('wysicheck') || isset($_REQUEST['action']) && $_REQUEST['action'] != 'licok' && $modelC->getValue('premium_key')) {
         //$this->notice('licence check');
         $onedaysec = 7 * 24 * 3600;
         if (get_option('wysicheck') || (!$modelC->getValue('premium_val') || time() > (int) $modelC->getValue('premium_val') + $onedaysec)) {
             $helpLic =& WYSIJA::get('licence', 'helper');
             $res = $helpLic->check(true);
             if ($res['nocontact']) {
                 /* redirect instantly to a page with a javascript file  where we check the domain is ok */
                 $data = get_option('wysijey');
                 /* remotely connect to host */
                 wp_enqueue_script('wysija-verif-licence', 'http://www.wysija.com/?wysijap=checkout&wysijashop-page=1&controller=customer&action=checkDomain&js=1&data=' . $data, array('jquery'), time());
             }
         }
     }
     if (get_option('dkim_autosetup')) {
         $helpLic =& WYSIJA::get('licence', 'helper');
         $data = $helpLic->getDomainInfo();
         wp_enqueue_script('wysija-setup-dkim', 'http://www.wysija.com/?wysijap=checkout&wysijashop-page=1&controller=customer&action=checkDkim&js=1&data=' . $data, array('jquery'), time());
     }
     /*check if the plugin has an update available */
     $updateH =& WYSIJA::get('update', 'helper');
     $updateH->checkForNewVersion();
 }
Esempio n. 15
0
 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']);
     }
 }
Esempio n. 16
0
 function __construct()
 {
     parent::__construct();
     $this->viewObj = WYSIJA::get('tmce', 'view');
 }