Initial commit

This commit is contained in:
NightBits
2018-12-19 20:44:16 +01:00
parent b680b82039
commit 878eda33b8
92 changed files with 5819 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
RewriteEngine on
# disable directory browsing
Options All -Indexes
<FilesMatch "\.(htaccess|htpasswd|ini|phps|fla|psd|log|sh)$">
Order Allow,Deny
Deny from all
</FilesMatch>
# turn off magic_quotes_gpc for PHP enabled servers
<ifmodule mod_php4.c>
php_flag magic_quotes_gpc off
</ifmodule>

View File

@@ -0,0 +1 @@
deny from all

View File

@@ -0,0 +1 @@
deny from all

View File

@@ -0,0 +1,16 @@
<?php
$defaultController = 'login';
$defaultAction = 'start';
$language = 'english';
$controllerParameter = 'c';
$actionParameter = 'a';
$development = false;
$logErrors = true;
$urlParameters = false;
$sessionDatabase = false;
$libraries = array();
$helpers = array();
?>

View File

@@ -0,0 +1,12 @@
<?php
$applicationName = 'taskmanager';
$websiteTitle = 'SuperSmash Taskmanager';
$webmasterEmail = 'info@SuperSmash.nl';
$useDatabase = true;
// Include the database configuration file
include_once ('databaseconfiguration.php');
// Include the SuperSmash framework configuration file
include_once ('SuperSmashconfiguration.php');
?>

View File

@@ -0,0 +1,10 @@
<?php
$database = array(
'driver' => 'mysql',
'host' => 'localhost',
'database' => 'taskmanager',
'username' => 'root',
'password' => '',
'port' => '3306'
);
?>

View File

@@ -0,0 +1,39 @@
<?php
class Login extends System\SuperSmash\Controller {
// Create the constructor
function __construct() {
parent::__construct();
}
function _beforeAction() {
}
function start($error = false) {
// Load the login Model
$this->load->model('login');
// Load the data for the login model
$data = $this->LoginModel->login($error);
// Load the view and add the data
$this->load->view('login', $data);
}
function check(){
// Load the login Model
$this->load->model('login');
if ($this->LoginModel->check()){
die("ingelogd");
} else {
$this->start(true);
}
}
function _afterAction() {
}
}
?>

View File

@@ -0,0 +1,58 @@
<?php
class LoginModel extends System\SuperSmash\Model {
// Create the constructor
public function __construct() {
parent::__construct();
}
public function login($error = false) {
$array = array('loginMessage' =>
'Use this form to login into the application.'
);
if ($error) {
$error = array('errorMessage' =>
'Invalid username or password.'
);
$array = array_merge($array, $error);
}
return $array;
}
public function check(){
if ($_SERVER['REQUEST_METHOD'] == "POST"){
if (isset($_POST['username']) && isset($_POST['password'])){
// Get the database connection
$database = \System\SuperSmash\SuperSmash::database();
$password = $_POST['password'];
// Check if the username and password are valid
$query = $database->prepare("SELECT * FROM login WHERE username = ? LIMIT 1");
$query->execute(array($_POST['username']));
$result = $query->fetch();
$password = md5(sha1($password . $result['salt']));
$password = $this->encrypt_login($password, $result['salt']);
return $password == $result['password'];
}
}
}
private function encrypt_login($string, $key){
$r = 0;
for ($i = 0; $i < strlen($string); $i++)
$r .= substr((md5($key)), ($i % strlen(md5($key))),
1) . $string[$i];
for ($i = 1; $i < strlen($r); $i++)
$string[$i - 1] = chr(ord($r[$i - 1]) + ord(substr(md5
($key), ($i % strlen(md5($key))) - 1, 1)));
$value = 0;
$value = urlencode(base64_encode($string));
return stripslashes($value);
}
}
?>

View File

@@ -0,0 +1,128 @@
body
{
margin:0 auto;
background-color:#000000;
}
#container
{
width:600px;
margin: 0 auto;
}
#header
{
margin: 0 auto;
height:100px;
text-align: center;
color : #FFFFFF;
font: bold 20px "SuperSmash", Arial;
}
#footer
{
width:600px;
margin: 0 auto;
background: #F0C74D;
border-top-left-radius: 15px;
border-top-right-radius: 15px;
border-bottom-left-radius: 15px;
border-bottom-right-radius: 15px;
text-align: center;
}
#login-box {
width:333px;
height: 352px;
padding: 58px 76px 0 76px;
margin: 0 auto;
color: #ebebeb;
font: 12px Arial, Helvetica, sans-serif;
background: url("../images/background.png") no-repeat left top;
}
.loginButton{
margin-left:90px;
background: url("../images/button.png") no-repeat left top;
width:103px;
height:42px;
border:0px;
}
#login-box img {
border:none;
}
#login-box h2 {
padding:0;
margin:0;
color: #ebebeb;
font: bold 44px "Calibri", Arial;
}
#login-box-username {
float: left;
display:inline;
width:80px;
text-align: right;
padding: 14px 10px 0 0;
margin:0 0 7px 0;
}
#login-box-usernamefield {
float: left;
display:inline;
width:230px;
margin:0;
margin:0 0 7px 0;
}
#login-box-password {
float: left;
display:inline;
width:80px;
text-align: right;
padding: 14px 10px 0 0;
margin:0 0 7px 0;
}
#login-box-passwordfield {
float: left;
display:inline;
width:230px;
margin:0;
margin:0 0 7px 0;
}
.form-login {
width: 205px;
padding: 10px 4px 6px 3px;
border: 1px solid #0d2c52;
background-color:#1e4f8a;
font-size: 16px;
color: #ebebeb;
}
.login-box-options {
clear:both;
padding-left:87px;
font-size: 11px;
}
.login-box-options a {
color: #ebebeb;
font-size: 11px;
}
pre
{
font-size: 12px;
padding-top: 10px;
background: #f0f0f0;
border: 1px solid #999;
width:400px;
margin: 0 auto;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@@ -0,0 +1,43 @@
<!DOCTYPE html>
<html>
<head>
<title><?php echo configuration('websiteTitle');?></title>
<link href="<?php echo $websiteURL . "/" . "applications" . "/" . configuration('applicationName') . $viewPath;?>/images/favicon.ico" rel="shortcut icon" type="image/x-icon"/>
<link rel="stylesheet" type="text/css" href="<?php echo $websiteURL . "/" . "applications" . "/" . configuration('applicationName') . $viewPath;?>/css/login.css"/>
</head>
<body>
<div id="header">
<br/><br/><h1>SuperSmash Task manager</h1>
</div>
<div id="container">
<div id="content">
<form action="<?php echo "$websiteURL/login/check"; ?>" method="post">
<div id="login-box">
<?php echo $loginMessage; ?>
<br />
<?php if(isset($errorMessage)) echo "<font color=\"red\">" . $errorMessage . "</font><br />"; ?>
<div id="login-box-username" style="margin-top:20px;">Username:</div>
<div id="login-box-usernamefield" style="margin-top:20px;">
<input name="username" class="form-login" title="Username" value="" size="30" maxlength="50" />
</div>
<div id="login-box-password">Password:</div>
<div id="login-box-passwordfield">
<input name="password" type="password" class="form-login" title="Password" value="" size="30" maxlength="50" />
</div>
<br />
<span class="login-box-options"><input type="checkbox" name="1" value="1"> Remember Me <a href="forget.php" style="margin-left:30px;">Forgot password?</a>
<br />
<br />
</span>
<button class="loginButton" type="submit">&nbsp;</button>
</div>
</form>
</div>
</div>
<div id="footer"></div>
</body>
</html>