diff options
author | Malf Furious <m@lfurio.us> | 2016-02-07 16:13:11 -0500 |
---|---|---|
committer | Malf Furious <m@lfurio.us> | 2016-02-07 16:13:11 -0500 |
commit | db6505607b2356e91fe396badf50243407f3345b (patch) | |
tree | aec767b0627d8db6a3aec0dce1034333355913db /app/class | |
parent | 3fc1102bccbcbc32b0d4cb026a9250796c384bd6 (diff) | |
download | scrott-db6505607b2356e91fe396badf50243407f3345b.tar.gz scrott-db6505607b2356e91fe396badf50243407f3345b.zip |
Add in-app administrative setting: settSSL
This is the in-app version of $_SCROTT['settSSL'] system-level setting.
Setting::settSSL() overrides $_SCROTT['settSSL'] only if the latter is set to 'neither'.
If both are set to 'neither', the app will run on either HTTP or HTTPS depending on how the page was requested.
Diffstat (limited to 'app/class')
-rw-r--r-- | app/class/setting.class.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/app/class/setting.class.php b/app/class/setting.class.php index e3ef7f1..9cafdfd 100644 --- a/app/class/setting.class.php +++ b/app/class/setting.class.php @@ -42,6 +42,24 @@ class Setting extends Framework } /* + * Force or forbid SSL connections? + */ + static function settSSL($value = null) + { + $opt = "settSSL"; + + if ($value != null) + self::setValue($opt, $value); + + $value = self::getValue($opt); + + if ($value === false) + return "neither"; + + return $value; + } + + /* * Should the app allow the public to signup their own accounts with Scrott? */ static function allowPublicSignup($value = null) |