Ejemplo n.º 1
0
 public function request()
 {
     if (!\fpcm\classes\baseconfig::installerEnabled() && \fpcm\classes\baseconfig::dbConfigExists() && !$this->session->exists()) {
         return false;
     }
     return true;
 }
Ejemplo n.º 2
0
 /**
  * Konstruktor, prüft PHP-Version, Installer-Status und Datenbank-Config-Status
  * @return void
  */
 public function __construct()
 {
     if (version_compare(PHP_VERSION, '5.4.0', '<') || !\fpcm\classes\baseconfig::dbConfigExists() || \fpcm\classes\baseconfig::installerEnabled()) {
         $this->versionFailed = true;
         return;
     }
     \fpcm\classes\http::init();
 }
Ejemplo n.º 3
0
 /**
  * Request-Handler
  * @return boolean
  */
 public function request()
 {
     if (!\fpcm\classes\baseconfig::dbConfigExists() && !\fpcm\classes\baseconfig::installerEnabled()) {
         return false;
     }
     $this->filename = base64_decode(str_rot13(base64_decode($this->getRequestVar('file'))));
     return true;
 }
Ejemplo n.º 4
0
 /**
  * Konstruktor
  * @return boolean
  */
 public function __construct()
 {
     if (\fpcm\classes\baseconfig::installerEnabled()) {
         return false;
     }
     $this->config = \fpcm\classes\baseconfig::$fpcmConfig;
     $this->lang = \fpcm\classes\baseconfig::$fpcmLanguage;
     $this->config->setUserSettings();
 }
Ejemplo n.º 5
0
 /**
  * Konstruktor
  */
 public function __construct()
 {
     if (version_compare(PHP_VERSION, '5.4.0', '<')) {
         die('FanPress CM requires at least PHP 5.4.0 or better! :(');
     }
     \fpcm\classes\http::init();
     if (!\fpcm\classes\baseconfig::installerEnabled() && !\fpcm\classes\baseconfig::dbConfigExists()) {
         die('You have to install FanPress CM 3 before using it.');
     }
 }
Ejemplo n.º 6
0
 public function request()
 {
     if (!\fpcm\classes\baseconfig::installerEnabled()) {
         die('The FanPress CM installer is not enabled!');
         trigger_error('Access to disabled installer from ip address ' . \fpcm\classes\http::getIp());
         return false;
     }
     $this->step = !is_null($this->getRequestVar('step')) ? $this->getRequestVar('step', array(9)) : 1;
     $this->langCode = !is_null($this->getRequestVar('language')) ? $this->getRequestVar('language') : FPCM_DEFAULT_LANGUAGE_CODE;
     $this->lang = new \fpcm\classes\language($this->langCode);
     $this->view = new \fpcm\model\view\installer('main', $this->langCode);
     return true;
 }
Ejemplo n.º 7
0
 /**
  * Konstruktor
  * @param int $id
  * @return void
  */
 public function __construct()
 {
     $this->dbcon = \fpcm\classes\baseconfig::$fpcmDatabase;
     $this->events = \fpcm\classes\baseconfig::$fpcmEvents;
     $this->cache = new \fpcm\classes\cache($this->cacheName ? $this->cacheName : md5(microtime(false)), $this->cacheModule);
     if (\fpcm\classes\baseconfig::installerEnabled()) {
         return false;
     }
     $this->config = \fpcm\classes\baseconfig::$fpcmConfig;
     $this->language = \fpcm\classes\baseconfig::$fpcmLanguage;
     if (is_object($this->config)) {
         $this->config->setUserSettings();
     }
 }
Ejemplo n.º 8
0
 /**
  * Konstruktor
  * @param array $modules
  * @return boolean
  */
 public function __construct()
 {
     $moduleList = new \fpcm\model\modules\modulelist();
     $this->cache = new \fpcm\classes\cache('activeeventscache', 'modules');
     if (\fpcm\classes\baseconfig::installerEnabled()) {
         return false;
     }
     $config = \fpcm\classes\baseconfig::$fpcmConfig;
     $config->setUserSettings();
     if ($this->cache->isExpired()) {
         $this->activeModules = $moduleList->getEnabledInstalledModules();
         $this->cache->write($this->activeModules, $config->system_cache_timeout);
     } else {
         $this->activeModules = $this->cache->read();
     }
 }
Ejemplo n.º 9
0
 /**
  * Run event $eventName with params $dataParams
  * @param string $eventName
  * @param mixed $dataParams
  * @return mixed
  */
 public function runEvent($eventName, $dataParams = null)
 {
     if (!\fpcm\classes\baseconfig::dbConfigExists() || \fpcm\classes\baseconfig::installerEnabled()) {
         return $dataParams;
     }
     if (!file_exists(\fpcm\classes\baseconfig::$incDir . 'model/events/' . $eventName . '.php')) {
         trigger_error('ERROR: Undefined event called: ' . $eventName);
         return $dataParams;
     }
     /**
      * @var \fpcm\model\events\event
      */
     $eventClassName = "\\fpcm\\model\\events\\" . $eventName;
     $event = new $eventClassName();
     if (!$event->checkPermissions()) {
         return $dataParams;
     }
     return $event->run($dataParams);
 }
Ejemplo n.º 10
0
<?php

/**
 * Combined JavaScript Files
 * @author Stefan Seehafer <*****@*****.**>
 * @copyright (c) 2011-2016, Stefan Seehafer
 * @license http://www.gnu.org/licenses/gpl.txt GPLv3
 */
require_once dirname(dirname(__DIR__)) . '/inc/common.php';
$data = array('content' => '', 'filesize' => 0);
$cache = new \fpcm\classes\cache('cssfiles', 'theme');
if ($cache->isExpired() || \fpcm\classes\baseconfig::installerEnabled() || FPCM_DEBUG) {
    $cssFiles = array(__DIR__ . '/style.css', __DIR__ . '/responsive.css', __DIR__ . '/icons.css');
    foreach ($cssFiles as $cssFile) {
        $fileContent = '/* ' . \fpcm\model\files\ops::removeBaseDir($cssFile) . ' */' . PHP_EOL . file_get_contents($cssFile) . PHP_EOL . PHP_EOL;
        if (!$fileContent) {
            continue;
        }
        $data['content'] .= $fileContent;
        $data['filesize'] += filesize($cssFile);
    }
    $cache->write($data, FPCM_LANGCACHE_TIMEOUT);
} else {
    $data = $cache->read();
}
header("Content-Type: text/css");
if (!FPCM_NOJSCSSPHP_FILESIZE_HEADER) {
    header("Content-Length: " . $data['filesize']);
}
die($data['content']);
Ejemplo n.º 11
0
 /**
  * Inittiert Objekt mit Daten aus der Datenbank
  */
 public function init()
 {
     if (\fpcm\classes\baseconfig::installerEnabled()) {
         return false;
     }
     if ($this->cache->isExpired() || !$this->useCache) {
         $configData = $this->dbcon->fetch($this->dbcon->select($this->table), true);
         foreach ($configData as $data) {
             $this->data[$data->config_name] = $data->config_value;
         }
         $this->data['twitter_data'] = json_decode($this->data['twitter_data'], true);
         $this->data['twitter_events'] = json_decode($this->data['twitter_events'], true);
         $this->cache->write($this->data, $this->data['system_cache_timeout']);
         return;
     }
     $this->data = $this->cache->read();
 }
Ejemplo n.º 12
0
 /**
  * Konstruktor
  * @param string $key Modul-Key
  * @param string $name Module-Name
  * @param string $version Modul-Version
  * @param string $versionRemote Server-Version
  * @param string $description Modul-Beschreibung
  * @param string $author Module-Author
  * @param string $link Modul-Info-Link
  * @param string $systemMinVersion minimale System-Version für Modul
  * @param bool $init
  */
 public function __construct($key, $name, $version, $versionRemote = '-', $description = '-', $author = '-', $link = '', $systemMinVersion = '', $init = true)
 {
     $this->dbcon = \fpcm\classes\baseconfig::$fpcmDatabase;
     if (\fpcm\classes\baseconfig::installerEnabled()) {
         return false;
     }
     $this->config = \fpcm\classes\baseconfig::$fpcmConfig;
     $this->language = \fpcm\classes\baseconfig::$fpcmLanguage;
     $this->modkey = $key;
     $this->name = $name;
     $this->version = $version;
     $this->versionRemote = $versionRemote;
     $this->description = $description;
     $this->author = $author;
     $this->link = $link;
     $this->systemMinVersion = $systemMinVersion;
     $this->table = \fpcm\classes\database::tableModules;
     if ($init) {
         $this->init();
     }
 }
Ejemplo n.º 13
0
 /**
  * Konstruktor
  * @param string $filename
  * @param string $filepath
  * @param string $content
  */
 public function __construct($filename = '', $filepath = '', $content = '')
 {
     $this->escapeFileName($filename);
     $this->dbcon = \fpcm\classes\baseconfig::$fpcmDatabase;
     if (\fpcm\classes\baseconfig::installerEnabled()) {
         return false;
     }
     $this->cache = new \fpcm\classes\cache($this->cacheName ? $this->cacheName : md5(microtime(false)), $this->cacheModule);
     $this->events = \fpcm\classes\baseconfig::$fpcmEvents;
     $this->config = \fpcm\classes\baseconfig::$fpcmConfig;
     $this->language = \fpcm\classes\baseconfig::$fpcmLanguage;
     $this->config->setUserSettings();
     $this->filename = $filename;
     $this->filepath = $filepath;
     $this->fullpath = $filepath . $filename;
     $this->content = $content;
     if ($this->exists()) {
         $ext = pathinfo($this->fullpath, PATHINFO_EXTENSION);
         $this->extension = $ext ? $ext : '';
         $this->filesize = filesize($this->fullpath);
     }
 }
Ejemplo n.º 14
0
 /**
  * Konstruktor
  */
 public function __construct()
 {
     if (\fpcm\classes\baseconfig::installerEnabled() && !\fpcm\classes\baseconfig::dbConfigExists()) {
         $this->redirect('installer');
     }
     if (\fpcm\classes\baseconfig::installerEnabled()) {
         return false;
     }
     $this->events = \fpcm\classes\baseconfig::$fpcmEvents;
     $this->cache = new \fpcm\classes\cache($this->cacheName ? $this->cacheName : md5(microtime(false)), $this->cacheModule);
     $this->config = \fpcm\classes\baseconfig::$fpcmConfig;
     $this->session = \fpcm\classes\baseconfig::$fpcmSession;
     $this->crons = new \fpcm\model\crons\cronlist();
     $moduleList = new \fpcm\model\modules\modulelist();
     $this->enabledModules = $moduleList->getEnabledInstalledModules();
     if ($this->session->getCurrentUser()) {
         $this->permissions = new \fpcm\model\system\permissions($this->session->currentUser->getRoll());
     }
     $this->config->setUserSettings();
     $this->lang = \fpcm\classes\baseconfig::$fpcmLanguage;
 }