From 18dc9b18d34ef229edfe5ef74a07a99f6ca0cc03 Mon Sep 17 00:00:00 2001 From: Bryan Pedini Date: Mon, 25 Mar 2019 11:27:37 +0100 Subject: [PATCH] Website refactoring Moved PHP files to "lib" folder Moved Javascript files to "lib" folder Moved login page inline CSS to "login.css" Moved database functions to class "Database" Removed the html template, compensated with a direct HTML code inside PHP "else" statement --- lib/css/login.css | 5 ++-- {errors => lib/errors}/404.html | 0 {js => lib/js}/insertnew.js | 0 {js => lib/js}/login.js | 0 {js => lib/js}/sha512.js | 0 {js => lib/js}/sha512.min.js | 0 lib/php/{lostpassword.php => forgot.php} | 0 lib/php/go.php | 32 +++++++++++++++++++++--- lib/php/insert.php | 3 ++- lib/php/login.php | 10 ++++---- templates/LICENSE | 16 ------------ templates/redirect.html | 26 ------------------- 12 files changed, 38 insertions(+), 54 deletions(-) rename {errors => lib/errors}/404.html (100%) rename {js => lib/js}/insertnew.js (100%) rename {js => lib/js}/login.js (100%) rename {js => lib/js}/sha512.js (100%) rename {js => lib/js}/sha512.min.js (100%) rename lib/php/{lostpassword.php => forgot.php} (100%) delete mode 100644 templates/LICENSE delete mode 100644 templates/redirect.html diff --git a/lib/css/login.css b/lib/css/login.css index 9059f16..25e5a62 100644 --- a/lib/css/login.css +++ b/lib/css/login.css @@ -4,7 +4,6 @@ body { .login-container{ margin-top: 5%; margin-bottom: 5%; - margin-left: 30%; } .login-form-1{ padding: 5%; @@ -19,8 +18,8 @@ body { } .btnSubmit { - width: 50%; - border-radius: 1rem; + width: 40%; + border-radius: 2rem; padding: 1.5%; border: none; cursor: pointer; diff --git a/errors/404.html b/lib/errors/404.html similarity index 100% rename from errors/404.html rename to lib/errors/404.html diff --git a/js/insertnew.js b/lib/js/insertnew.js similarity index 100% rename from js/insertnew.js rename to lib/js/insertnew.js diff --git a/js/login.js b/lib/js/login.js similarity index 100% rename from js/login.js rename to lib/js/login.js diff --git a/js/sha512.js b/lib/js/sha512.js similarity index 100% rename from js/sha512.js rename to lib/js/sha512.js diff --git a/js/sha512.min.js b/lib/js/sha512.min.js similarity index 100% rename from js/sha512.min.js rename to lib/js/sha512.min.js diff --git a/lib/php/lostpassword.php b/lib/php/forgot.php similarity index 100% rename from lib/php/lostpassword.php rename to lib/php/forgot.php diff --git a/lib/php/go.php b/lib/php/go.php index 9bf4cec..bbcbf76 100644 --- a/lib/php/go.php +++ b/lib/php/go.php @@ -18,12 +18,38 @@ $row = $result->fetch_assoc ( ); if ( ! $row ) { http_response_code ( 404 ); - include ( 'errors/404.html' ); + include ( $config [ 'installation_path' ] . '/lib/errors/404.html' ); exit; } else { - include ( 'templates/redirect.html' ); - echo ( '' ); +?> + + + + Redirect in 5 seconds + + + +
+

You will be redirected to in 5

+
+ + + + BJPHoster URL Shortener | Control Panel + @@ -55,7 +56,7 @@
- + diff --git a/lib/php/login.php b/lib/php/login.php index a87f171..7e359c7 100644 --- a/lib/php/login.php +++ b/lib/php/login.php @@ -3,8 +3,8 @@ header ( "Location: " . substr ( $_SERVER [ 'SCRIPT_NAME' ], 0, -10 ) . "/insert" ); exit; } - if ( isset ( $session [ 1 ] ) && $session [ 1 ] == "forgot" ) { - include ( $config [ 'installation_path ' ] . '/lib/php/forgotpassword.php' ); + if ( isset ( $request [ 1 ] ) && $request [ 1 ] == "forgot" ) { + include ( $config [ 'installation_path' ] . '/lib/php/forgot.php' ); exit; } if ( isset ( $_POST [ 'username' ] ) && isset ( $_POST [ 'password' ] ) ) { @@ -49,7 +49,7 @@ BJPHoster URL Shortener | Login - +
@@ -74,8 +74,8 @@
- - + + diff --git a/templates/LICENSE b/templates/LICENSE deleted file mode 100644 index 2cd9da9..0000000 --- a/templates/LICENSE +++ /dev/null @@ -1,16 +0,0 @@ -Copyright © 2019 - Bryan Pedini - -Every file within this folder and it's subfolders is provided -with the website for the correct work of the website itself, -is provided AS IS, comes with NO WARRANTY of scope or -working purposes, and is proprietary software. - -Such this code may not be copied without explicit permission from -myself only, this code may not be modified within the website, -you may not copy, edit, share, clone or do anything else but -use the code as is without explicit permission to do so. - -Such permissions can be requested at copyright@bryanpedini.it -No permissions to do anything against this license is given -without an explicit and valid motivation to do so, so please -don't email me asking to do so or so without providing why. \ No newline at end of file diff --git a/templates/redirect.html b/templates/redirect.html deleted file mode 100644 index 218b8dc..0000000 --- a/templates/redirect.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - Redirect in 5 seconds - - -
-

You will be redirected to in 5

-
- - -