getadmacc.php 632 B

1234567891011121314151617181920
  1. <?php
  2. $res=mysqli_query($link,'SELECT * FROM Admins WHERE ID='.$_SESSION['AdmID'])
  3. or muoribene(mysqli_error($link),true);
  4. if (mysqli_num_rows($res)==1) {
  5. $account=mysqli_fetch_assoc($res);
  6. if ($account['Enabled']==0)
  7. muoribene('Your account has been disabled.',true);
  8. if ($account['Level']=='guest') {
  9. $res=mysqli_query($link,'SELECT ID FROM Instances WHERE GuestID='.$account['ID'])
  10. or muoribene(mysqli_error($link),true);
  11. $account['Insts']=array();
  12. while ($row=mysqli_fetch_assoc($res))
  13. $account['Insts'][]=$row['ID'];
  14. }
  15. } else {
  16. muoribene('There’s no account with ID='.$_SESSION['AdmID'].'.',true);
  17. }
  18. ?>