Exemple #1
0
 /**
  * Parse into template
  */
 private function parse()
 {
     // init vars
     $warnings = BackendSettingsModel::getWarnings();
     // assign warnings
     if (!empty($warnings)) {
         $this->tpl->assign('warnings', $warnings);
     }
 }
Exemple #2
0
 /**
  * Show the warnings based on the active modules & configured settings
  *
  * @return	void
  */
 private function parseWarnings()
 {
     // get warnings
     $warnings = BackendSettingsModel::getWarnings();
     // assign warnings
     $this->tpl->assign('warnings', $warnings);
 }
Exemple #3
0
 /**
  * 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;
 }