1
0
mirror of https://github.com/monstra-cms/monstra.git synced 2025-08-03 19:57:57 +02:00

Update admin/index.php

This commit is contained in:
Sergey Romanenko
2013-01-11 13:39:28 +02:00
parent ea611229a6
commit 1129602b52

View File

@@ -21,7 +21,7 @@ define('ROOT', rtrim(str_replace(array('admin'), array(''), dirname(__FILE__)),
define('BACKEND', true); define('BACKEND', true);
define('MONSTRA_ACCESS', true); define('MONSTRA_ACCESS', true);
// Load bootstrap file // Load Monstra engine _init.php file
require_once ROOT. DS .'engine'. DS .'_init.php'; require_once ROOT. DS .'engine'. DS .'_init.php';
// Errors var when users login failed // Errors var when users login failed
@@ -33,7 +33,7 @@ $users = new Table('users');
// Admin login // Admin login
if (Request::post('login_submit')) { if (Request::post('login_submit')) {
$user = $users->select("[login='" . trim(Request::post('login')) . "']", null); $user = $users->select("[login='" . trim(Request::post('login')) . "']", null);
if (count($user) !== 0) { if (count($user) !== 0) {
if ($user['login'] == Request::post('login')) { if ($user['login'] == Request::post('login')) {
if (trim($user['password']) == Security::encryptPassword(Request::post('password'))) { if (trim($user['password']) == Security::encryptPassword(Request::post('password'))) {