]>
Commit | Line | Data |
---|---|---|
ee8927ad VP |
1 | <?php |
2 | require_once "../inc/common.php"; | |
3 | require_once "../inc/header.php"; | |
4 | ||
5 | $canEdit = current_user_can(PERMISSION_MANAGE_USERS); | |
6 | function _ce($can){ | |
7 | echo ($can) ? "" : "disabled"; | |
8 | } | |
f2e07243 VP |
9 | if (isset($_POST['submit']) && $canEdit) |
10 | { | |
3d4e4ec4 VP |
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")); | |
15 | ||
f2e07243 | 16 | $dbug = (isset($config['debug']) && $config['debug']) ? true : false; |
3d4e4ec4 | 17 | $config['debug'] = isset($_POST['debug_mode']) ? true : false; |
f2e07243 VP |
18 | if ($config['debug'] != $dbug) // we just toggled |
19 | Message::Info("Debug Mode is now ".(($config['debug']) ? "enabled" : "disabled")); | |
3d4e4ec4 | 20 | |
f2e07243 | 21 | write_config(); |
3d4e4ec4 | 22 | unset($_POST['debug'], $_POST['submit'], $_POST['hibp']); |
f2e07243 VP |
23 | Hook::run(HOOKTYPE_GENERAL_SETTINGS_POST, $_POST); |
24 | } | |
ee8927ad | 25 | |
f2e07243 | 26 | do_log("\$_POST", $_POST); |
ee8927ad VP |
27 | ?> |
28 | <h4>General Settings</h4> | |
29 | <br> | |
f2e07243 | 30 | <form method="post"> |
3d4e4ec4 VP |
31 | <div class="card m-1" style="padding-left:20px;padding-right:20px;padding-top:5px;padding-bottom:10px;max-width:fit-content"> |
32 | <h6>Password Data Leak Checks</h6> | |
33 | <div class="custom-control custom-switch"> | |
34 | <input name="hibp" type="checkbox" class="custom-control-input" id="hibp" <?php _ce($canEdit); echo (!isset($config['hibp']) || $config['hibp'] == true) ? " checked" : ""; ?>> | |
35 | <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> | |
36 | </div> | |
37 | <i>This check is made everytime someone successfully logs into the webpanel or when they update their password.</i> | |
38 | </div> | |
39 | <div class="card m-1" style="padding-left:20px;padding-right:20px;padding-top:5px;padding-bottom:10px;max-width:fit-content"> | |
f2e07243 VP |
40 | <h6>Debug Mode</h6> |
41 | <div class="custom-control custom-switch"> | |
42 | <input name="debug_mode" type="checkbox" class="custom-control-input" id="debug_mode" <?php _ce($canEdit); echo ($config['debug'] == true) ? " checked" : ""; ?>> | |
43 | <label class="custom-control-label" for="debug_mode">Enable Debug Mode (Developers Only)</label> | |
44 | </div> | |
45 | <i>Enabling this will likely make your webpanel more difficult to use</i> | |
ee8927ad VP |
46 | </div> |
47 | ||
ee8927ad VP |
48 | <?php $a = []; Hook::run(HOOKTYPE_GENERAL_SETTINGS, $a); ?> |
49 | <br><br> | |
f2e07243 VP |
50 | <button type="post" name="submit" class="btn btn-primary">Save</div> |
51 | </form> | |
ee8927ad VP |
52 | <?php |
53 | require_once "../inc/footer.php"; |