php-cs-fixer run
This commit is contained in:
@ -454,11 +454,11 @@ class SettingsController extends Controller
|
|||||||
|
|
||||||
public function actionTwoFactor($id)
|
public function actionTwoFactor($id)
|
||||||
{
|
{
|
||||||
if(!$this->module->enableTwoFactorAuthentication){
|
if (!$this->module->enableTwoFactorAuthentication) {
|
||||||
throw new ForbiddenHttpException(Yii::t('usuario','Application not configured for two factor authentication.'));
|
throw new ForbiddenHttpException(Yii::t('usuario', 'Application not configured for two factor authentication.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if($id != Yii::$app->user->id) {
|
if ($id != Yii::$app->user->id) {
|
||||||
throw new ForbiddenHttpException();
|
throw new ForbiddenHttpException();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -489,8 +489,8 @@ class SettingsController extends Controller
|
|||||||
|
|
||||||
public function actionTwoFactorEnable($id)
|
public function actionTwoFactorEnable($id)
|
||||||
{
|
{
|
||||||
if(!$this->module->enableTwoFactorAuthentication){
|
if (!$this->module->enableTwoFactorAuthentication) {
|
||||||
throw new ForbiddenHttpException(Yii::t('usuario','Application not configured for two factor authentication.'));
|
throw new ForbiddenHttpException(Yii::t('usuario', 'Application not configured for two factor authentication.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
Yii::$app->response->format = Response::FORMAT_JSON;
|
Yii::$app->response->format = Response::FORMAT_JSON;
|
||||||
@ -525,11 +525,11 @@ class SettingsController extends Controller
|
|||||||
|
|
||||||
public function actionTwoFactorDisable($id)
|
public function actionTwoFactorDisable($id)
|
||||||
{
|
{
|
||||||
if(!$this->module->enableTwoFactorAuthentication){
|
if (!$this->module->enableTwoFactorAuthentication) {
|
||||||
throw new ForbiddenHttpException(Yii::t('usuario','Application not configured for two factor authentication.'));
|
throw new ForbiddenHttpException(Yii::t('usuario', 'Application not configured for two factor authentication.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if($id != Yii::$app->user->id) {
|
if ($id != Yii::$app->user->id) {
|
||||||
throw new ForbiddenHttpException();
|
throw new ForbiddenHttpException();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -542,7 +542,7 @@ class SettingsController extends Controller
|
|||||||
throw new NotFoundHttpException();
|
throw new NotFoundHttpException();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($user->updateAttributes(['auth_tf_enabled' => '0', 'auth_tf_key' => NULL])) {
|
if ($user->updateAttributes(['auth_tf_enabled' => '0', 'auth_tf_key' => null])) {
|
||||||
Yii::$app
|
Yii::$app
|
||||||
->getSession()
|
->getSession()
|
||||||
->setFlash('success', Yii::t('usuario', 'Two factor authentication has been disabled.'));
|
->setFlash('success', Yii::t('usuario', 'Two factor authentication has been disabled.'));
|
||||||
|
|||||||
Reference in New Issue
Block a user