Example #1
0
 public static function login($username)
 {
     require_once "handlers/SessionsHandler.php";
     $user_id = UserHandler::getUserId($username);
     if (!$user_id) {
         $user_id = static::createUser($username);
     }
     SessionsHandler::startSession();
     SessionsHandler::setSessionUser($user_id, $username);
 }