|
@@ -79,13 +79,11 @@ $config = [
|
|
|
'pay/<action:[\w\-]+>' => 'pay/<action>',
|
|
'pay/<action:[\w\-]+>' => 'pay/<action>',
|
|
|
'history/<action:[\w\-]+>' => 'history/<action>',
|
|
'history/<action:[\w\-]+>' => 'history/<action>',
|
|
|
//'user/admin/<action:\w+>' => 'user/admin/<action>',
|
|
//'user/admin/<action:\w+>' => 'user/admin/<action>',
|
|
|
|
|
+
|
|
|
'user/<controller:[\w\-]+>/<action:[\w\-]+>' => 'user/<controller>/<action>',
|
|
'user/<controller:[\w\-]+>/<action:[\w\-]+>' => 'user/<controller>/<action>',
|
|
|
- /*'<controller>/<action>' => '<controller>/<action>',
|
|
|
|
|
- '<controller:\w+>/<action:\w+>' => '<controller>/<action>',
|
|
|
|
|
- '<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',*/
|
|
|
|
|
|
|
+
|
|
|
//'login' => 'user/security/login',
|
|
//'login' => 'user/security/login',
|
|
|
'<alias:logout|login>' => 'user/security/<alias>',
|
|
'<alias:logout|login>' => 'user/security/<alias>',
|
|
|
- //'<alias:logout|login>' => 'user/security/<alias>',
|
|
|
|
|
|
|
|
|
|
//'api/<action:\w+>' => 'api/<action>',
|
|
//'api/<action:\w+>' => 'api/<action>',
|
|
|
//'api/<action:[\w\-]+>/<id:\d+>' => 'api/<action>'
|
|
//'api/<action:[\w\-]+>/<id:\d+>' => 'api/<action>'
|
|
@@ -132,20 +130,24 @@ $config = [
|
|
|
'user' => [
|
|
'user' => [
|
|
|
'class' => 'dektrium\user\Module',
|
|
'class' => 'dektrium\user\Module',
|
|
|
'enableRegistration' => false,
|
|
'enableRegistration' => false,
|
|
|
- 'enablePasswordRecovery' => false,
|
|
|
|
|
|
|
+ 'enablePasswordRecovery' => true,
|
|
|
'enableConfirmation' => false,
|
|
'enableConfirmation' => false,
|
|
|
- 'adminPermission' => 'admin',
|
|
|
|
|
|
|
+ //'adminPermission' => 'admin',
|
|
|
//'admins' => ['ptenchik0'],
|
|
//'admins' => ['ptenchik0'],
|
|
|
'rememberFor' => 86400,
|
|
'rememberFor' => 86400,
|
|
|
- /*'modelMap' => [
|
|
|
|
|
|
|
+ 'debug' => true,
|
|
|
|
|
+ 'controllerMap' => [
|
|
|
|
|
+ 'settings' => 'app\controllers\ProfileController'
|
|
|
|
|
+ ],
|
|
|
|
|
+ 'modelMap' => [
|
|
|
//'RecoveryForm' => 'app\models\security\RecoveryForm',
|
|
//'RecoveryForm' => 'app\models\security\RecoveryForm',
|
|
|
//'RegistrationForm' => 'app\models\security\RegistrationForm',
|
|
//'RegistrationForm' => 'app\models\security\RegistrationForm',
|
|
|
'User' => 'app\models\user\User',
|
|
'User' => 'app\models\user\User',
|
|
|
- 'UserSearch' => 'app\models\search\Users',
|
|
|
|
|
- 'LoginForm' => 'app\models\security\LoginForm',
|
|
|
|
|
|
|
+ //'UserSearch' => 'app\models\search\Users',
|
|
|
|
|
+ 'LoginForm' => 'app\models\user\LoginForm',
|
|
|
//'Profile' => 'app\models\user\Profile',
|
|
//'Profile' => 'app\models\user\Profile',
|
|
|
//'SettingsForm' => 'app\models\user\SettingsForm',
|
|
//'SettingsForm' => 'app\models\user\SettingsForm',
|
|
|
- ],*/
|
|
|
|
|
|
|
+ ],
|
|
|
],
|
|
],
|
|
|
'api' => [
|
|
'api' => [
|
|
|
'class' => 'app\modules\api\Module',
|
|
'class' => 'app\modules\api\Module',
|
|
@@ -153,7 +155,22 @@ $config = [
|
|
|
],
|
|
],
|
|
|
'params' => $params,
|
|
'params' => $params,
|
|
|
'on beforeAction' => function ($event) {
|
|
'on beforeAction' => function ($event) {
|
|
|
- if (Yii::$app->user->isGuest) Yii::$app->layout = 'guest';
|
|
|
|
|
|
|
+ if (Yii::$app->user->isGuest) :
|
|
|
|
|
+ Yii::$app->layout = 'guest';
|
|
|
|
|
+ else:
|
|
|
|
|
+ $email = substr(Yii::$app->user->identity->email, strripos(Yii::$app->user->identity->email, '@') + 1 );
|
|
|
|
|
+
|
|
|
|
|
+ if('example.com' === $email){
|
|
|
|
|
+ $pass_link = \yii\bootstrap4\Html::a('Змінити', \yii\helpers\Url::to(['profile/account']), ['class'=>'text-uppercase']);
|
|
|
|
|
+ Yii::$app->session->setFlash('warning', 'Для можливості відновлення паролю, будь-ласка, змініть свій <strong>Email</strong>. ' . $pass_link);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if(Yii::$app->user->identity->created_at == Yii::$app->user->identity->updated_at){
|
|
|
|
|
+ $pass_link = \yii\bootstrap4\Html::a('Змінити', \yii\helpers\Url::to(['profile/account']), ['class'=>'text-white text-uppercase']);
|
|
|
|
|
+ Yii::$app->session->setFlash('danger', '<strong>Ваш пароль є тимчасовым</strong>. З розумінь безпеки, будь-ласка, змініть свій пароль. ' . $pass_link);
|
|
|
|
|
+ }
|
|
|
|
|
+ endif;
|
|
|
|
|
+
|
|
|
},
|
|
},
|
|
|
'as globalAccess' => [
|
|
'as globalAccess' => [
|
|
|
'class' => app\components\GlobalAccessBehavior::class,
|
|
'class' => app\components\GlobalAccessBehavior::class,
|
|
@@ -164,7 +181,7 @@ $config = [
|
|
|
'roles' => ["?","@"],
|
|
'roles' => ["?","@"],
|
|
|
],
|
|
],
|
|
|
[
|
|
[
|
|
|
- 'actions' => ['login'],
|
|
|
|
|
|
|
+ 'actions' => ['login', 'request'],
|
|
|
'allow' => true,
|
|
'allow' => true,
|
|
|
'roles' => ['?'],
|
|
'roles' => ['?'],
|
|
|
],
|
|
],
|
|
@@ -173,18 +190,19 @@ $config = [
|
|
|
'allow' => true,
|
|
'allow' => true,
|
|
|
'roles' => ['@'],
|
|
'roles' => ['@'],
|
|
|
],
|
|
],
|
|
|
|
|
+ /*
|
|
|
[
|
|
[
|
|
|
'controllers' => ['api/user'],
|
|
'controllers' => ['api/user'],
|
|
|
'allow' => true,
|
|
'allow' => true,
|
|
|
'roles' => ['?'],
|
|
'roles' => ['?'],
|
|
|
- ],
|
|
|
|
|
|
|
+ ],*/
|
|
|
[
|
|
[
|
|
|
'controllers' => ['user/admin'],
|
|
'controllers' => ['user/admin'],
|
|
|
'allow' => true,
|
|
'allow' => true,
|
|
|
'roles' => ['admin'],
|
|
'roles' => ['admin'],
|
|
|
],
|
|
],
|
|
|
[
|
|
[
|
|
|
- 'controllers' => ['user/admin'],
|
|
|
|
|
|
|
+ 'controllers' => ['user/admin', 'user/settings', 'user/profile'],
|
|
|
'allow' => false,
|
|
'allow' => false,
|
|
|
],
|
|
],
|
|
|
[
|
|
[
|