From 5051e0572a1f0618156cd84c1cb93107e2d584a9 Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Mon, 19 Aug 2013 02:03:54 +1000 Subject: Missing theme conf type "checkbox" --- inc/mod/pages.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'inc/mod') diff --git a/inc/mod/pages.php b/inc/mod/pages.php index fe55b513..887be16b 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -2155,7 +2155,10 @@ function mod_theme_configure($theme_name) { $query = prepare("INSERT INTO ``theme_settings`` VALUES(:theme, :name, :value)"); $query->bindValue(':theme', $theme_name); $query->bindValue(':name', $conf['name']); - $query->bindValue(':value', $_POST[$conf['name']]); + if ($conf['type'] == 'checkbox') + $query->bindValue(':value', isset($_POST[$conf['name']]) ? 1 : 0); + else + $query->bindValue(':value', $_POST[$conf['name']]); $query->execute() or error(db_error($query)); } -- cgit v1.3 From 47dec494658566772a0bdf9c0f2a97113acfb481 Mon Sep 17 00:00:00 2001 From: ctrlcctrlv Date: Sun, 18 Aug 2013 01:44:36 +0000 Subject: Optionally access mod cookie in JavaScript --- inc/config.php | 3 +++ inc/mod/auth.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'inc/mod') diff --git a/inc/config.php b/inc/config.php index f0e3ea9f..ba336d48 100644 --- a/inc/config.php +++ b/inc/config.php @@ -1070,6 +1070,9 @@ // Replace ?/config with a simple text editor for editing inc/instance-config.php. $config['mod']['config_editor_php'] = false; + // Whether or not you can access the mod cookie in JavaScript. Most users should not need to change this. + $config['mod']['cookie_httponly'] = true; + /* * ==================== * Mod permissions diff --git a/inc/mod/auth.php b/inc/mod/auth.php index bfab0f7e..5f449e0f 100644 --- a/inc/mod/auth.php +++ b/inc/mod/auth.php @@ -72,7 +72,7 @@ function setCookies() { $mod['hash'][0] . // password ':' . $mod['hash'][1], // salt - time() + $config['cookies']['expire'], $config['cookies']['jail'] ? $config['cookies']['path'] : '/', null, false, true); + time() + $config['cookies']['expire'], $config['cookies']['jail'] ? $config['cookies']['path'] : '/', null, false, $config['mod']['cookie_httponly']); } function destroyCookies() { -- cgit v1.3 From 977341655378c03a47a0869b32202506d0fb4088 Mon Sep 17 00:00:00 2001 From: ctrlcctrlv Date: Sun, 18 Aug 2013 01:53:39 +0000 Subject: Better setting name --- inc/config.php | 6 +++--- inc/mod/auth.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'inc/mod') diff --git a/inc/config.php b/inc/config.php index ba336d48..fbe20d3e 100644 --- a/inc/config.php +++ b/inc/config.php @@ -154,6 +154,9 @@ // Make this something long and random for security. $config['cookies']['salt'] = 'abcdefghijklmnopqrstuvwxyz09123456789!@#$%^&*()'; + // Whether or not you can access the mod cookie in JavaScript. Most users should not need to change this. + $config['cookies']['httponly'] = true; + // Used to salt secure tripcodes ("##trip") and poster IDs (if enabled). $config['secure_trip_salt'] = ')(*&^%$#@!98765432190zyxwvutsrqponmlkjihgfedcba'; @@ -1070,9 +1073,6 @@ // Replace ?/config with a simple text editor for editing inc/instance-config.php. $config['mod']['config_editor_php'] = false; - // Whether or not you can access the mod cookie in JavaScript. Most users should not need to change this. - $config['mod']['cookie_httponly'] = true; - /* * ==================== * Mod permissions diff --git a/inc/mod/auth.php b/inc/mod/auth.php index 5f449e0f..0733646f 100644 --- a/inc/mod/auth.php +++ b/inc/mod/auth.php @@ -72,7 +72,7 @@ function setCookies() { $mod['hash'][0] . // password ':' . $mod['hash'][1], // salt - time() + $config['cookies']['expire'], $config['cookies']['jail'] ? $config['cookies']['path'] : '/', null, false, $config['mod']['cookie_httponly']); + time() + $config['cookies']['expire'], $config['cookies']['jail'] ? $config['cookies']['path'] : '/', null, false, $config['cookies']['httponly']); } function destroyCookies() { -- cgit v1.3