use login name to verify password

This commit is contained in:
Bjoern Schiessle 2014-11-24 15:44:43 +01:00
parent 168fce0b18
commit 1645c8f819
1 changed files with 2 additions and 1 deletions

View File

@ -26,9 +26,10 @@ $newPassword = $_POST['newPassword'];
$view = new \OC\Files\View('/');
$session = new \OCA\Encryption\Session($view);
$user = \OCP\User::getUser();
$loginName = \OC::$server->getUserSession()->getLoginName();
// check new password
$passwordCorrect = \OCP\User::checkPassword($user, $newPassword);
$passwordCorrect = \OCP\User::checkPassword($loginName, $newPassword);
if ($passwordCorrect !== false) {