Example #1
0
 public static final function trySetCurrentUserEntity()
 {
     $token = Loader::loadInput()->input('token');
     if (TRUE === Kit::isString($token) and '' !== $token) {
         $class_name = Loader::includeCore('User/User');
         try {
             self::$currentUser = $class_name::getCurrentUserEntity($token);
             self::$currentInstitution = self::$currentUser->getInstitution()->setReadOnly();
         } catch (Exception $e) {
             self::$currentUser = NULL;
             self::$currentInstitution = NULL;
         }
     }
 }