set noavatar si avatar non existant (ref #77)
This commit is contained in:
parent
2641c8197f
commit
99894ec91c
|
@ -110,6 +110,17 @@ class PurgeFileCommand extends Command
|
|||
}
|
||||
}
|
||||
|
||||
$fs = new Filesystem();
|
||||
$users=$this->em->getRepository("CadolesCoreBundle:User")->findAll();
|
||||
foreach($users as $user) {
|
||||
if(!$fs->exists($directory."/".$user->getAvatar())) {
|
||||
$this->writeln($user->getUsername());
|
||||
$user->setAvatar("noavatar.png");
|
||||
$this->em->persist($user);
|
||||
$this->em->flush();
|
||||
}
|
||||
}
|
||||
|
||||
// /web/uploads/header
|
||||
$this->writelnred('');
|
||||
$this->writelnred('== Directory = Header');
|
||||
|
|
Loading…
Reference in New Issue