mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-25 10:09:20 +03:00
Fix unexpected desktop mode on mobile devices + small fixes (#1514)
This commit is contained in:
parent
677a5f2e35
commit
ed5685314e
10 changed files with 115 additions and 88 deletions
|
|
@ -14,7 +14,7 @@ class Actions
|
|||
const AUTH_SPEC_LOGOUT_TOKEN_KEY = 'rlspeclogout';
|
||||
const AUTH_SPEC_LOGOUT_CUSTOM_MSG_KEY = 'rlspeclogoutcmk';
|
||||
const AUTH_ADMIN_TOKEN_KEY = 'rlaauth';
|
||||
const RL_SKIP_MOBILE_KEY = 'rlmobile';
|
||||
const RL_MOBILE_TYPE = 'rlmobiletype';
|
||||
|
||||
/**
|
||||
* @var \MailSo\Base\Http
|
||||
|
|
|
|||
|
|
@ -162,18 +162,20 @@ class Service
|
|||
$bMobileDevice = $oMobileDetect->isMobile() &&
|
||||
($bUseMobileVersionForTablets ? true : !$oMobileDetect->isTablet());
|
||||
|
||||
$bMobile = (0 < \count($aPaths) && !empty($aPaths[0]) && 'mobile' === \strtolower($aPaths[0]));
|
||||
}
|
||||
|
||||
if ($bIndex && !$bMobile)
|
||||
{
|
||||
$iMobileKey = (int) \RainLoop\Utils::GetCookie(\RainLoop\Actions::RL_SKIP_MOBILE_KEY, 0);
|
||||
if (1 !== $iMobileKey)
|
||||
if ($bIndex)
|
||||
{
|
||||
if ($bMobileDevice)
|
||||
{
|
||||
$this->oActions->Location('./?/Mobile/');
|
||||
return $this;
|
||||
$sMobileType = (string) \RainLoop\Utils::GetCookie(\RainLoop\Actions::RL_MOBILE_TYPE, '');
|
||||
switch ($sMobileType) {
|
||||
default:
|
||||
$sMobileType = '';
|
||||
$bMobile = $bMobileDevice;
|
||||
break;
|
||||
case 'mobile':
|
||||
$bMobile = true;
|
||||
break;
|
||||
case 'desktop':
|
||||
$bMobile = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -829,9 +829,9 @@ class ServiceActions
|
|||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function ServiceSkipMobile()
|
||||
public function ServiceMobileVersion()
|
||||
{
|
||||
\RainLoop\Utils::SetCookie(\RainLoop\Actions::RL_SKIP_MOBILE_KEY, 1);
|
||||
\RainLoop\Utils::SetCookie(\RainLoop\Actions::RL_MOBILE_TYPE, 'mobile');
|
||||
$this->oActions->Location('./');
|
||||
return '';
|
||||
}
|
||||
|
|
@ -839,9 +839,9 @@ class ServiceActions
|
|||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function ServiceClearSkipMobile()
|
||||
public function ServiceDesktopVersion()
|
||||
{
|
||||
\RainLoop\Utils::ClearCookie(\RainLoop\Actions::RL_SKIP_MOBILE_KEY);
|
||||
\RainLoop\Utils::SetCookie(\RainLoop\Actions::RL_MOBILE_TYPE, 'desktop');
|
||||
$this->oActions->Location('./');
|
||||
return '';
|
||||
}
|
||||
|
|
@ -1183,16 +1183,6 @@ class ServiceActions
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function ServiceChangeMobile()
|
||||
{
|
||||
$this->changeAction();
|
||||
$this->oActions->Location('./?/Mobile/');
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue