diff --git a/db/StoredProcedures.sql b/db/StoredProcedures.sql
index 2dbbe41314727c6f4ae12dfaee04af490fd1dc06..057b5310b21585257e76914a9fafa8f62822dd63 100644
--- a/db/StoredProcedures.sql
+++ b/db/StoredProcedures.sql
@@ -380,7 +380,8 @@ BEGIN
 			accounts.Login 		AS 'AccLogin', 
 			accounts.EMail 		AS 'AccEMail', 
 			user_roles.Type 	AS 'AccType',
-			user_roles.Role 	AS 'AccRole',	 
+			user_roles.RoleName	AS 'AccRole',	 
+			user_roles.Mark 	AS 'AccRoleMark',	 
 			accounts.isEnabled,
 			( accounts.ActivationCode IS NULL) AS 'isActivated',
 			accounts.UserAgent	
diff --git a/~dev_rating/application/bootstrap.php b/~dev_rating/application/bootstrap.php
index dda05c96821c710508aa689036e7ba773e1225ed..726fa28a6ec5a6cff19186a804911f3f257be96a 100644
--- a/~dev_rating/application/bootstrap.php
+++ b/~dev_rating/application/bootstrap.php
@@ -1,4 +1,4 @@
-п»ї<?php defined('SYSPATH') or die('No direct script access.');
+<?php defined('SYSPATH') or die('No direct script access.');
 
 // -- Environment setup --------------------------------------------------------
 
@@ -103,7 +103,7 @@ if (isset($_SERVER['KOHANA_ENV']))
  * - boolean  expose      set the X-Powered-By header                        FALSE
  */
 Kohana::init(array(
-	'base_url'   => '/~dev_rating',
+	'base_url'   => '/~dev_rating/',
         'index_file' => FALSE
 ));
 
@@ -166,7 +166,7 @@ Route::set('handler', 'handler/<controller>/<action>(/<id>)')
                 {
                     if ($request->method() !== HTTP_Request::POST)
                     {
-                        // Данный маршрут выполним только для POST-запросов
+                        // Данный маршрут выполним только для POST-запросов изнутри фреймворка
                         return FALSE;
                     }
                 });
diff --git a/~dev_rating/application/classes/Controller/UserEnvi.php b/~dev_rating/application/classes/Controller/UserEnvi.php
index 403f538625e004d02b263420ee28207a33cf38b8..e162be9be246e6f81e90887e15b7da4baeacef48 100644
--- a/~dev_rating/application/classes/Controller/UserEnvi.php
+++ b/~dev_rating/application/classes/Controller/UserEnvi.php
@@ -7,8 +7,7 @@ class Controller_UserEnvi extends Controller {
     {
         if(!User::instance()->isSignedIn())
         {
-            //$this->redirect('sign', 302);
-            throw new Kohana_Exception();
+            $this->redirect('sign', 302);
         }
         else 
         {
@@ -16,12 +15,13 @@ class Controller_UserEnvi extends Controller {
             // Проверка на 
             $this->UserInfo = User::instance()->getInfoAsArray();
             // Проверка на доступ к странице
-            $route = $this->request->route()->name();
-            $userMark = User::instance()->getUserMark();
-            $bitmask = Model_System::factory()->getBitmaskForRoute($route);
+            $route = Route::name($this->request->route());
+            $userMark = User::instance()->offsetGet('AccRoleMark');
+            $sysModel = new Model_System;
+            $bitmask = $sysModel->getBitmaskForRoute($route);
             if(!($bitmask & $userMark))
             {
-                throw HTTP_Exception::factory(403, 'Не пытайтесь попасть туда, куда попадать не следует.');
+                throw HTTP_Exception::factory(403, 'Не пытайтесь попасть туда, куда попадать не следует: '.$bitmask);
             }
         }
     }
diff --git a/~dev_rating/application/classes/Model/System.php b/~dev_rating/application/classes/Model/System.php
new file mode 100644
index 0000000000000000000000000000000000000000..0ec6304bf4317f9dc43354a0b7f64075fe10b85a
--- /dev/null
+++ b/~dev_rating/application/classes/Model/System.php
@@ -0,0 +1,10 @@
+<?php defined('SYSPATH') or die('No direct script access.');
+  
+class Model_System extends Model
+{
+    public function getBitmaskForRoute($routeName)
+    {
+        $sql = "SELECT `GetBitmaskByPagename`('$routeName') AS `Bitmask`; ";
+        return DB::query(Database::SELECT, $sql)->execute()->get('Bitmask');
+    }
+}
diff --git a/~dev_rating/modules/account/classes/Kohana/User.php b/~dev_rating/modules/account/classes/Kohana/User.php
index 6e4cd21824402569ed1d018e844459503a891da9..099d36657dfe15190c7e61c845e20f2b19f1664d 100644
--- a/~dev_rating/modules/account/classes/Kohana/User.php
+++ b/~dev_rating/modules/account/classes/Kohana/User.php
@@ -87,7 +87,7 @@ class Kohana_User implements ArrayAccess {
     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);
@@ -218,8 +218,6 @@ class Kohana_User implements ArrayAccess {
     {
         $info = $this->_model->getPersonalInfoByID($id)->offsetGet(0);
         $info += $this->_model->getAccountInfoByID($id)->offsetGet(0);
-        $info['EMail'] = $info['E-Mail'];
-        unset($info['E-Mail']);
         return $info;
     }