added missing changedisplayname.php

This commit is contained in:
Björn Schießle 2013-01-29 21:52:03 +01:00
parent e613a68274
commit 27edbfdf56

View file

@ -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" )));
}