-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from Sch-Tomi/phpDev
Php dev
- Loading branch information
Showing
64 changed files
with
2,509 additions
and
241 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
class Laser extends MasterBlock { | ||
constructor(heading, x, y, moving, rotating) { | ||
super("img/lezer.png", heading, x, y, moving, rotating) | ||
super("/img/blocks/lezer.png", heading, x, y, moving, rotating) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,3 @@ BROWSER = firefox | |
|
||
all: | ||
compafy | ||
$(BROWSER) site/index.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<IfModule mod_rewrite.c> | ||
|
||
RewriteEngine On | ||
RewriteBase / | ||
|
||
RewriteRule ^index\.php$ - [L] | ||
|
||
RewriteCond %{REQUEST_FILENAME} !-f | ||
RewriteCond %{REQUEST_FILENAME} !-d | ||
RewriteRule . /index.php [L] | ||
|
||
</IfModule> | ||
<ifModule mod_headers.c> | ||
Header unset ETag | ||
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate" | ||
Header set Pragma "no-cache" | ||
Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT" | ||
</ifModule> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
/* | ||
* Specials: | ||
* (:any) | ||
* (:string) | ||
* (:num) | ||
*/ | ||
|
||
|
||
$this->route['GET']['/'] = 'Main'; | ||
$this->route['GET']['404'] = 'Errors/show_404'; | ||
$this->route['GET']['/error/(:num)'] = 'Errors/show'; | ||
|
||
$this->route['GET']['/game'] = "Game/show_games"; | ||
$this->route['GET']['/game/(:num)'] = "Game/start"; | ||
$this->route['POST']['/game/report'] = "Game/report"; | ||
|
||
$this->route['GET']['/login'] = "Auth/login"; | ||
$this->route['POST']['/login'] = "Auth/do_login"; | ||
$this->route['GET']['/logout'] = "Auth/logout"; | ||
|
||
$this->route['GET']['/register'] = "Auth/register"; | ||
$this->route['POST']['/register'] = "Auth/do_register"; | ||
|
||
$this->route['GET']['/admin'] = "Admin/adminDash"; | ||
$this->route['POST']['/admin/add'] = "Admin/add"; | ||
$this->route['GET']['/admin/delete/(:num)'] = "Admin/del"; | ||
|
||
|
||
|
||
|
||
|
||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
|
||
class Admin extends LightController{ | ||
|
||
private $authLib; | ||
private $gameModel; | ||
|
||
function __construct(){ | ||
parent::__construct(); | ||
|
||
$this->authLib = $this->libMan->load_and_create("AuthenticationLib"); | ||
$this->gameModel = $this->modelMan->load_and_create("GameModel"); | ||
$this->view->set_template("basic"); | ||
|
||
$this->view->add_style("/css/style.css"); | ||
|
||
$this->view->add_section("menu", "sections/menu"); | ||
$this->view->add_section("footer", "sections/footer"); | ||
|
||
$this->authoritization(); | ||
} | ||
|
||
public function adminDash(){ | ||
$this->view->add_style("/css/table.css"); | ||
$this->view->add_style("/css/adminDash.css"); | ||
$this->view->add_script("/js/adminHelper.js"); | ||
$this->view->show("admin/dash", array('games' => $this->gameModel->get_games() )); | ||
} | ||
|
||
public function add(){ | ||
$this->gameModel->add($_POST); | ||
$this->redirect("/admin"); | ||
} | ||
|
||
public function del($id){ | ||
$this->gameModel->del($id); | ||
$this->redirect("/admin"); | ||
} | ||
|
||
private function authoritization(){ | ||
if (!$this->authLib->is_admin()) { | ||
$this->redirect("/error/403"); | ||
} | ||
} | ||
|
||
} | ||
|
||
|
||
|
||
?> |
Oops, something went wrong.