Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php include("../site-inc/gamengdb.php"); ?>
- <?php
- switch($setcase){case 1:
- //-----------------------------------
- // PART ONE
- // if there's no cookie 'logname' redirect to login and die
- //if(!isset($_COOKIE['logname'])){redirect('nolog.php');die();}
- // if there's no cookie 'privilege' redirect to login and die
- //if(!isset($_COOKIE['privilege'])){redirect('nolog.php');die();}
- // separating ID from NAME
- //$cookie=explode('|',$_COOKIE['logname']);
- $query = "SELECT * FROM `game_data` WHERE (id='$_POST[id]')";
- $result = mysqli_query($connection, $query) or die ("Couldn't get data.");
- $data=mysqli_fetch_array ($result);
- $logname=$data[log_name];
- $id=$data[id];
- $privilege=$data[user_privilege];
- $password=$data[password];
- //echo ("logname=$logname<br>");
- //echo ("id=$id<br>");
- //echo ("privilege=$privilege<br>");
- //echo ("password=$password<br>");
- // check if username exists and at least 3 chars. If not, redirect to login and die
- if(!isset($data[log_name]) || strlen($data[log_name])<3){redirect('nolog.php');die();}
- // assign ID and check if it is a number greater then 0. If not, redirect to login and die
- $member_id=(int)$data[id]; if($member_id<1){redirect('nolog.php');die();}
- // assign USERNAME
- $member_name=$data[log_name];
- // assign PRIVILEGE and make sure it's a number
- $member_privilege=(int)$data[user_privilege];
- // if privilege is 0 and below, or is greater than 5 or 3 (not possible as you mentioned, make it 4)
- if($member_privilege<1 || $member_privilege>5 || $member_privilege==3){$member_privilege=4;}
- /******************************************************************************************
- here you can run some check against the database to make sure that the password matches etc
- ******************************************************************************************/
- // now we have all needed, $user below is an array that blab understands what to do with.
- $user=array();
- $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
- $user['name']=$member_name;
- $user['group']=$member_privilege;
- $pmss=get_permissions($user['group'],0); // permissions, do not touch
- //-----------------------------------
- ;break;case 2:
- //-----------------------------------
- // PART TWO
- /******************************************************************************************
- 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)
- as I don't see any info that can be displayed
- ******************************************************************************************/
- //-----------------------------------
- ;break;case 3:
- //-----------------------------------
- // PART THREE
- // you can import your groups from ACP -> Groups -> click on DELETE AND LINK GROUPS
- $imp_groups=array();
- $imp_groups[1]='Admin';
- $imp_groups[2]='Moderator';
- $imp_groups[4]='User';
- $imp_groups[5]='Banned';
- //-----------------------------------
- ;break; default: $setcase=0;break;}
- ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>Untitled Document</title>
- </head>
- <body>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement