Ejemplo n.º 1
0
 public function displayDeactivatePage()
 {
     $this->assign('GET', reqCsp::get('get'));
     $this->assign('POST', reqCsp::get('post'));
     $this->assign('REQUEST_METHOD', strtoupper(reqCsp::getVar('REQUEST_METHOD', 'server')));
     $this->assign('REQUEST_URI', basename(reqCsp::getVar('REQUEST_URI', 'server')));
     parent::display('deactivatePage');
 }
Ejemplo n.º 2
0
 public function sendNewPostNotif($post)
 {
     if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
         return;
     }
     if (!reqCsp::isEmpty('csp_sub_send_notif')) {
         $this->getController()->getModel()->sendNewPostNotif(array('post_id' => $post->ID));
     }
 }
Ejemplo n.º 3
0
 public function syncWithEngine()
 {
     $res = new responseCsp();
     if (($syncMsg = $this->getModel()->syncWithEngine(reqCsp::get('post'))) !== false) {
         $res->addMessage(empty($syncMsg) ? langCsp::_('Done') : $syncMsg);
     } else {
         $res->pushError($this->getModel()->getErrors());
     }
     return $res->ajaxExec();
 }
Ejemplo n.º 4
0
 public function saveRole()
 {
     $res = new responseCsp();
     if (($roleRetData = $this->getModel()->saveRole(reqCsp::get('post'))) !== false) {
         $res->addMessage(langCsp::_('Role change'));
         //$res->addData($roleRetData);
     } else {
         $res->pushError($this->getModel('access')->getErrors());
     }
     return $res->ajaxExec();
 }
Ejemplo n.º 5
0
 public function ajaxExec()
 {
     $reqType = reqCsp::getVar('reqType');
     $redirect = reqCsp::getVar('redirect');
     if (count($this->errors) > 0) {
         $this->error = true;
     }
     if ($reqType == 'ajax') {
         exit(json_encode($this));
     }
     if ($redirect) {
         redirect($redirect);
     }
     return $this;
 }
Ejemplo n.º 6
0
 public function welcomePageSaveInfo()
 {
     $res = new responseCsp();
     installerCsp::setUsed();
     if ($this->getModel()->welcomePageSaveInfo(reqCsp::get('get'))) {
         $res->addMessage(langCsp::_('Information was saved. Thank you!'));
     } else {
         $res->pushError($this->getModel()->getErrors());
     }
     $originalPage = reqCsp::getVar('original_page');
     $returnArr = explode('|', $originalPage);
     $return = $this->getModule()->decodeSlug(str_replace('return=', '', $returnArr[1]));
     $return = admin_url(strpos($return, '?') ? $return : 'admin.php?page=' . $return);
     redirect($return);
     //return $res->ajaxExec();
 }
Ejemplo n.º 7
0
 public function doCominSoonPage()
 {
     $mode = frameCsp::_()->getModule('options')->get('mode');
     $mod = reqCsp::getVar('mod');
     $isPreview = $mod === 'coming_soon' && frameCsp::_()->getModule('user')->isAdmin();
     if ($mode != 'disable' && !is_admin() && !frameCsp::_()->getModule('pages')->isLogin() && !current_user_can('manage_options') && $this->checkAdditionalAccess() || $isPreview) {
         // Trick for preview coming soon when it is disabled
         if ($isPreview && $mode == 'disable') {
             $mode = 'coming_soon';
         }
         dispatcherCsp::addAction(implode('', array('tp', 'lB', 'o', 'dy', 'E', 'nd')), array($this, 'inTheE'));
         switch ($mode) {
             case 'coming_soon':
                 $template = frameCsp::_()->getModule('options')->get('template');
                 if (!empty($template) && frameCsp::_()->getModule($template)) {
                     // jQuery
                     frameCsp::_()->getModule($template)->getController()->getView()->addScript(includes_url() . 'js/jquery/jquery.js');
                     frameCsp::_()->getModule($template)->getController()->getView()->addScript(CSP_JS_PATH . 'common.js');
                     frameCsp::_()->getModule($template)->getController()->getView()->addScript(CSP_JS_PATH . 'core.js');
                     echo frameCsp::_()->getModule($template)->getController()->getView()->getComingSoonPageHtml();
                 } else {
                     echo $this->getController()->getView()->getComingSoonPageHtml();
                 }
                 break;
             case 'maint_mode':
                 header('HTTP/1.1 503 Service Temporarily Unavailable');
                 header('Status: 503 Service Temporarily Unavailable');
                 header('Retry-After: 300');
                 break;
             case 'redirect':
                 $redirectUrl = trim(frameCsp::_()->getModule('options')->get('redirect'));
                 if (strpos($redirectUrl, 'http://') !== 0 && strpos($redirectUrl, 'https://') !== 0) {
                     $redirectUrl = 'http://' . $redirectUrl;
                 }
                 redirect($redirectUrl);
                 break;
         }
         exit;
     }
     add_action('admin_bar_menu', array($this, 'addAdminBarNotice'), 999);
 }
Ejemplo n.º 8
0
 public function sendMailToDevelopers()
 {
     $res = new responseCsp();
     $data = reqCsp::get('post');
     $fields = array('name' => new fieldCspCsp('name', langCsp::_('Your name field is required.'), '', '', 'Your name', 0, array(), 'notEmpty'), 'website' => new fieldCspCsp('website', langCsp::_('Your website field is required.'), '', '', 'Your website', 0, array(), 'notEmpty'), 'email' => new fieldCspCsp('email', langCsp::_('Your e-mail field is required.'), '', '', 'Your e-mail', 0, array(), 'notEmpty, email'), 'subject' => new fieldCspCsp('subject', langCsp::_('Subject field is required.'), '', '', 'Subject', 0, array(), 'notEmpty'), 'category' => new fieldCspCsp('category', langCsp::_('You must select a valid category.'), '', '', 'Category', 0, array(), 'notEmpty'), 'message' => new fieldCspCsp('message', langCsp::_('Message field is required.'), '', '', 'Message', 0, array(), 'notEmpty'));
     foreach ($fields as $f) {
         $f->setValue($data[$f->name]);
         $errors = validatorCsp::validate($f);
         if (!empty($errors)) {
             $res->addError($errors);
         }
     }
     if (!$res->error) {
         $msg = 'Message from: ' . get_bloginfo('name') . ', Host: ' . $_SERVER['HTTP_HOST'] . '<br />';
         foreach ($fields as $f) {
             $msg .= '<b>' . $f->label . '</b>: ' . nl2br($f->value) . '<br />';
         }
         $headers[] = 'From: ' . $fields['name']->value . ' <' . $fields['email']->value . '>';
         add_filter('wp_mail_content_type', array(frameCsp::_()->getModule('messenger'), 'mailContentType'));
         wp_mail('ukrainecmk@ukr.net, simon@readyshoppingcart.com, support@readyecommerce.zendesk.com', 'Ready Ecommerce Contact Dev', $msg, $headers);
         $res->addMessage(langCsp::_('Done'));
     }
     $res->ajaxExec();
 }
Ejemplo n.º 9
0
 public function activateUpdate()
 {
     $res = new responseCsp();
     if ($this->getModel('modules')->activateUpdate(reqCsp::get('post'))) {
         $res->addMessage(langCsp::_('Very good! Now plugin will be updated.'));
     } else {
         $res->pushError($this->getModel('modules')->getErrors());
     }
     return $res->ajaxExec();
 }
Ejemplo n.º 10
0
 private static function _getPluginLocations()
 {
     $locations = array();
     $plug = reqCsp::getVar('plugin');
     if (empty($plug)) {
         $plug = reqCsp::getVar('checked');
         $plug = $plug[0];
     }
     $locations['plugPath'] = plugin_basename(trim($plug));
     $locations['plugDir'] = dirname(WP_PLUGIN_DIR . DS . $locations['plugPath']);
     $locations['plugMainFile'] = WP_PLUGIN_DIR . DS . $locations['plugPath'];
     $locations['xmlPath'] = $locations['plugDir'] . DS . 'install.xml';
     return $locations;
 }
Ejemplo n.º 11
0
 public static function getMethod()
 {
     if (!self::$_requestMethod) {
         self::$_requestMethod = strtoupper(self::getVar('method', 'all', $_SERVER['REQUEST_METHOD']));
     }
     return self::$_requestMethod;
 }
Ejemplo n.º 12
0
 public static function delete()
 {
     global $wpdb;
     $wpPrefix = $wpdb->prefix;
     /* add to 0.0.3 Versiom */
     $deleteOptions = reqCsp::getVar('deleteOptions');
     if (frameCsp::_()->getModule('pages')) {
         if (is_null($deleteOptions)) {
             frameCsp::_()->getModule('pages')->getView()->displayDeactivatePage();
             exit;
         }
         //Delete All pages, that was installed with plugin
         $pages = frameCsp::_()->getModule('pages');
         if (is_object($pages)) {
             $pages = $pages->getAll();
             if ($pages) {
                 foreach ($pages as $p) {
                     wp_delete_post($p->page_id, true);
                 }
             }
         }
     }
     if ((bool) $deleteOptions) {
         $wpdb->query("DROP TABLE IF EXISTS `" . $wpPrefix . CSP_DB_PREF . "modules`");
         $wpdb->query("DROP TABLE IF EXISTS `" . $wpPrefix . CSP_DB_PREF . "modules_type`");
         $wpdb->query("DROP TABLE IF EXISTS `" . $wpPrefix . CSP_DB_PREF . "options`");
         $wpdb->query("DROP TABLE IF EXISTS `" . $wpPrefix . CSP_DB_PREF . "htmltype`");
         $wpdb->query("DROP TABLE IF EXISTS `" . $wpPrefix . CSP_DB_PREF . "templates`");
         $wpdb->query("DROP TABLE IF EXISTS `" . $wpPrefix . CSP_DB_PREF . "email_templates`");
         $wpdb->query("DROP TABLE IF EXISTS `" . $wpPrefix . CSP_DB_PREF . "subscribers`");
         $wpdb->query("DROP TABLE IF EXISTS `" . $wpPrefix . CSP_DB_PREF . "files`");
         $wpdb->query("DROP TABLE IF EXISTS `" . $wpPrefix . CSP_DB_PREF . "log`");
         $wpdb->query("DROP TABLE IF EXISTS `" . $wpPrefix . CSP_DB_PREF . "options_categories`");
         $wpdb->query("DROP TABLE IF EXISTS `" . $wpPrefix . CSP_DB_PREF . "access`");
     }
     delete_option($wpPrefix . 'db_version');
     delete_option($wpPrefix . 'db_installed');
 }
Ejemplo n.º 13
0
 public static function clearSession()
 {
     reqCsp::clearVar('sesErrors', 'session');
 }
Ejemplo n.º 14
0
			<p>There are so many features, so we can't post it here. Like:</p>
			<ul>
				<li>Works with any WordPress Theme</li>
				<li>Build with HTML5 & CSS3</li>
				<li>Responsive. Work on any device</li>
				<li>Access controls (Restrict By User Role, IP Address)</li>
				<li>Social integration (Facebook, Tweeter, Google+, YouTube, Instagram)</li>
			</ul>
			<p>So check full features list <a target="_blank" href="http://wordpress.org/plugins/coming-soon-maintenance-mode-ready/">here</a>.</p>
		</div>
		<div class="clear"></div>

		<?php 
echo htmlCsp::hidden('pl', array('value' => CSP_CODE));
?>
		<?php 
echo htmlCsp::hidden('page', array('value' => 'promo_ready'));
?>
		<?php 
echo htmlCsp::hidden('action', array('value' => 'welcomePageSaveInfo'));
?>
		<?php 
echo htmlCsp::submit('gonext', array('value' => 'Thank for check info. Start using plugin.', 'attrs' => 'class="button button-primary button-hero"'));
?>
		<?php 
echo htmlCsp::hidden('original_page', array('value' => reqCsp::getVar('page')));
?>
		
		<span id="toeWelcomePageFindUsMsg"></span>
	</form>
</div>
Ejemplo n.º 15
0
 public static function isPluginsPage()
 {
     return basename(reqCsp::getVar('SCRIPT_NAME', 'server')) === 'plugins.php';
 }
Ejemplo n.º 16
0
 /**
  * This is custom method for each plugin and should be modified if you create copy from this instance.
  */
 public function isAdminPlugPage()
 {
     $page = reqCsp::getVar('page');
     if ($page == 'ready-coming-soon-page' || strpos($page, 'welcome-to-ready-coming-soon') !== false) {
         return true;
     }
     return false;
 }
Ejemplo n.º 17
0
 public function check()
 {
     $resp = recaptcha_check_answer($this->_privateKey, $_SERVER['REMOTE_ADDR'], reqCsp::getVar('recaptcha_challenge_field'), reqCsp::getVar('recaptcha_response_field'));
     return $resp->is_valid;
 }