Ejemplo n.º 1
0
 /**
  * Auszuführender Cron-Code
  */
 public function run()
 {
     if (!\fpcm\classes\baseconfig::asyncCronjobsEnabled()) {
         return false;
     }
     if (!is_writable(\fpcm\classes\baseconfig::$tempDir)) {
         trigger_error('Unable to cleanup ' . \fpcm\classes\baseconfig::$tempDir . '! Access denied!');
         return false;
     }
     $tempFiles = glob(\fpcm\classes\baseconfig::$tempDir . '*');
     if (!is_array($tempFiles) || !count($tempFiles)) {
         return true;
     }
     foreach ($tempFiles as $tempFile) {
         if ($tempFile == \fpcm\classes\baseconfig::$tempDir . 'index.html') {
             continue;
         }
         if (filectime($tempFile) + 3600 * 24 > time()) {
             continue;
         }
         if (is_dir($tempFile)) {
             \fpcm\model\files\ops::deleteRecursive($tempFile);
             continue;
         }
         unlink($tempFile);
     }
     \fpcm\classes\logs::syslogWrite('Temp files cleanup in ' . \fpcm\classes\baseconfig::$tempDir);
     return true;
 }
Ejemplo n.º 2
0
 /**
  * View-Variablen initialisieren
  */
 public function initAssigns()
 {
     /**
      * Pfade
      */
     $this->assign('FPCM_BASELINK', \fpcm\classes\baseconfig::$rootPath);
     $this->assign('FPCM_THEMEPATH', \fpcm\classes\baseconfig::$themePath);
     $this->assign('FPCM_BASEMODULELINK', \fpcm\classes\baseconfig::$rootPath . 'index.php?module=');
     $this->assign('FPCM_SELF', $_SERVER['PHP_SELF']);
     /**
      * Sprache
      */
     $this->assign('FPCM_LANG', $this->language);
     /**
      * Login-Status
      */
     $this->assign('FPCM_LOGGEDIN', $this->session->exists());
     /**
      * System config data
      */
     $this->assign('FPCM_VERSION', $this->config->system_version);
     $this->assign('FPCM_FRONTEND_LINK', $this->config->system_url);
     $this->assign('FPCM_DATETIME_MASK', $this->config->system_dtmask);
     $this->assign('FPCM_DATETIME_ZONE', $this->config->system_timezone);
     $this->assign('FPCM_MAINTENANCE_MODE', $this->config->system_maintenance);
     $this->assign('FPCM_CRONJOBS_DISABLED', \fpcm\classes\baseconfig::asyncCronjobsEnabled());
     /**
      * Current module
      */
     $this->assign('FPCM_CURRENT_MODULE', \fpcm\classes\http::get('module'));
     if ($this->session->exists()) {
         $this->assign('FPCM_USER', $this->session->currentUser->getDisplayName());
         $this->assign('FPCM_SESSION_LOGIN', $this->session->getLogin());
     }
     helper::init($this->config->system_lang);
 }
Ejemplo n.º 3
0
 /**
  * View-Variablen initialisieren
  */
 protected function initAssigns()
 {
     /**
      * Current module
      */
     $this->assign('FPCM_CURRENT_MODULE', \fpcm\classes\http::get('module'));
     if ($this->session->exists()) {
         $this->assign('FPCM_USER', $this->session->currentUser->getDisplayName());
         $this->assign('FPCM_SESSION_LOGIN', $this->session->getLogin());
         $nav = new \fpcm\model\theme\navigation();
         $this->assign('FPCM_NAVIGATION', $nav->render());
         $this->assign('FPCM_NAVIGATION_ACTIVE', $this->getNavigationActiveCheckStr());
         $this->jsvars = array('fpcmSessionCheckEnabled' => true) + $this->jsvars;
         $this->addJsLangVars(array('sessionCheckMsg' => $this->language->translate('SESSION_TIMEOUT')));
     }
     /**
      * Meldungen
      */
     $this->addJsVars(array('fpcmMsg' => $this->getMessages()));
     /**
      * CSS und JS Files
      */
     $this->assign('FPCM_CSS_FILES', $this->getViewCssFiles());
     $this->assign('FPCM_JS_FILES', $this->getViewJsFiles());
     $this->assign('FPCM_JS_VARS', $this->getJsVars());
     /**
      * Pfade
      */
     $this->assign('FPCM_BASELINK', \fpcm\classes\baseconfig::$rootPath);
     $this->assign('FPCM_THEMEPATH', \fpcm\classes\baseconfig::$themePath);
     $this->assign('FPCM_BASEMODULELINK', \fpcm\classes\baseconfig::$rootPath . 'index.php?module=');
     $this->assign('FPCM_SELF', $_SERVER['PHP_SELF']);
     /**
      * Sprache
      */
     $this->assign('FPCM_LANG', $this->language);
     /**
      * Login-Status
      */
     $this->assign('FPCM_LOGGEDIN', $this->session->exists());
     /**
      * Aufruf durch mobile Endgerät
      */
     $this->assign('FPCM_ISMOBILE', $this->isMobile);
     /**
      * System config data
      */
     $this->assign('FPCM_VERSION', $this->config->system_version);
     $this->assign('FPCM_FRONTEND_LINK', $this->config->system_url);
     $this->assign('FPCM_DATETIME_MASK', $this->config->system_dtmask);
     $this->assign('FPCM_DATETIME_ZONE', $this->config->system_timezone);
     $this->assign('FPCM_MAINTENANCE_MODE', $this->config->system_maintenance);
     $this->assign('FPCM_CRONJOBS_DISABLED', \fpcm\classes\baseconfig::asyncCronjobsEnabled());
     helper::init($this->config->system_lang);
 }
Ejemplo n.º 4
0
 /**
  * Request-Handler
  * @return bool
  */
 public function request()
 {
     return \fpcm\classes\baseconfig::asyncCronjobsEnabled();
 }