|
@@ -258,7 +258,7 @@ function ModifyDatabaseSettings($return_config = false)
|
|
|
*/
|
|
|
function ModifyCookieSettings($return_config = false)
|
|
|
{
|
|
|
- global $context, $scripturl, $txt, $sourcedir, $modSettings, $cookiename, $user_settings;
|
|
|
+ global $context, $scripturl, $txt, $sourcedir, $modSettings, $cookiename, $user_settings, $boardurl;
|
|
|
|
|
|
// Define the variables we want to edit.
|
|
|
$config_vars = array(
|
|
@@ -267,6 +267,7 @@ function ModifyCookieSettings($return_config = false)
|
|
|
array('cookieTime', $txt['cookieTime'], 'db', 'int'),
|
|
|
array('localCookies', $txt['localCookies'], 'db', 'check', false, 'localCookies'),
|
|
|
array('globalCookies', $txt['globalCookies'], 'db', 'check', false, 'globalCookies'),
|
|
|
+ array('globalCookiesDomain', $txt['globalCookiesDomain'], 'db', 'text', false, 'globalCookiesDomain'),
|
|
|
array('secureCookies', $txt['secureCookies'], 'db', 'check', false, 'secureCookies', 'disabled' => !isset($_SERVER['HTTPS']) || !(strtolower($_SERVER['HTTPS']) == 'on' || strtolower($_SERVER['HTTPS']) == '1')),
|
|
|
array('httponlyCookies', $txt['httponlyCookies'], 'db', 'check', false, 'httponlyCookies'),
|
|
|
'',
|
|
@@ -289,6 +290,9 @@ function ModifyCookieSettings($return_config = false)
|
|
|
{
|
|
|
call_integration_hook('integrate_save_cookie_settings');
|
|
|
|
|
|
+ if (isset($_POST['globalCookiesDomain']) && strpos($boardurl, $_POST['globalCookiesDomain']) === false)
|
|
|
+ fatal_lang_error('invalid_cookie_domain', false);
|
|
|
+
|
|
|
saveSettings($config_vars);
|
|
|
|
|
|
// If the cookie name was changed, reset the cookie.
|