MastodonStartpage/web/admin/include/getadmacc.php
pezcurrel 3c631ccf7e ...
2020-04-05 22:45:21 +02:00

18 lines
547 B
PHP

<?php
$res=mysqli_query($link,'SELECT * FROM Admins WHERE ID='.$_SESSION['AdmID'])
or muoribene(mysqli_error($link),true);
if (mysqli_num_rows($res)==1) {
$account=mysqli_fetch_assoc($res);
if ($account['Level']=='guest') {
$res=mysqli_query($link,'SELECT ID FROM Instances WHERE OurAdmID='.$account['ID'])
or muoribene(mysqli_error($link),true);
$account['Insts']=array();
while ($row=mysqli_fetch_assoc($res))
$account['Insts'][]=$row['ID'];
}
} else {
muoribene('Non esiste un account con ID='.$_SESSION['AdmID'],true);
}
?>