summaryrefslogtreecommitdiff
path: root/html
diff options
context:
space:
mode:
Diffstat (limited to 'html')
-rw-r--r--html/app/config/app_constants.php5
-rw-r--r--html/app/models/admin/History_model.php2
-rw-r--r--html/app/routes/frontend.php3
-rw-r--r--html/app/views/login.php52
-rw-r--r--html/app/views/simple/Render.php2
-rw-r--r--html/index.php11
6 files changed, 71 insertions, 4 deletions
diff --git a/html/app/config/app_constants.php b/html/app/config/app_constants.php
index c3b142f..c533748 100644
--- a/html/app/config/app_constants.php
+++ b/html/app/config/app_constants.php
@@ -14,6 +14,11 @@ define('DEFAULT_PRIVILEGES', [
+define('COMMON_USER', 1);
+define('EDITOR', 2);
+define('ADMIN', 3);
+
+
// ACCESS HISTORY //////////////////////////////////////////////////////////////
// -----------------------------------------------------------------------------
// (user-)access types
diff --git a/html/app/models/admin/History_model.php b/html/app/models/admin/History_model.php
index 638ac62..438121e 100644
--- a/html/app/models/admin/History_model.php
+++ b/html/app/models/admin/History_model.php
@@ -5,7 +5,7 @@ namespace app\models\admin;
use \Registry;
-class User_model
+class Histrory_model
{
/** track user access
diff --git a/html/app/routes/frontend.php b/html/app/routes/frontend.php
index 8ba7b4f..191ce4e 100644
--- a/html/app/routes/frontend.php
+++ b/html/app/routes/frontend.php
@@ -19,6 +19,9 @@ Route::notFound( function() {
}); // 404
+Route::add('/login', function() { Render::view('login'); });
+
+
// Resolve urls
// --- -- -- - - -
Route::add('/course/([0-9a-zA-Z-_]*)',
diff --git a/html/app/views/login.php b/html/app/views/login.php
new file mode 100644
index 0000000..769b660
--- /dev/null
+++ b/html/app/views/login.php
@@ -0,0 +1,52 @@
+<html>
+<head>
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>404: Not Found</title>
+
+ <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-aFq/bzH65dt+w6FI2ooMVUpc+21e0SRygnTpmBvdBgSdnuTN7QbdgL+OapgHtvPp" crossorigin="anonymous">
+
+ <style>
+ html,body{
+ padding:0; margin:0;
+ font-size:1.25em; font-family: Ubuntu, Arial, Helvetica, sans-serif;
+ color: #037; background: #f3f4f5;
+ line-height:1.2em;
+ }
+ h3 {
+ font-size: 2em; font-style: normal;
+ font-weight: 400;
+ color: #05a;
+ margin: 0; padding: 5px;
+ opacity: 0.27;
+ border-bottom: 1px solid #05a;
+ }
+ .container { display: flex; height: 100vh; align-items:center; }
+ .content { position: relative;
+ max-width:320px; width: 100%;
+ margin: auto auto; padding: 1.5em;
+ text-align: center; justify-center: center;
+ opacity: .33;
+ }
+ </style>
+</head>
+<body>
+ <div class='container'>
+ <div class='content'>
+ <h2>Login</h2>
+ <hr />
+ <form method="post" action="/login-check">
+ <div class="mb-3">
+ <label for="exampleInputEmail1" class="form-label">Email</label>
+ <input type="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp">
+ </div>
+ <div class="mb-3">
+ <label for="exampleInputPassword1" class="form-label">Password</label>
+ <input type="password" class="form-control" id="exampleInputPassword1">
+ </div>
+ <button type="submit" class="btn btn-primary">Submit</button>
+ </form>
+ </div>
+ </div>
+</body>
+</html>
diff --git a/html/app/views/simple/Render.php b/html/app/views/simple/Render.php
index ebe15fc..79a93a0 100644
--- a/html/app/views/simple/Render.php
+++ b/html/app/views/simple/Render.php
@@ -10,7 +10,7 @@
*
* -----------------------------------------------------------------------------
*/
-class Render
+class Render_example
{
/** Render::template($data)
diff --git a/html/index.php b/html/index.php
index d26d0a3..92b825a 100644
--- a/html/index.php
+++ b/html/index.php
@@ -28,11 +28,19 @@ require_once '../core/config/anom_settings.php'; // core framework constants
require_once 'app/config/app_constants.php'; // application constants
+
// Enable Autoloader
// -----------------------------------------------------------------------------
require_once AUTOLOADER;
+// Enable sessions
+// -----------------------------------------------------------------------------
+$session = new (SESSION_DRIVER)(); // Start a new session
+
+
+// prepare output control and benchmarking
+// -----------------------------------------------------------------------------
ob_start(); // handle output
if (!PRODUCTION) Benchmark::add_spot('start'); // benchmark request's life
@@ -44,11 +52,10 @@ if (!PRODUCTION) Benchmark::add_spot('start'); // benchmark request's life
require_once INIT_APPLICATION;
-
// Application is ready!
// -----------------------------------------------------------------------------
-Route::run(Registry::get('REQUEST')); // Run baby, run!
+Route::run(Registry::get('REQUEST')); // Run baby, run!
if (!PRODUCTION) Benchmark::add_spot('end'); // request ended