added missing changedisplayname.php
This commit is contained in:
parent
e613a68274
commit
27edbfdf56
1 changed files with 15 additions and 0 deletions
15
settings/ajax/changedisplayname.php
Normal file
15
settings/ajax/changedisplayname.php
Normal 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" )));
|
||||
}
|
Loading…
Reference in a new issue