diff --git a/admin/controllers/login.php b/admin/controllers/login.php index 60227b2e..d9ee03fe 100644 --- a/admin/controllers/login.php +++ b/admin/controllers/login.php @@ -8,6 +8,31 @@ // Functions // ============================================================================ +function checkPost($args) +{ + global $Security; + global $Login; + global $Language; + + if($Security->isBlocked()) { + Alert::set($Language->g('IP address has been blocked').'
'.$Language->g('Try again in a few minutes')); + return false; + } + + // Verify User sanitize the input + if( $Login->verifyUser($_POST['username'], $_POST['password']) ) + { + Redirect::page('admin', 'dashboard'); + return true; + } + + // Bruteforce protection, add IP to blacklist. + $Security->addLoginFail(); + Alert::set($Language->g('Username or password incorrect')); + + return false; +} + // ============================================================================ // Main before POST // ============================================================================ @@ -18,15 +43,7 @@ if( $_SERVER['REQUEST_METHOD'] == 'POST' ) { - // Verify User sanitize the input - if( $Login->verifyUser($_POST['username'], $_POST['password']) ) - { - Redirect::page('admin', 'dashboard'); - } - else - { - Alert::set($Language->g('Username or password incorrect')); - } + checkPost($_POST); } // ============================================================================ diff --git a/admin/controllers/plugins.php b/admin/controllers/plugins.php new file mode 100644 index 00000000..20c8e2fb --- /dev/null +++ b/admin/controllers/plugins.php @@ -0,0 +1,26 @@ +role()!=='admin') { + Alert::set($Language->g('you-do-not-have-sufficient-permissions')); + Redirect::page('admin', 'dashboard'); +} + +// ============================================================================ +// Functions +// ============================================================================ + +// ============================================================================ +// Main before POST +// ============================================================================ + +// ============================================================================ +// POST Method +// ============================================================================ + +// ============================================================================ +// Main after POST +// ============================================================================ \ No newline at end of file diff --git a/admin/themes/default/css/default.css b/admin/themes/default/css/default.css index a8d4dca0..5246859e 100644 --- a/admin/themes/default/css/default.css +++ b/admin/themes/default/css/default.css @@ -16,6 +16,10 @@ div.unit-80 { margin-left: 1% !important; } +.tools-alert { + text-align: center; +} + /* ----------- FONTS AWESOME ----------- */ .fa-right { margin-right: 5px; @@ -140,6 +144,7 @@ div.dashboardBox .nav { div.dashboardBox .nav a { padding: 0 !important; display: inline-block; + margin-left: 8px; } div.dashboardBox i.iconContent { @@ -154,6 +159,11 @@ div.dashboardBox div.bigContent { font-weight: bold; } +div.dashboardBox span { + display: inline-block !important; + padding: 3px 6px; +} + div.dashboardBox h2 { color: #666; font-size: 1.1em; @@ -189,6 +199,7 @@ div.dashboardBox ul.menu li.description:last-child { margin-bottom: 0 !important; } + /* ----------- FORMS ----------- */ form h4 { diff --git a/admin/themes/default/css/installer.css b/admin/themes/default/css/installer.css index 988fe753..153f0e5f 100644 --- a/admin/themes/default/css/installer.css +++ b/admin/themes/default/css/installer.css @@ -8,6 +8,10 @@ a:hover { text-decoration: none !important; } +p { + margin-bottom: 0; +} + /* ----------- FONTS AWESOME ----------- */ .fa-right { margin-right: 5px; @@ -16,7 +20,7 @@ a:hover { /* ----------- ----------- */ div.main { text-align: center; - margin: 30px 0; + margin: 50px 0 0 0; } h1.title { font-weight: lighter; @@ -27,6 +31,10 @@ td { text-align: center; } +.boxInstallerForm { + margin-top: 30px !important; +} + .tools-message { display: block; position: relative; diff --git a/admin/themes/default/index.php b/admin/themes/default/index.php index 02113bb6..c6738ce8 100644 --- a/admin/themes/default/index.php +++ b/admin/themes/default/index.php @@ -2,7 +2,7 @@ - + <?php echo $layout['title'] ?> diff --git a/admin/themes/default/login.php b/admin/themes/default/login.php index d4744cd0..e7cf297f 100644 --- a/admin/themes/default/login.php +++ b/admin/themes/default/login.php @@ -2,10 +2,10 @@ - + - Bludit Log in + Bludit @@ -23,7 +23,7 @@ @@ -31,13 +31,13 @@
-
+
'.Alert::get().'
'; + echo '
'.Alert::get().'
'; } // Load view @@ -51,8 +51,6 @@
- - diff --git a/admin/views/dashboard.php b/admin/views/dashboard.php index f96240a9..9e159b1c 100644 --- a/admin/views/dashboard.php +++ b/admin/views/dashboard.php @@ -50,7 +50,7 @@
-

Drafts

+

p('Drafts') ?>

-
- \ No newline at end of file diff --git a/admin/views/manage-pages.php b/admin/views/manage-pages.php index 22c18e12..e2370ee1 100644 --- a/admin/views/manage-pages.php +++ b/admin/views/manage-pages.php @@ -24,7 +24,7 @@ } echo ''; - echo ''.($Page->parentKey()?NO_PARENT_CHAR:'').''.($Page->published()?'':'['.$Language->g('Draft').'] ').($Page->title()?$Page->title():'['.$Language->g('Empty title').'] ').''; + echo ''.($Page->parentKey()?NO_PARENT_CHAR:'').''.($Page->published()?'':''.$Language->g('Draft').' ').($Page->title()?$Page->title():''.$Language->g('Empty title').' ').''; echo ''.$parentTitle.''; echo ''; } diff --git a/admin/views/manage-posts.php b/admin/views/manage-posts.php index 2745600c..2d0562b7 100755 --- a/admin/views/manage-posts.php +++ b/admin/views/manage-posts.php @@ -16,7 +16,7 @@ foreach($posts as $Post) { echo ''; - echo ''.($Post->published()?'':''.$Language->g('Draft').' ').($Post->title()?$Post->title():'['.$Language->g('Empty title').'] ').''; + echo ''.($Post->published()?'':''.$Language->g('Draft').' ').($Post->title()?$Post->title():''.$Language->g('Empty title').' ').''; echo ''.$Post->dateCreated().''; echo ''.$Post->timeago().''; echo ''; diff --git a/admin/views/settings.php b/admin/views/settings.php index efd30b4b..16ab51f2 100644 --- a/admin/views/settings.php +++ b/admin/views/settings.php @@ -24,7 +24,7 @@