File size: 4.14Kb
<?php
header ("Content-type:text/vnd.wap.wml; charset=utf-8");
header("Cache-Control: no-store, no-cache, must-revalidate");
print "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""
. " \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
?>
<wml>
<card id="login" title="BMWap форумы">
<p align="center">
<?php
$nick=$_GET["nick"];
$pass=$_GET["pass"];
$useris=$_POST["useris"];
include("core.php"); //load main functions
include("conf.php"); //load config
echo connect($dbuser,$dbpass,$dbserver,$dbname);
//$name=base64_decode($name);
echo login($nick,$pass);
echo "<br/><br/>";
global $logged;
if ($logged)
{
isadmin($nick,$pass);
global $administrator;
if (!$administrator) echo "You are not allowed to do this!"; else
{
$info=mysql_fetch_array(mysql_query("SELECT name, owntext, email, tlphone FROM users WHERE name='".$useris."'"));
$modas=mysql_fetch_array(mysql_query("SELECT name,forum FROM moderators WHERE name='".$useris."'"));
$permissions=mysql_fetch_array(mysql_query("SELECT name,forum FROM permissions WHERE name='".$useris."'"));
echo "Editing <b>$useris</b><br/><br/>";
echo "Moderators:<br/>";
echo "<select name=\"modai\">";
$forumulistas=mysql_query("SELECT forum FROM moderators WHERE name='".$useris."'");
while ($forumelis=mysql_fetch_array($forumulistas))
{
if ($forumelis[0]!="*") $forumuneimas=mysql_fetch_array(mysql_query("SELECT name FROM forums WHERE id='".$forumelis[0]."'")); else $forumuneimas[0]="*";
echo "<option value=\"$forumelis[0]\">$forumuneimas[0]</option>";
};
echo "</select><br/>";
echo "<anchor title=\"delete\">delete!";
echo "<go href=\"delmod.php?nick=$nick&pass=$pass\" method=\"post\">";
echo "<postfield name=\"modai\" value=\"\$modai\"/>";
echo "<postfield name=\"useris\" value=\"$useris\"/>";
echo "</go>";
echo "</anchor>";
echo "<br/><br/>";
$arglobal=mysql_fetch_array(mysql_query("SELECT forum FROM moderators WHERE name='".$useris."'"));
if ($arglobal[0]!=="*") {
echo "<select name=\"forumux1\">";
$forumulistas=mysql_query("SELECT name, id, perms FROM forums");
while ($forumelis=mysql_fetch_array($forumulistas))
{
echo "<option value=\"$forumelis[1]\">$forumelis[0]</option>";
};
echo "</select><br/>";
// echo "<input name=\"addperm\" format=\"*N\"/><br/>";
echo "<anchor title=\"add\">add!";
echo "<go href=\"addmod.php?nick=$nick&pass=$pass\" method=\"post\">";
echo "<postfield name=\"forumux\" value=\"\$forumux1\"/>";
echo "<postfield name=\"useris\" value=\"$useris\"/>";
echo "</go>";
echo "</anchor>";
echo "<br/>";
// echo "<input name=\"addperm\" format=\"*N\"/><br/>";
echo "<anchor title=\"grantall\">Grant all forums!";
echo "<go href=\"addmod.php?nick=$nick&pass=$pass\" method=\"post\">";
echo "<postfield name=\"forumux\" value=\"*\"/>";
echo "<postfield name=\"useris\" value=\"$useris\"/>";
echo "</go>";
echo "</anchor>"; }
echo "<br/><br/>";
};
};
echo "<a href=\"index.php?nick=$nick&pass=$pass\">BACK</a>";
?>
</p>
</card>
</wml>