Sample text
This commit is contained in:
@@ -1,12 +1,23 @@
|
||||
<?php
|
||||
<?php // Viewing account data
|
||||
|
||||
require_once("../_auth.php");
|
||||
require_once("../_json.php");
|
||||
require_once("../_utils.php");
|
||||
|
||||
|
||||
|
||||
// Check if user with supplied login exists
|
||||
function User_LoginExist ($login): bool {
|
||||
global $db;
|
||||
|
||||
$s = $db->prepare("SELECT * FROM users WHERE login = ?");
|
||||
$s->bind_param("s", $login);
|
||||
$s->execute();
|
||||
|
||||
return (bool)$s->get_result()->fetch_assoc();
|
||||
}
|
||||
|
||||
// Check if user has specified role
|
||||
function User_HasRole ($id, $role) {
|
||||
function User_HasRole ($id, $role): bool {
|
||||
global $db;
|
||||
|
||||
$s = $db->prepare("SELECT * FROM users WHERE id = ?");
|
||||
@@ -72,6 +83,8 @@ function User_GetInfoByID ($id) {
|
||||
|
||||
|
||||
if (ThisFileIsRequested(__FILE__)) {
|
||||
require_once("../_json.php");
|
||||
|
||||
$UserID = null;
|
||||
|
||||
if (isset($_REQUEST["id"])) {
|
||||
|
||||
Reference in New Issue
Block a user