username = $username; } } public function login($username, $password) { global $db; $this->username = $username; $this->password = $password; $user = $db->query("SELECT * FROM `users` WHERE `username` = '" . $username . "'"); if($user->password === md5($password)) { $_SESSION['loggedIn'] = true; $_SESSION['username'] = $this->username; header("Location: http://vpn.mmnx.de/index.php?action=profile"); } else { return false; } } public function logout() { $this->username = ""; $this->password = ""; $this->email = ""; $_SESSION['loggedIn'] = false; unset($_SESSION['username']); session_destroy(); header("Location: http://vpn.mmnx.de/index.php"); } public function getClients() { global $db; //$clients = $db->query("SELECT * FROM `clients` WHERE `owned_by` = '" . $this->username . "'"); //sizeof($clients); //return $clients->name; return $this->username; } } ?>