Example #1
0
 public function __construct($configFile, $version)
 {
     $this->_file = $configFile;
     $this->version = $version;
     $this->lang = Intl::$lang;
     // Loading user config
     if (file_exists($this->_file)) {
         include_once $this->_file;
     } else {
         $this->_install();
     }
     Session::$disableSessionProtection = $this->disableSessionProtection;
     if ($this->addFavicon) {
         /* favicon dir */
         if (!is_dir(INC_DIR)) {
             if (!@mkdir(INC_DIR, 0755)) {
                 FeedPage::$pb->assign('message', sprintf(Intl::msg('Can not create %s directory, check permissions'), INC_DIR));
                 FeedPage::$pb->renderPage('message');
             }
         }
         if (!is_dir(FAVICON_DIR)) {
             if (!@mkdir(FAVICON_DIR, 0755)) {
                 FeedPage::$pb->assign('message', sprintf(Intl::msg('Can not create %s directory, check permissions'), FAVICON_DIR));
                 FeedPage::$pb->renderPage('message');
             }
         }
     }
     if ($this->isLogged()) {
         unset($_SESSION['view']);
         unset($_SESSION['listFeeds']);
         unset($_SESSION['filter']);
         unset($_SESSION['order']);
         unset($_SESSION['byPage']);
         unset($_SESSION['lang']);
     }
     $view = $this->getView();
     $listFeeds = $this->getListFeeds();
     $filter = $this->getFilter();
     $order = $this->getOrder();
     $byPage = $this->getByPage();
     $lang = $this->getLang();
     if ($this->view != $view || $this->listFeeds != $listFeeds || $this->filter != $filter || $this->order != $order || $this->byPage != $byPage || $this->lang != $lang) {
         $this->view = $view;
         $this->listFeeds = $listFeeds;
         $this->filter = $filter;
         $this->order = $order;
         $this->byPage = $byPage;
         $this->lang = $lang;
         $this->write();
     }
     if (!$this->isLogged()) {
         $_SESSION['view'] = $view;
         $_SESSION['listFeeds'] = $listFeeds;
         $_SESSION['filter'] = $filter;
         $_SESSION['order'] = $order;
         $_SESSION['byPage'] = $byPage;
         $_SESSION['lang'] = $lang;
     }
     Intl::$lang = $this->lang;
 }
Example #2
0
<?php

include 'Session.php';
// Personnalize PHP session name
Session::$sessionName = 'kriss';
// default is empty
// If the user does not access any page within this time,
// his/her session is considered expired (3600 sec. = 1 hour)
Session::$inactivityTimeout = 7200;
// default is 3600
// If you get disconnected often or if your IP address changes often.
// Let you disable session cookie hijacking protection
Session::$disableSessionProtection = true;
// default is false
// Ban IP after this many failures.
Session::$banAfter = 5;
// default is 4
// Ban duration for IP address after login failures (in seconds).
// (1800 sec. = 30 minutes)
Session::$banDuration = 3600;
// default is 1800
// File storage for failures and bans. If empty, no ban management.
Session::$banFile = 'ipbans.php';
// default is empty
Session::init();