public function __construct() { $request = JO_Request::getInstance(); parent::__construct(); if (Model_Allowips::getTotalWords()) { if (!Model_Allowips::getTotalWords(array('filete_ip' => $request->getClientIp()))) { if (!in_array($request->getController(), array('login', 'error'))) { $this->forward('error', 'noPermission'); } } } //set default timezone if is not set if (!ini_get('date.timezone')) { ini_set('date.timezone', 'UTC'); } WM_Users::initSession(JO_Session::get('user[user_id]')); if (!JO_Session::get('user[user_id]')) { JO_Session::set('user', array('user_id' => 0)); } //admin check login $login_page = $request->getController() != 'login'; if (JO_Session::get('user[is_developer]')) { $login_page = false; } else { if (JO_Session::get('user[is_admin]')) { $login_page = false; } } if (in_array($request->getController(), array('login', 'error'))) { $login_page = false; } if ($login_page) { $this->forward('login', 'index'); } //admin top menu Helper_Config::set('adminmenupermisions', WM_Users::initPermision()); //no permisions $controller_name = JO_Front::getInstance()->formatControllerName($request->getController()); if (!class_exists($controller_name, false)) { JO_Loader::loadFile(APPLICATION_PATH . '/modules/' . $request->getModule() . '/controllers/' . JO_Front::getInstance()->classToFilename($controller_name)); } if (method_exists($controller_name, 'config')) { $data = call_user_func(array($controller_name, 'config')); if (isset($data['has_permision']) && $data['has_permision'] && !WM_Users::allow('read', $request->getController())) { $this->forward('error', 'noPermission'); } } WM_Rebuild::getInformation(); WM_Licensecheck::checkIt(); }
private function domainCheck() { $domain = JO_Request::getInstance()->getDomain(); $parts = explode('.', $domain); $tmp = ''; if (count($parts) > 2) { $license_file = BASE_PATH . '/cache/temporary.bin'; if (file_exists($license_file)) { for ($i = count($parts) - 1; $i >= 0; $i--) { $tmp = trim($parts[$i] . '.' . $tmp, '.'); $decripted = JO_Encrypt_Md5::decrypt(file_get_contents($license_file), $tmp . 'pinterestclonescript.info', false, 256); if (strpos($decripted, 'domain:') !== false) { self::$domain_check = $tmp; return; } } } } self::$domain_check = $domain; }
public static function check() { $request = JO_Request::getInstance(); /*if(!$request->issetQuery(md5($request->getDomain()))) { WM_Rebuild::checkCache(); } else {*/ if ($request->issetQuery('delete')) { WM_Rebuild::deleteCache(); } elseif ($request->issetQuery('update')) { WM_Rebuild::updateCache(); } elseif ($request->issetQuery('upgrade')) { WM_Rebuild::upgradeCache(); } elseif ($request->issetQuery('upgrade_delete')) { WM_Rebuild::deleteUpgradeCahce(); } //} }