summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2020-09-18 15:48:22 +0300
committerAndrew Dolgov <[email protected]>2020-09-18 15:48:22 +0300
commit03a337a660a40263db0f3b5b5123cfa04f5c7505 (patch)
tree18bc4241a2784217803f78f43fe7b87727c6c8bb /classes
parent3588d5186ef7321fa573adbb62f42b05d7a138be (diff)
add basic safe mode which doesn't load any user plugins
Diffstat (limited to 'classes')
-rwxr-xr-xclasses/handler/public.php2
-rw-r--r--classes/pref/prefs.php4
2 files changed, 6 insertions, 0 deletions
diff --git a/classes/handler/public.php b/classes/handler/public.php
index a735b1931..822ad1fd9 100755
--- a/classes/handler/public.php
+++ b/classes/handler/public.php
@@ -673,6 +673,7 @@ class Handler_Public extends Handler {
$login = clean($_POST["login"]);
$password = clean($_POST["password"]);
$remember_me = clean($_POST["remember_me"]);
+ $safe_mode = checkbox_to_sql_bool(clean($_POST["safe_mode"]));
if ($remember_me) {
@session_set_cookie_params(SESSION_COOKIE_LIFETIME);
@@ -689,6 +690,7 @@ class Handler_Public extends Handler {
$_SESSION["ref_schema_version"] = get_schema_version(true);
$_SESSION["bw_limit"] = !!clean($_POST["bw_limit"]);
+ $_SESSION["safe_mode"] = $safe_mode;
if (clean($_POST["profile"])) {
diff --git a/classes/pref/prefs.php b/classes/pref/prefs.php
index 25aac9964..ac2684683 100644
--- a/classes/pref/prefs.php
+++ b/classes/pref/prefs.php
@@ -858,6 +858,10 @@ class Pref_Prefs extends Handler_Protected {
print_warning("Your PHP configuration has open_basedir restrictions enabled. Some plugins relying on CURL for functionality may not work correctly.");
}
+ if ($_SESSION["safe_mode"]) {
+ print_error("You have logged in using safe mode, no user plugins will be actually enabled until you login again.");
+ }
+
$feed_handler_whitelist = [ "Af_Comics" ];
$feed_handlers = array_merge(