mirror of
https://github.com/nextcloud/server.git
synced 2024-08-12 02:11:02 +02:00
use login name to verify password
This commit is contained in:
parent
168fce0b18
commit
1645c8f819
@ -26,9 +26,10 @@ $newPassword = $_POST['newPassword'];
|
|||||||
$view = new \OC\Files\View('/');
|
$view = new \OC\Files\View('/');
|
||||||
$session = new \OCA\Encryption\Session($view);
|
$session = new \OCA\Encryption\Session($view);
|
||||||
$user = \OCP\User::getUser();
|
$user = \OCP\User::getUser();
|
||||||
|
$loginName = \OC::$server->getUserSession()->getLoginName();
|
||||||
|
|
||||||
// check new password
|
// check new password
|
||||||
$passwordCorrect = \OCP\User::checkPassword($user, $newPassword);
|
$passwordCorrect = \OCP\User::checkPassword($loginName, $newPassword);
|
||||||
|
|
||||||
if ($passwordCorrect !== false) {
|
if ($passwordCorrect !== false) {
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user