<?php
/********************************************************/
/* NSN Your Account                                     */
/* By: NukeScripts Network (webmaster@nukescripts.fr)   */
/* http://www.nukescripts.fr                            */
/* Copyright  2000-2004 by NukeScripts Network         */
/* ==================================================== */
/* Based from:                                          */
/* NSN YAT 320 from www.nukescripts.net                 */
/* Based from:                                          */
/* PHP-NUKE: Web Portal System                          */
/********************************************************/
if (!defined('ADMIN_ALLOW') && !defined('ADMIN_MAX')) {
	die ("Access Denied");
}
global $prefix, $db, $admin_file;
$aid = substr("$aid", 0,25);
$row = $db->sql_fetchrow($db->sql_query("SELECT title, admins FROM ".TABLE_MODULES." WHERE title='Your_Account'"));
$row2 = $db->sql_fetchrow($db->sql_query("SELECT name, radminsuper FROM ".TABLE_AUTHORS." WHERE aid='$aid'"));
$admins = explode(",", $row['admins']);
$auth_user = 0;
for ($i=0; $i < sizeof($admins); $i++) {
    if ($row2['name'] == "$admins[$i]" AND $row['admins'] != "") {
        $auth_user = 1;
    }
}
if ($row2['radminsuper'] == 1 ) {


    $raw = $db->sql_fetchrow($db->sql_query("SELECT username, name, user_email, user_website, user_password FROM ".TABLE_USERS." WHERE user_id='$chng_uid'"));
    $uname = stripslashes($raw['username']);
    $rname = stripslashes($raw['name']);
    $email = stripslashes($raw['user_email']);
    $site = stripslashes($raw['user_website']);
    $upass = stripslashes($raw['user_password']);
    $pagetitle = ": "._USERADMIN." - "._PROMOTEUSER;
    incoh();
    title(_USERADMIN." - "._PROMOTEUSER);
    amain();
    br('1');
    Max_OpenTable();
    echo "<center><table align='center' border='0' cellpadding='2' cellspacing='2'>\n";
    echo "<form action='".$admin_file.".php?op=members' method='post'>\n";
    if (isset($min)) { echo "<input type='hidden' name='min' value='$min'>\n"; }
    if (isset($xop)) { echo "<input type='hidden' name='xop' value='$xop'>\n"; }
    echo "<input type='hidden' name='op' value='promoteUserConf'>\n";
    echo "<tr><td align=center>"._SURE2PROMOTE." <b>$uname<i>($chng_uid)</i></b>?</td></tr>\n";
    echo "<tr><td><table border='0'>";
    echo "<tr><td bgcolor='$bgcolor2'>"._NAME.":</td><td colspan='3'><input type='text' name='add_name' size='30' maxlength='50' value='$rname'> <font class='tiny'>"._REQUIREDNOCHANGE."</font></td></tr>";
    echo "<tr><td bgcolor='$bgcolor2'>"._NICKNAME.":</td><td colspan='3'><input type='text' name='add_aid' size='30' maxlength='30' value='$uname'> <font class='tiny'>"._REQUIRED."</font></td></tr>";
    echo "<tr><td bgcolor='$bgcolor2'>"._EMAIL.":</td><td colspan='3'><input type='text' name='add_email' size='30' maxlength='60' value='$email'> <font class='tiny'>"._REQUIRED."</font></td></tr>";
    echo "<tr><td bgcolor='$bgcolor2'>"._URL.":</td><td colspan='3'><input type='text' name='add_url' size='30' maxlength='60' value='$site'></td></tr>";
    echo "<tr><td bgcolor='$bgcolor2' rowspan='5' valign='top'>"._PERMISSIONS.":</td>";
    echo "<td><input type='checkbox' name='add_radminarticle' value='1'> "._ARTICLES."</td>";
    echo "<td><input type='checkbox' name='add_radmincontent' value='1'> "._CONTENT."</td>";
    echo "<td><input type='checkbox' name='add_radmindownload' value='1'> "._DOWNLOAD."</td>";
    echo "</tr><tr>";
    echo "<td><input type='checkbox' name='add_radminency' value='1'> "._ENCYCLOPEDIA."</td>";
    echo "<td><input type='checkbox' name='add_radminephem' value='1'> "._EPHEMERIDS."</td>";
    echo "<td><input type='checkbox' name='add_radminfaq' value='1'> "._FAQ."</td>";
    echo "</tr><tr>";
    echo "<td><input type='checkbox' name='add_radminforum' value='1'> "._BBFORUM."</td>";
    echo "<td><input type='checkbox' name='add_radminnewsletter' value='1'> "._NEWSLETTER."</td>";
    echo "<td><input type='checkbox' name='add_radminreviews' value='1'> "._REVIEWS."</td>";
    echo "</tr><tr>";
    echo "<td><input type='checkbox' name='add_radminsection' value='1'> "._SECTIONS."</td>";
    echo "<td><input type='checkbox' name='add_radminsurvey' value='1'> "._SURVEYS."</td>";
    echo "<td><input type='checkbox' name='add_radmintopic' value='1'> "._TOPICS."</td>";
    echo "</tr><tr>";
    echo "<td><input type='checkbox' name='add_radminlink' value='1'> "._WEBLINKS."</td>";
    echo "<td>&nbsp;</td>";
    echo "<td>&nbsp;</td>";
    echo "</tr>";
    echo "<input type='hidden' name='add_password' value='$upass'>";
    echo "</table></td></tr>";
    echo "<tr><td align=center><input type='submit' value='"._PROMOTEUSER."'></td><tr>\n";
    echo "</form>\n";
    echo "<form action='".$admin_file.".php?op=members' method='post'>\n";
    if (isset($query)) { echo "<input type='hidden' name='query' value='$query'>\n"; }
    if (isset($min)) { echo "<input type='hidden' name='min' value='$min'>\n"; }
    if (isset($xop)) { echo "<input type='hidden' name='op' value='$xop'>\n"; }
    echo "<input type='hidden' name='chng_uid' value='$chng_uid'>\n";
    echo "<tr><td align='center'><input type='submit' value='"._CANCEL."'></td></tr>\n";
    echo "</form>\n";
    echo "</table></center>\n";
    Max_CloseTable();
    incof();
    }