Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions apps/provisioning_api/lib/Controller/UsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
namespace OCA\Provisioning_API\Controller;

use OC\Accounts\AccountManager;
use OC\HintException;
use OC\Settings\Mailer\NewUserMailHelper;
use OC_Helper;
use OCA\Provisioning_API\FederatedFileSharingFactory;
Expand Down Expand Up @@ -193,15 +194,22 @@ public function addUser($userid, $password, $groups = null) {

try {
$newUser = $this->userManager->createUser($userid, $password);
$this->logger->info('Successful addUser call with userid: '.$userid, ['app' => 'ocs_api']);
$this->logger->info('Successful addUser call with userid: ' . $userid, ['app' => 'ocs_api']);

if (is_array($groups)) {
foreach ($groups as $group) {
$this->groupManager->get($group)->addUser($newUser);
$this->logger->info('Added userid '.$userid.' to group '.$group, ['app' => 'ocs_api']);
$this->logger->info('Added userid ' . $userid . ' to group ' . $group, ['app' => 'ocs_api']);
}
}
return new DataResponse();
} catch (HintException $e ) {
$this->logger->logException($e, [
'message' => 'Failed addUser attempt with hint exception.',
'level' => \OCP\Util::WARN,
'app' => 'ocs_api',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*provisioning_api?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just copied from the one below - wanted to keep it in one way ;)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah thats why I approved afterwards, didnt see it before

]);
throw new OCSException($e->getHint(), 107);
} catch (\Exception $e) {
$this->logger->logException($e, [
'message' => 'Failed addUser attempt with exception.',
Expand Down