Location: PHPKode > projects > raSMP > rasmp/admin/settings.php
<?php

/*******************************************************************

 Name		: raSMP 2.0
 Copyright	: 2002, Adam Alkins
 Website	: http://www.rasmp.com
 email		: hide@address.com

 $Id: settings.php,v 1.7 2003/03/16 18:26:44 rasadam Exp $: 

*******************************************************************/

/*******************************************************************

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the 
Free Software Foundation Inc., 59 Temple Place, Suite 330,
Boston, MA  02111-1307  USA

*******************************************************************/

/*

Site Settings

*/

define('RASMP',true);
define('RASMP_ADMIN',true);
define('SCRIPT_PATH','../');
include SCRIPT_PATH.'common/extension.inc';
include SCRIPT_PATH.'common/admin_common.'.FILE_EXT;

// Check authentication
check_auth('settings');

global $config;

function do_header($title)
{
  	display_header($title);
	display_menu();
	display_body();
}

function display_menu()
{
?>

<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td bgcolor="#0066CC">
      <div align="center"><font color="#FFFFFF"><strong>Site Settings</strong></font></div>
    </td>
  </tr>
</table>

<?php

}

if(!isset($_POST['dosave']))
{
	if(isset($_GET['site_name']))
	{
		$site_name = urldecode($_GET['site_name']);
	}
	else
	{
		$site_name = stripslashes($config['site_name']);
	}
	
	if(isset($_GET['site_webmaster']))
	{
		$site_webmaster = urldecode($_GET['site_webmaster']);
	}
	else
	{
		$site_webmaster = $config['site_webmaster'];
	}
	
	if(isset($_GET['cookie_domain']))
	{
		$cookie_domain = urldecode($_GET['cookie_domain']);
	}
	else
	{
		$cookie_domain = $config['cookie_domain'];
	}

	if(isset($_GET['cookie_name']))
	{
		$cookie_name = urldecode($_GET['cookie_name']);
	}
	else
	{
		$cookie_name = $config['cookie_name'];
	}
	
	if(isset($_GET['cookie_path']))
	{
		$cookie_path = urldecode($_GET['cookie_path']);
	}
	else
	{
		$cookie_path = $config['cookie_path'];
	}
	
	if(isset($_GET['cookie_time']))
	{
		$cookie_time = urldecode($_GET['cookie_time']);
	}
	else
	{
		$cookie_time = $config['cookie_time'];
	}

	if(isset($_GET['online_timeout']))
	{
		$online_timeout = urldecode($_GET['online_timeout']);
	}
	else
	{
		$online_timeout = $config['online_timeout'];
	}

	if(isset($_GET['ip_security']))
	{
		$ip_security = urldecode($_GET['ip_security']);
	}
	else
	{
		$ip_security = $config['ip_security'];
	}
	
	if(isset($_GET['disabled_message']))
	{
		$disabled_message = urldecode($_GET['disabled_message']);
	}
	else
	{
		$disabled_message = stripslashes($config['disabled_message']);
	}

	if(isset($_GET['site_disabled']))
	{
		$site_disabled = urldecode($_GET['site_disabled']);
	}
	else
	{
		$site_disabled = $config['site_disabled'];
	}

	if(isset($_GET['page_not_exist']))
	{
		$page_not_exist = urldecode($_GET['page_not_exist']);
	}
	else
	{
		$page_not_exist = stripslashes($config['page_not_exist']);
	}

	if(isset($_GET['banned_message']))
	{
		$banned_message = urldecode($_GET['banned_message']);
	}
	else
	{
		$banned_message = stripslashes($config['banned_message']);
	}
	
	do_header("Admin Panel >> Site Settings");
?>
<div align="center">
  <p><strong><font color="#0066CC" size="6">Site Settings</font></strong></p>
  <p align="left">Below you can change some basic configuration values for your 
    site. Please read the explanations carefully before changing any values.</p>
  <form name="sitesettings" id="sitesettings" method="post" action="<?php echo attach_sid("settings.".FILE_EXT); ?>">
    <div align="left">
      <p><font size="4"><strong>Site name:</strong></font>&nbsp;&nbsp; 
        <input name="site_name" type="text" id="site_name" size="50" maxlength="255" value="<?php echo $site_name; ?>" />
      </p>
      <p><font size="4"><strong>Webmaster Email:</strong></font>&nbsp;&nbsp; 
        <input name="site_webmaster" type="text" id="site_webmaster" size="40" maxlength="255" value="<?php echo $site_webmaster; ?>" />
      </p>
      <p><font size="4"><strong>Cookie Domain:</strong></font>&nbsp;&nbsp; 
        <input name="cookie_domain" type="text" id="cookie_domain" size="40" maxlength="255" value="<?php echo $cookie_domain; ?>" />
        <br />
        &nbsp;&nbsp;&nbsp;The cookie domain should match the domain of your website. 
        A cookie domain should contain two dots to work properly with all browsers, 
        e.g. &quot;www.rasmp.com&quot; OR be blank.</p>
      <p><font size="4"><strong>Cookie Name:</strong></font>&nbsp;&nbsp; 
        <input name="cookie_name" type="text" id="cookie_name" size="25" maxlength="255" value="<?php echo $cookie_name; ?>" />
        <br />
        &nbsp;&nbsp;&nbsp;The cookie name should contain letters, numbers and 
        underscores only. No spaces. If you have multiple raSMP's running on your 
        site, it is suggested you use different cookie name for each to avoid 
        possible conflicts.</p>
      <p><font size="4"><strong>Cookie Path:</strong></font>&nbsp;&nbsp; 
        <input name="cookie_path" type="text" id="cookie_path" size="20" maxlength="255" value="<?php echo $cookie_path; ?>" />
        <br />
        &nbsp;&nbsp;&nbsp;This is the directory on your domain where you want 
        your cookie to be valid. &quot;/' means all directories can access the 
        cookie data. If changing this value, make sure the raSMP root directory 
        has access to the cookie.</p>
      <p><font size="4"><strong>Cookie Time:</strong></font>&nbsp;&nbsp; 
        <input name="cookie_time" type="text" id="cookie_time" size="10" maxlength="20" value="<?php echo $cookie_time; ?>" />
        <br />
        &nbsp;&nbsp;&nbsp;This is the amount of time a cookie will be valid for. 
        Time is in seconds. The suggested value is 86400 seconds, which is one 
        day.</p>
      <p><font size="4"><strong>Activity Timeout:</strong></font>&nbsp;&nbsp; 
        <input name="online_timeout" type="text" id="online_timeout" size="10" maxlength="20" value="<?php echo $online_timeout; ?>" />
        <br />
        &nbsp;&nbsp;&nbsp;This is the amount of seconds an account is flagged 
        as Online in the Account Management &quot;Online Accounts&quot; area. 
        Value is in seconds.</p>
      <p><font size="4"><strong>Login Security Level:</strong></font>&nbsp;&nbsp; 
        <input name="ip_security" type="text" id="ip_security" size="1" maxlength="1" value="<?php echo $ip_security; ?>" />
        <br />
        &nbsp;&nbsp;&nbsp;This is the level of security used to validate a session 
		for Administration Access. To track whether someone is logged in or not, 
		raSMP uses a session system, and matches a session to an IP. You can specify 
		how much leeway you give users with their IP, because you may want users to 
		remain logged in even if their IP address changes. raSMP supports 5 levels of 
		security, enter the corresponding number in the box to use that level (0 - 4).<br />
		4 (<strong>Safest</strong>) - The IP address must match exactly (If IP changes, they 
		must re-login.)<br />
		3 - IP address can be matched in the last quad (0.0.0.XXX)<br />
		2 - IP address can be matched in the last two quads (0.0.XXX.XXX)<br />
		1 - IP address can be matched in the last three quads (0.XXX.XXX.XXX)<br />
		0 - IP address does not need to match at all.</p>
      <p><font size="4"><strong>Disbaled Message:</strong></font>&nbsp;&nbsp; 
        <input name="disabled_message" type="text" id="disabled_message" size="40" maxlength="255" value="<?php echo $disabled_message; ?>" />
        <br />
        &nbsp;&nbsp;&nbsp;This message will be displayed if you Disable the site, 
		which you can below</p>
		<p><font size="4"><strong>Disable Site?</strong></font>&nbsp;&nbsp;
		  <select name="site_disabled" id="site_disabled">
<?php		    
	if($site_disable==1)
	{
?>  			<option value="1" selected="selected">Yes</option>
		    <option value="0">No</option>
<?php
	}
	else
	{
?>  			<option value="1">Yes</option>
		    <option value="0" selected="selected">No</option>
<?php	
	}
?>  		  </select>
		  <br />
		</p>
		
		<p><font size="4"><strong>Page Not Found Error:</strong></font>&nbsp;&nbsp; 
		  <input name="page_not_exist" type="text" id="page_not_exist" size="40" maxlength="255" value="<?php echo $page_not_exist; ?>" />
		        <br />
		  &nbsp;&nbsp;&nbsp;This message will be displayed if a requested page does not 
		  exist. </p>
		
		<p><font size="4"><strong>Banned Error Message:</strong></font>&nbsp;&nbsp; 
		  <input name="banned_message" type="text" id="banned_message" size="40" maxlength="255" value="<?php echo $banned_message; ?>" />
		        <br />
		  &nbsp;&nbsp;&nbsp;This message will be displayed if the user is Banned in the 
		  Title Bar. (The main message is set when you create a ban)</p>

      <p align="center">
        <input type="submit" name="dosave" value="Save Settings" />
      </p>
    </div>
  </form>
  <p align="left">&nbsp;</p>
</div>
<?php
	display_footer();
}
else
{
	if(!isset($_POST['site_name']))
	{
		redirect_page("Site Name Missing",attach_sid("settings.".FILE_EXT."?site_webmaster=".urlencode($_POST['site_webmaster'])."&cookie_domain=".urlencode($_POST['cookie_domain'])."&cookie_name=".urlencode($_POST['cookie_name'])."&cookie_path=".urlencode($_POST['cookie_path'])."&cookie_time=".urlencode($_POST['cookie_time'])."&online_timeout=".urlencode($_POST['online_timeout'])."ip_security=".urlencode($_POST['ip_security'])."&disabled_message=".urlencode($_POST['disabled_message'])."&site_disabled=".urlencode($_POST['site_disabled'])."&page_not_exist=".urlencode($_POST['page_not_exist'])."&banned_message=".urlencode($_POST['banned_message'])));
	}
	
	if(!isset($_POST['site_webmaster']))
	{
		redirect_page("Webmaster Email Missing",attach_sid("settings.".FILE_EXT."?site_name=".urlencode($_POST['site_name'])."&cookie_domain=".urlencode($_POST['cookie_domain'])."&cookie_name=".urlencode($_POST['cookie_name'])."&cookie_path=".urlencode($_POST['cookie_path'])."&cookie_time=".urlencode($_POST['cookie_time'])."&online_timeout=".urlencode($_POST['online_timeout'])."ip_security=".urlencode($_POST['ip_security'])."&disabled_message=".urlencode($_POST['disabled_message'])."&site_disabled=".urlencode($_POST['site_disabled'])."&page_not_exist=".urlencode($_POST['page_not_exist'])."&banned_message=".urlencode($_POST['banned_message'])));
	}
	
	if(!isset($_POST['cookie_domain']))
	{
		redirect_page("Cookie Domain Missing",attach_sid("settings.".FILE_EXT."?site_name=".urlencode($_POST['site_name'])."&site_webmaster=".urlencode($_POST['site_webmaster'])."&cookie_name=".urlencode($_POST['cookie_name'])."&cookie_path=".urlencode($_POST['cookie_path'])."&cookie_time=".urlencode($_POST['cookie_time'])."&online_timeout=".urlencode($_POST['online_timeout'])."ip_security=".urlencode($_POST['ip_security'])."&disabled_message=".urlencode($_POST['disabled_message'])."&site_disabled=".urlencode($_POST['site_disabled'])."&page_not_exist=".urlencode($_POST['page_not_exist'])."&banned_message=".urlencode($_POST['banned_message'])));
	}

	if(!isset($_POST['cookie_name']))
	{
		redirect_page("Cookie Name Missing",attach_sid("settings.".FILE_EXT."?site_name=".urlencode($_POST['site_name'])."&site_webmaster=".urlencode($_POST['site_webmaster'])."&cookie_domain=".urlencode($_POST['cookie_domain'])."&cookie_path=".urlencode($_POST['cookie_path'])."&cookie_time=".urlencode($_POST['cookie_time'])."&online_timeout=".urlencode($_POST['online_timeout'])."ip_security=".urlencode($_POST['ip_security'])."&disabled_message=".urlencode($_POST['disabled_message'])."&site_disabled=".urlencode($_POST['site_disabled'])."&page_not_exist=".urlencode($_POST['page_not_exist'])."&banned_message=".urlencode($_POST['banned_message'])));
	}

	if(!isset($_POST['cookie_path']))
	{
		redirect_page("Cookie Path Missing",attach_sid("settings.".FILE_EXT."?site_name=".urlencode($_POST['site_name'])."&site_webmaster=".urlencode($_POST['site_webmaster'])."&cookie_domain=".urlencode($_POST['cookie_domain'])."&cookie_name=".urlencode($_POST['cookie_name'])."&cookie_time=".urlencode($_POST['cookie_time'])."&online_timeout=".urlencode($_POST['online_timeout'])."ip_security=".urlencode($_POST['ip_security'])."&disabled_message=".urlencode($_POST['disabled_message'])."&site_disabled=".urlencode($_POST['site_disabled'])."&page_not_exist=".urlencode($_POST['page_not_exist'])."&banned_message=".urlencode($_POST['banned_message'])));
	}

	if(!isset($_POST['cookie_time']))
	{
		redirect_page("Cookie Time Missing",attach_sid("settings.".FILE_EXT."?site_name=".urlencode($_POST['site_name'])."&site_webmaster=".urlencode($_POST['site_webmaster'])."&cookie_domain=".urlencode($_POST['cookie_domain'])."&cookie_name=".urlencode($_POST['cookie_name'])."&cookie_path=".urlencode($_POST['cookie_path'])."&online_timeout=".urlencode($_POST['online_timeout'])."ip_security=".urlencode($_POST['ip_security'])."&disabled_message=".urlencode($_POST['disabled_message'])."&site_disabled=".urlencode($_POST['site_disabled'])."&page_not_exist=".urlencode($_POST['page_not_exist'])."&banned_message=".urlencode($_POST['banned_message'])));
	}

	if(!isset($_POST['online_timeout']))
	{
		redirect_page("Activity Timeout Missing",attach_sid("settings.".FILE_EXT."?site_name=".urlencode($_POST['site_name'])."&site_webmaster=".urlencode($_POST['site_webmaster'])."&cookie_domain=".urlencode($_POST['cookie_domain'])."&cookie_name=".urlencode($_POST['cookie_name'])."&cookie_path=".urlencode($_POST['cookie_path'])."&cookie_time=".urlencode($_POST['cookie_time'])."ip_security=".urlencode($_POST['ip_security'])."&disabled_message=".urlencode($_POST['disabled_message'])."&site_disabled=".urlencode($_POST['site_disabled'])."&page_not_exist=".urlencode($_POST['page_not_exist'])."&banned_message=".urlencode($_POST['banned_message'])));
	}

	if(!isset($_POST['ip_security']))
	{
		redirect_page("Login Security Level Missing",attach_sid("settings.".FILE_EXT."?site_name=".urlencode($_POST['site_name'])."&site_webmaster=".urlencode($_POST['site_webmaster'])."&cookie_domain=".urlencode($_POST['cookie_domain'])."&cookie_name=".urlencode($_POST['cookie_name'])."&cookie_path=".urlencode($_POST['cookie_path'])."&cookie_time=".urlencode($_POST['cookie_time'])."&disabled_message=".urlencode($_POST['disabled_message'])."&site_disabled=".urlencode($_POST['site_disabled'])."&page_not_exist=".urlencode($_POST['page_not_exist'])."&banned_message=".urlencode($_POST['banned_message'])));
	}
	
	if(!isset($_POST['disabled_message']))
	{
		redirect_page("Disabled Message Missing",attach_sid("settings.".FILE_EXT."?site_name=".urlencode($_POST['site_name'])."&site_webmaster=".urlencode($_POST['site_webmaster'])."&cookie_domain=".urlencode($_POST['cookie_domain'])."&cookie_name=".urlencode($_POST['cookie_name'])."&cookie_path=".urlencode($_POST['cookie_path'])."&cookie_time=".urlencode($_POST['cookie_time'])."&online_timeout=".urlencode($_POST['online_timeout'])."ip_security=".urlencode($_POST['ip_security'])."&site_disabled=".urlencode($_POST['site_disabled'])."&page_not_exist=".urlencode($_POST['page_not_exist'])."&banned_message=".urlencode($_POST['banned_message'])));
	}

	if(!isset($_POST['site_disabled']))
	{
		redirect_page("Site Disabled value Missing",attach_sid("settings.".FILE_EXT."?site_name=".urlencode($_POST['site_name'])."&site_webmaster=".urlencode($_POST['site_webmaster'])."&cookie_domain=".urlencode($_POST['cookie_domain'])."&cookie_name=".urlencode($_POST['cookie_name'])."&cookie_path=".urlencode($_POST['cookie_path'])."&cookie_time=".urlencode($_POST['cookie_time'])."&online_timeout=".urlencode($_POST['online_timeout'])."ip_security=".urlencode($_POST['ip_security'])."&disabled_message=".urlencode($_POST['disabled_message'])."&page_not_exist=".urlencode($_POST['page_not_exist'])."&banned_message=".urlencode($_POST['banned_message'])));
	}

	if(!isset($_POST['page_not_exist']))
	{
		redirect_page("Page Not Found Error Missing",attach_sid("settings.".FILE_EXT."?site_name=".urlencode($_POST['site_name'])."&site_webmaster=".urlencode($_POST['site_webmaster'])."&cookie_domain=".urlencode($_POST['cookie_domain'])."&cookie_name=".urlencode($_POST['cookie_name'])."&cookie_path=".urlencode($_POST['cookie_path'])."&cookie_time=".urlencode($_POST['cookie_time'])."&online_timeout=".urlencode($_POST['online_timeout'])."ip_security=".urlencode($_POST['ip_security'])."&disabled_message=".urlencode($_POST['disabled_message'])."&site_disabled=".urlencode($_POST['site_disabled'])."&banned_message=".urlencode($_POST['banned_message'])));
	}

	if(!isset($_POST['banned_message']))
	{
		redirect_page("Banned Message Missing",attach_sid("settings.".FILE_EXT."?site_name=".urlencode($_POST['site_name'])."&site_webmaster=".urlencode($_POST['site_webmaster'])."&cookie_domain=".urlencode($_POST['cookie_domain'])."&cookie_name=".urlencode($_POST['cookie_name'])."&cookie_path=".urlencode($_POST['cookie_path'])."&cookie_time=".urlencode($_POST['cookie_time'])."&online_timeout=".urlencode($_POST['online_timeout'])."ip_security=".urlencode($_POST['ip_security'])."&disabled_message=".urlencode($_POST['disabled_message'])."&site_disabled=".urlencode($_POST['site_disabled'])."&page_not_exist=".urlencode($_POST['page_not_exist'])));
	}
	
	if(!validate_email(urldecode($_POST['site_webmaster'])))
	{
		redirect_page("Webmaster Email Invalid",attach_sid("settings.".FILE_EXT."?site_name=".urlencode($_POST['site_name'])."&cookie_domain=".urlencode($_POST['cookie_domain'])."&cookie_name=".urlencode($_POST['cookie_name'])."&cookie_path=".urlencode($_POST['cookie_path'])."&cookie_time=".urlencode($_POST['cookie_time'])."&online_timeout=".urlencode($_POST['online_timeout'])."ip_security=".urlencode($_POST['ip_security'])."&disabled_message=".urlencode($_POST['disabled_message'])."&site_disabled=".urlencode($_POST['site_disabled'])."&page_not_exist=".urlencode($_POST['page_not_exist'])."&banned_message=".urlencode($_POST['banned_message'])));
	}

	if($_POST['site_disabled']!=1&&$_POST['site_disabled']!=0)
	{
		redirect_page("Site Disabled value Invalid",attach_sid("settings.".FILE_EXT."?site_name=".urlencode($_POST['site_name'])."&site_webmaster=".urlencode($_POST['site_webmaster'])."&cookie_domain=".urlencode($_POST['cookie_domain'])."&cookie_name=".urlencode($_POST['cookie_name'])."&cookie_path=".urlencode($_POST['cookie_path'])."&cookie_time=".urlencode($_POST['cookie_time'])."&online_timeout=".urlencode($_POST['online_timeout'])."ip_security=".urlencode($_POST['ip_security'])."&disabled_message=".urlencode($_POST['disabled_message'])."&page_not_exist=".urlencode($_POST['page_not_exist'])."&banned_message=".urlencode($_POST['banned_message'])));
	}
	
	if($_POST['ip_security'] > 0 && $_POST['ip_security'] > 4)
	{
		redirect_page("Login Security Level Invalid",attach_sid("settings.".FILE_EXT."?site_name=".urlencode($_POST['site_name'])."&site_webmaster=".urlencode($_POST['site_webmaster'])."&cookie_domain=".urlencode($_POST['cookie_domain'])."&cookie_name=".urlencode($_POST['cookie_name'])."&cookie_path=".urlencode($_POST['cookie_path'])."&cookie_time=".urlencode($_POST['cookie_time'])."&disabled_message=".urlencode($_POST['disabled_message'])."&site_disabled=".urlencode($_POST['site_disabled'])."&page_not_exist=".urlencode($_POST['page_not_exist'])."&banned_message=".urlencode($_POST['banned_message'])));
	}
	
	$site_name = htmlentities(addslashes(urldecode($_POST['site_name'])));
	$site_webmaster = urldecode($_POST['site_webmaster']);
	$cookie_domain = addslashes(urldecode($_POST['cookie_domain']));
	$cookie_name = addslashes(urldecode($_POST['cookie_name']));
	$cookie_path = addslashes(urldecode($_POST['cookie_path']));
	$cookie_time = intval(urldecode($_POST['cookie_time']));
	$online_timeout = intval(urldecode($_POST['online_timeout']));
	$ip_security = intval(urldecode($_POST['ip_security']));
	$disabled_message = addslashes(urldecode($_POST['disabled_message']));
	$site_disabled = $_POST['site_disabled'];
	$page_not_exist = addslashes(urldecode($_POST['page_not_exist']));
	$banned_message = addslashes(urldecode($_POST['banned_message']));
		
	unset($query);
	
	if($site_name != $config['site_name'])
	{
		$query[] = "UPDATE ".CONFIG_TABLE." SET config_value = '".$site_name."' WHERE config_name = 'site_name'";
	}

	if($site_webmaster != $config['site_webmaster'])
	{
		$query[] = "UPDATE ".CONFIG_TABLE." SET config_value = '".$site_webmaster."' WHERE config_name = 'site_webmaster'";
	}

	if($cookie_domain != $config['cookie_domain'])
	{
		$query[] = "UPDATE ".CONFIG_TABLE." SET config_value = '".$cookie_domain."' WHERE config_name = 'cookie_domain'";
	}

	if($cookie_name != $config['cookie_name'])
	{
		$query[] = "UPDATE ".CONFIG_TABLE." SET config_value = '".$cookie_name."' WHERE config_name = 'cookie_name'";
	}

	if($cookie_path != $config['cookie_path'])
	{
		$query[] = "UPDATE ".CONFIG_TABLE." SET config_value = '".$cookie_path."' WHERE config_name = 'cookie_path'";
	}

	if($cookie_time != $config['cookie_time'])
	{
		$query[] = "UPDATE ".CONFIG_TABLE." SET config_value = ".$cookie_time." WHERE config_name = 'cookie_time'";
	}

	if($online_timeout != $config['online_timeout'])
	{
		$query[] = "UPDATE ".CONFIG_TABLE." SET config_value = ".$online_timeout." WHERE config_name = 'online_timeout'";
	}

	if($ip_security != $config['ip_security'])
	{
		$query[] = "UPDATE ".CONFIG_TABLE." SET config_value = ".$ip_security." WHERE config_name = 'ip_security'";
	}

	if($disabled_message != $config['disabled_message'])
	{
		$query[] = "UPDATE ".CONFIG_TABLE." SET config_value = '".$disabled_message."' WHERE config_name = 'disabled_message'";
	}

	if($site_disabled != $config['site_disabled'])
	{
		$query[] = "UPDATE ".CONFIG_TABLE." SET config_value = ".$site_disabled." WHERE config_name = 'site_disabled'";
	}

	if($page_not_exist != $config['page_not_exist'])
	{
		$query[] = "UPDATE ".CONFIG_TABLE." SET config_value = '".$page_not_exist."' WHERE config_name = 'page_not_exist'";
	}

	if($banned_message != $config['banned_message'])
	{
		$query[] = "UPDATE ".CONFIG_TABLE." SET config_value = '".$banned_message."' WHERE config_name = 'banned_message'";
	}
	
	for($i = 0; $i < count($query); $i++)
	{
		db_query($query[$i],'Could not update configuration settings');
	}
	
	redirect_page("Settings saved successfully",attach_sid("settings.".FILE_EXT));
}

?>
Return current item: raSMP