mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 06:53:15 +00:00
Remove get_wrong_email_users() from User_Adapter
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
* @link www.phraseanet.com
|
||||
*/
|
||||
use Alchemy\Phrasea\Command\Command;
|
||||
use Alchemy\Phrasea\Setup\Version\MailChecker;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
@@ -41,7 +42,10 @@ class module_console_systemMailCheck extends Command
|
||||
{
|
||||
$output->writeln("Processing...");
|
||||
|
||||
$bad_users = User_Adapter::get_wrong_email_users($this->container);
|
||||
$bad_users = array();
|
||||
if (version_compare($this->getService('phraseanet.appbox')->get_version(), '3.9', '<')) {
|
||||
$bad_users = MailChecker::getWrongEmailUsers($this->container);
|
||||
}
|
||||
|
||||
foreach ($bad_users as $email => $users) {
|
||||
if ($input->getOption('list')) {
|
||||
@@ -112,12 +116,14 @@ class module_console_systemMailCheck extends Command
|
||||
$output->writeln($email);
|
||||
|
||||
foreach ($users as $user) {
|
||||
$dateConn = new \DateTime($user['last_conn']);
|
||||
|
||||
$output->writeln(
|
||||
sprintf(
|
||||
"\t %5d %40s %s"
|
||||
, $user->get_id()
|
||||
, $user->get_display_name()
|
||||
, $user->get_last_connection()->format('Y m d')
|
||||
, $user['usr_id']
|
||||
, $user['usr_login']
|
||||
, $dateConn->format('Y m d')
|
||||
)
|
||||
);
|
||||
}
|
||||
|
@@ -67,12 +67,12 @@ class module_console_systemUpgrade extends Command
|
||||
try {
|
||||
$output->write('<info>Upgrading...</info>', true);
|
||||
|
||||
if (count(User_Adapter::get_wrong_email_users($this->container)) > 0) {
|
||||
try {
|
||||
$upgrader = new Setup_Upgrade($this->container, $input->getOption('force'));
|
||||
} catch (\Exception_Setup_FixBadEmailAddresses $e) {
|
||||
return $output->writeln(sprintf('<error>You have to fix your database before upgrade with the system:mailCheck command </error>'));
|
||||
}
|
||||
|
||||
$upgrader = new Setup_Upgrade($this->container, $input->getOption('force'));
|
||||
|
||||
$queries = $this->getService('phraseanet.appbox')->forceUpgrade($upgrader, $this->container);
|
||||
|
||||
if ($input->getOption('dump')) {
|
||||
|
Reference in New Issue
Block a user