*/ class ActiveUser { public static $user = null; public static $session = null; public static function init($userId, $sessionId) { // Create a session object self::$session = new Session($userId, $sessionId); // Create a user object $user = User::construct($userId); // Check if the session exists and check if the user is activated if (self::$session->validate() > 0 && !$user->permission(Site::DEACTIVATED)) { // Assign the user object self::$user = $user; } else { self::$user = User::construct(0); } } }