2 require_once "../inc/common.php";
3 require_once "../inc/header.php";
5 $canEdit = current_user_can(PERMISSION_MANAGE_USERS
);
7 echo ($can) ? "" : "disabled";
9 if (isset($_POST['submit']) && $canEdit)
11 $hibp = (!isset($config['hibp']) || $config['hibp']) ? true : false;
12 $config['hibp'] = isset($_POST['hibp']) ? true : false;
13 if ($config['hibp'] != $hibp) // we just toggled
14 Message
::Info("Checking passwords against data breaches is now is now ".(($config['hibp']) ? "enabled" : "disabled"));
16 $dbug = (isset($config['debug']) && $config['debug']) ? true : false;
17 $config['debug'] = isset($_POST['debug_mode']) ? true : false;
18 if ($config['debug'] != $dbug) // we just toggled
19 Message
::Info("Debug Mode is now ".(($config['debug']) ? "enabled" : "disabled"));
22 if (!empty($_FILES['customFile']))
26 $a[sizeof($a) - 1] = NULL;
28 $target_dir = "$cwd/img/";
29 $target_file = "/$target_dir/wallpaper.jpg";
31 $imageFileType = strtolower(pathinfo($target_file,PATHINFO_EXTENSION
));
32 $check = getimagesize($_FILES["customFile"]["tmp_name"]);
37 $errs[] = "File is not an image.";
40 else if ($_FILES["customFile"]["size"] > 500000) {
41 $errs[] = "File is too large.";
44 elseif($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg"
45 && $imageFileType != "gif" )
47 $errs[] = "Only JPG, JPEG, PNG & GIF files are allowed.";
51 if (file_exists($target_file))
53 move_uploaded_file($_FILES["customFile"]["tmp_name"], $target_file);
54 Message
::Success("Updloaded file: $target_file");
56 else Message::Fail($errs);
60 unset($_POST['debug'], $_POST['submit'], $_POST['hibp']);
61 Hook::run(HOOKTYPE_GENERAL_SETTINGS_POST, $_POST);
64 do_log("\$_POST
", $_POST);
65 do_log("\$_FILES
", $_FILES);
67 <h4>General Settings</h4>
69 <form method="post
" enctype="multipart
/form
-data
">
70 <div class="card m
-1" style="padding
-left
:20px
;padding
-right
:20px
;padding
-top
:5px
;padding
-bottom
:10px
;max
-width
:fit
-content
">
71 <h6>Password Data Leak Checks</h6>
72 <div class="custom
-control custom
-switch">
73 <input name="hibp
" type="checkbox
" class="custom
-control
-input
" id="hibp
" <?php _ce($canEdit); echo (!isset($config['hibp']) || $config['hibp'] == true) ? " checked
" : ""; ?>>
74 <label class="custom
-control
-label
" for="hibp
">Checks a users password on login against known data leaks (<a href="https
://haveibeenpwned.com">Have I Been Pwned</a>)</label>
76 <i
>This check is made everytime someone successfully logs into the webpanel
or when they update their password
.</i
>
78 <div
class="card m-1" style
="padding-left:20px;padding-right:20px;padding-top:5px;padding-bottom:10px;max-width:fit-content">
80 <div
class="custom-control custom-switch">
81 <input name
="debug_mode" type
="checkbox" class="custom-control-input" id
="debug_mode" <?php
_ce($canEdit); echo ($config['debug'] == true) ? " checked" : ""; ?>>
82 <label
class="custom-control-label" for="debug_mode">Enable Debug
Mode (Developers Only
)</label
>
84 <i
>Enabling this will likely make your webpanel more difficult to
use</i
>
87 const iframe
=document
.getElementById('frame');
88 iframe
.contentWindow
.location
.reload(true);
96 #frame { transform:none; zoom: 0.8; -moz-transform: scale(0.8); -moz-transform-origin: 0 0; transform-origin: 3%; border:none;}
98 <div
class="card mb-2" style
="padding-left:20px;padding-right:20px;padding-top:5px;padding-bottom:10px;max-width:fit-content;max-height:fit-content">
99 <h6
>Overview Background Image
</h6
>
100 <div
class="" id
="wrap">
101 <label
class="form-label" for="customFile">Upload an image
</label
>
102 <input type
="file" class="form-control" name
="customFile" id
="customFile" /> Might not show current image
if caching is used
. You
'll notice the changes soon.
104 <iframe width="100%" height="500vh" id="frame" style="pointer-events: none;position:relative;margin-top:10px" src="<?php echo get_config('base_url
'); ?>">Loading Live Preview</iframe>
107 <?php $a = []; Hook::run(HOOKTYPE_GENERAL_SETTINGS, $a); ?>
109 <button type="post" name="submit" class="btn btn-primary">Save</div>
112 require_once "../inc/footer.php";