This commit is contained in:
the-djmaze 2023-02-06 11:51:41 +01:00
parent 7c090ee775
commit 4f7f713046
11 changed files with 68 additions and 27 deletions

View file

@ -31,7 +31,11 @@ class DemoStorage extends \RainLoop\Providers\Storage\FileStorage
}
}
$sDataPath .= '/' . \MailSo\Base\Utils::SecureFileName(\RainLoop\Utils::GetConnectionToken());
// $_COOKIE['smtoken']
if (empty($_COOKIE['smctoken'])) {
\SnappyMail\Cookies::set('smctoken', \base64_encode(\random_bytes(16)), 0, false);
}
$sDataPath .= '/' . \MailSo\Base\Utils::SecureFileName($_COOKIE['smctoken']);
if (!\is_dir($sDataPath) && \mkdir($sDataPath, 0700, true)) {
\file_put_contents("{$sDataPath}/settings",'{"RemoveColors":true,"ListInlineAttachments":true}');
if (\mkdir($sDataPath.'/.gnupg/private-keys-v1.d', 0700, true)) {