Author |
|
igor.martin Newbie
Joined: 15 July 2020 Location: Ukraine
Online Status: Offline Posts: 2
|
Posted: 15 July 2020 at 6:44am | IP Logged
|
|
|
Hello there!
We have iframe integration of Webmail into our app and login users via SSO so we omit the login page at all.
The question is: is there a way to set locale programmatically like passing locale parameter or setting a cookie or something?
|
Back to Top |
|
|
Igor AfterLogic Support
Joined: 24 June 2008 Location: United States
Online Status: Offline Posts: 6104
|
Posted: 16 July 2020 at 1:29am | IP Logged
|
|
|
While it's not supported out-of-box, it can be achieved with a small code modification. In system/Api.php file, locate GenerateSsoToken function and add $sLanguage argument:
Code:
public static function GenerateSsoToken($sEmail, $sPassword, $sLogin = '', $sLanguage = '')
{
$sSsoHash = \md5($sEmail.$sPassword.$sLogin.\microtime(true).\rand(10000, 99999));
return self::Cacher()->Set('SSO:'.$sSsoHash, self::EncodeKeyValues(array(
'Email' => $sEmail,
'Password' => $sPassword,
'Login' => $sLogin,
'Language' => $sLanguage
))) ? $sSsoHash : '';
} |
|
|
In modules/Core/Module.php file, locate EntrySso method and modify the following line:
Code:
$aResult = self::Decorator()->Login($aData['Email'], $aData['Password']); |
|
|
with an argument added:
Code:
$aResult = self::Decorator()->Login($aData['Email'], $aData['Password'], $aData['Language']); |
|
|
And the argument needs to be supplied when generating SSO hash:
Code:
\Aurora\System\Api::GenerateSsoToken($sEmail, $sPassword, $sLogin, $sLanguage); |
|
|
Hope this helps.
--
Regards,
Igor, Afterlogic Support
|
Back to Top |
|
|
igor.martin Newbie
Joined: 15 July 2020 Location: Ukraine
Online Status: Offline Posts: 2
|
Posted: 17 July 2020 at 1:38am | IP Logged
|
|
|
Should help. thank you
|
Back to Top |
|
|