/** * checks whether a user is still existing in LDAP * @param string[] $user */ private function checkUser(array $user) { if ($this->userBackend->userExistsOnLDAP($user['name'])) { //still available, all good return; } $this->dui->markUser($user['name']); }
protected function execute(InputInterface $input, OutputInterface $output) { try { $uid = $input->getArgument('ocName'); $this->isAllowed($input->getOption('force')); $this->confirmUserIsMapped($uid); $exists = $this->backend->userExistsOnLDAP($uid); if ($exists === true) { $output->writeln('The user is still available on LDAP.'); return; } $this->dui->markUser($uid); $output->writeln('The user does not exists on LDAP anymore.'); $output->writeln('Clean up the user\'s remnants by: ./occ user:delete "' . $uid . '"'); } catch (\Exception $e) { $output->writeln('<error>' . $e->getMessage() . '</error>'); } }