Skip to content
Snippets Groups Projects
Commit c8442bad authored by Andrew Rudenets's avatar Andrew Rudenets
Browse files

lol

parent 9848313d
Branches
Tags
No related merge requests found
...@@ -5,6 +5,5 @@ ...@@ -5,6 +5,5 @@
~dev_rating/modules/kotwig/cache/ ~dev_rating/modules/kotwig/cache/
nbproject/ nbproject/
*.*~ *.*~
~dev_rating/.htaccess
/.project /.project
...@@ -53,8 +53,8 @@ INSERT INTO `degrees` (`ID`, `Name`) VALUES ...@@ -53,8 +53,8 @@ INSERT INTO `degrees` (`ID`, `Name`) VALUES
-- --
INSERT INTO `faculties` (`ID`, `Name`, `Abbr`) VALUES INSERT INTO `faculties` (`ID`, `Name`, `Abbr`) VALUES
(1, 'Математика Механика и КН', 'МехМат'), (1, 'Институт математики, механики и компьютерных наук', 'Мехмат'),
(2, 'Юридический факультет', 'ЮрФак'); (2, 'Юридический факультет', 'Юрфак');
-- --
-- Дамп данных таблицы `departments` -- Дамп данных таблицы `departments`
......
...@@ -5,12 +5,14 @@ class Controller_UserEnvi extends Controller { ...@@ -5,12 +5,14 @@ class Controller_UserEnvi extends Controller {
public function before() public function before()
{ {
if(!Account::instance()->isSignedIn()) if(!User::instance()->isSignedIn())
{ {
$this->redirect('sign', 302); //$this->redirect('sign', 302);
throw new Kohana_Exception();
} }
else else
{ {
// Проверка на // Проверка на
$this->UserInfo = User::instance()->getInfoAsArray(); $this->UserInfo = User::instance()->getInfoAsArray();
// Проверка на доступ к странице // Проверка на доступ к странице
......
...@@ -81,13 +81,13 @@ class Kohana_User implements ArrayAccess { ...@@ -81,13 +81,13 @@ class Kohana_User implements ArrayAccess {
if($id == -1) if($id == -1)
return false; return false;
else else
return $this->completeSignIn ($id, $this->hash($password)); return $this->completeSignIn($id, $this->hash($password));
} }
protected function completeSignIn($id, $passhash) { protected function completeSignIn($id, $passhash) {
$userHash = $this->hash($id.Request::$user_agent.Request::$client_ip).$this->_config['hash_key']; $userHash = $this->hash($id.Request::$user_agent.Request::$client_ip).$this->_config['hash_key'];
$passhash = $this->hash($passhash.$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->_userInfo = $this->_getInfoFromDB($id);
$this->_session->regenerate(); $this->_session->regenerate();
$this->_session->set('ID', $id); $this->_session->set('ID', $id);
......
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