Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*=========================================================
- | HabbluxCMS - Habbo Retro Content Management System
- | #########################################################
- | Housekeeping developed by Bill Gilson
- | Visit habblux.net
- | #########################################################
- | Developed with stability & security in mind and uses
- | Phoenix Emulator 3.0 database
- | #########################################################
- \=========================================================*/
- $auth->updateLocation($_SERVER['REQUEST_URI']);
- if(!$auth->permission("hk.users_information"))
- {
- $nopage = 1;
- $auth->logAction("NONE","account_information","Access denied");
- }
- else
- {
- $username = filter($_GET['username']);
- $userid = $users->userData($username,'id');
- if(isset($_GET['username']))
- {
- if($userid == NULL)
- {
- $error = "User not found";
- }
- else if($rankVerify['rank'] > $users->userData($_SESSION['hk_user'],'rank'))
- {
- $error = "User info not permitted";
- $auth->logAction($userid,"account_information","User info not permitted");
- }
- if($error)
- {
- ?>
- <div class="page-header">
- <div class="styled_title"><h1>Account Information</h1></div>
- </div>
- <div class="well">
- <div class="textcenter">
- <form method="get" class="form-stacked">
- <fieldset>
- <input type="hidden" name="account_information">
- <input class="bigfield" name="username" type="text" value="User not found" onfocus="this.value=(this.value=='<?php echo $error; ?>') ? '' : this.value;" onblur="this.value=(this.value=='') ? '<?php echo $error; ?>' : this.value;"/>
- <input type="submit" class="btn large primary" value="Go" />
- </fieldset>
- </form>
- </div>
- </div>
- <?php
- }
- if(isset($_POST['update']))
- {
- $updateemail = filter($_POST['email']);
- $updaterank = filter($_POST['rank']);
- $updatecredits = filter($_POST['credits']);
- $updatemotto = filter($_POST['motto']);
- $updatevip = filter($_POST['vip']);
- $updatebirthday = filter($_POST['birthday']);
- if(!is_numeric($updatecredits))
- {
- echo("<div class='alert-message failure'><p>Error, credits must be numberic!</p></div>");
- }
- else
- {
- mysql_query("UPDATE `users` SET `mail` = '".$updateemail."' , `rank` = '".$updaterank."' , `credits` = '".$updatecredits."' , `motto` = '".$updatemotto."' , `vip` = '".$updatevip."' , `birthday` = '".$updatebirthday."' WHERE `id` = '".$userid."'") or die($core->systemError("Update User","Updating of the user failed, most probable cause would be that the username doesnt exist."));
- $auth->logAction($userid,'account_information','User info updated');
- $server->serverMUS('updatemotto',$userid);
- $server->serverMUS('updatecredits',$userid);
- echo("<div class='alert-message success'><p>Changes Saved Successfully!</p></div>");
- }
- }
- if(isset($_POST['updatestats']))
- {
- $updaterespectpoints = filter($_POST['respectpoints']);
- $updatepetpoints = filter($_POST['petpoints']);
- if(!is_numeric($updaterespectpoints) || !is_numeric($updatepetpoints))
- {
- echo("<div class='alert-message failure'><p>Error, values must be numberic!</p></div>");
- }
- else
- {
- mysql_query("UPDATE `user_stats` SET `DailyRespectPoints` = '".$updaterespectpoints."' , `DailyPetRespectPoints` = '".$updatepetpoints."' WHERE `id` = '".$userid."'") or die(mysql_error());
- $auth->logAction($userid,'account_information','User info [stats] updated');
- echo("<div class='alert-message success'><p>Changes Saved Successfully!</p></div>");
- }
- }
- if(isset($_POST['ban']))
- {
- $ban_reason = filter($_POST['ban_reason']);
- $ban_length = filter($_POST['ban_length']);
- if($ban_reason == NULL || $ban_length == NULL)
- {
- echo("<div class='alert-message failure'><p>Error, you missed something!</p></div>");
- }
- else
- {
- $users->banUser('user',$username,$ban_reason,$ban_length);
- $auth->logAction($userid,'account_information','User banned, reason: ".$ban_reason."');
- echo("<div class='alert-message success'><p>User Banned</p></div>");
- }
- }
- // Tab 1 - User info;
- $auth->logAction($userid,'account_information','User info accessed');
- ?>
- <div id="tabs">
- <ul class="tabs">
- <li class="active">
- <a href="#tab1">Details</a>
- </li>
- <?php
- if($auth->permission("hk.users_update"))
- {
- echo("<li><a href='#tab2'>Edit Details</a></li>");
- echo("<li><a href='#tab3'>Edit Stats</a></li>");
- echo("<li><a href='#tab4'>Password Reset</a></li>");
- }
- if($auth->permission("hk.users_ban"))
- {
- echo("<li><a href='#tab5'>Ban</a></li>");
- }
- ?>
- </li>
- </ul>
- </div>
- <div id="tab1" class="tab_content">
- <div class="row">
- <div class="col30">
- <div class="internalpadding">
- <div class="styled_title">
- <h2><?php echo $users->userDatabyID($userid,"username"); ?> (# <?php echo $userid; ?>)</h2>
- </div>
- <p>Rank: <b><font color="red"><?php echo $users->rankName($users->userDatabyID($userid,"rank")); ?></font></b></p>
- <p>Real Name: <b><?php echo $users->userDatabyID($userid,"real_name"); ?></b></p>
- <p>Credits: <b><?php echo $users->userDatabyID($userid,"credits"); ?></b></p>
- <p>Email: <b><?php echo $users->userDatabyID($userid,"mail"); ?></b></p>
- <p>Motto: <b><?php echo $users->userDatabyID($userid,"motto"); ?></b></p>
- <p>Registration Date:<br /><b><?php echo date("F d, Y, G:i",$users->userDatabyID($userid,"account_created")); ?></b></p>
- <p>Registration IP:<br /><b><?php echo $users->userDatabyID($userid,"ip_reg"); ?></b></p>
- <p>Last Login:<br /><b><?php echo date("F d, Y, G:i",$users->userDatabyID($userid,"last_online")); ?></b></p>
- <p>Last IP:<br /><b><?php echo $users->userDatabyID($userid,"ip_last"); ?></b></p>
- </div>
- </div>
- <div class="col70">
- <p><h4>User Reports</h4></p>
- <div class="internalpadding">
- <table>
- <thead>
- <tr>
- <th>Title</th>
- <th>Date</th>
- </tr>
- </thead>
- <tbody>
- <?php
- $getReports = mysql_query("SELECT * FROM `cms_user_reports` WHERE `user_id` = '".$userid."'") or die(mysql_error());
- if(mysql_num_rows($getReports) == 0)
- {
- echo("<tr><th>There are no reports for this user</th><th></th></tr>");
- }
- else
- {
- while($reports = mysql_fetch_array($getReports))
- {
- $title = $reports['title'];
- $date = date("l F d, Y, G:i",$reports['date']);
- echo("<tr><th>".$title."</th><th>".$date."</th></tr>");
- }
- }
- ?>
- </tbody>
- </table>
- </div>
- </div>
- </div>
- </div>
- <?php
- // Tab 2 - Update user info;
- if($auth->permission("hk.users_update"))
- {
- ?>
- <div id="tab2" class="tab_content">
- <form method="post">
- <fieldset>
- <div class="clearfix">
- <div class="col2half">
- <div class="clearfix">
- <label for="username">Username</label>
- <div class="input">
- <input type="text" name="username" id="username" value="<?php echo $users->userDatabyID($userid,"username"); ?>" readonly />
- </div>
- </div>
- <div class="clearfix">
- <label for="email">Email</label>
- <div class="input">
- <input type="text" name="email" id="email" value="<?php echo $users->userDatabyID($userid,"mail"); ?>" />
- </div>
- </div>
- <div class="clearfix">
- <label for="rank">Rank</label>
- <div class="input">
- <select name="rank">
- <option value="<?php echo $rank; ?>"><?php echo $users->rankName($users->userDatabyID($userid,"rank")); ?></option>
- <?php
- $getRanks = mysql_query("SELECT * FROM `ranks` WHERE `id` != '".$rank."'");
- while($ranks = mysql_fetch_array($getRanks))
- {
- $id = $ranks['id'];
- $name = $users->rankName($id);
- echo("<option value='".$id."'>".$name." (".$id.")</option>");
- }
- ?>
- </select>
- </div>
- </div>
- <div class="clearfix">
- <label for="credits">Credits</label>
- <div class="input">
- <input type="text" name="credits" id="credits" value="<?php echo $users->userDatabyID($userid,"credits"); ?>" />
- </div>
- </div>
- </div>
- <div class="col2half">
- <div class="clearfix">
- <label for="motto">Motto</label>
- <div class="input">
- <input type="text" name="motto" id="motto" value="<?php echo $users->userDatabyID($userid,"motto"); ?>" />
- </div>
- </div>
- <div class="clearfix">
- <label for="vip">VIP</label>
- <div class="input">
- <select name="vip">
- <?php
- if($users->userDatabyID($userid,"vip") == 1)
- {
- echo "<option value='1'>Yes</option>";
- }
- else
- {
- echo "<option value='0'>No</option>";
- }
- if($users->userDatabyID($userid,"vip") == 0)
- {
- echo "<option value='0'>No</option>";
- }
- else
- {
- echo "<option value='1'>Yes</option>";
- }
- ?>
- </select>
- </div>
- </div>
- <div class="clearfix">
- <label for="birthday">Birthday</label>
- <div class="input">
- <input type="text" name="birthday" id="birthday" value="<?php echo $users->userDatabyID($userid,"birthday"); ?>" />
- </div>
- </div>
- </div>
- </div>
- </fieldset>
- <div class="actions">
- <input class="btn primary" type="submit" name="update" value="Save Changes" />
- <input class="btn" type="reset" value="Reset" />
- </div>
- </form>
- </div>
- <?php // Tab 3 - Update Stats; ?>
- <div id="tab3" class="tab_content">
- <form method="post">
- <fieldset>
- <div class="clearfix">
- <div class="col2half">
- <div class="clearfix">
- <label for="username">Respect Recieved</label>
- <div class="input">
- <input type="text" name="respect" id="respect" value="<?php echo $users->userStats($username,'Respect'); ?>" readonly />
- </div>
- </div>
- <div class="clearfix">
- <label for="email">Respect Given</label>
- <div class="input">
- <input type="text" name="respectgiven" id="respectgiven" value="<?php echo $users->userStats($username,'RespectGiven'); ?>" readonly />
- </div>
- </div>
- <div class="clearfix">
- <label for="rank">Gifts Recieved</label>
- <div class="input">
- <input type="text" name="giftsrecieved" id="giftsrecieved" value="<?php echo $users->userStats($username,'GiftsReceived'); ?>" readonly />
- </div>
- </div>
- <div class="clearfix">
- <label for="credits">Gifts Given</label>
- <div class="input">
- <input type="text" name="giftsgiven" id="giftsgiven" value="<?php echo $users->userStats($username,'GiftsGiven'); ?>" readonly />
- </div>
- </div>
- </div>
- <div class="col2half">
- <div class="clearfix">
- <label for="motto">Respect Points</label>
- <div class="input">
- <input type="text" name="respectpoints" id="respectpoints" value="<?php echo $users->userStats($username,'DailyRespectPoints'); ?>" />
- </div>
- </div>
- <div class="clearfix">
- <label for="vip">Pet Points</label>
- <div class="input">
- <input type="text" name="petpoints" id="petpoints" value="<?php echo $users->userStats($username,'DailyPetRespectPoints'); ?>" />
- </div>
- </div>
- </div>
- </div>
- </fieldset>
- <div class="actions">
- <input class="btn primary" type="submit" name="updatestats" value="Save Changes" />
- <input class="btn" type="reset" value="Reset" />
- </div>
- </form>
- </div>
- <?php // Tab 4 - Password Reset; ?>
- <div id="tab4" class="tab_content">
- <div class="row">
- <div class="col30">
- <div class="internalpadding">
- <div class="styled_title"><h2>Password Reset</h2></div>
- <p>From here you can reset this users password. The password will be displayed to you and it'll also be sent to the user's email address.</p>
- </div>
- </div>
- <div class="col70">
- <div class="internalpadding">
- <form method="post">
- <fieldset class="onecol">
- <div class="clearfix">
- <label for="password">New Password</label>
- <div class="input">
- <input type="text" name="new_password" id="new_password" value="Coming Soon" readonly />
- </div>
- </div>
- </fieldset>
- <div class="actions">
- <input class="btn primary" type="submit" name="change_password" value="Change Password" />
- </div>
- </form>
- </div>
- </div>
- </div>
- </div>
- <?php
- }
- // Tab 5 - Bans;
- if($auth->permission("hk.users_ban"))
- {
- ?>
- <div id="tab5" class="tab_content">
- <div class="row">
- <div class="col30">
- <div class="internalpadding">
- <div class="styled_title"><h2>Ban</h2></div>
- <p>From here you can ban a user. All bans are logged.</p>
- </div>
- </div>
- <div class="col70">
- <div class="internalpadding">
- <form method="post">
- <fieldset class="onecol">
- <div class="clearfix">
- <label for="ban_reason">Reason</label>
- <div class="input">
- <select name="ban_reasons" onchange="this.form.ban_reason.value=this.form.common.options[this.form.common.selectedIndex].value;this.form.common.selectedIndex=0" width="171px;">
- <option value="">Choose a common message / type own</option>
- <option value="Unacceptable Language / Behaviour">Unacceptable Language / Behaviour</option>
- <option value="Scamming / Tricking Users">Scamming / Tricking Users</option
- <option value="Fraud">Fraud</option>
- <option value="Hacking / Malicious Activites">Hacking / Malicious Activites</option>
- <option value="Harrasment">Harrasment</option>
- <option value="Unwelcome User">Unwelcome User</option>
- </select>
- </div>
- </div>
- <div class="clearfix">
- <div class="input">
- <input type="text" name="ban_reason" id="ban_reason" />
- </div>
- </div>
- <div class="clearfix">
- <label for="password">Length</label>
- <div class="input">
- <select name="ban_length">
- <option value="7200">2 hours</option>
- <option value="14400">4 hours</option>
- <option value="43200">12 hours</option>
- <option value="86400">24 hours</option>
- <option value="172800">2 days</option>
- <option value="259200">3 days</option>
- <option value="604800">1 week</option>
- <option value="1209600">2 weeks</option>
- <option value="1814400">3 weeks</option>
- <option value="2629743.83">1 month</option>
- <option value="5259487.66">2 months</option>
- <option value="31556926">1 year</option>
- <option value="63113851.9">2 years</option>
- <option value="315569259747">Permanent</option>
- </select>
- </div>
- </div>
- </fieldset>
- <div class="actions">
- <input class="btn primary" type="submit" name="ban" value="Ban" />
- </div>
- </form>
- </div>
- </div>
- </div>
- </div>
- <?php
- }
- }
- else
- {
- ?>
- <div class="page-header">
- <div class="styled_title"><h1>Account Information</h1></div>
- </div>
- <div class="well">
- <div class="textcenter">
- <form method="get" class="form-stacked">
- <fieldset>
- <input type="hidden" name="account_information">
- <input class="bigfield" name="username" type="text" value="Type a username" onfocus="this.value=(this.value=='Type a username') ? '' : this.value;" onblur="this.value=(this.value=='') ? 'Type a username' : this.value;"/>
- <input type="submit" class="btn large primary" value="Go" />
- </fieldset>
- </form>
- </div>
- </div>
- <?php
- }
- }
- ?>
Add Comment
Please, Sign In to add comment