Commit 73c98b9a326bcdc70d713aabf39b202e624d16e1

Authored by Yarik
1 parent 0829b346

Устранены баги, поменял базу на PostgreSQL

common/config/main-local.php
@@ -3,10 +3,15 @@ return [ @@ -3,10 +3,15 @@ return [
3 'components' => [ 3 'components' => [
4 'db' => [ 4 'db' => [
5 'class' => 'yii\db\Connection', 5 'class' => 'yii\db\Connection',
6 - 'dsn' => 'mysql:host=localhost;dbname=artbox_db',  
7 - 'username' => 'root', 6 + 'dsn' => 'pgsql:host=localhost;port=5432;dbname=artbox_pg',
  7 + 'username' => 'postgres',
8 'password' => '', 8 'password' => '',
9 - 'charset' => 'utf8', 9 + 'schemaMap' => [
  10 + 'pgsql'=> [
  11 + 'class'=>'yii\db\pgsql\Schema',
  12 + 'defaultSchema' => 'public'
  13 + ]
  14 + ],
10 ], 15 ],
11 'mailer' => [ 16 'mailer' => [
12 'class' => 'yii\swiftmailer\Mailer', 17 'class' => 'yii\swiftmailer\Mailer',
common/models/User.php
@@ -64,14 +64,20 @@ class User extends ActiveRecord implements IdentityInterface, UserRbacInterface @@ -64,14 +64,20 @@ class User extends ActiveRecord implements IdentityInterface, UserRbacInterface
64 /** 64 /**
65 * @inheritdoc 65 * @inheritdoc
66 */ 66 */
67 - public static function findIdentity($id) {  
68 - if (Yii::$app->getSession()->has('user-'.$id)) { 67 + public static function findIdentity($id) {
  68 + if(Yii::$app->getSession()->has('user-'.$id)) {
  69 + if (Yii::$app->getSession()->has('user-'.$id)) {
69 return new self(Yii::$app->getSession()->get('user-'.$id)); 70 return new self(Yii::$app->getSession()->get('user-'.$id));
70 - } 71 + }
  72 + else {
  73 + return isset(self::$users[$id]) ? new self(self::$users[$id]) : null;
  74 + }
  75 + }
71 else { 76 else {
72 - return isset(self::$users[$id]) ? new self(self::$users[$id]) : null; 77 + return static::findOne(['id' => $id, 'status' => self::STATUS_ACTIVE]);
73 } 78 }
74 - } 79 +
  80 + }
75 /** 81 /**
76 * @param \nodge\eauth\ServiceBase $service 82 * @param \nodge\eauth\ServiceBase $service
77 * @return User 83 * @return User
common/translation/ru/app.php
@@ -11,9 +11,6 @@ return [ @@ -11,9 +11,6 @@ return [
11 'Make default' => 'Установить по умолчанию', 11 'Make default' => 'Установить по умолчанию',
12 'Language Name' => 'Название языка', 12 'Language Name' => 'Название языка',
13 'Lang Code' => 'Код языка', 13 'Lang Code' => 'Код языка',
14 -<<<<<<< 1fd2bdb43fc5cfdcf100cac8b72e67fd81e7f0fa  
15 - 'Is Default' => 'По умолчанию'  
16 -=======  
17 'Is Default' => 'По умолчанию', 14 'Is Default' => 'По умолчанию',
18 'adress' => 'Адрес', 15 'adress' => 'Адрес',
19 'adress_name' => 'Адрес', 16 'adress_name' => 'Адрес',
@@ -26,5 +23,4 @@ return [ @@ -26,5 +23,4 @@ return [
26 'one_name' => 'Имя', 23 'one_name' => 'Имя',
27 'message' => 'Сообщение', 24 'message' => 'Сообщение',
28 'Feedback' => 'Обратная связь' 25 'Feedback' => 'Обратная связь'
29 ->>>>>>> 0e0edb85a79343e4d020ff05378179e2323b21bd  
30 ]; 26 ];
31 \ No newline at end of file 27 \ No newline at end of file