documentation update + code fixes
This commit is contained in:
@ -33,10 +33,10 @@ abstract class AbstractAuthItemController extends Controller
|
||||
/**
|
||||
* AbstractAuthItemController constructor.
|
||||
*
|
||||
* @param string $id
|
||||
* @param Module $module
|
||||
* @param string $id
|
||||
* @param Module $module
|
||||
* @param AuthHelper $authHelper
|
||||
* @param array $config
|
||||
* @param array $config
|
||||
*/
|
||||
public function __construct($id, Module $module, AuthHelper $authHelper, array $config = [])
|
||||
{
|
||||
@ -92,9 +92,8 @@ abstract class AbstractAuthItemController extends Controller
|
||||
->setFlash('success', Yii::t('usuario', 'Authorization item successfully created.'));
|
||||
|
||||
return $this->redirect(['index']);
|
||||
} else {
|
||||
Yii::$app->getSession()->setFlash('danger', Yii::t('usuario', 'Unable to create authorization item.'));
|
||||
}
|
||||
Yii::$app->getSession()->setFlash('danger', Yii::t('usuario', 'Unable to create authorization item.'));
|
||||
}
|
||||
|
||||
return $this->render(
|
||||
@ -122,9 +121,8 @@ abstract class AbstractAuthItemController extends Controller
|
||||
->setFlash('success', Yii::t('usuario', 'Authorization item successfully updated.'));
|
||||
|
||||
return $this->redirect(['index']);
|
||||
} else {
|
||||
Yii::$app->getSession()->setFlash('danger', Yii::t('usuario', 'Unable to update authorization item.'));
|
||||
}
|
||||
Yii::$app->getSession()->setFlash('danger', Yii::t('usuario', 'Unable to update authorization item.'));
|
||||
}
|
||||
|
||||
return $this->render(
|
||||
|
||||
@ -43,10 +43,10 @@ class AdminController extends Controller
|
||||
/**
|
||||
* AdminController constructor.
|
||||
*
|
||||
* @param string $id
|
||||
* @param Module $module
|
||||
* @param string $id
|
||||
* @param Module $module
|
||||
* @param UserQuery $userQuery
|
||||
* @param array $config
|
||||
* @param array $config
|
||||
*/
|
||||
public function __construct($id, Module $module, UserQuery $userQuery, array $config = [])
|
||||
{
|
||||
@ -233,7 +233,10 @@ class AdminController extends Controller
|
||||
Yii::$app->getSession()->setFlash('success', Yii::t('usuario', 'User has been confirmed'));
|
||||
$this->trigger(UserEvent::EVENT_AFTER_CONFIRMATION, $event);
|
||||
} else {
|
||||
Yii::$app->getSession()->setFlash('warning', Yii::t('usuario', 'Unable to confirm user. Please, try again.'));
|
||||
Yii::$app->getSession()->setFlash(
|
||||
'warning',
|
||||
Yii::t('usuario', 'Unable to confirm user. Please, try again.')
|
||||
);
|
||||
}
|
||||
|
||||
return $this->redirect(Url::previous('actions-redirect'));
|
||||
|
||||
@ -12,10 +12,10 @@
|
||||
namespace Da\User\Controller;
|
||||
|
||||
use Da\User\Query\ProfileQuery;
|
||||
use Yii;
|
||||
use yii\base\Module;
|
||||
use yii\filters\AccessControl;
|
||||
use yii\web\Controller;
|
||||
use Yii;
|
||||
use yii\web\NotFoundHttpException;
|
||||
|
||||
class ProfileController extends Controller
|
||||
@ -25,10 +25,10 @@ class ProfileController extends Controller
|
||||
/**
|
||||
* ProfileController constructor.
|
||||
*
|
||||
* @param string $id
|
||||
* @param Module $module
|
||||
* @param string $id
|
||||
* @param Module $module
|
||||
* @param ProfileQuery $profileQuery
|
||||
* @param array $config
|
||||
* @param array $config
|
||||
*/
|
||||
public function __construct($id, Module $module, ProfileQuery $profileQuery, array $config = [])
|
||||
{
|
||||
|
||||
@ -16,6 +16,7 @@ use Da\User\Event\ResetPasswordEvent;
|
||||
use Da\User\Factory\MailFactory;
|
||||
use Da\User\Form\RecoveryForm;
|
||||
use Da\User\Model\Token;
|
||||
use Da\User\Module;
|
||||
use Da\User\Query\TokenQuery;
|
||||
use Da\User\Query\UserQuery;
|
||||
use Da\User\Service\PasswordRecoveryService;
|
||||
@ -23,7 +24,6 @@ use Da\User\Service\ResetPasswordService;
|
||||
use Da\User\Traits\ContainerAwareTrait;
|
||||
use Da\User\Validator\AjaxRequestModelValidator;
|
||||
use Yii;
|
||||
use Da\User\Module;
|
||||
use yii\filters\AccessControl;
|
||||
use yii\web\Controller;
|
||||
use yii\web\NotFoundHttpException;
|
||||
@ -38,11 +38,11 @@ class RecoveryController extends Controller
|
||||
/**
|
||||
* RecoveryController constructor.
|
||||
*
|
||||
* @param string $id
|
||||
* @param Module $module
|
||||
* @param UserQuery $userQuery
|
||||
* @param string $id
|
||||
* @param Module $module
|
||||
* @param UserQuery $userQuery
|
||||
* @param TokenQuery $tokenQuery
|
||||
* @param array $config
|
||||
* @param array $config
|
||||
*/
|
||||
public function __construct($id, Module $module, UserQuery $userQuery, TokenQuery $tokenQuery, array $config = [])
|
||||
{
|
||||
|
||||
@ -44,11 +44,11 @@ class RegistrationController extends Controller
|
||||
/**
|
||||
* RegistrationController constructor.
|
||||
*
|
||||
* @param string $id
|
||||
* @param Module $module
|
||||
* @param UserQuery $userQuery
|
||||
* @param string $id
|
||||
* @param Module $module
|
||||
* @param UserQuery $userQuery
|
||||
* @param SocialNetworkAccountQuery $socialNetworkAccountQuery
|
||||
* @param array $config
|
||||
* @param array $config
|
||||
*/
|
||||
public function __construct(
|
||||
$id,
|
||||
@ -232,7 +232,7 @@ class RegistrationController extends Controller
|
||||
'info',
|
||||
Yii::t(
|
||||
'usuario',
|
||||
'A message has been sent to your email address. '.
|
||||
'A message has been sent to your email address. ' .
|
||||
'It contains a confirmation link that you must click to complete registration.'
|
||||
)
|
||||
);
|
||||
@ -243,18 +243,21 @@ class RegistrationController extends Controller
|
||||
'danger',
|
||||
Yii::t(
|
||||
'usuario',
|
||||
'We couldn\'t re-send the mail to confirm your address. '.
|
||||
'We couldn\'t re-send the mail to confirm your address. ' .
|
||||
'Please, verify is the correct email or if it has been confirmed already.'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return $this->render('/shared/message', [
|
||||
'title' => $success
|
||||
? Yii::t('usuario', 'A new confirmation link has been sent')
|
||||
: Yii::t('usuario', 'Unable to send confirmation link'),
|
||||
'module' => $this->module,
|
||||
]);
|
||||
return $this->render(
|
||||
'/shared/message',
|
||||
[
|
||||
'title' => $success
|
||||
? Yii::t('usuario', 'A new confirmation link has been sent')
|
||||
: Yii::t('usuario', 'Unable to send confirmation link'),
|
||||
'module' => $this->module,
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
return $this->render(
|
||||
|
||||
@ -37,10 +37,10 @@ class SecurityController extends Controller
|
||||
/**
|
||||
* SecurityController constructor.
|
||||
*
|
||||
* @param string $id
|
||||
* @param Module $module
|
||||
* @param string $id
|
||||
* @param Module $module
|
||||
* @param SocialNetworkAccountQuery $socialNetworkAccountQuery
|
||||
* @param array $config
|
||||
* @param array $config
|
||||
*/
|
||||
public function __construct(
|
||||
$id,
|
||||
@ -116,6 +116,7 @@ class SecurityController extends Controller
|
||||
|
||||
if (Yii::$app->request->isAjax && $form->load(Yii::$app->request->post())) {
|
||||
Yii::$app->response->format = Response::FORMAT_JSON;
|
||||
|
||||
return ActiveForm::validate($form);
|
||||
}
|
||||
|
||||
|
||||
@ -27,10 +27,10 @@ use Da\User\Query\UserQuery;
|
||||
use Da\User\Service\EmailChangeService;
|
||||
use Da\User\Traits\ContainerAwareTrait;
|
||||
use Da\User\Validator\AjaxRequestModelValidator;
|
||||
use Yii;
|
||||
use yii\filters\AccessControl;
|
||||
use yii\filters\VerbFilter;
|
||||
use yii\web\Controller;
|
||||
use Yii;
|
||||
use yii\web\ForbiddenHttpException;
|
||||
use yii\web\NotFoundHttpException;
|
||||
|
||||
@ -38,24 +38,24 @@ class SettingsController extends Controller
|
||||
{
|
||||
use ContainerAwareTrait;
|
||||
|
||||
protected $profileQuery;
|
||||
protected $userQuery;
|
||||
protected $socialNetworkAccountQuery;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public $defaultAction = 'profile';
|
||||
|
||||
protected $profileQuery;
|
||||
protected $userQuery;
|
||||
protected $socialNetworkAccountQuery;
|
||||
|
||||
/**
|
||||
* SettingsController constructor.
|
||||
*
|
||||
* @param string $id
|
||||
* @param Module $module
|
||||
* @param ProfileQuery $profileQuery
|
||||
* @param UserQuery $userQuery
|
||||
* @param string $id
|
||||
* @param Module $module
|
||||
* @param ProfileQuery $profileQuery
|
||||
* @param UserQuery $userQuery
|
||||
* @param SocialNetworkAccountQuery $socialNetworkAccountQuery
|
||||
* @param array $config
|
||||
* @param array $config
|
||||
*/
|
||||
public function __construct(
|
||||
$id,
|
||||
@ -145,7 +145,10 @@ class SettingsController extends Controller
|
||||
$this->trigger(UserEvent::EVENT_BEFORE_ACCOUNT_UPDATE, $event);
|
||||
|
||||
if ($form->save()) {
|
||||
Yii::$app->getSession()->setFlash('success', Yii::t('usuario', 'Your account details have been updated'));
|
||||
Yii::$app->getSession()->setFlash(
|
||||
'success',
|
||||
Yii::t('usuario', 'Your account details have been updated')
|
||||
);
|
||||
$this->trigger(UserEvent::EVENT_AFTER_ACCOUNT_UPDATE, $event);
|
||||
|
||||
return $this->refresh();
|
||||
|
||||
Reference in New Issue
Block a user