/** * Execute the action * * @return void */ public function execute() { // call parent, this will probably add some general CSS/JS or other required files parent::execute(); // get some data $modulesThatRequireAkismet = BackendSettingsModel::getModulesThatRequireAkismet(); $modulesThatRequireGoogleMaps = BackendSettingsModel::getModulesThatRequireGoogleMaps(); // set properties $this->needsAkismet = !empty($modulesThatRequireAkismet); $this->needsGoogleMaps = !empty($modulesThatRequireGoogleMaps); // load the form $this->loadForm(); // validate the form $this->validateForm(); // parse $this->parse(); // display the page $this->display(); }
/** * Checks the settings and optionally returns an array with warnings * * @return array */ public static function checkSettings() { // init var $warnings = array(); $akismetModules = BackendSettingsModel::getModulesThatRequireAkismet(); $googleMapsModules = BackendSettingsModel::getModulesThatRequireGoogleMaps(); // check if the akismet key is available if there are modules that require it if (!empty($akismetModules) && self::getModuleSetting('core', 'akismet_key', null) == '') { // add warning $warnings[] = array('message' => BL::err('AkismetKey')); } // check if the google maps key is available if there are modules that require it if (!empty($googleMapsModules) && self::getModuleSetting('core', 'google_maps_key', null) == '') { // add warning $warnings[] = array('message' => BL::err('GoogleMapsKey')); } // check if the fork API keys are available if (self::getModuleSetting('core', 'fork_api_private_key') == '' || self::getModuleSetting('core', 'fork_api_public_key') == '') { $warnings[] = array('message' => BL::err('ForkAPIKeys')); } // check if debug-mode is active if (SPOON_DEBUG) { $warnings[] = array('message' => BL::err('DebugModeIsActive')); } /* // @note: robots.txt are removed // indexability is now based on meta noindex (SPOON_DEBUG true = not noindex) // try to validate robots.txt if(SpoonFile::exists(PATH_WWW . '/robots.txt')) { // get content $content = SpoonFile::getContent(PATH_WWW . '/robots.txt'); $isOK = true; // split into lines $lines = explode("\n", $content); // loop lines foreach($lines as $line) { // cleanup line $line = mb_strtolower(trim($line)); // validate disallow if(substr($line, 0, 8) == 'disallow') { // split into chunks $chunks = explode(':', $line); // validate disallow if(isset($chunks[1]) && trim($chunks[1]) == '/') $isOK = false; } } // add warning if(!$isOK) $warnings[] = array('message' => BL::err('RobotsFileIsNotOK')); } */ // return return $warnings; }