mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-06 07:57:02 +03:00
Check for cPanel $_ENV['REMOTE_TEMP_USER']
This commit is contained in:
parent
82d5d34174
commit
2634edd842
1 changed files with 10 additions and 5 deletions
|
|
@ -62,11 +62,16 @@ class LoginRemotePlugin extends \RainLoop\Plugins\AbstractPlugin
|
||||||
public function FilterLoginCredentials(&$sEmail, &$sLogin, &$sPassword)
|
public function FilterLoginCredentials(&$sEmail, &$sLogin, &$sPassword)
|
||||||
{
|
{
|
||||||
// cPanel https://github.com/the-djmaze/snappymail/issues/697
|
// cPanel https://github.com/the-djmaze/snappymail/issues/697
|
||||||
if (static::$login/* && $sLogin == $_SERVER['REMOTE_USER']*/) {
|
// && !empty($_ENV['CPANEL'])
|
||||||
$iPos = \strpos($sPassword, '[::cpses::]');
|
if (static::$login/* && $sLogin == $_ENV['REMOTE_USER']*/) {
|
||||||
if ($iPos) {
|
if (empty($_ENV['REMOTE_TEMP_USER'])) {
|
||||||
$sKey = \substr($sPassword, 0, $iPos);
|
$iPos = \strpos($sPassword, '[::cpses::]');
|
||||||
$sLogin = $_SERVER['REMOTE_USER'] . '/' . \substr($sPassword, 0, $iPos);
|
if ($iPos) {
|
||||||
|
$_ENV['REMOTE_TEMP_USER'] = \substr($sPassword, 0, $iPos);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!empty($_ENV['REMOTE_TEMP_USER'])) {
|
||||||
|
$sLogin = $_ENV['REMOTE_USER'] . '/' . $_ENV['REMOTE_TEMP_USER'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue