mirror of
https://github.com/nextcloud/server.git
synced 2026-03-07 07:50:57 -05:00
update the display name for the database back-end
This commit is contained in:
parent
e0f2ed2757
commit
70c3ab3c53
1 changed files with 18 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue