Kristan Kenney 5 лет назад
Родитель
Сommit
b3c655af19
2 измененных файлов с 75 добавлено и 0 удалено
  1. 33 0
      web/edit/server/index.php
  2. 42 0
      web/templates/admin/edit_server.html

+ 33 - 0
web/edit/server/index.php

@@ -695,6 +695,39 @@ if (!empty($_POST['save'])) {
         }
     }
 
+    // Change POLICY_USER_EDIT_DETAILS
+    if (empty($_SESSION['error_msg'])) {
+        if ($_POST['v_policy_user_edit_details'] != $_SESSION['POLICY_USER_EDIT_DETAILS']) {
+            exec (HESTIA_CMD."v-change-sys-config-value POLICY_USER_EDIT_DETAILS ".escapeshellarg($_POST['v_policy_user_edit_details']), $output, $return_var);
+            check_return_code($return_var,$output);
+            unset($output);
+            if (empty($_SESSION['error_msg'])) $v_enforce_subdomain_ownership = $_POST['v_policy_user_edit_details'];
+            $v_security_adv = 'yes';
+        }
+    }
+
+    // Change POLICY_USER_VIEW_LOGS
+    if (empty($_SESSION['error_msg'])) {
+        if ($_POST['v_policy_user_view_logs'] != $_SESSION['POLICY_USER_VIEW_LOGS']) {
+            exec (HESTIA_CMD."v-change-sys-config-value POLICY_USER_VIEW_LOGS ".escapeshellarg($_POST['v_policy_user_view_logs']), $output, $return_var);
+            check_return_code($return_var,$output);
+            unset($output);
+            if (empty($_SESSION['error_msg'])) $v_enforce_subdomain_ownership = $_POST['v_policy_user_view_logs'];
+            $v_security_adv = 'yes';
+        }
+    }
+
+    // Change POLICY_USER_DELETE_LOGS
+    if (empty($_SESSION['error_msg'])) {
+        if ($_POST['v_policy_user_delete_logs'] != $_SESSION['POLICY_USER_DELETE_LOGS']) {
+            exec (HESTIA_CMD."v-change-sys-config-value POLICY_USER_DELETE_LOGS ".escapeshellarg($_POST['v_policy_user_delete_logs']), $output, $return_var);
+            check_return_code($return_var,$output);
+            unset($output);
+            if (empty($_SESSION['error_msg'])) $v_enforce_subdomain_ownership = $_POST['v_policy_user_delete_logs'];
+            $v_security_adv = 'yes';
+        }
+    }
+
     // Change RESTRICTED_ADMIN
     if (empty($_SESSION['error_msg'])) {
         if ($_POST['v_restrict_admin'] != $_SESSION['RESTRICTED_ADMIN']) {

+ 42 - 0
web/templates/admin/edit_server.html

@@ -1056,6 +1056,48 @@
                                                 </td>
                                             </tr>
                                         <?}?>
+                                        <tr>
+                                            <td class="vst-text input-label">
+                                                <?php print _('Users can edit their account details');?>
+                                            </td>
+                                        </tr>
+                                        <tr>
+                                            <td>
+                                                <select class="vst-list" name="v_policy_user_edit_details">
+                                                    <option value='yes'><?php print _('yes'); ?></option>
+                                                    <option value='no' <?php if($_SESSION['POLICY_USER_EDIT_DETAILS'] == 'no') echo 'selected' ?> ><?php print _('no'); ?></option>
+                                                </select>
+                                                <br><br>
+                                            </td>
+                                        </tr>
+                                        <tr>
+                                            <td class="vst-text input-label">
+                                                <?php print _('Users can view their action and login history logs');?>
+                                            </td>
+                                        </tr>
+                                        <tr>
+                                            <td>
+                                                <select class="vst-list" name="v_policy_user_view_logs">
+                                                    <option value='yes'><?php print _('yes'); ?></option>
+                                                    <option value='no' <?php if($_SESSION['POLICY_USER_VIEW_LOGS'] == 'no') echo 'selected' ?> ><?php print _('no'); ?></option>
+                                                </select>
+                                                <br><br>
+                                            </td>
+                                        </tr>
+                                        <tr>
+                                            <td class="vst-text input-label">
+                                                <?php print _('Users can delete their action and login history logs');?>
+                                            </td>
+                                        </tr>
+                                        <tr>
+                                            <td>
+                                                <select class="vst-list" name="v_policy_user_delete_logs">
+                                                    <option value='yes'><?php print _('yes'); ?></option>
+                                                    <option value='no' <?php if($_SESSION['POLICY_USER_DELETE_LOGS'] == 'no') echo 'selected' ?> ><?php print _('no'); ?></option>
+                                                </select>
+                                                <br><br>
+                                            </td>
+                                        </tr>
                                         <tr>
                                             <td class="vst-text input-label">
                                                 <?php print _('Inactive session timeout');?> (<?php print _('Minutes');?>)