mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-01 05:29:20 +03:00
Code refactoring
Enable password validation (password change plugins)
This commit is contained in:
parent
8af2140e7a
commit
78f09856e3
8 changed files with 53 additions and 57 deletions
|
|
@ -300,21 +300,29 @@ class Actions
|
|||
*/
|
||||
public function ParseQueryAuthString()
|
||||
{
|
||||
$sQuery = \trim($this->Http()->GetQueryString());
|
||||
|
||||
$iPos = \strpos($sQuery, '&');
|
||||
if (0 < $iPos)
|
||||
{
|
||||
$sQuery = \substr($sQuery, 0, $iPos);
|
||||
}
|
||||
|
||||
$sQuery = \trim(\trim($sQuery), ' /');
|
||||
|
||||
$sSubQuerty = \trim(\trim($this->Http()->GetQuery('/s/', '')), ' /');
|
||||
$sQuery .= 0 < \strlen($sSubQuerty) ? '/'.$sSubQuerty : '';
|
||||
|
||||
if ('' === $this->GetSpecAuthToken())
|
||||
{
|
||||
$sQuery = \trim(\trim($this->Http()->GetServer('QUERY_STRING', '')), ' /');
|
||||
$iPos = \strpos($sQuery, '&');
|
||||
if (0 < $iPos)
|
||||
{
|
||||
$sQuery = \substr($sQuery, 0, $iPos);
|
||||
}
|
||||
|
||||
$aPaths = \explode('/', $sQuery);
|
||||
if (!empty($aPaths[0]) && !empty($aPaths[1]) && '_' === substr($aPaths[1], 0, 1))
|
||||
{
|
||||
$this->SetSpecAuthToken($aPaths[1]);
|
||||
}
|
||||
}
|
||||
|
||||
return $sQuery;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -555,7 +563,7 @@ class Actions
|
|||
if (null === $this->oChangePasswordProvider)
|
||||
{
|
||||
$this->oChangePasswordProvider = new \RainLoop\Providers\ChangePassword(
|
||||
$this, $this->fabrica('change-password'), !!$this->Config()->Get('labs', 'check_new_password_strength', false)
|
||||
$this, $this->fabrica('change-password'), !!$this->Config()->Get('labs', 'check_new_password_strength', true)
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue