Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not add same email address or IP address in black list and white list #243

Open
wants to merge 2 commits into
base: 1.1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Controller/Branding.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,13 @@ public function spam(Request $request)
return trim($email);
}, $whitelist)));

foreach ($blacklist as $blacklistedEmail) {
if (in_array($blacklistedEmail, $whitelist)) {
$this->addFlash('warning', $this->translator->trans('Same email address or I.P address not save in both blacklist & white list.'));
return $this->redirect($this->generateUrl('helpdesk_member_knowledgebase_spam'));
}
}

$whitelist = implode(',', $whitelist);
$blacklist = implode(',', $blacklist);

Expand Down
6 changes: 6 additions & 0 deletions Controller/Website.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ public function viewFolder(Request $request)
if(!$solution)
$this->noResultFound();

if ($solution->getVisibility() == 'private')
return $this->redirect($this->generateUrl('helpdesk_knowledgebase'));

$breadcrumbs = [
[
'label' => $this->translator->trans('Support Center'),
Expand Down Expand Up @@ -183,6 +186,9 @@ public function viewFolderArticle(Request $request)

if(!$solution)
$this->noResultFound();

if ($solution->getVisibility() == 'private')
return $this->redirect($this->generateUrl('helpdesk_knowledgebase'));

$breadcrumbs = [
[
Expand Down