Letractively / add-mvc-framework

Automatically exported from code.google.com/p/add-mvc-framework
0 stars 0 forks source link

model_auth::require_logged_in() #146

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
{{{
   /**
    * require_logged_in()
    * requires current_logged_in() user, if there is none, redirect and die()
    *
    * @param i_auth_entity $user require the current logged in to be $user
    *
    * @since ADD MVC 0.0
    */
   static function require_logged_in(i_auth_entity $user=NULL) {
      if (!self::current_logged_in() || ($user && self::current_logged_in() != $user) ) {
         static::login_redirect();
      }
      return true;
   }
}}}

Original issue reported on code.google.com by albertdi...@gmail.com on 23 Sep 2014 at 4:48

GoogleCodeExporter commented 9 years ago

Original comment by albertdi...@gmail.com on 23 Sep 2014 at 4:49