Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Use TextResponse objects - Fix #1308 (plus other similar occurrences)
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Dec 9, 2016
1 parent c3e187b commit 3c9987f
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions core/src/plugins/core.auth/AbstractAuthDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,13 @@ public function switchAction(ServerRequestInterface $requestInterface, ResponseI

$userObject = $ctx->getUser();
if ($userObject == null || $userObject->getId() == "guest") {
header("Content-Type:text/plain");
print "SUCCESS";
$responseInterface = new TextResponse("SUCCESS");
break;
}
$oldPass = $httpVars["old_pass"];
$newPass = $httpVars["new_pass"];
if (strlen($newPass) < ConfService::getContextConf($ctx, "PASSWORD_MINLENGTH", "auth")) {
header("Content-Type:text/plain");
print "PASS_ERROR";
$responseInterface = new TextResponse("PASS_ERROR");
break;
}
if (UsersService::checkPassword($userObject->getId(), $oldPass, false)) {
Expand All @@ -95,13 +93,10 @@ public function switchAction(ServerRequestInterface $requestInterface, ResponseI
$userObject->save("superuser");
}
} else {
header("Content-Type:text/plain");
print "PASS_ERROR";
$responseInterface = new TextResponse("PASS_ERROR");
break;
}
header("Content-Type:text/plain");
print "SUCCESS";

$responseInterface = new TextResponse("SUCCESS");
break;


Expand Down

0 comments on commit 3c9987f

Please sign in to comment.