diff options
author | Björn Schießle <schiessle@owncloud.com> | 2013-01-28 14:23:15 +0100 |
---|---|---|
committer | Björn Schießle <schiessle@owncloud.com> | 2013-01-28 14:23:15 +0100 |
commit | 70c3ab3c53fa31331c19d3f1d74fce29efc047d4 (patch) | |
tree | 3afceccf9108be9f19ed41e3f10bd17188018a79 /lib/user | |
parent | e0f2ed2757b698448d49fa3e73340ce9ced25e7a (diff) | |
download | nextcloud-server-70c3ab3c53fa31331c19d3f1d74fce29efc047d4.tar.gz nextcloud-server-70c3ab3c53fa31331c19d3f1d74fce29efc047d4.zip |
update the display name for the database back-end
Diffstat (limited to 'lib/user')
-rw-r--r-- | lib/user/database.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/user/database.php b/lib/user/database.php index f33e338e2e4..49c76545327 100644 --- a/lib/user/database.php +++ b/lib/user/database.php @@ -110,6 +110,24 @@ class OC_User_Database extends OC_User_Backend { return false; } } + + /**
+ * @brief Set display name
+ * @param $uid The username
+ * @param $displayName The new display name
+ * @returns true/false
+ *
+ * Change the display name of a user
+ */ + public function setDisplayName( $uid, $displayName ) { + if( $this->userExists($uid) ) {
+ $query = OC_DB::prepare( 'UPDATE `*PREFIX*users` SET `displayname` = ? WHERE `uid` = ?' );
+ $query->execute( array( $displayName, $uid ));
+ return true;
+ }else{
+ return false;
+ }
+ } /** * @brief Check if the password is correct |