diff options
author | Bart Visscher <bartv@thisnet.nl> | 2013-02-22 17:21:57 +0100 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2013-02-22 19:05:36 +0100 |
commit | bb75dfc021a68bcd9526ef40f78bca4910798345 (patch) | |
tree | 30185c8198f4da87f180214bf1f2076ec48f3777 /settings/ajax | |
parent | 78fce834058a38a7dbcc5310e16095c743434bc6 (diff) | |
download | nextcloud-server-bb75dfc021a68bcd9526ef40f78bca4910798345.tar.gz nextcloud-server-bb75dfc021a68bcd9526ef40f78bca4910798345.zip |
Whitespace fixes
Diffstat (limited to 'settings/ajax')
-rw-r--r-- | settings/ajax/changedisplayname.php | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/settings/ajax/changedisplayname.php b/settings/ajax/changedisplayname.php index 08c1b1455cd..dff4d733cd2 100644 --- a/settings/ajax/changedisplayname.php +++ b/settings/ajax/changedisplayname.php @@ -1,33 +1,33 @@ -<?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"];
-
-$userstatus = null;
-if(OC_User::isAdminUser(OC_User::getUser())) {
- $userstatus = 'admin';
-}
-if(OC_SubAdmin::isUserAccessible(OC_User::getUser(), $username)) {
- $userstatus = 'subadmin';
-}
-
-if ($username == OC_User::getUser() && OC_User::canUserChangeDisplayName($username)) {
- $userstatus = 'changeOwnDisplayName';
-}
-
-if(is_null($userstatus)) {
- OC_JSON::error( array( "data" => array( "message" => $l->t("Authentication error") )));
- exit();
-}
-
-// Return Success story
-if( OC_User::setDisplayName( $username, $displayName )) {
- OC_JSON::success(array("data" => array( "username" => $username, 'displayName' => $displayName )));
-}
-else{
+<?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"]; + +$userstatus = null; +if(OC_User::isAdminUser(OC_User::getUser())) { + $userstatus = 'admin'; +} +if(OC_SubAdmin::isUserAccessible(OC_User::getUser(), $username)) { + $userstatus = 'subadmin'; +} + +if ($username == OC_User::getUser() && OC_User::canUserChangeDisplayName($username)) { + $userstatus = 'changeOwnDisplayName'; +} + +if(is_null($userstatus)) { + OC_JSON::error( array( "data" => array( "message" => $l->t("Authentication error") ))); + exit(); +} + +// Return Success story +if( OC_User::setDisplayName( $username, $displayName )) { + OC_JSON::success(array("data" => array( "username" => $username, 'displayName' => $displayName ))); +} +else{ OC_JSON::error(array("data" => array( "message" => $l->t("Unable to change display name"), 'displayName' => OC_User::getDisplayName($username) ))); } |