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

$stopwysiwyg = 1;
    $pagetitle = ": "._USERSCONFIG;
    incoh();
    title(_USERSCONFIG);
    amain();
    br('1');
    Max_OpenTable();
    echo "<center><table border='0' cellpadding='2' cellspacing='2'>\n";
    echo "<form action='".$admin_file.".php?op=UsersConfig' method='post'>\n";
    echo "<tr><td align='center' bgcolor='$bgcolor3' colspan='2'><b>"._YA_REGOPTIONS."</b></td></tr>\n";
    echo "<tr><td align='right' bgcolor='$bgcolor2'>"._ACTALLOWREG."</td>\n<td>";
    if ($ya_config['allowuserreg']==0) { $ck1 = " checked"; $ck2 = ""; } else { $ck1 = ""; $ck2 = " checked"; }
    echo "<input type='radio' name='xallowuserreg' value='0'$ck1>"._YES." &nbsp;";
    echo "<input type='radio' name='xallowuserreg' value='1'$ck2>"._NO."</td></tr>\n";
    echo "<tr><td align='right' bgcolor='$bgcolor2'>"._REQUIREADMIN."</td>\n<td>";
    if ($ya_config['requireadmin']==0) { $ck1 = ""; $ck2 = " checked"; } else { $ck1 = " checked"; $ck2 = ""; }
    echo "<input type='radio' name='xrequireadmin' value='1'$ck1>"._YES." &nbsp;";
    echo "<input type='radio' name='xrequireadmin' value='0'$ck2>"._NO."</td></tr>\n";
    echo "<tr><td align='right' bgcolor='$bgcolor2'>"._ACTALLOWDELETE."</td>\n<td>";
    if ($ya_config['allowuserdelete']==0) { $ck1 = ""; $ck2 = " checked"; } else { $ck1 = " checked"; $ck2 = ""; }
    echo "<input type='radio' name='xallowuserdelete' value='1'$ck1>"._YES." &nbsp;";
    echo "<input type='radio' name='xallowuserdelete' value='0'$ck2>"._NO."</td></tr>\n";
    echo "<tr><td align='center' colspan='2'>&nbsp;</td></tr>\n";
    echo "<tr><td align='center' bgcolor='$bgcolor3' colspan='2'><b>"._YA_MAILOPTIONS."</b></td></tr>\n";
    echo "<tr><td align='right' bgcolor='$bgcolor2'>"._SERVERMAIL."</td>\n<td>";
    if ($ya_config['servermail']==0) { $ck1 = " checked"; $ck2 = ""; } else { $ck1 = ""; $ck2 = " checked"; }
    echo "<input type='radio' name='xservermail' value='0'$ck1>"._YES." &nbsp;";
    echo "<input type='radio' name='xservermail' value='1'$ck2>"._NO."</td></tr>\n";
    echo "<tr><td align='right' bgcolor='$bgcolor2'>"._ACTNOTIFYADD."<br />"._YA_SERVERMAILNOTE."</td>\n<td>";
    if ($ya_config['sendaddmail']==0) { $ck1 = ""; $ck2 = " checked"; } else { $ck1 = " checked"; $ck2 = ""; }
    echo "<input type='radio' name='xsendaddmail' value='1'$ck1>"._YES." &nbsp;";
    echo "<input type='radio' name='xsendaddmail' value='0'$ck2>"._NO."</td></tr>\n";
    echo "<tr><td align='right' bgcolor='$bgcolor2'>"._ACTNOTIFYDELETE."<br />"._YA_SERVERMAILNOTE."</td>\n<td>";
    if ($ya_config['senddeletemail']==0) { $ck1 = ""; $ck2 = " checked"; } else { $ck1 = " checked"; $ck2 = ""; }
    echo "<input type='radio' name='xsenddeletemail' value='1'$ck1>"._YES." &nbsp;";
    echo "<input type='radio' name='xsenddeletemail' value='0'$ck2>"._NO."</td></tr>\n";
    echo "<tr><td align='right' bgcolor='$bgcolor2'>"._USEACTIVATE."<br />"._YA_SERVERMAILNOTE."</td>\n<td>";
    if ($ya_config['useactivate']==0) { $ck1 = " checked"; $ck2 = ""; } else { $ck1 = ""; $ck2 = " checked"; }
    echo "<input type='radio' name='xuseactivate' value='0'$ck1>"._YES." &nbsp;";
    echo "<input type='radio' name='xuseactivate' value='1'$ck2>"._NO."</td></tr>\n";
    echo "<tr><td align='right' bgcolor='$bgcolor2'>"._ACTALLOWMAIL."</td>\n<td>";
    if ($ya_config['allowmailchange']==0) { $ck1 = " checked"; $ck2 = ""; } else { $ck1 = ""; $ck2 = " checked"; }
    echo "<input type='radio' name='xallowmailchange' value='0'$ck1>"._YES." &nbsp;";
    echo "<input type='radio' name='xallowmailchange' value='1'$ck2>"._NO."</td></tr>\n";
    echo "<tr><td align='right' bgcolor='$bgcolor2'>"._EMAILVALIDATE."<br />"._YA_SERVERMAILNOTE."</td>\n<td>";
    if ($ya_config['emailvalidate']==0) { $ck1 = " checked"; $ck2 = ""; } else { $ck1 = ""; $ck2 = " checked"; }
    echo "<input type='radio' name='xemailvalidate' value='0'$ck1>"._YES." &nbsp;";
    echo "<input type='radio' name='xemailvalidate' value='1'$ck2>"._NO."</td></tr>\n";
    echo "<tr><td align='center' colspan='2'>&nbsp;</td></tr>\n";
    echo "<tr><td align='center' bgcolor='$bgcolor3' colspan='2'><b>"._YA_GRAPOPTIONS."</b></td></tr>\n";
    echo "<tr><td align='right' bgcolor='$bgcolor2'>"._ACTALLOWTHEME."</td>\n<td>";
    if ($ya_config['allowusertheme']==1) { $ck1 = " checked"; $ck2 = ""; } else { $ck1 = ""; $ck2 = " checked"; }
    echo "<input type='radio' name='xallowusertheme' value='1'$ck1>"._YES." &nbsp;";
    echo "<input type='radio' name='xallowusertheme' value='0'$ck2>"._NO."</td></tr>\n";
    echo "<tr><td align='right' bgcolor='$bgcolor2' valign='top'>"._USEGFXCHECK."</td>\n<td>";
    if (extension_loaded("gd")) {
        $ck0 = $ck1 = $ck2 = $ck3 = "";
        if ($ya_config['usegfxcheck']==0) { $ck0 = " checked"; } elseif ($ya_config['usegfxcheck']==1) { $ck1 = " checked"; } elseif ($ya_config['usegfxcheck']==2) { $ck2 = " checked"; } elseif ($ya_config['usegfxcheck']==3) { $ck3 = " checked"; }
        echo "<input type='radio' name='xusegfxcheck' value='0'$ck0>"._YA_NC."<br />\n";
        echo "<input type='radio' name='xusegfxcheck' value='1'$ck1>"._YA_RC."<br />\n";
        echo "<input type='radio' name='xusegfxcheck' value='2'$ck2>"._YA_LC."<br />\n";
        echo "<input type='radio' name='xusegfxcheck' value='3'$ck3>"._YA_CA."";
    } else {
        echo "<input type='hidden' name='xusegfxcheck' value='0'>"._YA_GD."";
    }
    echo "</td></tr>\n";
    echo "<tr><td align='center' colspan='2'>&nbsp;</td></tr>\n";
    echo "<tr><td align='center' bgcolor='$bgcolor3' colspan='2'><b>"._YA_EXPOPTIONS."</b></td></tr>\n";
    echo "<tr><td align='right' bgcolor='$bgcolor2' valign='top'>"._AUTOSUSPEND."</td><td><select name='xautosuspend'>\n";
    echo "<option value='0'";
    if ($ya_config['autosuspend'] == 0) { echo " selected"; }
    echo ">0 "._YA_NONEXPIRE."</option>\n";
    $i = 1;
    while ($i <= 52) {
        $k = $i * 604800;
        echo "<option value='$k'";
        if ($ya_config['autosuspend'] == $k) { echo " selected"; }
        echo">$i ";
        if ($i == 1) { echo _YA_WEEK; } else { echo _YA_WEEKS; }
        echo "</option>\n";
        $i++;
    }
    echo "</select><br />("._AUTOSUSNOTE.")</td></tr>\n";
    echo "<tr><td align='right' bgcolor='$bgcolor2' valign='top'>"._YA_EXPIRING."</td><td><select name='xexpiring'>\n";
    echo "<option value='0'";
    if ($ya_config['expiring'] == 0) { echo " selected"; }
    echo ">0 "._YA_NONEXPIRE."</option>\n";
    $i = 1;
    while ($i <= 30) {
        $k = $i * 86400;
        echo "<option value='$k'";
        if ($ya_config['expiring'] == $k) { echo " selected"; }
        echo">$i ";
        if ($i == 1) { echo _YA_DAY; } else { echo _YA_DAYS; }
        echo "</option>\n";
        $i++;
    }
echo "</select><br />("._YA_EXPIRINGNOTE.")</td></tr>\n";
echo "<tr><td align='right' bgcolor='$bgcolor2' valign='top'>"._YA_COOKIEEXPIRING."</td><td><select name='xtemp_cookie'>\n";

if ($ya_config['temp_cookie']==0) { $selcook0 = " selected"; }
elseif ($ya_config['temp_cookie']==3600) { $selcook1 = " selected"; }
elseif ($ya_config['temp_cookie']==21600) { $selcook2 = " selected"; }
elseif ($ya_config['temp_cookie']==43200) { $selcook3 = " selected"; }
elseif ($ya_config['temp_cookie']==86400) { $selcook4 = " selected"; }
elseif ($ya_config['temp_cookie']==172800) { $selcook5 = " selected"; }
elseif ($ya_config['temp_cookie']==259200) { $selcook6 = " selected"; }
elseif ($ya_config['temp_cookie']==345600) { $selcook7 = " selected"; }
elseif ($ya_config['temp_cookie']==432000) { $selcook8 = " selected"; }
elseif ($ya_config['temp_cookie']==518400) { $selcook9 = " selected"; }
elseif ($ya_config['temp_cookie']==604800) { $selcook10 = " selected"; }
elseif ($ya_config['temp_cookie']==1209600) { $selcook11 = " selected"; }
elseif ($ya_config['temp_cookie']==1814400) { $selcook12 = " selected"; }
elseif ($ya_config['temp_cookie']==2592000) { $selcook13 = " selected"; }
elseif ($ya_config['temp_cookie']==5184000) { $selcook14 = " selected"; }
elseif ($ya_config['temp_cookie']==7776000) { $selcook15 = " selected"; }
elseif ($ya_config['temp_cookie']==10368000) { $selcook16 = " selected"; }
elseif ($ya_config['temp_cookie']==12960000) { $selcook17 = " selected"; }
elseif ($ya_config['temp_cookie']==15552000) { $selcook18 = " selected"; }
elseif ($ya_config['temp_cookie']==18144000) { $selcook19 = " selected"; }
elseif ($ya_config['temp_cookie']==20736000) { $selcook20 = " selected"; }
elseif ($ya_config['temp_cookie']==23328000) { $selcook21 = " selected"; }
elseif ($ya_config['temp_cookie']==25920000) { $selcook22 = " selected"; }
elseif ($ya_config['temp_cookie']==28512000) { $selcook23 = " selected"; }
elseif ($ya_config['temp_cookie']==31104000) { $selcook24 = " selected"; }

echo "<option value='0' $selcook0>1 "._YA_SESSION."</option>\n";
echo "<option value='3600' $selcook1>1 "._YA_HOUR."</option>\n";
echo "<option value='21600' $selcook2>6 "._YA_HOURS."</option>\n";
echo "<option value='43200' $selcook3>12 "._YA_HOURS."</option>\n";
echo "<option value='86400' $selcook4>1 "._YA_DAY."</option>\n";
echo "<option value='172800' $selcook5>2 "._YA_DAYS."</option>\n";
echo "<option value='259200' $selcook6>3 "._YA_DAYS."</option>\n";
echo "<option value='345600' $selcook7>4 "._YA_DAYS."</option>\n";
echo "<option value='432000' $selcook8>5 "._YA_DAYS."</option>\n";
echo "<option value='518400' $selcook9>6 "._YA_DAYS."</option>\n";
echo "<option value='604800' $selcook10>1 "._YA_WEEK."</option>\n";
echo "<option value='1209600' $selcook11>2 "._YA_WEEKS."</option>\n";
echo "<option value='1814400' $selcook12>3 "._YA_WEEKS."</option>\n";
echo "<option value='2592000' $selcook13>1 "._YA_MONTH."</option>\n";
echo "<option value='5184000' $selcook14>2 "._YA_MONTH."</option>\n";
echo "<option value='7776000' $selcook15>3 "._YA_MONTH."</option>\n";
echo "<option value='10368000' $selcook16>4 "._YA_MONTH."</option>\n";
echo "<option value='12960000' $selcook17>5 "._YA_MONTH."</option>\n";
echo "<option value='15552000' $selcook18>6 "._YA_MONTH."</option>\n";
echo "<option value='18144000' $selcook19>7 "._YA_MONTH."</option>\n";
echo "<option value='20736000' $selcook20>8 "._YA_MONTH."</option>\n";
echo "<option value='23328000' $selcook21>9 "._YA_MONTH."</option>\n";
echo "<option value='25920000' $selcook22>10 "._YA_MONTH."</option>\n";
echo "<option value='28512000' $selcook23>11 "._YA_MONTH."</option>\n";
echo "<option value='31104000' $selcook24>1 "._YA_YEAR."</option>\n";


    echo "</select><br />("._YA_EXPIRINGCOOKIENOTE.")</td></tr>\n";

    echo "<tr><td align='right' bgcolor='$bgcolor2'>"._YA_ACTALLOWLOGOUT."</td>\n<td>";
    if ($ya_config['allowlogout']==0) { $ck1 = " checked"; $ck2 = ""; } else { $ck1 = ""; $ck2 = " checked"; }
    echo "<input type='radio' name='xallowlogout' value='0'$ck1>"._YES." &nbsp;";
    echo "<input type='radio' name='xallowlogout' value='1'$ck2>"._NO."</td></tr>\n";

    echo "<tr><td align='center' colspan='2'>&nbsp;</td></tr>\n";
    echo "<tr><td align='center' bgcolor='$bgcolor3' colspan='2'><b>"._YA_LMTOPTIONS."</b></td></tr>\n";
    echo "<tr><td align='right' bgcolor='$bgcolor2' valign='top'>"._YA_PERPAGE."</td><td><select name='xperpage'>\n";
    $i = 1;
    while ($i <= 10) {
        $k = $i * 50;
        echo "<option value='$k'";
        if ($ya_config['perpage'] == $k) { echo " selected"; }


        echo">$k "._YA_USERS."</option>\n";




        $i++;
    }
    echo "</select><br />("._YA_PERPAGENOTE.")</td></tr>\n";
    echo "<tr><td align='right' bgcolor='$bgcolor2' valign='top'>"._YA_BADNICK.":</td><td><textarea name='xbad_nick' rows='5' cols='40'>".$ya_config['bad_nick']."</textarea><br />"._YA_1PERLINE."</td><td>\n";
    echo "<tr><td align='right' bgcolor='$bgcolor2' valign='top'>"._YA_BADMAIL.":</td><td><textarea name='xbad_mail' rows='5' cols='40'>".$ya_config['bad_mail']."</textarea><br />"._YA_1PERLINE."</td><td>\n";
    echo "<tr><td align='right' bgcolor='$bgcolor2' valign='top'>"._YA_BADIP.":</td><td><textarea name='xbad_ip' rows='5' cols='40'>".$ya_config['bad_ip']."</textarea><br />"._YA_1PERLINE."</td><td>\n";
    echo "<tr><td align='right' bgcolor='$bgcolor2' valign='top'>"._YA_NICKMIN.":</td><td><select name='xnick_min'>\n";
    for ($i = 3; $i <= 24; $i++) {
        echo "<option value='$i'";
        if ($ya_config['nick_min'] == $i) { echo " selected"; }
        echo">$i "._YA_CHARS."</option>\n";
    }
    echo "</select></td></tr>\n";
    echo "<tr><td align='right' bgcolor='$bgcolor2' valign='top'>"._YA_NICKMAX.":</td><td><select name='xnick_max'>\n";
    for ($i = 4; $i <= 25; $i++) {
        echo "<option value='$i'";
        if ($ya_config['nick_max'] == $i) { echo " selected"; }
        echo">$i "._YA_CHARS."</option>\n";
    }
    echo "</select></td></tr>\n";
    echo "<tr><td align='right' bgcolor='$bgcolor2' valign='top'>"._YA_PASSMIN.":</td><td><select name='xpass_min'>\n";
    for ($i = 3; $i <= 24; $i++) {
        echo "<option value='$i'";
        if ($ya_config['pass_min'] == $i) { echo " selected"; }
        echo">$i "._YA_CHARS."</option>\n";
    }
    echo "</select></td></tr>\n";
    echo "<tr><td align='right' bgcolor='$bgcolor2' valign='top'>"._YA_PASSMAX.":</td><td><select name='xpass_max'>\n";
    for ($i = 4; $i <= 25; $i++) {
        echo "<option value='$i'";
        if ($ya_config['pass_max'] == $i) { echo " selected"; }
        echo">$i "._YA_CHARS."</option>\n";
    }

    echo "</select></td></tr>\n";
    echo "<input type='hidden' name='op' value='UsersConfigSave'>";
    echo "<tr><td align='center' colspan='2'>&nbsp;</td></tr>\n";
    echo "<tr><td align='center' colspan='2'><input type='submit' value='"._SAVECHANGES."'></td></tr>";
    echo "</form></table></center>";
    Max_CloseTable();
    incof();

}