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'); }
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; }
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(); }
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); }
/** * Will save subscriptions options as usual options + try to re-saive email templates from this part */ public function saveSubscriptionGroup() { $res = new responseCsp(); if ($this->getModel()->saveGroup(reqCsp::get('post'))) { $res->addMessage(langCsp::_('Done')); $emailTplData = reqCsp::getVar('email_tpl'); if (!empty($emailTplData) && is_array($emailTplData)) { foreach ($emailTplData as $id => $tData) { frameCsp::_()->getModule('messenger')->getController()->getModel('email_templates')->save(array('id' => $id, 'subject' => $tData['subject'], 'body' => $tData['body'])); } } } else { $res->pushError($this->getModel('options')->getErrors()); } return $res->ajaxExec(); }
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; }
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'); }
public static function getSession() { return reqCsp::getVar('sesErrors', 'session'); }
<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>
public static function isPluginsPage() { return basename(reqCsp::getVar('SCRIPT_NAME', 'server')) === 'plugins.php'; }
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; }
/** * 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; }