Advertisement
Guest User

Untitled

a guest
Aug 12th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.41 KB | None | 0 0
  1. <?php include("../site-inc/gamengdb.php"); ?>
  2. <?php
  3.  
  4. switch($setcase){case 1:
  5. //-----------------------------------
  6.  
  7. // PART ONE
  8. // if there's no cookie 'logname' redirect to login and die
  9. //if(!isset($_COOKIE['logname'])){redirect('nolog.php');die();}
  10.  
  11. // if there's no cookie 'privilege' redirect to login and die
  12. //if(!isset($_COOKIE['privilege'])){redirect('nolog.php');die();}
  13.  
  14. // separating ID from NAME
  15. //$cookie=explode('|',$_COOKIE['logname']);
  16.  
  17. $query = "SELECT * FROM `game_data` WHERE (id='$_POST[id]')";
  18. $result = mysqli_query($connection, $query) or die ("Couldn't get data.");
  19. $data=mysqli_fetch_array ($result);
  20. $logname=$data[log_name];
  21. $id=$data[id];
  22. $privilege=$data[user_privilege];
  23. $password=$data[password];
  24.  
  25. //echo ("logname=$logname<br>");
  26. //echo ("id=$id<br>");
  27. //echo ("privilege=$privilege<br>");
  28. //echo ("password=$password<br>");
  29.  
  30. // check if username exists and at least 3 chars. If not, redirect to login and die
  31. if(!isset($data[log_name]) || strlen($data[log_name])<3){redirect('nolog.php');die();}
  32.  
  33. // assign ID and check if it is a number greater then 0. If not, redirect to login and die
  34. $member_id=(int)$data[id]; if($member_id<1){redirect('nolog.php');die();}
  35.  
  36. // assign USERNAME
  37. $member_name=$data[log_name];
  38.  
  39. // assign PRIVILEGE and make sure it's a number
  40. $member_privilege=(int)$data[user_privilege];
  41.  
  42. // if privilege is 0 and below, or is greater than 5 or 3 (not possible as you mentioned, make it 4)
  43. if($member_privilege<1 || $member_privilege>5 || $member_privilege==3){$member_privilege=4;}
  44.  
  45. /******************************************************************************************
  46.  
  47. here you can run some check against the database to make sure that the password matches etc
  48.  
  49. ******************************************************************************************/
  50.  
  51. // now we have all needed, $user below is an array that blab understands what to do with.
  52.  
  53. $user=array();
  54. $user['id']=$member_id + 500000000; // you can have both blab users and site users so site user ID should be +500000000 to make the difference. do not change
  55. $user['name']=$member_name;
  56. $user['group']=$member_privilege;
  57. $pmss=get_permissions($user['group'],0); // permissions, do not touch
  58.  
  59.  
  60. //-----------------------------------
  61. ;break;case 2:
  62. //-----------------------------------
  63.  
  64. // PART TWO
  65.  
  66. /******************************************************************************************
  67.  
  68. this is supposed to display some profile info from the database you have the ID of the user as $uid (the actual ID, without 500000000)
  69. as I don't see any info that can be displayed
  70.  
  71. ******************************************************************************************/
  72.  
  73. //-----------------------------------
  74. ;break;case 3:
  75. //-----------------------------------
  76.  
  77. // PART THREE
  78. // you can import your groups from ACP -> Groups -> click on DELETE AND LINK GROUPS
  79.  
  80. $imp_groups=array();
  81. $imp_groups[1]='Admin';
  82. $imp_groups[2]='Moderator';
  83. $imp_groups[4]='User';
  84. $imp_groups[5]='Banned';
  85.  
  86. //-----------------------------------
  87. ;break; default: $setcase=0;break;}
  88.  
  89. ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  90. <html xmlns="http://www.w3.org/1999/xhtml">
  91. <head>
  92. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  93. <title>Untitled Document</title>
  94. </head>
  95.  
  96. <body>
  97. </body>
  98. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement