Experienced Elementalist
- Joined
- Dec 7, 2006
- Messages
- 250
- Reaction score
- 2
This is more sth like a broken release since im needing some help.
when i try to update a user with authority=0 it says character xx not found, when i try it with 255 it just works , same for 9 and 1 :s
Code:
<?php
if ($site == 0)
{
echo'This tool is only for super-admins.';
die();
}
include('./log_maker.php');
parth1tr();
parth1('100%',4,'center');
echo '<font color="black"><h1><strong>Authority Tool</strong></h1></font>';
echo '<u>By HellFire</u>';
parth2();
echo"Auth 0 = GM<br>Auth 1 = Player<br>Auth 255 = Banned<br>Auth 9 = Muted<br>";
parth2tr();
if ($site == 1)
{
if ($security == 1)
if ($_GET['do'] == 'authtool')
{
if ($_SESSION['editOk'] != "canEdit") {
echo "<script>self.location = 'index.php?act=admin&actu=authtool'</script>";
} else {
$_SESSION['editOk'] = "";
}
error_reporting(E_ALL ^ E_NOTICE);
$char = trim($_POST['char']);
$auth = trim($_POST['auth']);
$char = test($char);
$auth = test($auth);
if (empty($char) && empty($auth))
{
parth1tr();
part1('100%',1,1,'center');
echo "U have to fill all fields. <br><a href='$PHP_SELF?act=admin&actu=authtool'>Edit again.</a>";
die();
}
if (!empty($char) && !empty($auth))
{
$msquery="UPDATE USERDATA SET Authority='$auth' WHERE strUserID='$char'";
$msresults=odbc_exec($msconnect,$msquery) or die("Error, check your connection parameters!");
parth1tr();
part1('100%',1,1,'center');
echo "<font color='blue'>Succesfully edited Authority</font>";
echo"<br>";
echo "<font color='green'>Details</font><br>";
echo"<br>";
echo"<br>";
echo "<font color='red'>Character Name:</font> ".$char."";
echo"<br>";
echo "<font color='red'>New Authority:</font> ".$auth."";
echo"</p>";
parth2();
parth2tr();
}else
{
parth1tr();
part1('100%',1,1,'center');
echo "Character <b>".$char."</b> not found. <br><a href='$PHP_SELF?act=admin&actu=authtool'Try Again!</a>";
parth2();
parth2tr();
}
}else
{
$_SESSION['editOk'] = "canEdit";
echo '<td class="alt1"><center><FORM method=post name=regform action=index.php?act=admin&actu=authtool&do=authtool style="margin:0px; padding:0px">
<table width="300px">
<tr>
<td>Character Name:</td>
<td><input type="text" class="input" name="char" value="" maxlength="50" size="20"></td>
<tr>
<td>New Authority:</td>
<td><input type="text" class="input" name="auth" value="" maxlength="50" size="20"></td>
<tr>
</table>
<center><input class="input" type="submit" value="Update!"</center></br></br>
</form>
</center>
</td>
';
}
}
?>
when i try to update a user with authority=0 it says character xx not found, when i try it with 255 it just works , same for 9 and 1 :s