Ejemplo n.º 1
0
 public static function handler($data = null)
 {
     Session::init();
     $key = Cache::PREFIX . 'sessionReq_' . Session::getId();
     if (apc_exists($key)) {
         Session::setBatchVars(apc_fetch($key));
         apc_delete($key);
     }
     $ip = Session::getVar('ip');
     if (Session::isLoggedIn() && Session::getVar('lockToIP') && $ip != null && $ip != $_SERVER['REMOTE_ADDR']) {
         Session::destroy();
         header('Location: ' . Url::format('/'));
         die;
     }
     Session::setVar('ip', $_SERVER['REMOTE_ADDR']);
     $twitter = new twitter(ConnectionFactory::get('redis'));
     Layout::set('tweets', $twitter->getOfficialTweets());
     self::slowBan();
     self::errorBan();
 }