Skip to content

Commit

Permalink
@come-nc Improvements to get user array
Browse files Browse the repository at this point in the history
Signed-off-by: Jore <contact@jore.cc>
  • Loading branch information
nooblag committed Sep 21, 2023
1 parent 792c11a commit b5034c0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions core/Command/User/LastSeen.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
* @author Joas Schilling <coding@schilljs.com>
* @author Pierre Ozoux <pierre@ozoux.net>
* @author Roeland Jago Douma <roeland@famdouma.nl>
* @author Jordan Brown <code@jore.cc>
*
* @license AGPL-3.0
*
Expand All @@ -24,7 +23,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/

namespace OC\Core\Command\User;

use OC\Core\Command\Base;
Expand Down Expand Up @@ -64,11 +62,11 @@ protected function configure(): void {
protected function execute(InputInterface $input, OutputInterface $output): int {
$singleUserId = $input->getArgument('uid');
if ($singleUserId !== null) {
if (is_null($this->userManager->get($singleUserId))) {
if (is_null($user = $this->userManager->get($singleUserId))) {
$output->writeln('<error>User does not exist</error>');
return 1;
}
$users = $this->userManager->search($singleUserId);
$users = [$user];
} elseif ($input->getOption('all')) {
$users = $this->userManager->search('');
} else {
Expand Down

0 comments on commit b5034c0

Please sign in to comment.