Skip to content
Snippets Groups Projects
Commit 34a51b1f authored by PavelBegunkov's avatar PavelBegunkov
Browse files

fix signin - absent personal data

parent 6adadc14
Branches
Tags
No related merge requests found
......@@ -20,7 +20,7 @@ class Controller_Handler extends Controller {
public function before()
{
$isDownload = Cookie::get('fD');
// $isDownload = Cookie::get('fD'); // TODO: check - unused var
$this->user = User::instance();
// Если у нас запрос идет не из AJAX
// if(!$this->request->is_ajax() && !$isDownload)
......@@ -41,10 +41,12 @@ class Controller_Handler extends Controller {
// Получаем имя маршрута
$route = Route::name($this->request->route());
$route .= ':'.$this->request->controller();
$userMark = (int)$this->user->RoleMark;
if ($userMark == 0) {
try {
$userMark = (int)$this->user->RoleMark;
} catch (Exception $e) {
$userMark = (int)1;
}
// Если запрос не прошел на проверку доступа
if( !$this->checkAccessLevel() ||
!$this->checkBitmask($userMark, $route))
......
......@@ -10,7 +10,8 @@ class Controller_Handler_Sign extends Controller_Handler {
public function action_in()
{
$this->post->rule('login', 'email')->rule('login', 'not_empty');
$checklogin = true; $response['success'] = false;
$checkLogin = true;
$response['success'] = false;
if(!$this->post->check())
{
$this->post = Validation::factory($this->post->data());
......@@ -18,10 +19,10 @@ class Controller_Handler_Sign extends Controller_Handler {
if(!$this->post->check())
{
// Данные не безопасны, даже не пытаемся авторизоваться
$checklogin = false;
$checkLogin = false;
}
}
if($checklogin)
if($checkLogin)
{
$response['success'] = User::instance()
->signIn($this->post['login'],
......
......@@ -139,7 +139,7 @@ class Kohana_User implements ArrayAccess
$this->_session->set('UserHash', $this->hash($userHash));
$this->_session->set('PasswordHash', $passwordHash);
$this->_session->set('start_time', time());
$this->_session->set("SemesterID", $semester);
$this->_session->set('SemesterID', $semester);
return true;
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment