diff options
Diffstat (limited to 'apps/provisioning_api/lib/Controller/UsersController.php')
-rw-r--r-- | apps/provisioning_api/lib/Controller/UsersController.php | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/apps/provisioning_api/lib/Controller/UsersController.php b/apps/provisioning_api/lib/Controller/UsersController.php index 2e8a2ffe5ed..e659b49443b 100644 --- a/apps/provisioning_api/lib/Controller/UsersController.php +++ b/apps/provisioning_api/lib/Controller/UsersController.php @@ -29,6 +29,7 @@ namespace OCA\Provisioning_API\Controller; +use OC\Accounts\AccountManager; use \OC_Helper; use OCP\AppFramework\Http\DataResponse; use OCP\AppFramework\OCS\OCSException; @@ -53,6 +54,8 @@ class UsersController extends OCSController { private $groupManager; /** @var IUserSession */ private $userSession; + /** @var AccountManager */ + private $accountManager; /** @var ILogger */ private $logger; @@ -63,6 +66,7 @@ class UsersController extends OCSController { * @param IConfig $config * @param IGroupManager $groupManager * @param IUserSession $userSession + * @param AccountManager $accountManager * @param ILogger $logger */ public function __construct($appName, @@ -71,6 +75,7 @@ class UsersController extends OCSController { IConfig $config, IGroupManager $groupManager, IUserSession $userSession, + AccountManager $accountManager, ILogger $logger) { parent::__construct($appName, $request); @@ -78,6 +83,7 @@ class UsersController extends OCSController { $this->config = $config; $this->groupManager = $groupManager; $this->userSession = $userSession; + $this->accountManager = $accountManager; $this->logger = $logger; } @@ -107,7 +113,7 @@ class UsersController extends OCSController { } if($offset === null) { - $offset = 0; + $offset = 0; } $users = []; @@ -159,7 +165,7 @@ class UsersController extends OCSController { throw new OCSException('no group specified (required for subadmins)', 106); } } - + try { $newUser = $this->userManager->createUser($userid, $password); $this->logger->info('Successful addUser call with userid: '.$userid, ['app' => 'ocs_api']); @@ -209,10 +215,16 @@ class UsersController extends OCSController { } } + $userAccount = $this->accountManager->getUser($targetUserObject); + // Find the data $data['quota'] = $this->fillStorageInfo($userId); $data['email'] = $targetUserObject->getEMailAddress(); $data['displayname'] = $targetUserObject->getDisplayName(); + $data['phone'] = $userAccount[\OC\Accounts\AccountManager::PROPERTY_PHONE]['value']; + $data['address'] = $userAccount[\OC\Accounts\AccountManager::PROPERTY_ADDRESS]['value']; + $data['webpage'] = $userAccount[\OC\Accounts\AccountManager::PROPERTY_WEBSITE]['value']; + $data['twitter'] = $userAccount[\OC\Accounts\AccountManager::PROPERTY_TWITTER]['value']; return new DataResponse($data); } @@ -436,7 +448,7 @@ class UsersController extends OCSController { throw new OCSException('', \OCP\API::RESPOND_UNAUTHORISED); } } - + } /** |