diff --git a/index.php b/index.php index 90b355c622b384ef574794fc054d5c4736329b51..127f3aa51bebe60cc26b11ab7b884f82af58fc33 100644 --- a/index.php +++ b/index.php @@ -29,7 +29,7 @@ if ($_SESSION["user_right"] == -1) { } // if user is logged and not use https, disconnect it! -if ($_SERVER['HTTPS'] != "on" && $user_id > 0) +if ($_SERVER['HTTPS'] != "on" && $_SESSION["user_id"] > 0) userDisconnect(); ?> diff --git a/public/connection.php b/public/connection.php index 26d2b6ea9eadbd2e654873f90654726a1d6cbd31..397381c15fae49ce680f02f98e77173ef73858b0 100644 --- a/public/connection.php +++ b/public/connection.php @@ -194,8 +194,8 @@ return ($str); // Disconnect user function userDisconnect(){ - $_SESSION["user_right"] = 0; - $_SESSION["user_id"] = 0; + $_SESSION["user_right"] = 0; + $_SESSION["user_id"] = 0; }