*
* @author Arthur Schiwon <blizzz@arthur-schiwon.de>
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
+ * @author Côme Chilliet <come.chilliet@nextcloud.com>
* @author Joas Schilling <coding@schilljs.com>
* @author Morris Jobke <hey@morrisjobke.de>
* @author Roeland Jago Douma <roeland@famdouma.nl>
/** @var UserMapping */
protected $mapping;
- /**
- * @param User_Proxy $uBackend
- * @param Helper $helper
- * @param DeletedUsersIndex $dui
- * @param UserMapping $mapping
- */
public function __construct(User_Proxy $uBackend, Helper $helper, DeletedUsersIndex $dui, UserMapping $mapping) {
$this->backend = $uBackend;
$this->helper = $helper;
parent::__construct();
}
- protected function configure() {
+ protected function configure(): void {
$this
->setName('ldap:check-user')
->setDescription('checks whether a user exists on LDAP.')
protected function execute(InputInterface $input, OutputInterface $output): int {
try {
$uid = $input->getArgument('ocName');
- $this->isAllowed($input->getOption('force'));
+ $this->assertAllowed($input->getOption('force'));
$wasMapped = $this->userWasMapped($uid);
$exists = $this->backend->userExistsOnLDAP($uid, true);
if ($exists === true) {
/**
* checks whether the setup allows reliable checking of LDAP user existence
* @throws \Exception
- * @return true
*/
- protected function isAllowed($force) {
+ protected function assertAllowed(bool $force): void {
if ($this->helper->haveDisabledConfigurations() && !$force) {
throw new \Exception('Cannot check user existence, because '
. 'disabled LDAP configurations are present.');
// we don't check ldapUserCleanupInterval from config.php because this
// action is triggered manually, while the setting only controls the
// background job.
-
- return true;
}
private function updateUser(string $uid, OutputInterface $output): void {