<?
/*
####################################################
# Name: The Uniform Server Setup
# Developed By: The Uniform Server Development Team
# Modified Last By: Olajide Olaolorun (empirex) 
# Web: http://www.uniformserver.com
####################################################
*/

// Includes
include "includes/config.inc.php";
include "$apanel_path/includes/lang/".file_get_contents("includes/.lang").".php"; 
include "includes/header.php";
include "includes/secure.php";


if ( !(file_exists($mysqlpwd)) ) {
	$FHandle = fopen($mysqlpwd, 'w');
	fclose($FHandle);
}


if ($_POST['submit']) {

	$nwpass = $_POST['qpass'];

	$urdata = "$nwpass";

	$wfile = fopen($mysqlpwd, 'w') ;
	fwrite($wfile, $urdata);
	fclose($wfile);
?>

	<div id="main">
	<h2>&#187; <?=$US['mqsetup-head']?></h2>
	<h3><?=$US['mqsetup-sub-0']?></h3>
	<p>
	<?=$US['mqsetup-success']?>
	<br />
	<br />
	<?=$US['mqsetup-pass']?>: <?=$_POST['qpass'];?>
	</p>
	</div>

<?
}

else {
	$tfile = fopen($mysqlpwd, "r");

	$fcontents = fgets($tfile);
?>

	<div id="main">
		<h2>&#187; <?=$US['mqsetup-head']?></h2>
		<h3><?=$US['mqsetup-sub-0']?></h3>

		<p><?=$US['mqsetup-text-0']?></p>
		<form action="<?=$PHP_SELF?>" method="post">
		<table width="100%">
		<tr>
		<td width="100">
		<p><?=$US['mqsetup-pass']?></p>
		</td>
		<td>
		<input type="text" name="qpass" value="<?=$fcontents?>" />
		</td>
		</tr>
		</table>
		<br />
		<input type="submit" name="submit" value="<?=$US['mqsetup-change']?>" />
		</form>
	</div>

<?
	fclose($tfile);
}

// Footer
include "includes/footer.php";
?>