<?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) {


    $tmp_nick = explode("\r\n",$xbad_nick);
    rsort($tmp_nick);
    for ($i=count($tmp_nick)-1; $i > -1; $i--) {
        if ($tmp_nick[$i] == "") { array_pop($tmp_nick); }
    }
    sort($tmp_nick);
    $xbad_nick = implode("\r\n",$tmp_nick);
    $tmp_mail = explode("\r\n",$xbad_mail);
    rsort($tmp_mail);
    for ($i=count($tmp_mail)-1; $i > -1; $i--) {
        if ($tmp_mail[$i] == "") { array_pop($tmp_mail); }
    }
    sort($tmp_mail);
    $xbad_mail = implode("\r\n",$tmp_mail);
    ya_save_config('sendaddmail', $xsendaddmail);
    ya_save_config('allowuserdelete', $xallowuserdelete);
    ya_save_config('senddeletemail', $xsenddeletemail);
    ya_save_config('allowusertheme', $xallowusertheme);
    ya_save_config('allowuserreg', $xallowuserreg);
    ya_save_config('allowmailchange', $xallowmailchange);
    ya_save_config('emailvalidate', $xemailvalidate);
    ya_save_config('requireadmin', $xrequireadmin);
    ya_save_config('servermail', $xservermail);
    ya_save_config('useactivate', $xuseactivate);
    ya_save_config('usegfxcheck', $xusegfxcheck);
    ya_save_config('autosuspend', $xautosuspend);
    ya_save_config('perpage', $xperpage);
    ya_save_config('expiring', $xexpiring);
    ya_save_config('bad_nick', $xbad_nick);
    ya_save_config('bad_mail', $xbad_mail);
    ya_save_config('bad_ip', $xbad_ip);
    ya_save_config('nick_min', $xnick_min);
    ya_save_config('nick_max', $xnick_max);
    ya_save_config('pass_min', $xpass_min);
    ya_save_config('pass_max', $xpass_max);
    ya_save_config('temp_cookie', $xtemp_cookie);
    ya_save_config('allowlogout', $xallowlogout);
    redirect_url("".$admin_file.".php?op=UsersConfig");

}