function requireRank($rank, $die = true) { global $srank; error_log("Warning: requireRank is depricated."); if (!requireLoggedIn($die)) { return false; } if ($die and $srank > $rank) { sro('/Pages/restricted/admin.php'); die(""); } else { return $srank <= $rank; } }
<?php require_once '/var/www/config.php'; sro('/Includes/mysql.php'); sro('/Includes/session.php'); sro('/Includes/functions.php'); requireLoggedIn(TRUE); global $mysqli, $suid; print_r($_GET); print_r($_POST); /* $stmt = $mysqli->prepare("DELETE FROM user_vocab WHERE id = ?"); if (!$stmt) { echo "Prepare failed: (" . $mysqli->errno . ") " . $mysqli->error; } else if (!$stmt->bind_param("i", $id)) { echo "Binding parameters failed: (" . $stmt->errno . ") " . $stmt->error; } else if (!$stmt->execute()) { echo "Execute failed (".__FILE__."@".__LINE__."): (" . $stmt->errno . ") " . $stmt->error; } else $stmt->close(); /**/
<?php require_once 'common.php'; requireLoggedIn(); $action = false; $httpMethod = false; if (isset($_GET['a'])) { $action = $_GET['a']; $httpMethod = "GET"; } else { if (isset($_POST['a'])) { $action = $_POST['a']; $httpMethod = "POST"; } else { throw400("Your request did not specify an action to perform."); } } if ($action == "join") { $channel = getChannelWithAuthOrDie($USER_ACCESS_LEVEL_OWNER); $bot = getParamOrDie('bot'); $channelCoebotData = dbGetChannel($channel); if ($channelCoebotData['isActive'] == true) { throw400("That channel is already joined by " . $channelCoebotData['botChannel'] . "! Only one instance of CoeBot can be in a channel at a time."); } $botSession = BotSession::getBotSessionCurrentUser($bot, $channel); $botSession->doJoin(); $botSession->finalize(); header('refresh: 3;url=' . getUrlToChannel($channel)); printHead("Processing..."); printNav('', true); ?>
<?php require_once '/var/www/config.php'; sro('/Includes/mysql.php'); sro('/Includes/session.php'); sro('/Includes/functions.php'); sro('/PHP5/quiz/common.php'); global $sql_stmts, $suid; ?> <header> <h1 data-i18n>Quiz</h1> </header> <article id="quiz"> <?php if (requireLoggedIn(FALSE)) { ?> <span data-i18n="quiz.loggedin">Review and resume previous quizzes</span> <a href="quizzes.php" data-i18n="ui.here">here</a>. <?php $quizzes = []; sql_getmany(sql_stmt("user_id->quiz_id reversed"), $quizzes, ["i", $suid]); foreach ($quizzes as $i => $q) { if (QUIZ($q)->completed()) { unset($quizzes[$i]); } } if (count($quizzes) == 1) { $pl = ""; } else { $pl = "zes"; } if (count($quizzes)) { echo "You have " . count($quizzes) . " quiz{$pl} to complete.";