summaryrefslogtreecommitdiffstats
path: root/settings/ajax/changedisplayname.php
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2013-02-06 11:38:03 +0100
committerBjörn Schießle <schiessle@owncloud.com>2013-02-06 11:38:03 +0100
commit9d73e7eb1e0dae044ef386211b214e01624a3364 (patch)
tree11d85b61a0260291f9430d3602591a11f873d8b2 /settings/ajax/changedisplayname.php
parent335b6cd0609b269b3b8c85baed2eeed94f654c3d (diff)
downloadnextcloud-server-9d73e7eb1e0dae044ef386211b214e01624a3364.tar.gz
nextcloud-server-9d73e7eb1e0dae044ef386211b214e01624a3364.zip
let the user change his display name, if supported by the back-end
Diffstat (limited to 'settings/ajax/changedisplayname.php')
-rw-r--r--settings/ajax/changedisplayname.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/settings/ajax/changedisplayname.php b/settings/ajax/changedisplayname.php
index f80ecb7a0c9..766f1459aec 100644
--- a/settings/ajax/changedisplayname.php
+++ b/settings/ajax/changedisplayname.php
@@ -1,5 +1,6 @@
<?php
// Check if we are a user
+
OCP\JSON::callCheck();
OC_JSON::checkLoggedIn();
@@ -21,8 +22,8 @@ if(is_null($userstatus)) {
// Return Success story
if( OC_User::setDisplayName( $username, $displayName )) {
- OC_JSON::success(array("data" => array( "username" => $username )));
+ OC_JSON::success(array("data" => array( "username" => $username, 'displayName' => $displayName )));
}
else{
- OC_JSON::error(array("data" => array( "message" => "Unable to change display name" )));
+ OC_JSON::error(array("data" => array( "message" => "Unable to change display name", displayName => OC_User::getDisplayName($username) )));
} \ No newline at end of file