X-Git-Url: https://jfr.im/git/irc/unrealircd/unrealircd-webpanel.git/blobdiff_plain/ee8927ade5b5379a335929a5ded74e55883a3397..cd26522ba6ff68c18e1504b022ca92f4d01827be:/settings/general.php diff --git a/settings/general.php b/settings/general.php index bf30105..8e4dbbc 100644 --- a/settings/general.php +++ b/settings/general.php @@ -6,19 +6,262 @@ $canEdit = current_user_can(PERMISSION_MANAGE_USERS); function _ce($can){ echo ($can) ? "" : "disabled"; } +if (isset($_POST['submit']) && $canEdit) +{ + $hibp = (!isset($config['hibp']) || $config['hibp']) ? true : false; + $config['hibp'] = isset($_POST['hibp']) ? true : false; + if ($config['hibp'] != $hibp) // we just toggled + Message::Info("Checking passwords against data breaches is now is now ".(($config['hibp']) ? "enabled" : "disabled")); + $dbug = (isset($config['debug']) && $config['debug']) ? true : false; + $config['debug'] = isset($_POST['debug_mode']) ? true : false; + if ($config['debug'] != $dbug) // we just toggled + Message::Info("Debug Mode is now ".(($config['debug']) ? "enabled" : "disabled")); + + + if (!empty($_FILES['customFile']['tmp_name'])) + { + $cwd = getcwd(); + $a = split($cwd,'/'); + $a[sizeof($a) - 1] = NULL; + $cwd = glue($a,'/'); + $target_dir = "$cwd/img/"; + $target_file = "/$target_dir/wallpaper.jpg"; + $uploadOk = 1; + $imageFileType = strtolower(pathinfo($target_file,PATHINFO_EXTENSION)); + $check = getimagesize($_FILES["customFile"]["tmp_name"]); + $errs = []; + + if($check == false) + { + $errs[] = "File is not an image."; + $uploadOk = 0; + } + else if ($_FILES["customFile"]["size"] > 500000) { + $errs[] = "File is too large."; + $uploadOk = 0; + } + elseif($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg" + && $imageFileType != "gif" ) + { + $errs[] = "Only JPG, JPEG, PNG & GIF files are allowed."; + $uploadOk = 0; + } + if ($uploadOk != 0) { + if (file_exists($target_file)) + unlink($target_file); + move_uploaded_file($_FILES["customFile"]["tmp_name"], $target_file); + Message::Success("Updloaded file: $target_file"); + } + else Message::Fail($errs); + } + + write_config(); + unset($_POST['debug'], $_POST['submit'], $_POST['hibp']); + Hook::run(HOOKTYPE_GENERAL_SETTINGS_POST, $_POST); +} + +do_log("\$_POST", $_POST); +do_log("\$_FILES", $_FILES); ?> + +

General Settings


-
Debug Mode
-
- > - +
+
+
Password Data Leak Checks
+
+ > + +
+ This check is made everytime someone successfully logs into the webpanel or when they update their password. +
+
+
Debug Mode
+
+ > + +
+ Enabling this will likely make your webpanel more difficult to use
+
+
Themes
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+
Overview Background Image
+
+ + Might not show current image if caching is used. You'll notice the changes soon. + +
+


-
Save
+
+