0
0

Updated author informations, updated location of included files, structured the website to the new layout, removed local fontawesome and moved to cloud CDN

This commit is contained in:
Bryan Pedini
2019-02-06 12:43:58 +01:00
parent b13167324a
commit d237a5443f
1608 changed files with 289 additions and 41171 deletions

35
lib/php/switch_action.php Normal file
View File

@@ -0,0 +1,35 @@
<?php
switch ( $_SERVER [ 'QUERY_STRING' ] ) {
case "/login":
if ( isset ( $_SESSION [ 'user_id' ] ) ) {
header ( "Location: " . $environment [ 'installation_path' ] );
exit;
}
if ( isset ( $_POST [ 'username' ] ) && isset ( $_POST [ 'password' ] ) ) {
//TODO: maybe implement two factor authentication, if possible
include ( $environment [ 'installation_path' ] . '/lib/php/user_login.php' );
exit;
}
include ( $environment [ 'installation_path' ] . '/lib/php/templates/login.php' );
break;
case "/insert":
if ( ! isset ( $_SESSION [ 'user_id' ] ) || $_SESSION [ 'user_permission_level' ] != 0 ) {
header ( "Location: " . $environment [ 'installation_path' ] . "/login" );
exit;
}
if ( isset ( $_POST [ 'new_article' ] ) ) {
//TODO: insert the new article into the database, previous validation of course!
$_SESSION [ 'section_id'] = 0; //TODO: get the ID of the last article just inserted and redirect the editor to the new article for preview.
header ( "Location: " . $environment [ 'installation_path' ] );
exit;
}
include ( $environment [ 'installation_path' ] . '/lib/php/templates/insert.php' );
break;
case "/contactme":
if ( ! isset ( $_POST [ 'contact_message' ] ) ) {
header ( "Location: " . $environment [ 'installation_path' ] );
exit;
}
include ( $environment [ 'installation_path' ] . '/lib/php/contactme.php' );
break;
}