Initial commit
14
applications/.htaccess
Normal 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>
|
14
applications/start/.htaccess
Normal 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>
|
1
applications/start/cache/.htaccess
vendored
Normal file
@@ -0,0 +1 @@
|
||||
deny from all
|
1
applications/start/configuration/.htaccess
Normal file
@@ -0,0 +1 @@
|
||||
deny from all
|
16
applications/start/configuration/SuperSmashconfiguration.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
$defaultController = 'introduction';
|
||||
$defaultAction = 'start';
|
||||
$language = 'english';
|
||||
|
||||
$controllerParameter = 'c';
|
||||
$actionParameter = 'a';
|
||||
|
||||
$development = true;
|
||||
$logErrors = true;
|
||||
$urlParameters = false;
|
||||
$sessionDatabase = false;
|
||||
|
||||
$libraries = array();
|
||||
$helpers = array();
|
||||
?>
|
11
applications/start/configuration/configuration.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
$applicationName = 'start';
|
||||
$websiteTitle = 'SuperSmash framework | Start';
|
||||
$webmasterEmail = 'info@SuperSmash.nl';
|
||||
|
||||
// Include the database configuration file
|
||||
include_once ('databaseconfiguration.php');
|
||||
|
||||
// Include the SuperSmash framework configuration file
|
||||
include_once ('SuperSmashconfiguration.php');
|
||||
?>
|
10
applications/start/configuration/databaseconfiguration.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
$database = array(
|
||||
'driver' => 'mysql',
|
||||
'host' => 'localhost',
|
||||
'database' => 'framework',
|
||||
'username' => 'root',
|
||||
'password' => '',
|
||||
'port' => '3306'
|
||||
);
|
||||
?>
|
0
applications/start/controllers/index.html
Normal file
28
applications/start/controllers/introduction.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
class Introduction extends System\SuperSmash\Controller {
|
||||
|
||||
// Create the constructor
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
function _beforeAction() {
|
||||
|
||||
}
|
||||
|
||||
function start() {
|
||||
// Load the introduction Model
|
||||
$this->load->model('introduction');
|
||||
|
||||
// Load the data for the introduction model
|
||||
$data = $this->IntroductionModel->introduction();
|
||||
|
||||
// Load the view and add the data
|
||||
$this->load->view('introduction', $data);
|
||||
}
|
||||
|
||||
function _afterAction() {
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
0
applications/start/helpers/index.html
Normal file
0
applications/start/library/index.html
Normal file
0
applications/start/models/index.html
Normal file
17
applications/start/models/introduction.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
class IntroductionModel extends System\SuperSmash\Model {
|
||||
|
||||
// Create the constructor
|
||||
public function __construct() {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function introduction() {
|
||||
return array('introductionMessage' =>
|
||||
'Hello and welcome to the SuperSmash Framework! <br />
|
||||
This framework will help you while developing your application <br /><br />
|
||||
');
|
||||
}
|
||||
}
|
||||
?>
|
BIN
applications/start/portal.png
Normal file
After Width: | Height: | Size: 19 KiB |
85
applications/start/views/introduction/css/style.css
Normal file
@@ -0,0 +1,85 @@
|
||||
body
|
||||
{
|
||||
margin:0 auto;
|
||||
background-color:#000000;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-family: SuperSmash, serif;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 1px;
|
||||
padding:10px;
|
||||
}
|
||||
|
||||
#container
|
||||
{
|
||||
width:600px;
|
||||
margin: 0 auto;
|
||||
background: #F0C74D;
|
||||
border: 1px solid #999;
|
||||
border-top-left-radius: 15px;
|
||||
border-top-right-radius: 15px;
|
||||
border-bottom-left-radius: 15px;
|
||||
border-bottom-right-radius: 15px;
|
||||
}
|
||||
|
||||
#header
|
||||
{
|
||||
width: auto;
|
||||
height:100px;
|
||||
text-align: center;
|
||||
color : #F0C74D;
|
||||
}
|
||||
|
||||
#content
|
||||
{
|
||||
width:600px;
|
||||
padding: 20px 10px 20px 10px;
|
||||
margin:0 auto;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#footer
|
||||
{
|
||||
width:600px;
|
||||
margin: 0 auto;
|
||||
background: #F0C74D;
|
||||
border: 1px solid #999;
|
||||
border-top-left-radius: 15px;
|
||||
border-top-right-radius: 15px;
|
||||
border-bottom-left-radius: 15px;
|
||||
border-bottom-right-radius: 15px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#dynamic{
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#html5{
|
||||
position:fixed;
|
||||
top:20px;
|
||||
right:5px;
|
||||
}
|
||||
|
||||
#twitter{
|
||||
position:fixed;
|
||||
top:60px;
|
||||
right:5px;
|
||||
}
|
||||
|
||||
#w3c{
|
||||
position:fixed;
|
||||
top:100px;
|
||||
right:5px;
|
||||
}
|
||||
|
||||
pre
|
||||
{
|
||||
font-size: 12px;
|
||||
padding-top: 10px;
|
||||
background: #f0f0f0;
|
||||
border: 1px solid #999;
|
||||
width:400px;
|
||||
margin: 0 auto;
|
||||
}
|
BIN
applications/start/views/introduction/images/favicon.ico
Normal file
After Width: | Height: | Size: 4.2 KiB |
BIN
applications/start/views/introduction/images/html5.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
applications/start/views/introduction/images/logo.png
Normal file
After Width: | Height: | Size: 6.7 KiB |
BIN
applications/start/views/introduction/images/mvc.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
applications/start/views/introduction/images/twitter.png
Normal file
After Width: | Height: | Size: 755 B |
BIN
applications/start/views/introduction/images/w3c.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
49
applications/start/views/introduction/index.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<!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/style.css"/>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="header">
|
||||
<h1>
|
||||
<img src="<?php echo $websiteURL . "/" . "applications" . "/" . configuration('applicationName') . $viewPath;?>/images/logo.png" alt="SuperSmash Logo" />
|
||||
Welcome to the SuperSmash Framework!
|
||||
<img src="<?php echo $websiteURL . "/" . "applications" . "/" . configuration('applicationName') . $viewPath;?>/images/logo.png" alt="SuperSmash Logo" />
|
||||
</h1>
|
||||
</div>
|
||||
<div id="container">
|
||||
<div id="content">
|
||||
<div id="dynamic"><?php echo $introductionMessage; ?></div>
|
||||
You can edit the <b>Model</b> by going here:
|
||||
<pre>applications/start/models/welcome.php
|
||||
</pre>
|
||||
<br />
|
||||
|
||||
You can edit the <b>View</b> by going here:
|
||||
<pre>applications/start/views/welcome.php
|
||||
</pre>
|
||||
<br />
|
||||
|
||||
You can edit the <b>Controller</b> by going here:
|
||||
<pre>applications/start/controllers/welcome.php
|
||||
</pre>
|
||||
|
||||
|
||||
<br /><img src="<?php echo $websiteURL . "/" . "applications" . "/" . configuration('applicationName') . $viewPath;?>/images/mvc.png" alt="MVC Model" /><br />
|
||||
|
||||
</div>
|
||||
</div> <br /><br />
|
||||
<div id="footer">
|
||||
<small>
|
||||
Page rendered in {elapsed} seconds, using {usage}<br />
|
||||
</small>
|
||||
</div>
|
||||
|
||||
<!-- Show some items -->
|
||||
<a target="_blank" href="http://www.HTML5.com"><img id="html5" src="<?php echo $websiteURL . "/" . "applications" . "/" . configuration('applicationName') . $viewPath;?>/images/html5.png" alt="HTML5" /></a>
|
||||
<a target="_blank" href="http://twitter.com/#!/SuperSmash007"><img id="twitter" src="<?php echo $websiteURL . "/" . "applications" . "/" . configuration('applicationName') . $viewPath;?>/images/twitter.png" alt="Twitter" /></a>
|
||||
</body>
|
||||
</html>
|
14
applications/taskmanager/.htaccess
Normal 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>
|
1
applications/taskmanager/cache/.htaccess
vendored
Normal file
@@ -0,0 +1 @@
|
||||
deny from all
|
1
applications/taskmanager/configuration/.htaccess
Normal file
@@ -0,0 +1 @@
|
||||
deny from all
|
@@ -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();
|
||||
?>
|
12
applications/taskmanager/configuration/configuration.php
Normal 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');
|
||||
?>
|
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
$database = array(
|
||||
'driver' => 'mysql',
|
||||
'host' => 'localhost',
|
||||
'database' => 'taskmanager',
|
||||
'username' => 'root',
|
||||
'password' => '',
|
||||
'port' => '3306'
|
||||
);
|
||||
?>
|
0
applications/taskmanager/controllers/index.html
Normal file
39
applications/taskmanager/controllers/login.php
Normal 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() {
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
0
applications/taskmanager/helpers/index.html
Normal file
0
applications/taskmanager/library/index.html
Normal file
0
applications/taskmanager/models/index.html
Normal file
58
applications/taskmanager/models/login.php
Normal 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);
|
||||
}
|
||||
}
|
||||
?>
|
128
applications/taskmanager/views/login/css/login.css
Normal 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;
|
||||
}
|
BIN
applications/taskmanager/views/login/images/background.png
Normal file
After Width: | Height: | Size: 54 KiB |
BIN
applications/taskmanager/views/login/images/button.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
applications/taskmanager/views/login/images/favicon.ico
Normal file
After Width: | Height: | Size: 4.2 KiB |
43
applications/taskmanager/views/login/index.php
Normal 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"> </button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer"></div>
|
||||
</body>
|
||||
</html>
|