Browse Source

Adjust check and add placeholder text

Kristan Kenney 5 years ago
parent
commit
ad9f0279ad
2 changed files with 2 additions and 1 deletions
  1. 1 0
      web/edit/user/index.php
  2. 1 1
      web/templates/pages/edit_user.html

+ 1 - 0
web/edit/user/index.php

@@ -193,6 +193,7 @@ if (!empty($_POST['save'])) {
 
     // Change use IP allow list option (admin only)
     if (($v_login_use_iplist != $_POST['v_login_use_iplist']) && (empty($_SESSION['error_msg']))) {
+        if ($_POST['v_login_use_iplist'] == 'on') { $_POST['v_login_use_iplist'] = 'yes'; } else { $_POST['v_login_use_iplist'] = 'no'; }
         $v_login_use_iplist = escapeshellarg($_POST['v_login_use_iplist']);
         exec (HESTIA_CMD."v-change-user-config-value ".escapeshellarg($v_username)." LOGIN_USE_IPLIST ".$v_login_use_iplist, $output, $return_var);
         check_return_code($return_var,$output);

+ 1 - 1
web/templates/pages/edit_user.html

@@ -172,7 +172,7 @@
                                     <table id="ip-allowlist" style="<? if ($data[$user]['LOGIN_USE_IPLIST'] === 'yes') { echo 'display: table-cell;'; } else { echo 'display: none;'; } ?>">
                                         <tr>
                                             <td>
-                                                <input type="text" size="20" class="vst-input" name="v_login_allowed_ips" value="<?=htmlentities(trim($v_login_allowed_ips, "'"))?>">
+                                                <input type="text" size="20" class="vst-input" placeholder="<?=_('Example: 127.0.0.1,192.168.1.100');?>" name="v_login_allowed_ips" value="<?=htmlentities(trim($v_login_allowed_ips, "'"))?>">
                                                 <input type="hidden" name="v_login_allowed_ips" value="<?=htmlentities(trim($v_login_allowed_ips, "'"))?>">
                                             </td>
                                         </tr>