-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
54 changed files
with
702 additions
and
774 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,4 +30,5 @@ Webserver: Apache with [Mod Rewrite](http://httpd.apache.org/docs/current/mod/mo | |
- [Documentation](http://monstra.org/documentation) | ||
- [Github Repository](https://github.com/monstra-cms/monstra) | ||
|
||
Copyright (C) 2012-2015 Romanenko Sergey / Awilum [[email protected]] | ||
## License | ||
See [LICENSE](https://github.com/monstra-cms/monstra/blob/master/LICENSE.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,17 @@ | ||
<?php | ||
|
||
/** | ||
* Monstra Engine | ||
* Monstra | ||
* | ||
* This source file is part of the Monstra Engine. More information, | ||
* documentation and tutorials can be found at http://monstra.org | ||
* | ||
* @package Monstra | ||
* | ||
* @author Romanenko Sergey / Awilum <[email protected]> | ||
* @copyright 2012-2014 Romanenko Sergey / Awilum <[email protected]> | ||
* @package Monstra | ||
* @author Romanenko Sergey / Awilum <[email protected]> | ||
* @link http://monstra.org | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
|
||
// Main engine defines | ||
define('DS', DIRECTORY_SEPARATOR); | ||
define('ROOT', rtrim(str_replace(array('admin'), array(''), dirname(__FILE__)), '\\/')); | ||
|
@@ -32,13 +29,9 @@ | |
|
||
// Admin login | ||
if (Request::post('login_submit')) { | ||
|
||
if (Cookie::get('login_attempts') && Cookie::get('login_attempts') >= 5) { | ||
|
||
$login_error = __('You are banned for 10 minutes. Try again later', 'users'); | ||
|
||
} else { | ||
|
||
$user = $users->select("[login='" . trim(Request::post('login')) . "']", null); | ||
if (count($user) !== 0) { | ||
if ($user['login'] == Request::post('login')) { | ||
|
@@ -64,7 +57,6 @@ | |
} else { | ||
Cookie::set('login_attempts', 1, 600); | ||
} | ||
|
||
} | ||
} | ||
} else { | ||
|
@@ -84,7 +76,6 @@ | |
} | ||
|
||
Notification::setNow('error', $login_error); | ||
|
||
} | ||
|
||
// Errors | ||
|
@@ -97,10 +88,15 @@ | |
|
||
// Reset Password Form Submit | ||
if (Request::post('reset_password_submit')) { | ||
|
||
if (Option::get('captcha_installed') == 'true' && ! CryptCaptcha::check(Request::post('answer'))) $errors['users_captcha_wrong'] = __('Captcha code is wrong', 'users'); | ||
if ($user_login == '') $errors['users_empty_field'] = __('Required field', 'users'); | ||
if ($user_login != '' && ! $users->select("[login='".$user_login."']")) $errors['users_user_doesnt_exists'] = __('This user doesnt exist', 'users'); | ||
if (Option::get('captcha_installed') == 'true' && ! CryptCaptcha::check(Request::post('answer'))) { | ||
$errors['users_captcha_wrong'] = __('Captcha code is wrong', 'users'); | ||
} | ||
if ($user_login == '') { | ||
$errors['users_empty_field'] = __('Required field', 'users'); | ||
} | ||
if ($user_login != '' && ! $users->select("[login='".$user_login."']")) { | ||
$errors['users_user_doesnt_exists'] = __('This user doesnt exist', 'users'); | ||
} | ||
|
||
if (count($errors) == 0) { | ||
|
||
|
@@ -136,7 +132,6 @@ | |
|
||
// Redirect to password-reset page | ||
Request::redirect(Site::url().'/admin'); | ||
|
||
} | ||
|
||
Notification::setNow('reset_password', 'reset_password'); | ||
|
@@ -184,12 +179,10 @@ | |
|
||
// Backend post render | ||
Action::run('admin_post_render'); | ||
|
||
} else { | ||
|
||
// Display login template | ||
require 'themes'. DS . Option::get('theme_admin_name') . DS . 'login.template.php'; | ||
|
||
} | ||
|
||
// Flush (send) the output buffer and turn off output buffering | ||
|
Oops, something went wrong.