aboutsummaryrefslogtreecommitdiffstats
path: root/settings/ajax
diff options
context:
space:
mode:
Diffstat (limited to 'settings/ajax')
-rw-r--r--settings/ajax/changedisplayname.php7
-rw-r--r--settings/ajax/changepassword.php13
2 files changed, 9 insertions, 11 deletions
diff --git a/settings/ajax/changedisplayname.php b/settings/ajax/changedisplayname.php
index f80ecb7a0c9..8f2ff865bd5 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();
@@ -15,14 +16,14 @@ if(OC_SubAdmin::isUserAccessible(OC_User::getUser(), $username)) {
}
if(is_null($userstatus)) {
- OC_JSON::error( array( "data" => array( "message" => "Authentication error" )));
+ 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 )));
+ 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" => $l->t("Unable to change display name"), displayName => OC_User::getDisplayName($username) )));
} \ No newline at end of file
diff --git a/settings/ajax/changepassword.php b/settings/ajax/changepassword.php
index 8d45e62e4d8..ceb4bbeecb0 100644
--- a/settings/ajax/changepassword.php
+++ b/settings/ajax/changepassword.php
@@ -4,6 +4,9 @@
OCP\JSON::callCheck();
OC_JSON::checkLoggedIn();
+// Manually load apps to ensure hooks work correctly (workaround for issue 1503)
+OC_APP::loadApps();
+
$username = isset($_POST["username"]) ? $_POST["username"] : OC_User::getUser();
$password = $_POST["password"];
$oldPassword=isset($_POST["oldpassword"])?$_POST["oldpassword"]:'';
@@ -15,14 +18,8 @@ if(OC_User::isAdminUser(OC_User::getUser())) {
if(OC_SubAdmin::isUserAccessible(OC_User::getUser(), $username)) {
$userstatus = 'subadmin';
}
-if(OC_User::getUser() === $username) {
- if (OC_User::checkPassword($username, $oldPassword)) {
- $userstatus = 'user';
- } else {
- if (!OC_Util::isUserVerified()) {
- $userstatus = null;
- }
- }
+if(OC_User::getUser() === $username && OC_User::checkPassword($username, $oldPassword)) {
+ $userstatus = 'user';
}
if(is_null($userstatus)) {