Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Created by PhpStorm.
- * User: x_stormrider
- * Date: 10/18/2016
- * Time: 12:07 AM
- *
- * A skeleton module used to integrate the ScapeRune website with the official server
- *
- */
- //imperative for connection to the database
- require('structure/database.php');
- require('includes/config.php');
- //declare basic vars
- //gets the users actual username
- $username = $user->getUsername($_COOKIE['user'], 2);
- //get the users actual rank
- $rank = $user->getRank($username);
- //get general database information
- $database = new database($db_host, $db_name, $db_user, $db_password);
- //query the databse for users details
- $query = $database->processQuery("SELECT password, acc_status FROM users WHERE username = LIMIT 1", array($_GET['username']), true);
- //retrieve the players username and password from the database
- if (isset($_GET['username']) && isset($_GET['pass'])) {
- $password = hash(sha256, md5(sha1($_GET['pass'])));
- $user_password = substr(substr($query[0]['password'], 54), 0, -3);
- echo ($pass == $user_password) ? '0' : '1';
- } else {
- echo '0';
- }
- //check the users rank status
- // 1 - regular player, 2 - player mod, 3 - forum moderator, 4 - administrator
- if (isset($_GET['username'])) {
- $rights_value = $rank;
- echo $rights_value;
- } else {
- echo '0';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement