Skip to content
This repository was archived by the owner on Mar 24, 2024. It is now read-only.

Commit 013d523

Browse files
author
Lorenz Bausch
committed
fixed moving entries to whitelist
1 parent d9bdf66 commit 013d523

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

app/controllers/GreylistController.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,12 @@ public function delete() {
6767
* @return Response
6868
*/
6969
public function move() {
70-
$items = $this->parseEntries();
70+
$items = $this->parseEntries('greylist', 'Bausch\Repositories\GreylistRepositoryInterface');
7171

7272
$whitelist = App::make('Bausch\Repositories\AwlEmailRepositoryInterface');
7373

74+
$messages = array();
75+
7476
foreach ($items as $key => $val) {
7577

7678
// convert Greylist to AwlEmail
@@ -89,9 +91,12 @@ public function move() {
8991
// insert into whitelist
9092
$whitelist->store($email);
9193
});
94+
95+
$messages[] = '<li>' . $email->getSenderName() . '@' . $email->getSenderDomain() . ' from ' . $email->getSource() . '</li>';
9296
}
9397

94-
return Redirect::action('GreylistController@index');
98+
return Redirect::action('GreylistController@index')
99+
->withSuccess('moved the following entries to the Whitelist: <ul>' . implode(PHP_EOL, $messages) . '</ul>');
95100
}
96101

97102
/**

0 commit comments

Comments
 (0)