<?

/*
FlexCMS (http://www.flexcms.com)
Flexible, Powerful, Affordable.

Contents of this file are protected by the copyright
notice found at http://www.flexcms.com/flex/pages/copyright.html,
and its usage is subject to the terms of the licensing agreement 
available at http://www.flexcms.com/flex/pages/license.html
*/


	$PageTitle = '<img src="'.$ImagesURL.'/admin/admincp_settings.gif" width="23" height="20"> '.$MsgText[0][685];
	$BrowserTitle = $MsgText[0][685];
	$LocationBar = '<a href="'.$IndexURL.'">'.$MsgText[0][1].'</a> > <a href="'.$MainURL.'/options.html">'.$MsgText[0][4].'</a> > '.$MsgText[0][685];
	
	
	if ($LoggedIn == 'y') {
		
		ReadPermissions();
		Global $Permissions;
		
		if ($Permissions[25] == 'y') {
	
			ReadFormArguments();
			Global $FormArguments;
			
			if (count($FormArguments) > 0) {
			
			
			$query = "update `".$Settings['DBPrefix']."core-Settings` set Value='".$FormArguments['MaintenanceMode']."' where Name='MaintenanceMode' limit 1";
			$result = mysql_query($query) or die (mysql_error());
			
			$query = "update `".$Settings['DBPrefix']."core-Settings` set Value='".$FormArguments['MaintenanceModeMessage']."' where Name='MaintenanceModeMessage' limit 1";
			$result = mysql_query($query) or die (mysql_error());
			
			
			
						
			header('Location: ' . $MainURL . '/options.html');
			
			}
			else {
				$PageContents = $MsgText[0][98];
			}
			

		}
		else {
		
			$PageContents = $MsgText[0][97];
		
		}

	}
	else {
	
		RedirectToLogin();
	
	}

	// ========================================================================================




?>
