© Nomsoftware 'Nomsoft' 2011-2012. All rights reserved. */ $page = new page(); $server = new server(); $account = new account(); ?> <div class="box_right_title"><?php echo $page->titleLink(); ?> » Manage Users</div> <?php if (isset($_GET['char'])) { echo 'Search results for <b>' . $_GET['char'] . '</b><pre>'; $result = mysql_query("SELECT name, id FROM realms"); while ($row = mysql_fetch_assoc($result)) { $server->connectToRealmDB($row['id']); $get = mysql_query("SELECT account,name FROM characters WHERE name='" . mysql_real_escape_string($_GET['char']) . "' OR guid='" . (int) $_GET['char'] . "'"); $rows = mysql_fetch_assoc($get); echo '<a href="?p=users&s=manage&user='******'account'] . '">' . $rows['name'] . ' - ' . $row['name'] . '</a><br/>'; } echo '</pre><hr/>'; } if (isset($_GET['user'])) { $server->selectDB('logondb'); $value = mysql_real_escape_string($_GET['user']); $result = mysql_query("SELECT * FROM account WHERE username='******' OR id='" . $value . "'"); if (mysql_num_rows($result) == 0) { echo "<span class='red_text'>No results found!</span>"; } else { $row = mysql_fetch_assoc($result); ?>
| __| | | | | | -_| | |_ -| |_____|_|_|_|___|____/|___|\_/|___| Copyright (C) 2013 EmuDevs <http://www.emudevs.com/> */ $page = new page(); $server = new server(); $account = new account(); $character = new character(); ?> <div class="box_right_title"><?php echo $page->titleLink(); ?> » Manage Character</div> Selected character: <?php echo $account->getCharName($_GET['guid'], $_GET['rid']); $server->connectToRealmDB($_GET['rid']); $usersTotal = mysql_query("SELECT name,race,account,class,level,money,leveltime,totaltime,online,latency,gender FROM characters WHERE guid='" . $_GET['guid'] . "'"); $row = mysql_fetch_assoc($usersTotal); ?> <hr/> <table style="width: 100%;"> <tr> <td>Character Name</td> <td><input type="text" value="<?php echo $row['name']; ?> " class="noremove" id="editchar_name"/></td> </tr> <tr> <td>Account</td> <td><input type="text" value="<?php
mysql_query("INSERT INTO account_access VALUES('" . $guid . "','" . $rank . "','" . $realm . "')"); $server->logThis("Added GM account access for " . ucfirst(strtolower($account->getAccName($guid)))); } ############################### if ($_POST['action'] == 'editChar') { $guid = (int) $_POST['guid']; $rid = (int) $_POST['rid']; $name = mysql_real_escape_string(trim(ucfirst(strtolower($_POST['name'])))); $class = (int) $_POST['class']; $race = (int) $_POST['race']; $gender = (int) $_POST['gender']; $money = (int) $_POST['money']; $accountname = mysql_real_escape_string($_POST['account']); $accountid = $account->getAccID($accountname); if (empty($guid) || empty($rid) || empty($name) || empty($class) || empty($race)) { exit('Error'); } $server->connectToRealmDB($rid); $onl = mysql_query("SELECT COUNT(*) FROM characters WHERE guid='" . $guid . "' AND online=1"); if (mysql_result($onl, 0) > 0) { exit('The character must be online for any change to take effect!'); } mysql_query("UPDATE characters SET name='" . $name . "',class='" . $class . "',race='" . $race . "',gender='" . $gender . "', money='" . $money . "', account='" . $accountid . "'\n\tWHERE guid='" . $guid . "'"); echo 'The character was saved!'; $chk = mysql_query("SELECT COUNT(*) FROM characters WHERE name='" . $name . "'"); if (mysql_result($chk, 0) > 1) { echo '<br/><b>NOTE:</b> It seems like there more than 1 character with this name, this might force them to rename when they log in.'; } $server->logThis("Modified character data for " . $name); } ###############################
public function getCharName($id, $realm_id) { $server = new server(); $server->connectToRealmDB($realm_id); $result = mysql_query("SELECT name FROM characters WHERE guid='" . (int) $id . "'"); if (mysql_num_rows($result) == 0) { return '<i>Unknown</i>'; } else { $row = mysql_fetch_assoc($result); if (empty($row['name'])) { return '<i>Unknown</i>'; } else { return $row['name']; } } }