<?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 $admin_file;
$aid = substr("$aid", 0,25);
$row = $GLOBALS['db']->sql_fetchrow($GLOBALS['db']->sql_query("SELECT `title`, `admins` FROM `".TABLE_MODULES."` WHERE `title`='Your_Account'"));
$row2 = $GLOBALS['db']->sql_fetchrow($GLOBALS['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." - "._DETUSER;
    incoh();
    title(""._USERADMIN." - "._DETUSER.": <i>$chng_uid</i>");
    amain();
    br('1');
    $sql = "SELECT * FROM `".TABLE_USERS."` WHERE `user_id`='$chng_uid'";
    if($GLOBALS['db']->sql_numrows($GLOBALS['db']->sql_query($sql)) > 0) {
        $chnginfo = $GLOBALS['db']->sql_fetchrow($GLOBALS['db']->sql_query($sql));
        Max_OpenTable();
        echo "<center><table border='0'>\n";
        echo "<tr><td bgcolor='$bgcolor2'>"._USERID.":</td><td><b>".$chnginfo['user_id']."</b></td></tr>\n";
        echo "<tr><td bgcolor='$bgcolor2'>"._NICKNAME.":</td><td><b>".$chnginfo['username']."</b></td></tr>\n";
        echo "<tr><td bgcolor='$bgcolor2'>"._NAME.":</td><td><b>".$chnginfo['name']."</b></td></tr>\n";
        echo "<tr><td bgcolor='$bgcolor2'>"._URL.":</td><td><b><a href='".$chnginfo['user_website']."' target='_blank'>".$chnginfo['user_website']."</a></b></td></tr>\n";
        echo "<tr><td bgcolor='$bgcolor2'>"._EMAIL.":</td><td><b><a href='mailto:".$chnginfo['user_email']."'>".$chnginfo['user_email']."</a></b></td></tr>\n";
        echo "<tr><td bgcolor='$bgcolor2'>"._REGDATE.":</td><td><b>".$chnginfo['user_regdate']."</b></td></tr>\n";
        echo "<tr><td bgcolor='$bgcolor2'>"._FAKEEMAIL.":</td><td><b>".$chnginfo['femail']."</b></td></tr>\n";
        echo "<tr><td bgcolor='$bgcolor2'>"._ICQ.":</td><td><b>".$chnginfo['user_icq']."</b></td></tr>\n";
        echo "<tr><td bgcolor='$bgcolor2'>"._AIM.":</td><td><b>".$chnginfo['user_aim']."</b></td></tr>\n";
        echo "<tr><td bgcolor='$bgcolor2'>"._YIM.":</td><td><b>".$chnginfo['user_yim']."</b></td></tr>\n";
        echo "<tr><td bgcolor='$bgcolor2'>"._MSNM.":</td><td><b>".$chnginfo['user_msnm']."</b></td></tr>\n";
        echo "<tr><td bgcolor='$bgcolor2'>"._LOCATION.":</td><td><b>".$chnginfo['user_from']."</b></td></tr>\n";
        echo "<tr><td bgcolor='$bgcolor2'>"._OCCUPATION.":</td><td><b>".$chnginfo['user_occ']."</b></td></tr>\n";
        echo "<tr><td bgcolor='$bgcolor2'>"._INTERESTS.":</td><td><b>".$chnginfo['user_intrests']."</b></td></tr>\n";
        if ($chnginfo['user_viewemail'] ==1) { $cuv = _YES; } else { $cuv = _NO; }
        echo "<tr><td bgcolor='$bgcolor2'> "._SHOWMAIL.":</td><td><b>$cuv</b></td></tr>\n";
        if ($chnginfo['newsletter'] == 1) { $cnl = _YES; } else { $cnl = _NO; }
        echo "<tr><td bgcolor='$bgcolor2'>"._NEWSLETTER.":</td><td><b>$cnl</b></td></tr>\n";
        $chnginfo[user_sig] = ereg_replace("\r\n", "<br />", $chnginfo[user_sig]);
        echo "<tr><td bgcolor='$bgcolor2' valign='top'>"._SIGNATURE.":</td><td><b><xmp>".$chnginfo['user_sig']."</xmp></b></td></tr>\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='op' value='$xop'>\n"; }
        echo "<input type='hidden' name='op' value='modifyUser'>\n";
        echo "<input type='hidden' name='chng_uid' value='".$chnginfo['user_id']."'>\n";
        echo "<tr><td align='center' colspan='2'><input type='submit' value='"._MODIFY."'></td></tr>\n";
        echo "</form>\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='op' value='$xop'>\n"; }
        echo "<tr><td align='center' colspan='2'><input type='submit' value='"._RETURN."'></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();

}