Skip to content
This repository was archived by the owner on Aug 3, 2021. It is now read-only.

Commit

Permalink
Made review message optional
Browse files Browse the repository at this point in the history
  • Loading branch information
KieranFYI committed Feb 10, 2020
1 parent 6f7b515 commit ba999f2
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions Pub/Controller/Bans.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,9 @@ public function actionReview(ParameterBag $params) {
if ($ban->ban_review != $input) {

$message = trim($this->plugin('XF:Editor')->fromInput('message'));
if (!strlen($message)) {
/*if (!strlen($message)) {
throw $this->exception($this->notFound(\XF::phrase('kieran_bans_message_required')));
}
}*/

$ban->ban_review = $input;
$ban->save();
Expand Down Expand Up @@ -295,13 +295,15 @@ public function banSaveProcess($ban) {

$form->basicEntitySave($ban, $input['ban']);

$visitor = \XF::visitor();
$form->basicEntitySave($ban, [
'admin_name' => $visitor->username,
'admin_id' => $this->getPrimarySteamID(),
'admin_user_id' => $visitor->user_id,
'admin_ip' => $this->app()->request()->getIp(),
]);
if ($ban->isInsert()) {
$visitor = \XF::visitor();
$form->basicEntitySave($ban, [
'admin_name' => $visitor->username,
'admin_id' => $this->getPrimarySteamID(),
'admin_user_id' => $visitor->user_id,
'admin_ip' => $this->app()->request()->getIp(),
]);
}

return $form;
}
Expand Down

0 comments on commit ba999f2

Please sign in to comment.