1
0
mirror of https://github.com/Foltik/Shimapan synced 2024-11-30 14:31:42 -05:00

Fix insufficient access level bug on invite page

This commit is contained in:
Foltik 2016-08-14 19:42:31 -04:00
parent 5845c6c427
commit 51b5d26f09

View File

@ -48,19 +48,21 @@ function generate($level)
{
global $db;
if (isset($_SESSION['id'])) {
if ($_SESSION['level'] < '3' && $level > $_SESSION['level'] && $level < '4') {
if ($_SESSION['level'] < '3') {
if (empty($level)) {
include_once('./invite.php');
} else {
$q = $db->prepare("INSERT INTO invites (code, level, issuer) VALUES (:code, :level, :issuer)");
$code = generateString(CODE_CHARSET, 16);
$q->bindParam(':code', $code);
$q->bindParam(':level', $level);
$q->bindParam(':issuer', $_SESSION['user']);
$q->execute();
echo '<p>Generation Successful.</p><br>
<p>Code: '.$code.'</p><br>
<p>Access Level: '.$level.'</p>';
if ($level > $_SESSION['level'] && $level < '4') {
$q = $db->prepare("INSERT INTO invites (code, level, issuer) VALUES (:code, :level, :issuer)");
$code = generateString(CODE_CHARSET, 16);
$q->bindParam(':code', $code);
$q->bindParam(':level', $level);
$q->bindParam(':issuer', $_SESSION['user']);
$q->execute();
echo '<p>Generation Successful.</p><br>
<p>Code: '.$code.'</p><br>
<p>Access Level: '.$level.'</p>';
}
}
} else {
echo 'Insufficient Access Level.';