Пример #1
0
 public static function load_current_user(){
     if (!isset(self::$current) && !empty($_SESSION['userid'])) {
         self::$current = new User($_SESSION['userid']);
         Logger::debug('Loading current user ' . self::$current->username);
     }
     return true;
 }
 function redirect_to_login(){
     \Dreamblaze\Framework\Core\Logger::debug($this->params);
     if($this->params['controller'] == 'session' && $this->params['action'] == 'add')
         $this->render_error(401);
     else
         $this->redirect_to(array('session', 'add'));
 }
Пример #3
0
 public static function get(){
     $keys = func_get_args();
     $tmp = self::$l;
     foreach($keys as $key){
         if(is_array($tmp) && isset($tmp[$key]))
             $tmp = $tmp[$key];
     }
     if(empty($tmp) || is_array($tmp)){
         $tmp = '$' . implode(' - ', $keys) . '$';
         Logger::error($keys,'I18n Error');
     }
     return $tmp;
 }