mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-09 06:35:42 +12:00
Fix the bug where every user is an admin
This commit is contained in:
parent
964a4e879c
commit
0e571700fa
3 changed files with 6 additions and 2 deletions
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
session_start();
|
||||||
include("config.php");
|
include("config.php");
|
||||||
|
|
||||||
// Handle logout
|
// Handle logout
|
||||||
|
|
|
@ -272,7 +272,7 @@ function get_admin(int $userid)
|
||||||
$stmt->bind_param("i", $userid);
|
$stmt->bind_param("i", $userid);
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
$result = $stmt->get_result();
|
$result = $stmt->get_result();
|
||||||
return $result->fetch_row()[0];
|
return $result->fetch_row()[0] === "YES";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -285,7 +285,7 @@ function get_mod(int $userid)
|
||||||
$stmt->bind_param("i", $userid);
|
$stmt->bind_param("i", $userid);
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
$result = $stmt->get_result();
|
$result = $stmt->get_result();
|
||||||
return $result->fetch_row()[0];
|
return $result->fetch_row()[0] === "YES";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
session_start();
|
||||||
include('common.php');
|
include('common.php');
|
||||||
include('crosserver.php');
|
include('crosserver.php');
|
||||||
include('config.php');
|
include('config.php');
|
||||||
|
@ -9,6 +10,8 @@ if(isset($_GET["LOGOUT"]))
|
||||||
{
|
{
|
||||||
if($_GET["LOGOUT"] == 1)
|
if($_GET["LOGOUT"] == 1)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
$_SESSION['LOGGED_IN'] = "NO";
|
||||||
session_destroy();
|
session_destroy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue