diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/PurgeFileCommand.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/PurgeFileCommand.php index 7fea6bcc..ac2572df 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/PurgeFileCommand.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/PurgeFileCommand.php @@ -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');