View file wapforum2/edituserprms.php

File size: 4Kb
<?php
header("Content-type: text/vnd.wap.wml");
print "<?xml version=\"1.0\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""
. " \"http://www.wapforum.org/DTD/wml_1.1.xml\">";

?>
<wml>
<card id="login" title="WAP FORUMS">
<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 "Permissions:<br/>";
                      echo "<select name=\"permsai\">";
                      $forumulistas=mysql_query("SELECT forum FROM permissions 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=\"delperms.php?nick=$nick&amp;pass=$pass\" method=\"post\">";
                      echo "<postfield name=\"permsai\" value=\"\$permsai\"/>";
                      echo "<postfield name=\"useris\" value=\"$useris\"/>";
                      echo "</go>";
                      echo "</anchor>";
                      echo "<br/><br/>";

                       $arglobal=mysql_fetch_array(mysql_query("SELECT forum FROM permissions WHERE name='".$useris."'"));
                       if ($arglobal[0]!=="*") {
                      echo "<select name=\"forumux\">";
                      $forumulistas=mysql_query("SELECT name, id, perms FROM forums");
                      while ($forumelis=mysql_fetch_array($forumulistas))
                           {
                             if ($forumelis[2]=="2") 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=\"addperms.php?nick=$nick&amp;pass=$pass\" method=\"post\">";
                      echo "<postfield name=\"forumux\" value=\"\$forumux\"/>";
                      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 permissions!";
                      echo "<go href=\"addperms.php?nick=$nick&amp;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&amp;pass=$pass\">BACK</a>";
?>
</p>
</card>
</wml>