Bludit Installer
+Welcome to the Bludit installer
+ + + +Complete the form, choose a password for the username admin
+'.$value.' |
diff --git a/admin/controllers/add-user.php b/admin/controllers/add-user.php index 8988d60b..1cb13fe7 100644 --- a/admin/controllers/add-user.php +++ b/admin/controllers/add-user.php @@ -1,5 +1,14 @@ role()!=='admin') { + Alert::set('You do not have sufficient permissions to access this page, contact the administrator.'); + Redirect::page('admin', 'dashboard'); +} + // ============================================================================ // Functions // ============================================================================ @@ -45,3 +54,7 @@ if( $_SERVER['REQUEST_METHOD'] == 'POST' ) Redirect::page('admin', 'users'); } } + +// ============================================================================ +// Main +// ============================================================================ diff --git a/admin/controllers/edit-user.php b/admin/controllers/edit-user.php index 7fdd0da5..f2fe4d9e 100644 --- a/admin/controllers/edit-user.php +++ b/admin/controllers/edit-user.php @@ -1,5 +1,9 @@ role()!=='admin') + { + $_POST['username'] = $Login->username(); + unset($_POST['role']); + } + if( editUser($_POST) ) { Alert::set('User saved successfuly.'); } + +} + +// ============================================================================ +// Main +// ============================================================================ + +if($Login->role()!=='admin') { + $layout['parameters'] = $Login->username(); } $_user = $dbUsers->get($layout['parameters']); // If the user doesn't exist, redirect to the users list. -if($_user===false) - Redirect::page('admin', 'users'); \ No newline at end of file +if($_user===false) { + Redirect::page('admin', 'users'); +} + +$_user['username'] = $layout['parameters']; \ No newline at end of file diff --git a/admin/controllers/login.php b/admin/controllers/login.php index 4dc0d4ca..4dc23ea9 100644 --- a/admin/controllers/login.php +++ b/admin/controllers/login.php @@ -9,4 +9,8 @@ if( $_SERVER['REQUEST_METHOD'] == 'POST' ) { Redirect::page('admin', 'dashboard'); } + else + { + Alert::set('Login failed'); + } } diff --git a/admin/controllers/logout.php b/admin/controllers/logout.php new file mode 100644 index 00000000..53702e42 --- /dev/null +++ b/admin/controllers/logout.php @@ -0,0 +1,6 @@ +logout()) +{ + Redirect::home(); +} diff --git a/admin/controllers/settings.php b/admin/controllers/settings.php index 90a926dc..3b9d3bff 100644 --- a/admin/controllers/settings.php +++ b/admin/controllers/settings.php @@ -1,5 +1,14 @@ role()!=='admin') { + Alert::set('You do not have sufficient permissions to access this page, contact the administrator.'); + Redirect::page('admin', 'dashboard'); +} + // ============================================================================ // Functions // ============================================================================ @@ -28,3 +37,7 @@ if( $_SERVER['REQUEST_METHOD'] == 'POST' ) { setSettings($_POST); } + +// ============================================================================ +// Main +// ============================================================================ diff --git a/admin/controllers/users.php b/admin/controllers/users.php index 7e550c48..cb1667da 100644 --- a/admin/controllers/users.php +++ b/admin/controllers/users.php @@ -1,6 +1,23 @@ role()!=='admin') { + Alert::set('You do not have sufficient permissions to access this page, contact the administrator.'); + Redirect::page('admin', 'dashboard'); +} + +// ============================================================================ +// POST Method +// ============================================================================ + if( $_SERVER['REQUEST_METHOD'] == 'POST' ) { $Site->set($_POST); } + +// ============================================================================ +// Main +// ============================================================================ diff --git a/admin/themes/default/css/installer.css b/admin/themes/default/css/installer.css new file mode 100644 index 00000000..8b77bd52 --- /dev/null +++ b/admin/themes/default/css/installer.css @@ -0,0 +1,25 @@ +a { + text-decoration: none; + color: #333; +} + +a:hover { + color: #2672ec !important; + text-decoration: none !important; +} + +/* ----------- FONTS AWESOME ----------- */ +.fa-right { + margin-right: 5px; +} + +/* ----------- ----------- */ +div.main { + text-align: center; + margin: 30px 0; +} +h1.title { + font-weight: lighter; + font-size: 4em; +} + diff --git a/admin/themes/default/index.php b/admin/themes/default/index.php index 9b9dc3fb..673c36c1 100644 --- a/admin/themes/default/index.php +++ b/admin/themes/default/index.php @@ -22,7 +22,7 @@ + + +
+Welcome to the Bludit installer
+ + + +Complete the form, choose a password for the username admin
+'.$value.' |