wip
This commit is contained in:
@ -89,11 +89,11 @@ abstract class AbstractAuthItemController extends Controller
|
||||
if ($this->make(AuthItemEditionService::class, [$model])->run()) {
|
||||
Yii::$app
|
||||
->getSession()
|
||||
->setFlash('success', Yii::t('user', 'Authorization item successfully created.'));
|
||||
->setFlash('success', Yii::t('usuario', 'Authorization item successfully created.'));
|
||||
|
||||
return $this->redirect(['index']);
|
||||
} else {
|
||||
Yii::$app->getSession()->setFlash('danger', Yii::t('user', 'Unable to create authorization item.'));
|
||||
Yii::$app->getSession()->setFlash('danger', Yii::t('usuario', 'Unable to create authorization item.'));
|
||||
}
|
||||
}
|
||||
|
||||
@ -119,11 +119,11 @@ abstract class AbstractAuthItemController extends Controller
|
||||
if ($this->make(AuthItemEditionService::class, [$model])->run()) {
|
||||
Yii::$app
|
||||
->getSession()
|
||||
->setFlash('success', Yii::t('user', 'Authorization item successfully updated.'));
|
||||
->setFlash('success', Yii::t('usuario', 'Authorization item successfully updated.'));
|
||||
|
||||
return $this->redirect(['index']);
|
||||
} else {
|
||||
Yii::$app->getSession()->setFlash('danger', Yii::t('user', 'Unable to update authorization item.'));
|
||||
Yii::$app->getSession()->setFlash('danger', Yii::t('usuario', 'Unable to update authorization item.'));
|
||||
}
|
||||
}
|
||||
|
||||
@ -141,9 +141,9 @@ abstract class AbstractAuthItemController extends Controller
|
||||
$item = $this->getItem($name);
|
||||
|
||||
if ($this->authHelper->remove($item)) {
|
||||
Yii::$app->getSession()->setFlash('success', Yii::t('user', 'Authorization item successfully removed.'));
|
||||
Yii::$app->getSession()->setFlash('success', Yii::t('usuario', 'Authorization item successfully removed.'));
|
||||
} else {
|
||||
Yii::$app->getSession()->setFlash('success', Yii::t('user', 'Unable to remove authorization item.'));
|
||||
Yii::$app->getSession()->setFlash('success', Yii::t('usuario', 'Unable to remove authorization item.'));
|
||||
}
|
||||
|
||||
return $this->redirect(['index']);
|
||||
|
||||
@ -127,7 +127,7 @@ class AdminController extends Controller
|
||||
$mailService = MailFactory::makeWelcomeMailerService($user);
|
||||
|
||||
if ($this->make(UserCreateService::class, [$user, $mailService])->run()) {
|
||||
Yii::$app->getSession()->setFlash('success', Yii::t('user', 'User has been created'));
|
||||
Yii::$app->getSession()->setFlash('success', Yii::t('usuario', 'User has been created'));
|
||||
$this->trigger(UserEvent::EVENT_AFTER_CREATE, $event);
|
||||
|
||||
return $this->redirect(['update', 'id' => $user->id]);
|
||||
@ -150,7 +150,7 @@ class AdminController extends Controller
|
||||
$this->trigger(ActiveRecord::EVENT_BEFORE_UPDATE, $event);
|
||||
|
||||
if ($user->save()) {
|
||||
Yii::$app->getSession()->setFlash('success', Yii::t('user', 'Account details have been updated'));
|
||||
Yii::$app->getSession()->setFlash('success', Yii::t('usuario', 'Account details have been updated'));
|
||||
$this->trigger(ActiveRecord::EVENT_AFTER_UPDATE, $event);
|
||||
|
||||
return $this->refresh();
|
||||
@ -177,7 +177,7 @@ class AdminController extends Controller
|
||||
if ($profile->load(Yii::$app->request->post())) {
|
||||
if ($profile->save()) {
|
||||
$this->trigger(UserEvent::EVENT_BEFORE_PROFILE_UPDATE, $event);
|
||||
Yii::$app->getSession()->setFlash('success', Yii::t('user', 'Profile details have been updated'));
|
||||
Yii::$app->getSession()->setFlash('success', Yii::t('usuario', 'Profile details have been updated'));
|
||||
$this->trigger(UserEvent::EVENT_AFTER_PROFILE_UPDATE, $event);
|
||||
|
||||
return $this->refresh();
|
||||
@ -230,10 +230,10 @@ class AdminController extends Controller
|
||||
$this->trigger(UserEvent::EVENT_BEFORE_CONFIRMATION, $event);
|
||||
|
||||
if ($this->make(UserConfirmationService::class, [$user])->run()) {
|
||||
Yii::$app->getSession()->setFlash('success', Yii::t('user', 'User has been confirmed'));
|
||||
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('user', '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'));
|
||||
@ -242,7 +242,7 @@ class AdminController extends Controller
|
||||
public function actionDelete($id)
|
||||
{
|
||||
if ($id === Yii::$app->user->getId()) {
|
||||
Yii::$app->getSession()->setFlash('danger', Yii::t('user', 'You cannot remove your own account'));
|
||||
Yii::$app->getSession()->setFlash('danger', Yii::t('usuario', 'You cannot remove your own account'));
|
||||
} else {
|
||||
/** @var User $user */
|
||||
$user = $this->userQuery->where(['id' => $id])->one();
|
||||
@ -251,12 +251,12 @@ class AdminController extends Controller
|
||||
$this->trigger(ActiveRecord::EVENT_BEFORE_DELETE, $event);
|
||||
|
||||
if ($user->delete()) {
|
||||
Yii::$app->getSession()->setFlash('success', \Yii::t('user', 'User has been deleted'));
|
||||
Yii::$app->getSession()->setFlash('success', \Yii::t('usuario', 'User has been deleted'));
|
||||
$this->trigger(ActiveRecord::EVENT_AFTER_DELETE, $event);
|
||||
} else {
|
||||
Yii::$app->getSession()->setFlash(
|
||||
'warning',
|
||||
Yii::t('user', 'Unable to delete user. Please, try again later.')
|
||||
Yii::t('usuario', 'Unable to delete user. Please, try again later.')
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -267,7 +267,7 @@ class AdminController extends Controller
|
||||
public function actionBlock($id)
|
||||
{
|
||||
if ($id === Yii::$app->user->getId()) {
|
||||
Yii::$app->getSession()->setFlash('danger', Yii::t('user', 'You cannot remove your own account'));
|
||||
Yii::$app->getSession()->setFlash('danger', Yii::t('usuario', 'You cannot remove your own account'));
|
||||
} else {
|
||||
/** @var User $user */
|
||||
$user = $this->userQuery->where(['id' => $id])->one();
|
||||
@ -275,9 +275,9 @@ class AdminController extends Controller
|
||||
$event = $this->make(UserEvent::class, [$user]);
|
||||
|
||||
if ($this->make(UserBlockService::class, [$user, $event, $this])->run()) {
|
||||
Yii::$app->getSession()->setFlash('success', Yii::t('user', 'User block status has been updated.'));
|
||||
Yii::$app->getSession()->setFlash('success', Yii::t('usuario', 'User block status has been updated.'));
|
||||
} else {
|
||||
Yii::$app->getSession()->setFlash('danger', Yii::t('user', 'Unable to update block status.'));
|
||||
Yii::$app->getSession()->setFlash('danger', Yii::t('usuario', 'Unable to update block status.'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -101,7 +101,7 @@ class RecoveryController extends Controller
|
||||
return $this->render(
|
||||
'/shared/message',
|
||||
[
|
||||
'title' => Yii::t('user', 'Recovery message sent'),
|
||||
'title' => Yii::t('usuario', 'Recovery message sent'),
|
||||
'module' => $this->module,
|
||||
]
|
||||
);
|
||||
@ -136,13 +136,13 @@ class RecoveryController extends Controller
|
||||
if ($token === null || $token->getIsExpired() || $token->user === null) {
|
||||
Yii::$app->session->setFlash(
|
||||
'danger',
|
||||
Yii::t('user', 'Recovery link is invalid or expired. Please try requesting a new one.')
|
||||
Yii::t('usuario', 'Recovery link is invalid or expired. Please try requesting a new one.')
|
||||
);
|
||||
|
||||
return $this->render(
|
||||
'/shared/message',
|
||||
[
|
||||
'title' => Yii::t('user', 'Invalid or expired link'),
|
||||
'title' => Yii::t('usuario', 'Invalid or expired link'),
|
||||
'module' => $this->module,
|
||||
]
|
||||
);
|
||||
@ -161,7 +161,7 @@ class RecoveryController extends Controller
|
||||
return $this->render(
|
||||
'/shared/message',
|
||||
[
|
||||
'title' => Yii::t('user', 'Password has been changed'),
|
||||
'title' => Yii::t('usuario', 'Password has been changed'),
|
||||
'module' => $this->module,
|
||||
]
|
||||
);
|
||||
|
||||
@ -109,7 +109,7 @@ class RegistrationController extends Controller
|
||||
Yii::$app->session->setFlash(
|
||||
'info',
|
||||
Yii::t(
|
||||
'user',
|
||||
'usuario',
|
||||
'Your account has been created and a message with further instructions has been sent to your email'
|
||||
)
|
||||
);
|
||||
@ -117,7 +117,7 @@ class RegistrationController extends Controller
|
||||
return $this->render(
|
||||
'/shared/message',
|
||||
[
|
||||
'title' => Yii::t('user', 'Your account has been created'),
|
||||
'title' => Yii::t('usuario', 'Your account has been created'),
|
||||
'module' => $this->module,
|
||||
]
|
||||
);
|
||||
@ -189,20 +189,20 @@ class RegistrationController extends Controller
|
||||
|
||||
if ($this->make(AccountConfirmationService::class, [$code, $user, $userConfirmationService])->run()) {
|
||||
Yii::$app->user->login($user, $this->module->rememberLoginLifespan);
|
||||
Yii::$app->session->setFlash('success', Yii::t('user', 'Thank you, registration is now complete.'));
|
||||
Yii::$app->session->setFlash('success', Yii::t('usuario', 'Thank you, registration is now complete.'));
|
||||
|
||||
$this->trigger(UserEvent::EVENT_AFTER_CONFIRMATION, $event);
|
||||
} else {
|
||||
Yii::$app->session->setFlash(
|
||||
'danger',
|
||||
Yii::t('user', 'The confirmation link is invalid or expired. Please try requesting a new one.')
|
||||
Yii::t('usuario', 'The confirmation link is invalid or expired. Please try requesting a new one.')
|
||||
);
|
||||
}
|
||||
|
||||
return $this->render(
|
||||
'/shared/message',
|
||||
[
|
||||
'title' => Yii::t('user', 'Account confirmation'),
|
||||
'title' => Yii::t('usuario', 'Account confirmation'),
|
||||
'module' => $this->module,
|
||||
]
|
||||
);
|
||||
@ -231,7 +231,7 @@ class RegistrationController extends Controller
|
||||
Yii::$app->session->setFlash(
|
||||
'info',
|
||||
Yii::t(
|
||||
'user',
|
||||
'usuario',
|
||||
'A message has been sent to your email address. '.
|
||||
'It contains a confirmation link that you must click to complete registration.'
|
||||
)
|
||||
@ -242,7 +242,7 @@ class RegistrationController extends Controller
|
||||
Yii::$app->session->setFlash(
|
||||
'danger',
|
||||
Yii::t(
|
||||
'user',
|
||||
'usuario',
|
||||
'We couldn\'t re-send the mail to confirm your address. '.
|
||||
'Please, verify is the correct email or if it has been confirmed already.'
|
||||
)
|
||||
@ -251,8 +251,8 @@ class RegistrationController extends Controller
|
||||
|
||||
return $this->render('/shared/message', [
|
||||
'title' => $success
|
||||
? Yii::t('user', 'A new confirmation link has been sent')
|
||||
: Yii::t('user', 'Unable to send confirmation link'),
|
||||
? Yii::t('usuario', 'A new confirmation link has been sent')
|
||||
: Yii::t('usuario', 'Unable to send confirmation link'),
|
||||
'module' => $this->module,
|
||||
]);
|
||||
}
|
||||
|
||||
@ -158,7 +158,7 @@ class SecurityController extends Controller
|
||||
public function connect(AuthClientInterface $client)
|
||||
{
|
||||
if (Yii::$app->user->isGuest) {
|
||||
Yii::$app->session->setFlash('danger', Yii::t('user', 'Something went wrong'));
|
||||
Yii::$app->session->setFlash('danger', Yii::t('usuario', 'Something went wrong'));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@ -118,7 +118,7 @@ class SettingsController extends Controller
|
||||
if ($profile->load(Yii::$app->request->post())) {
|
||||
$this->trigger(UserEvent::EVENT_BEFORE_PROFILE_UPDATE, $event);
|
||||
if ($profile->save()) {
|
||||
Yii::$app->getSession()->setFlash('success', Yii::t('user', 'Your profile has been updated'));
|
||||
Yii::$app->getSession()->setFlash('success', Yii::t('usuario', 'Your profile has been updated'));
|
||||
$this->trigger(UserEvent::EVENT_AFTER_PROFILE_UPDATE, $event);
|
||||
|
||||
return $this->refresh();
|
||||
@ -145,7 +145,7 @@ class SettingsController extends Controller
|
||||
$this->trigger(UserEvent::EVENT_BEFORE_ACCOUNT_UPDATE, $event);
|
||||
|
||||
if ($form->save()) {
|
||||
Yii::$app->getSession()->setFlash('success', Yii::t('user', '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();
|
||||
@ -210,7 +210,7 @@ class SettingsController extends Controller
|
||||
public function actionDelete()
|
||||
{
|
||||
if (!$this->module->allowAccountDelete) {
|
||||
throw new NotFoundHttpException(\Yii::t('user', 'Not found'));
|
||||
throw new NotFoundHttpException(\Yii::t('usuario', 'Not found'));
|
||||
}
|
||||
|
||||
/** @var User $user */
|
||||
@ -222,7 +222,7 @@ class SettingsController extends Controller
|
||||
$user->delete();
|
||||
$this->trigger(UserEvent::EVENT_AFTER_DELETE, $event);
|
||||
|
||||
Yii::$app->session->setFlash('info', Yii::t('user', 'Your account has been completely deleted'));
|
||||
Yii::$app->session->setFlash('info', Yii::t('usuario', 'Your account has been completely deleted'));
|
||||
|
||||
return $this->goHome();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user