<?php
/*---------------------------------------------------+
| cpanel creator
+----------------------------------------------------+
| Copyright 2009 - Neil Taylor
| http://studyhost.co.uk
+----------------------------------------------------+
| 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
| (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, see <http://www.gnu.org/licenses/>
+----------------------------------------------------*/
if($_POST["submitcheck"]=="1") {
$myusername=$_POST['username'];
$mypassword=$_POST['password'];
$passwords_array = (parse_ini_file("users.ini",true));
$username = $_POST['username'];
$password = $_POST['password'];
if((array_key_exists($username, $passwords_array)) and ($passwords_array[$username][password] == $password)){
session_start();
$_SESSION["myusername"] = $myusername;
$_SESSION["mypassword"] = $mypassword;
$_SESSION["myaccess"] = $passwords_array[$username][accesslevel];
$_SESSION["email"] = $passwords_array[$username][email];
header("Location: index.php");
#$message = "admin";
exit();
}else{
$message = "<p class=\"error\">WRONG USERNAME OR PASSWORD</p>";
}
}
else {
$message = "<p>Use this form to login:</p>";
}
?>
<html>
<head>
<title>Login Page
</title>
<link rel="stylesheet" href="formstyle.css" type="text/css" media="screen" />
</head>
<body>
<fieldset>
<legend>cPanel Web Account Creation Login
</legend>
<?php echo($message); ?>
<form name="form2" method="post" action="">
<input type="hidden" name="submitcheck" value="1">
<div>
<label>Username:
<span>Please enter a username
</span>
</label>
<input type="text" name="username">
<label>Password:
<span>Please enter a password
</span>
</label>
<input type="password" name="password">
</div>
<input name="submit" type="submit" value="Login" style="margin-left :165px;">
</form>
</fieldset>
<div class="company">
<a href="#">© company</a>
</div>
</body>
</html>