diff --git a/classes/UserLoggedIn.php b/classes/UserLoggedIn.php index aada290..eece9eb 100644 --- a/classes/UserLoggedIn.php +++ b/classes/UserLoggedIn.php @@ -1,25 +1,24 @@ ' . $words -> __get('logout') - . ' [ ' . Url::html_output($this -> username) . ' ]

'; - if ($you -> level >= MODERATOR) - //show admin options if they are a moderator or higher + . '&logout=true">' . $words->__get('logout') + . ' [ ' . Url::html_output($this->username) . ' ]

'; + + if ($you->level >= MODERATOR) //show admin options if they are a moderator or higher { $admin_panel = new Admin($you); - $txt = $admin_panel -> __toString() . $txt; + $txt = $admin_panel->__toString() . $txt; } - if ($you -> level >= LEVEL_TO_UPLOAD) - //show upload options if they are a logged in user or higher + + if ($you->level >= LEVEL_TO_UPLOAD) //show upload options if they are a logged in user or higher { $upload_panel = new Upload($you); - $txt .= $upload_panel -> __toString(); + $txt .= $upload_panel->__toString(); } return $txt; } @@ -73,13 +73,13 @@ class UserLoggedIn extends User */ public function logout() { - global $subdir; - $this -> level = GUEST; - $this -> sha1_pass = $this -> username = ''; + global $request, $subdir; + $this->level = GUEST; + $this->sha1_pass = $this->username = ''; session_unset(); session_destroy(); - $home = new Url(Url::html_output($_SERVER['PHP_SELF']), true); - $home -> redirect(); + $home = new Url(Url::html_output($request->server('PHP_SELF', '')), true); + $home->redirect(); } /** @@ -93,22 +93,22 @@ class UserLoggedIn extends User { parent::__construct($username, $sha1_pass); $accounts = new Accounts(); - if (!($accounts -> is_valid_user($this))) + if (!($accounts->is_valid_user($this))) { global $log; - $log -> add_entry("Invalid login (Username: $username)"); + $log->add_entry("Invalid login (Username: $username)"); session_unset(); sleep(1); throw new ExceptionDisplay('Invalid username or password.'); } - $this -> level = $accounts -> get_level($username); - if ($this -> level <= BANNED) + $this->level = $accounts->get_level($username); + if ($this->level <= BANNED) { throw new ExceptionDisplay('Your account has been disabled by the site admin.'); } - $this -> username = $accounts -> get_stored_case($username); - $this -> home_dir = $accounts -> get_home_dir($username); + $this->username = $accounts->get_stored_case($username); + $this->home_dir = $accounts->get_home_dir($username); } } -?> \ No newline at end of file +?>