Location: PHPKode > projects > Phoenix FS > phoenixfs1.0.1/manage/index.php
<?php
/*-----------------------------------------------------------------------
| Phoenix FS v. 1.0.1                                                   |
| Created by Gian_PHP                                                   |
| Based on PHP & MySQL                                                  |
-------------------------------------------------------------------------
| 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 3 of the License, or     |
| 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.                          |
|                                                                       |
| GNU GPL License: http://www.gnu.org/licenses/gpl.txt                  |
-------------------------------------------------------------------------
| index.php                                                             |
-----------------------------------------------------------------------*/

define('ACCESS', true);

// controlling install files
$install_files = array('../install/index.php', '../install/insert_db.php',
'../install/update_db.php', '../install/finish.php');
$install_files_num = 0;
foreach($install_files as $value) {
	if(file_exists($value)) {
		$install_files_num++;
	}
}
if($install_files_num != 0) {
	die("Please remove install files. ".$install_files_num." left.");
} elseif(file_exists('./install/')) {
	die('Please remove the <b>install</b> folder.');
}

// config and functions
require_once '../includes/config.inc.php';
require_once '../includes/functions.inc.php';

// admin page
@$admin_name = $_POST['admin_name'];
@$admin_pass = $_POST['admin_pass'];
if(!empty($admin_name) OR !empty($admin_pass)) {
	DB_Connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
	$admin_crypt_pass = md5($admin_pass);
	$admin_select = "SELECT admin_id FROM ".DB_PREF."admin WHERE admin_name = '$admin_name' AND admin_pass = '$admin_crypt_pass'";
	$admin_result = mysql_query($admin_select);
	if(mysql_num_rows($admin_result) > 0) {
		session_start();
		$_SESSION['ADMIN_LOGIN'] = true;
		header('location: panel.php');
		exit();
	} else {
		header('location: index.php');
		exit();
	}
} else {
?>

<html>

<head>
<title>Phoenix FS Administration</title>
<style>
body {
	font-family: Verdana;
}

.font_small {
	font-size: small;
}
</style>

<script language="javascript">
<!--

function Admin_Check() {
	var admin_name = document.adminlogin.admin_name.value;
	var admin_pass = document.adminlogin.admin_pass.value;
	
	if ((admin_name == "") || (admin_name == "undefined")) {
		alert("admin name field needed");
		document.updatedb.admin_name.focus();
		return false;
	}
	
	if ((admin_pass == "") || (admin_pass == "undefined")) {
		alert("admin password field needed");
		document.updatedb.admin_pass.focus();
		return false;
	}
	
	else {
		document.adminlogin.action = "<?php echo $_SERVER['PHP_SELF'] ?>";
		document.adminlogin.submit();
	}
}

//-->
</script>

</head>

<body>

<table cellpadding="6" cellspacing="0" width="100%">
	<tr>
		<td>
		<table cellpadding="5" cellspacing="0" width="100%">
			<tr>
				<td width="1%">
				<img border="0" src="images/logo.gif"></td>
				<td><font color="#33CC33" size="5" face="Verdana">Phoenix FS Administration</font></td>
			</tr>
		</table>
		</td>
	</tr>
	<tr>
		<td class="font_small">
		<form method="post" name="adminlogin">
			<p>Username<br>
			<input type="text" name="admin_name" size="20"></p>
			<p>Password<br>
			<input type="password" name="admin_pass" size="20"></p>
			<p><input type="button" value="Verify" onClick="Admin_Check()">
			<input type="reset" value="Reset"></p>
		</form>
	    </td>
	</tr>
</table>

</body>

</html>
<?php } ?>
Return current item: Phoenix FS