From c8442bad8054b2cea8bace8ee90c494cf0d974a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B9=20=D0=A0=D1=83=D0=B4?= =?UTF-8?q?=D0=B5=D0=BD=D0=B5=D1=86?= <andrey.rudenets@gmail.com> Date: Fri, 22 Aug 2014 22:01:29 +0400 Subject: [PATCH] lol --- .gitignore | 1 - db/Sample.sql | 4 ++-- ~dev_rating/application/classes/Controller/UserEnvi.php | 6 ++++-- ~dev_rating/modules/account/classes/Kohana/User.php | 4 ++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 8247f97b2..342e1cbc2 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,5 @@ ~dev_rating/modules/kotwig/cache/ nbproject/ *.*~ -~dev_rating/.htaccess /.project diff --git a/db/Sample.sql b/db/Sample.sql index 52a06877d..95bd8d678 100644 --- a/db/Sample.sql +++ b/db/Sample.sql @@ -53,8 +53,8 @@ INSERT INTO `degrees` (`ID`, `Name`) VALUES -- INSERT INTO `faculties` (`ID`, `Name`, `Abbr`) VALUES -(1, 'Математика Механика Рё РљРќ', 'МехМат'), -(2, 'Юридический факультет', 'ЮрФак'); +(1, 'Рнститут математики, механики Рё компьютерных наук', 'Мехмат'), +(2, 'Юридический факультет', 'Юрфак'); -- -- Дамп данных таблицы `departments` diff --git a/~dev_rating/application/classes/Controller/UserEnvi.php b/~dev_rating/application/classes/Controller/UserEnvi.php index ca3de6681..403f53862 100644 --- a/~dev_rating/application/classes/Controller/UserEnvi.php +++ b/~dev_rating/application/classes/Controller/UserEnvi.php @@ -5,12 +5,14 @@ class Controller_UserEnvi extends Controller { public function before() { - if(!Account::instance()->isSignedIn()) + if(!User::instance()->isSignedIn()) { - $this->redirect('sign', 302); + //$this->redirect('sign', 302); + throw new Kohana_Exception(); } else { + // Проверка РЅР° $this->UserInfo = User::instance()->getInfoAsArray(); // Проверка РЅР° доступ Рє странице diff --git a/~dev_rating/modules/account/classes/Kohana/User.php b/~dev_rating/modules/account/classes/Kohana/User.php index 1be2f51e3..6e4cd2182 100644 --- a/~dev_rating/modules/account/classes/Kohana/User.php +++ b/~dev_rating/modules/account/classes/Kohana/User.php @@ -81,13 +81,13 @@ class Kohana_User implements ArrayAccess { if($id == -1) return false; else - return $this->completeSignIn ($id, $this->hash($password)); + return $this->completeSignIn($id, $this->hash($password)); } protected function completeSignIn($id, $passhash) { $userHash = $this->hash($id.Request::$user_agent.Request::$client_ip).$this->_config['hash_key']; $passhash = $this->hash($passhash.$this->_config['hash_key']); - Cookie::set('userhash', $passhash); + //Cookie::set('userhash', $passhash); $this->_userInfo = $this->_getInfoFromDB($id); $this->_session->regenerate(); $this->_session->set('ID', $id); -- GitLab