diff options
author | Björn Schießle <schiessle@owncloud.com> | 2013-01-29 21:52:03 +0100 |
---|---|---|
committer | Björn Schießle <schiessle@owncloud.com> | 2013-01-29 21:52:03 +0100 |
commit | 27edbfdf562ece30bd1fb81a1eaa7b5bd037a219 (patch) | |
tree | c496c3d8022b9d8ef12b7aa552ebc85139f8b38d /settings/ajax/changedisplayname.php | |
parent | e613a682745715d5f8bf2775c37c52d99e15c923 (diff) | |
download | nextcloud-server-27edbfdf562ece30bd1fb81a1eaa7b5bd037a219.tar.gz nextcloud-server-27edbfdf562ece30bd1fb81a1eaa7b5bd037a219.zip |
added missing changedisplayname.php
Diffstat (limited to 'settings/ajax/changedisplayname.php')
-rw-r--r-- | settings/ajax/changedisplayname.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/settings/ajax/changedisplayname.php b/settings/ajax/changedisplayname.php new file mode 100644 index 00000000000..82ca18c3706 --- /dev/null +++ b/settings/ajax/changedisplayname.php @@ -0,0 +1,15 @@ +<?php
+// Check if we are a user
+OCP\JSON::callCheck();
+OC_JSON::checkLoggedIn();
+
+$username = isset($_POST["username"]) ? $_POST["username"] : OC_User::getUser();
+$displayName = $_POST["displayName"];
+
+// Return Success story
+if( OC_User::setDisplayName( $username, $displayName )) {
+ OC_JSON::success(array("data" => array( "username" => $username )));
+}
+else{
+ OC_JSON::error(array("data" => array( "message" => "Unable to change display name" )));
+}
\ No newline at end of file |