فهرست منبع

Cron reporting handler + minor fixes in firewall templates

Serghey Rodin 11 سال پیش
والد
کامیت
ea050062ae

+ 28 - 0
web/bulk/cron/index.php

@@ -17,12 +17,40 @@ if ($_SESSION['user'] == 'admin') {
             break;
         case 'unsuspend': $cmd='v-unsuspend-cron-job';
             break;
+        case 'delete-cron-reports': $cmd='v-delete-cron-reports';
+            exec (VESTA_CMD.$cmd." ".$user, $output, $return_var);
+            $_SESSION['error_msg'] = __('Cronjob email reporting has been successfully diabled');
+            unset($output);
+            header("Location: /list/cron/");
+            exit;
+            break;
+        case 'add-cron-reports': $cmd='v-add-cron-reports';
+            exec (VESTA_CMD.$cmd." ".$user, $output, $return_var);
+            $_SESSION['error_msg'] = __('Cronjob email reporting has been successfully enabled');
+            unset($output);
+            header("Location: /list/cron/");
+            exit;
+            break;
         default: header("Location: /list/cron/"); exit;
     }
 } else {
     switch ($action) {
         case 'delete': $cmd='v-delete-cron-job';
             break;
+        case 'delete-cron-reports': $cmd='v-delete-cron-reports';
+            exec (VESTA_CMD.$cmd." ".$user, $output, $return_var);
+            $_SESSION['error_msg'] = __('Cronjob email reporting has been successfully diabled');
+            unset($output);
+            header("Location: /list/cron/");
+            exit;
+            break;
+        case 'add-cron-reports': $cmd='v-add-cron-reports';
+            exec (VESTA_CMD.$cmd." ".$user, $output, $return_var);
+            $_SESSION['error_msg'] = __('Cronjob email reporting has been successfully enabled');
+            unset($output);
+            header("Location: /list/cron/");
+            exit;
+            break;
         default: header("Location: /list/cron/"); exit;
     }
 }

+ 1 - 1
web/templates/admin/add_firewall.html

@@ -85,7 +85,7 @@
                             </tr>
                             <tr>
                                 <td class="vst-text input-label">
-                                    <?php print __('IP Address');?> <span class="optional">(<?php print __('CDIR format is supported');?>)</span>
+                                    <?php print __('IP address');?> <span class="optional">(<?php print __('CIDR format is supported');?>)</span>
                                 </td>
                             </tr>
                             <tr>

+ 1 - 1
web/templates/admin/add_firewall_banlist.html

@@ -64,7 +64,7 @@
                             </tr>
                             <tr>
                                 <td class="vst-text input-label">
-                                    <?php print __('IP Address');?> <span class="optional">(<?php print __('CDIR format is supported');?>)</span>
+                                    <?php print __('IP address');?> <span class="optional">(<?php print __('CDIR format is supported');?>)</span>
                                 </td>
                             </tr>
                             <tr>

+ 1 - 1
web/templates/admin/edit_firewall.html

@@ -90,7 +90,7 @@
                             </tr>
                             <tr>
                                 <td class="vst-text input-label">
-                                    <?php print __('IP Address');?> <span class="optional">(<?php print __('CDIR format is supported');?>)</span>
+                                    <?php print __('IP address');?> <span class="optional">(<?php print __('CIDR format is supported');?>)</span>
                                 </td>
                             </tr>
                             <tr>

+ 6 - 2
web/templates/admin/list_cron.html

@@ -15,25 +15,29 @@
                             <a class="submenu-select-link" href='javascript:checkedAll("objects");'> <?php print __('toggle all');?> </a>
                             <select class="submenu-select-dropdown" name="action">
                                 <option value=""><?php print __('apply to selected');?></option>
+                                <?php if($panel[$user]['CRON_REPORTS'] == 'yes') echo '<option value="delete-cron-reports">'. __('turn off notifications').'</option>'; ?> 
+                                <?php if($panel[$user]['CRON_REPORTS'] == 'no') echo '<option value="add-cron-reports">'. __('turn on notifications').'</option>'; ?> 
                                 <option value="suspend"><?php print __('suspend');?></option>
                                 <option value="unsuspend"><?php print __('unsuspend');?></option>
                                 <option value="delete"><?php print __('delete');?></option>
                             </select>
                             <input type="submit" name="ok" value="›" class="submenu-button-select">
                         </div>
+                        <?php  if ($panel[$user]['LANGUAGE'] == 'en') { ?>
                         <div class="submenu-select-block">
                             <?php
                                 if($panel[$user]['CRON_REPORTS'] == 'yes') {
                             ?> 
-                            <a class="submenu-select-link" href="/delete/cron/reports/">[ <?php print __('disable email reports');?> ]</a>
+                            <a class="submenu-select-link" href="/delete/cron/reports/">[ <?php print __('turn off notifications');?> ]</a>
                             <?php
                                 } else {
                             ?> 
-                            <a class="submenu-select-link" href="/add/cron/reports/">[ <?php print __('enable email reports');?> ]</a>
+                            <a class="submenu-select-link" href="/add/cron/reports/">[ <?php print __('turn on notifications');?> ]</a>
                             <?php
                                 }
                             ?> 
                         </div>
+                        <?php } ?> 
                         <?php display_error_block(); ?> 
                     </td>
                 </tr>

+ 1 - 1
web/templates/admin/list_firewall_banlist.html

@@ -75,7 +75,7 @@
             <div class="data-count">
                 <?php
                     if ( $i == 0) {
-                        echo __('There is no currently banned IP addresses');
+                        echo __('There are no currently banned IP');
                     }
                     if ( $i == 1) {
                         echo __('1 IP address');

+ 6 - 2
web/templates/user/list_cron.html

@@ -15,23 +15,27 @@
                             <a class="submenu-select-link" href='javascript:checkedAll("objects");'> <?php print __('toggle all');?> </a>
                             <select class="submenu-select-dropdown" name="action">
                                 <option value=""><?php print __('apply to selected');?></option>
+                                <?php if($panel[$user]['CRON_REPORTS'] == 'yes') echo '<option value="delete-cron-reports">'. __('turn off notifications').'</option>'; ?> 
+                                <?php if($panel[$user]['CRON_REPORTS'] == 'no') echo '<option value="add-cron-reports">'. __('turn on notifications').'</option>'; ?> 
                                 <option value="delete"><?php print __('delete');?></option>
                             </select>
                             <input type="submit" name="ok" value="›" class="submenu-button-select">
                         </div>
+                        <?php  if ($panel[$user]['LANGUAGE'] == 'en') { ?>
                         <div class="submenu-select-block">
                             <?php
                                 if($panel[$user]['CRON_REPORTS'] == 'yes') {
                             ?> 
-                            <a class="submenu-select-link" href="/delete/cron/reports/">[ <?php print __('disable email reports');?> ]</a>
+                            <a class="submenu-select-link" href="/delete/cron/reports/">[ <?php print __('turn off notifications');?> ]</a>
                             <?php
                                 } else {
                             ?> 
-                            <a class="submenu-select-link" href="/add/cron/reports/">[ <?php print __('enable email reports');?> ]</a>
+                            <a class="submenu-select-link" href="/add/cron/reports/">[ <?php print __('turn on notifications');?> ]</a>
                             <?php
                                 }
                             ?> 
                         </div>
+                        <?php } ?> 
                         <?php display_error_block(); ?> 
                     </td>
                 </tr>