summaryrefslogtreecommitdiffstats
path: root/lib/private/user
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 /lib/private/user
parentdd733d89256e0a2d1f7f4f96ac46b5a7bfbff984 (diff)
downloadnextcloud-server-aeb89947a2bddb1db10426538afaccdc141c059e.tar.gz
nextcloud-server-aeb89947a2bddb1db10426538afaccdc141c059e.zip
Introduce IUser::setEMailAddress and add hook mechanism
Diffstat (limited to 'lib/private/user')
-rw-r--r--lib/private/user/manager.php1
-rw-r--r--lib/private/user/user.php19
2 files changed, 20 insertions, 0 deletions
diff --git a/lib/private/user/manager.php b/lib/private/user/manager.php
index 2aafe98cef2..b547f981616 100644
--- a/lib/private/user/manager.php
+++ b/lib/private/user/manager.php
@@ -44,6 +44,7 @@ use OCP\IConfig;
* - postDelete(\OC\User\User $user)
* - preCreateUser(string $uid, string $password)
* - postCreateUser(\OC\User\User $user, string $password)
+ * - change(\OC\User\User $user)
*
* @package OC\User
*/
diff --git a/lib/private/user/user.php b/lib/private/user/user.php
index c2a6acc7664..d8a888806e0 100644
--- a/lib/private/user/user.php
+++ b/lib/private/user/user.php
@@ -146,6 +146,24 @@ class User implements IUser {
}
/**
+ * set the email address of the user
+ *
+ * @param string|null $mailAddress
+ * @return void
+ * @since 9.0.0
+ */
+ public function setEMailAddress($mailAddress) {
+ if($mailAddress === '') {
+ $this->config->deleteUserValue($this->uid, 'settings', 'email');
+ } else {
+ $this->config->setUserValue($this->uid, 'settings', 'email', $mailAddress);
+ }
+ if ($this->emitter) {
+ $this->emitter->emit('\OC\User', 'changeUser', array($this));
+ }
+ }
+
+ /**
* returns the timestamp of the user's last login or 0 if the user did never
* login
*
@@ -365,4 +383,5 @@ class User implements IUser {
return $url;
}
+
}