<?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 || $auth_user == 1) {


    $pagetitle = ": "._USERADMIN." - "._USERUPDATE;
    incoh();
    title(_USERADMIN." - "._USERUPDATE);
    amain();
    br('1');
    $result = $db->sql_query("select user_id, username, user_email, user_regdate, check_num from ".TABLE_USERS_TEMP." where user_id='$chng_uid' or username='$chng_uid'");
    if($db->sql_numrows($result) > 0) {
     $raw = $db->sql_fetchrow($result);
	$chng_uid = intval($raw['user_id']);
        $chng_uname = stripslashes($raw['username']);
        $chng_email = stripslashes($raw['user_email']);
        $chng_regdate = $raw['user_regdate'];
	$chng_check_num = intval($raw['check_num']);

        Max_OpenTable();
        echo "<center><table border='0'>\n";
        echo "<form action='".$admin_file.".php?op=members' method='post'>\n";
        echo "<tr><td bgcolor='$bgcolor2'>"._USERID.":</td><td><b>$chng_uid</b></td></tr>\n";
        echo "<tr><td bgcolor='$bgcolor2'>"._NICKNAME.":</td><td><input type='text' name='chng_uname' value='$chng_uname'><br /><b>"._YA_CHNGRISK."</b></td></tr>\n";
        echo "<tr><td bgcolor='$bgcolor2'>"._EMAIL.":</td><td><input type='text' name='chng_email' value='$chng_email' size='30' maxlength='60'></td></tr>\n";
        echo "<tr><td bgcolor='$bgcolor2'>"._REGDATE.":</td><td><input type='text' name='chng_regdate' value='$chng_regdate' size='25' maxlength='60'></td></tr>\n";
        echo "<tr><td bgcolor='$bgcolor2'>"._CHECKNUM.":</td><td>$chng_check_num</td></tr>\n";
        echo "<input type='hidden' name='chng_uid' value='$chng_uid'>\n";
        echo "<input type='hidden' name='old_uname' value='$chng_uname'>\n";
        echo "<input type='hidden' name='old_email' value='$chng_email'>\n";
        echo "<input type='hidden' name='op' value='modifyTempConf'>\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='xop' value='$xop'>\n"; }
        echo "<tr><td align='center' colspan='2'><input type='submit' value='"._SAVECHANGES."'></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 "<tr><td align='center'><input type='submit' value='"._CANCEL."'></td></tr>\n";
        echo "</form>\n";
        echo "</table></center>\n";
        Max_CloseTable();
    } else {
        Max_OpenTable();
        echo "<center><b>"._USERNOEXIST."</b></center>\n";
        Max_CloseTable();
    }
    incof();
}