mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-09 11:03:17 +00:00
Refactor MailChecker to avoid static instance.
This commit is contained in:
@@ -35,15 +35,15 @@ class module_console_systemMailCheck extends Command
|
||||
{
|
||||
$output->writeln("Processing...");
|
||||
|
||||
$bad_users = [];
|
||||
if (version_compare($this->getService('phraseanet.appbox')->get_version(), '3.9', '<')) {
|
||||
$bad_users = MailChecker::getWrongEmailUsers($this->container);
|
||||
}
|
||||
/** @var appbox $appBox */
|
||||
$appBox = $this->getService('phraseanet.appbox');
|
||||
$checker = new MailChecker($appBox);
|
||||
$bad_users = $checker->getWrongEmailUsers();
|
||||
|
||||
foreach ($bad_users as $email => $users) {
|
||||
if ($input->getOption('list')) {
|
||||
$this->write_infos($email, $users, $output, $this->getService('phraseanet.appbox'));
|
||||
} elseif ($this->manage_group($email, $users, $output, $this->getService('phraseanet.appbox')) === false) {
|
||||
$this->write_infos($email, $users, $output, $appBox);
|
||||
} elseif ($this->manage_group($email, $users, $output, $appBox) === false) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user