summaryrefslogtreecommitdiffstats
path: root/apps/provisioning_api
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-01-18 20:27:43 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2016-01-20 14:57:20 +0100
commitaeb89947a2bddb1db10426538afaccdc141c059e (patch)
tree4cd9bada02f0c7d4c944d5b83160f2d8e2bf831b /apps/provisioning_api
parentdd733d89256e0a2d1f7f4f96ac46b5a7bfbff984 (diff)
downloadnextcloud-server-aeb89947a2bddb1db10426538afaccdc141c059e.tar.gz
nextcloud-server-aeb89947a2bddb1db10426538afaccdc141c059e.zip
Introduce IUser::setEMailAddress and add hook mechanism
Diffstat (limited to 'apps/provisioning_api')
-rw-r--r--apps/provisioning_api/lib/users.php2
-rw-r--r--apps/provisioning_api/tests/userstest.php6
2 files changed, 4 insertions, 4 deletions
diff --git a/apps/provisioning_api/lib/users.php b/apps/provisioning_api/lib/users.php
index a385f2c1180..efb10a50865 100644
--- a/apps/provisioning_api/lib/users.php
+++ b/apps/provisioning_api/lib/users.php
@@ -285,7 +285,7 @@ class Users {
break;
case 'email':
if(filter_var($parameters['_put']['value'], FILTER_VALIDATE_EMAIL)) {
- $this->config->setUserValue($targetUserId, 'settings', 'email', $parameters['_put']['value']);
+ $targetUser->setEMailAddress($parameters['_put']['value']);
} else {
return new OC_OCS_Result(null, 102);
}
diff --git a/apps/provisioning_api/tests/userstest.php b/apps/provisioning_api/tests/userstest.php
index 25e723a13b4..3ce13181b8d 100644
--- a/apps/provisioning_api/tests/userstest.php
+++ b/apps/provisioning_api/tests/userstest.php
@@ -932,10 +932,10 @@ class UsersTest extends OriginalTest {
->method('get')
->with('UserToEdit')
->will($this->returnValue($targetUser));
- $this->config
+ $targetUser
->expects($this->once())
- ->method('setUserValue')
- ->with('UserToEdit', 'settings', 'email', 'demo@owncloud.org');
+ ->method('setEMailAddress')
+ ->with('demo@owncloud.org');
$expected = new \OC_OCS_Result(null, 100);
$this->assertEquals($expected, $this->api->editUser(['userid' => 'UserToEdit', '_put' => ['key' => 'email', 'value' => 'demo@owncloud.org']]));