Skip to content

Commit ea05006

Browse files
committed
Cron reporting handler + minor fixes in firewall templates
1 parent 66ea0b3 commit ea05006

File tree

7 files changed

+44
-8
lines changed

7 files changed

+44
-8
lines changed

web/bulk/cron/index.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,40 @@
1717
break;
1818
case 'unsuspend': $cmd='v-unsuspend-cron-job';
1919
break;
20+
case 'delete-cron-reports': $cmd='v-delete-cron-reports';
21+
exec (VESTA_CMD.$cmd." ".$user, $output, $return_var);
22+
$_SESSION['error_msg'] = __('Cronjob email reporting has been successfully diabled');
23+
unset($output);
24+
header("Location: /list/cron/");
25+
exit;
26+
break;
27+
case 'add-cron-reports': $cmd='v-add-cron-reports';
28+
exec (VESTA_CMD.$cmd." ".$user, $output, $return_var);
29+
$_SESSION['error_msg'] = __('Cronjob email reporting has been successfully enabled');
30+
unset($output);
31+
header("Location: /list/cron/");
32+
exit;
33+
break;
2034
default: header("Location: /list/cron/"); exit;
2135
}
2236
} else {
2337
switch ($action) {
2438
case 'delete': $cmd='v-delete-cron-job';
2539
break;
40+
case 'delete-cron-reports': $cmd='v-delete-cron-reports';
41+
exec (VESTA_CMD.$cmd." ".$user, $output, $return_var);
42+
$_SESSION['error_msg'] = __('Cronjob email reporting has been successfully diabled');
43+
unset($output);
44+
header("Location: /list/cron/");
45+
exit;
46+
break;
47+
case 'add-cron-reports': $cmd='v-add-cron-reports';
48+
exec (VESTA_CMD.$cmd." ".$user, $output, $return_var);
49+
$_SESSION['error_msg'] = __('Cronjob email reporting has been successfully enabled');
50+
unset($output);
51+
header("Location: /list/cron/");
52+
exit;
53+
break;
2654
default: header("Location: /list/cron/"); exit;
2755
}
2856
}

web/templates/admin/add_firewall.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
</tr>
8686
<tr>
8787
<td class="vst-text input-label">
88-
<?php print __('IP Address');?> <span class="optional">(<?php print __('CDIR format is supported');?>)</span>
88+
<?php print __('IP address');?> <span class="optional">(<?php print __('CIDR format is supported');?>)</span>
8989
</td>
9090
</tr>
9191
<tr>

web/templates/admin/add_firewall_banlist.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
</tr>
6565
<tr>
6666
<td class="vst-text input-label">
67-
<?php print __('IP Address');?> <span class="optional">(<?php print __('CDIR format is supported');?>)</span>
67+
<?php print __('IP address');?> <span class="optional">(<?php print __('CDIR format is supported');?>)</span>
6868
</td>
6969
</tr>
7070
<tr>

web/templates/admin/edit_firewall.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
</tr>
9191
<tr>
9292
<td class="vst-text input-label">
93-
<?php print __('IP Address');?> <span class="optional">(<?php print __('CDIR format is supported');?>)</span>
93+
<?php print __('IP address');?> <span class="optional">(<?php print __('CIDR format is supported');?>)</span>
9494
</td>
9595
</tr>
9696
<tr>

web/templates/admin/list_cron.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,29 @@
1515
<a class="submenu-select-link" href='javascript:checkedAll("objects");'> <?php print __('toggle all');?> </a>
1616
<select class="submenu-select-dropdown" name="action">
1717
<option value=""><?php print __('apply to selected');?></option>
18+
<?php if($panel[$user]['CRON_REPORTS'] == 'yes') echo '<option value="delete-cron-reports">'. __('turn off notifications').'</option>'; ?>
19+
<?php if($panel[$user]['CRON_REPORTS'] == 'no') echo '<option value="add-cron-reports">'. __('turn on notifications').'</option>'; ?>
1820
<option value="suspend"><?php print __('suspend');?></option>
1921
<option value="unsuspend"><?php print __('unsuspend');?></option>
2022
<option value="delete"><?php print __('delete');?></option>
2123
</select>
2224
<input type="submit" name="ok" value="" class="submenu-button-select">
2325
</div>
26+
<?php if ($panel[$user]['LANGUAGE'] == 'en') { ?>
2427
<div class="submenu-select-block">
2528
<?php
2629
if($panel[$user]['CRON_REPORTS'] == 'yes') {
2730
?>
28-
<a class="submenu-select-link" href="/delete/cron/reports/">[ <?php print __('disable email reports');?> ]</a>
31+
<a class="submenu-select-link" href="/delete/cron/reports/">[ <?php print __('turn off notifications');?> ]</a>
2932
<?php
3033
} else {
3134
?>
32-
<a class="submenu-select-link" href="/add/cron/reports/">[ <?php print __('enable email reports');?> ]</a>
35+
<a class="submenu-select-link" href="/add/cron/reports/">[ <?php print __('turn on notifications');?> ]</a>
3336
<?php
3437
}
3538
?>
3639
</div>
40+
<?php } ?>
3741
<?php display_error_block(); ?>
3842
</td>
3943
</tr>

web/templates/admin/list_firewall_banlist.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
<div class="data-count">
7676
<?php
7777
if ( $i == 0) {
78-
echo __('There is no currently banned IP addresses');
78+
echo __('There are no currently banned IP');
7979
}
8080
if ( $i == 1) {
8181
echo __('1 IP address');

web/templates/user/list_cron.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,27 @@
1515
<a class="submenu-select-link" href='javascript:checkedAll("objects");'> <?php print __('toggle all');?> </a>
1616
<select class="submenu-select-dropdown" name="action">
1717
<option value=""><?php print __('apply to selected');?></option>
18+
<?php if($panel[$user]['CRON_REPORTS'] == 'yes') echo '<option value="delete-cron-reports">'. __('turn off notifications').'</option>'; ?>
19+
<?php if($panel[$user]['CRON_REPORTS'] == 'no') echo '<option value="add-cron-reports">'. __('turn on notifications').'</option>'; ?>
1820
<option value="delete"><?php print __('delete');?></option>
1921
</select>
2022
<input type="submit" name="ok" value="" class="submenu-button-select">
2123
</div>
24+
<?php if ($panel[$user]['LANGUAGE'] == 'en') { ?>
2225
<div class="submenu-select-block">
2326
<?php
2427
if($panel[$user]['CRON_REPORTS'] == 'yes') {
2528
?>
26-
<a class="submenu-select-link" href="/delete/cron/reports/">[ <?php print __('disable email reports');?> ]</a>
29+
<a class="submenu-select-link" href="/delete/cron/reports/">[ <?php print __('turn off notifications');?> ]</a>
2730
<?php
2831
} else {
2932
?>
30-
<a class="submenu-select-link" href="/add/cron/reports/">[ <?php print __('enable email reports');?> ]</a>
33+
<a class="submenu-select-link" href="/add/cron/reports/">[ <?php print __('turn on notifications');?> ]</a>
3134
<?php
3235
}
3336
?>
3437
</div>
38+
<?php } ?>
3539
<?php display_error_block(); ?>
3640
</td>
3741
</tr>

0 commit comments

Comments
 (0)