<?php

/**
 * This module shows maintenance mode on Flatnuke.
 *
 * @author Simone Vellei <simone_vellei@users.sourceforge.net>
 * @author Marco Segato <segatom@users.sourceforge.net>
 * 
 * @license http://opensource.org/licenses/gpl-license.php GNU General Public License
 */
 
if (eregi("maintenance.php", $_SERVER['PHP_SELF'])) {
	Header("Location: ../../index.php");
	die();
}

global $maintenance;

if ($maintenance == "1") {
	if(!is_admin()) {
		?><div align="center" style="padding:2em;">
			<div style="background-color:#F0F0F0;max-width:250px;padding:10px;border:1px solid #999999;">
			<img alt="Flatnuke CMS login" src="images/maintenance.png" /><br />
			<br />
			<span style="color:#CC0000;">
				<b><?= _MAINT ?></b><br />
				<?= _MAINT_MSG ?>
			</span><br /><br />
			<form action="sections/none_Login/section.php" method="post">
			<input type="hidden" name="action" value="login" />
			<label for="username" style="font-size:20px;"><?= _NOMEUTENTE ?>:</label><br />
			<input alt="username" name="nome" size="15" id="username" style="border:0.5px solid #333333;color:grey;font-size:20px;" value="Username" onfocus="if(this.value=='Username'){this.value='';}" onblur="if(this.value==''){this.value='Username';}" /><br />
			<label for="password" style="font-size:20px;"><?= _PASSWORD ?>:</label><br />
			<input alt="password" name="logpassword" type="password" size="15" id="password" style="border:0.5px solid #333333;color:grey;font-size:20px;" value="********" onclick="javascript:this.value='';" /><br />
			<br />
			<input type="submit" value="<?= _LOGIN ?>" style="border:0.5px solid #333333;font-size:16px;font-weight:bold;" />
			</form>
			</div>
		</div><?
		$footer_elements = get_footer_array();
		echo $footer_elements['img_fn']." ";
		echo $footer_elements['img_w3c']." ";
		echo $footer_elements['img_css']." ";
		echo $footer_elements['img_rss']." ";
		echo $footer_elements['img_mail']."<br />";
		echo $footer_elements['legal']."<br />";
		echo $footer_elements['time'];
		exit();
	} else {
		echo "<div style='padding:1em;color:red;background-color:yellow;border:3px solid red;text-align:center;font-weight:bold;font-size:larger;'>"._MAINT."</div>";
	}
}

?>
