php-cs-fixer run

This commit is contained in:
Lorenzo Milesi
2022-09-22 11:17:46 +02:00
parent b4ba918a45
commit b680784f66

View File

@ -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.'));