old boot.php functions replaced in src/module (4)

This commit is contained in:
Michael 2022-10-19 04:43:47 +00:00 committed by Hypolite Petovan
parent de6eabde58
commit d47d78f2d4
22 changed files with 140 additions and 158 deletions

View file

@ -24,6 +24,7 @@ namespace Friendica\Module\Security;
use Friendica\App;
use Friendica\Core\L10n;
use Friendica\Core\Renderer;
use Friendica\Core\Session;
use Friendica\Database\DBA;
use Friendica\Model\User;
use Friendica\Module\Response;
@ -54,13 +55,13 @@ class PasswordTooLong extends \Friendica\BaseModule
}
// check if the old password was supplied correctly before changing it to the new value
User::getIdFromPasswordAuthentication(local_user(), $request['password_current']);
User::getIdFromPasswordAuthentication(Session::getLocalUser(), $request['password_current']);
if (strlen($request['password_current']) <= 72) {
throw new \Exception($this->l10n->t('Password does not need changing.'));
}
$result = User::updatePassword(local_user(), $newpass);
$result = User::updatePassword(Session::getLocalUser(), $newpass);
if (!DBA::isResult($result)) {
throw new \Exception($this->l10n->t('Password update failed. Please try again.'));
}