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']['tmp_name']))
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);
68 .color-circle.selected {
69 border: 2px solid #fff; /* Optional: Add a border to highlight selected option */
72 .color-option input[type="radio
"]:checked + .color-circle {
73 border: 2px solid #fff; /* Optional: Add a border to highlight selected option */
76 .color-option .color-circle {
77 width: 30px; /* Adjust size as needed */
78 height: 30px; /* Adjust size as needed */
79 border-radius: 50%; /* Ensure it's circular */
82 @media (max-width: 600px) {
84 flex-basis: 50%; /* Two items per row on smaller screens */
88 @media (max-width: 400px) {
90 flex-basis: 100%; /* One item per row on very small screens */
95 <h4>General Settings</h4>
97 <form method="post
" enctype="multipart
/form
-data
">
98 <div class="card m
-1" style="padding
-left
:20px
;padding
-right
:20px
;padding
-top
:5px
;padding
-bottom
:10px
;max
-width
:fit
-content
">
99 <h6>Password Data Leak Checks</h6>
100 <div class="custom
-control custom
-switch">
101 <input name="hibp
" type="checkbox
" class="custom
-control
-input
" id="hibp
" <?php _ce($canEdit); echo (!isset($config['hibp']) || $config['hibp'] == true) ? " checked
" : ""; ?>>
102 <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>
104 <i
>This check is made everytime someone successfully logs into the webpanel
or when they update their password
.</i
>
106 <div
class="card m-1" style
="padding-left:20px;padding-right:20px;padding-top:5px;padding-bottom:10px;max-width:fit-content">
108 <div
class="custom-control custom-switch">
109 <input name
="debug_mode" type
="checkbox" class="custom-control-input" id
="debug_mode" <?php
_ce($canEdit); echo ($config['debug'] == true) ? " checked" : ""; ?>>
110 <label
class="custom-control-label" for="debug_mode">Enable Debug
Mode (Developers Only
)</label
>
112 <i
>Enabling this will likely make your webpanel more difficult to
use</i
>
114 <div
class="card m-1" style
="padding-left:20px;padding-right:20px;padding-top:5px;padding-bottom:10px;max-width:fit-content">
116 <div
class="d-flex" id
="color-options">
117 <label
class="color-option">
118 <input type
="radio" name
="color" value
="gradient1" class="color-input" checked
>
119 <div
class="color-circle selected" style
="background: linear-gradient(to bottom, #4a0000, #6b0000);"></div
>
121 <label
class="color-option">
122 <input type
="radio" name
="color" value
="gradient2" class="color-input">
123 <div
class="color-circle" style
="background: linear-gradient(to top right, #3c4858, #1f2833);"></div
>
125 <label
class="color-option">
126 <input type
="radio" name
="color" value
="gradient3" class="color-input">
127 <div
class="color-circle" style
="background: radial-gradient(circle, #3f0f3f, #1a0643);"></div
>
129 <label
class="color-option">
130 <input type
="radio" name
="color" value
="gradient4" class="color-input">
131 <div
class="color-circle" style
="background: linear-gradient(to right, #443d6e, #191b3f);"></div
>
133 <label
class="color-option">
134 <input type
="radio" name
="color" value
="gradient5" class="color-input">
135 <div
class="color-circle" style
="background: linear-gradient(to bottom, #1a1a1a, #333333);"></div
>
137 <label
class="color-option">
138 <input type
="radio" name
="color" value
="gradient6" class="color-input">
139 <div
class="color-circle" style
="background: linear-gradient(135deg, #4d194d, #1a0643);"></div
>
141 <label
class="color-option">
142 <input type
="radio" name
="color" value
="gradient7" class="color-input">
143 <div
class="color-circle" style
="background: linear-gradient(to bottom right, #1a1a1a, #333333);"></div
>
145 <label
class="color-option">
146 <input type
="radio" name
="color" value
="gradient8" class="color-input">
147 <div
class="color-circle" style
="background: linear-gradient(to bottom right, #331a33, #191b3f);"></div
>
149 <!-- Extend with additional gradients
-->
150 <label
class="color-option">
151 <input type
="radio" name
="color" value
="gradient9" class="color-input">
152 <div
class="color-circle" style
="background: linear-gradient(to bottom, #400000, #800000);"></div
>
154 <label
class="color-option">
155 <input type
="radio" name
="color" value
="gradient10" class="color-input">
156 <div
class="color-circle" style
="background: linear-gradient(to top right, #363636, #1f1f1f);"></div
>
158 <label
class="color-option">
159 <input type
="radio" name
="color" value
="gradient11" class="color-input">
160 <div
class="color-circle" style
="background: radial-gradient(circle, #730073, #400040);"></div
>
162 <label
class="color-option">
163 <input type
="radio" name
="color" value
="gradient12" class="color-input">
164 <div
class="color-circle" style
="background: linear-gradient(to right, #4c4c99, #1a1a66);"></div
>
166 <label
class="color-option">
167 <input type
="radio" name
="color" value
="gradient13" class="color-input">
168 <div
class="color-circle" style
="background: linear-gradient(to bottom, #2e2e2e, #4d4d4d);"></div
>
170 <label
class="color-option">
171 <input type
="radio" name
="color" value
="gradient14" class="color-input">
172 <div
class="color-circle" style
="background: linear-gradient(135deg, #732673, #400040);"></div
>
174 <label
class="color-option">
175 <input type
="radio" name
="color" value
="gradient15" class="color-input">
176 <div
class="color-circle" style
="background: linear-gradient(to bottom right, #2e2e2e, #4d4d4d);"></div
>
178 <label
class="color-option">
179 <input type
="radio" name
="color" value
="gradient16" class="color-input">
180 <div
class="color-circle" style
="background: linear-gradient(to bottom right, #662266, #330033);"></div
>
182 <label
class="color-option">
183 <input type
="radio" name
="color" value
="gradient17" class="color-input">
184 <div
class="color-circle" style
="background: linear-gradient(to bottom right, #993399, #660066);"></div
>
186 <label
class="color-option">
187 <input type
="radio" name
="color" value
="gradient18" class="color-input">
188 <div
class="color-circle" style
="background: linear-gradient(to bottom right, #4c4c4c, #666666);"></div
>
190 <label
class="color-option">
191 <input type
="radio" name
="color" value
="gradient19" class="color-input">
192 <div
class="color-circle" style
="background: linear-gradient(to bottom right, #660066, #330033);"></div
>
194 <label
class="color-option">
195 <input type
="radio" name
="color" value
="gradient20" class="color-input">
196 <div
class="color-circle" style
="background: linear-gradient(to bottom right, #993399, #660066);"></div
>
198 <label
class="color-option">
199 <input type
="radio" name
="color" value
="gradient21" class="color-input">
200 <div
class="color-circle" style
="background: linear-gradient(to bottom right, #4c4c4c, #666666);"></div
>
202 <label
class="color-option">
203 <input type
="radio" name
="color" value
="gradient22" class="color-input">
204 <div
class="color-circle" style
="background: linear-gradient(to bottom right, #4c4c99, #191966);"></div
>
206 <label
class="color-option">
207 <input type
="radio" name
="color" value
="gradient23" class="color-input">
208 <div
class="color-circle" style
="background: linear-gradient(to bottom right, #4c4c99, #191966);"></div
>
210 <label
class="color-option">
211 <input type
="radio" name
="color" value
="gradient24" class="color-input">
212 <div
class="color-circle" style
="background: linear-gradient(to bottom right, #330000, #191966);"></div
>
214 <label
class="color-option">
215 <input type
="radio" name
="color" value
="gradient25" class="color-input">
216 <div
class="color-circle" style
="background: linear-gradient(to bottom right, #4c4c99, #191966);"></div
>
218 <label
class="color-option">
219 <input type
="radio" name
="color" value
="gradient26" class="color-input">
220 <div
class="color-circle" style
="background: linear-gradient(to bottom right, #330000, #191966);"></div
>
222 <label
class="color-option">
223 <input type
="radio" name
="color" value
="gradient27" class="color-input">
224 <div
class="color-circle" style
="background: linear-gradient(to bottom right, #ffccff, #ff66ff);"></div
>
226 <label
class="color-option">
227 <input type
="radio" name
="color" value
="gradient28" class="color-input">
228 <div
class="color-circle" style
="background: linear-gradient(to bottom right, #ff66ff, #ff99ff);"></div
>
230 <label
class="color-option">
231 <input type
="radio" name
="color" value
="gradient29" class="color-input">
232 <div
class="color-circle" style
="background: linear-gradient(to bottom right, #ff66ff, #ffccff);"></div
>
234 <label
class="color-option">
235 <input type
="radio" name
="color" value
="gradient30" class="color-input">
236 <div
class="color-circle" style
="background: linear-gradient(to bottom right, #ffccff, #ff66ff);"></div
>
242 const iframe
=document
.getElementById('frame');
243 iframe
.contentWindow
.location
.reload(true);
251 #frame { transform:none; zoom: 0.8; -moz-transform: scale(0.8); -moz-transform-origin: 0 0; transform-origin: 3%; border:none;}
253 <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">
254 <h6
>Overview Background Image
</h6
>
255 <div
class="" id
="wrap">
256 <label
class="form-label" for="customFile">Upload an image
</label
>
257 <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.
259 <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>
262 <?php $a = []; Hook::run(HOOKTYPE_GENERAL_SETTINGS, $a); ?>
264 <button type="post" name="submit" class="btn btn-primary">Save</div>
267 require_once "../inc/footer.php";