diff --git a/classes/User.php b/classes/User.php index 82bb826..5153bc5 100644 --- a/classes/User.php +++ b/classes/User.php @@ -1,49 +1,49 @@ query($query) or die($conn->error); - $row = $result->fetch_assoc(); + $data = $result->fetch_assoc(); - $returned = $result->num_rows; + $rows = $result->num_rows; - if($returned != 0) { - foreach($row as $key=>$value) { + if($rows != 0) { + foreach($data as $key=>$value) { $_SESSION[$key] = $value; } - return $row; + return $data; } else { return false; } } /** - * Log's Out a User that is logged in - * @param string - * @param string + * Log's Out the current user that is logged in + * @param string the action to perform or carry out after a successful logout + * @param string check if the action to be perform to know if it equal to logout */ public function logout($action, $check) { - + if(isset($action) && $action == "logout" && isset($check) && $check == "true") { for($i=0; $i<=count($_SESSION); $i++) { $_SESSION[$i] = ""; unset($_SESSION[$i]); } - $destroy = session_destroy(); + session_destroy(); - return $destroy; + return true; } }