mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-05 23:47:03 +03:00
Added Nextcloud auto-login admin panel (disabled for now)
This commit is contained in:
parent
0d4a4ad280
commit
00001c758d
1 changed files with 13 additions and 1 deletions
|
|
@ -78,7 +78,19 @@ class SnappyMailHelper
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$oActions = \RainLoop\Api::Actions();
|
$oActions = \RainLoop\Api::Actions();
|
||||||
if (!$oActions->getMainAccountFromToken(false)) {
|
$oConfig = \RainLoop\Api::Config();
|
||||||
|
if (isset($_GET[$oConfig->Get('security', 'admin_panel_key', 'admin')])) {
|
||||||
|
/* // TODO: check Nextcloud group if allowed
|
||||||
|
if ($oConfig->Get('security', 'allow_admin_panel', true) && !$oActions->IsAdminLoggined(false)) {
|
||||||
|
$sRand = \MailSo\Base\Utils::Sha1Rand();
|
||||||
|
if ($oActions->Cacher(null, true)->Set(\RainLoop\KeyPathHelper::SessionAdminKey($sRand), \time())) {
|
||||||
|
$sToken = \RainLoop\Utils::EncodeKeyValuesQ(array('token', $sRand));
|
||||||
|
// $oActions->setAdminAuthToken($sToken);
|
||||||
|
\RainLoop\Utils::SetCookie('smadmin', $sToken);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
} else if (!$oActions->getMainAccountFromToken(false)) {
|
||||||
$aCredentials = SnappyMailHelper::getLoginCredentials();
|
$aCredentials = SnappyMailHelper::getLoginCredentials();
|
||||||
if ($aCredentials[0] && $aCredentials[1]) {
|
if ($aCredentials[0] && $aCredentials[1]) {
|
||||||
$oActions->Logger()->AddSecret($aCredentials[1]);
|
$oActions->Logger()->AddSecret($aCredentials[1]);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue