Transfer default content of user approve/decline email to approve/decline form

This commit is contained in:
Faeze Moradi 2020-11-23 10:48:36 +01:00
parent a5da4c1b0b
commit d35906296d
3 changed files with 5 additions and 1 deletions

View File

@ -12,7 +12,7 @@ HumHub Changelog
- Fix #4628: Fixed stream gallery ratio issues on fluid themes
- Fix #4636: Jplayer overflow on mobile stream
- Fix #4591: Registration error text "You are already logged in!" not translatable
- Fix #4630: Transfer default content of user approve/decline email to approve/decline form
1.7.0 (November 4, 2020)
------------------------

View File

@ -97,6 +97,7 @@ class ApprovalController extends Controller
public function actionApprove($id)
{
$model = new ApproveUserForm($id);
$model->setApprovalDefaults();
if($model->load(Yii::$app->request->post()) && $model->approve()) {
return $this->redirect(['index']);
}
@ -110,6 +111,7 @@ class ApprovalController extends Controller
public function actionDecline($id)
{
$model = new ApproveUserForm($id);
$model->setDeclineDefaults();
if($model->load(Yii::$app->request->post()) && $model->decline()) {
return $this->redirect(['index']);
}

View File

@ -171,6 +171,7 @@ class ApproveUserForm extends \yii\base\Model
);
$loginLink = Html::a(urldecode(Url::to(["/user/auth/login"], true)), Url::to(["/user/auth/login"], true));
$loginURL = urldecode(Url::to(["/user/auth/login"], true));
$userName = Html::encode($this->user->displayName);
$adminName = Html::encode($this->admin->displayName);
@ -179,6 +180,7 @@ class ApproveUserForm extends \yii\base\Model
'{displayName}' => $userName,
'{AdminName}' => $adminName,
'{loginLink}' => $loginLink,
'{loginURL}' => $loginURL
]);
} else {
$this->message = static::getDefaultApprovalMessage($userName, $adminName, $loginLink);