Page 1 of 1

[Tutorial] CronJob Prevent Email

Posted: Mon Jun 02, 2014 3:27 pm
by ludalabs
File: /usr/local/vesta/web/add/cron/index.php

Find:

Code: Select all

$v_cmd = escapeshellarg($_POST['v_cmd']);
Replace with:

Code: Select all

$v_preventemail = isset($_POST['v_preventemail']);
$v_cmd = escapeshellarg($_POST['v_cmd'] . ($v_preventemail ? ' &> /dev/null' : '' ));
File: /usr/local/vesta/web/templates/admin/add_cron.html

Find:

Code: Select all

<tr>
	<td class="vst-text" style="padding: 12px 0 0 0;">
		<?php print __('Command');?>
	</td>
</tr>
<tr>
	<td>
		<input type="text" size="20" class="vst-input" name="v_cmd" <?php if (!empty($v_cmd)) echo "value='".$v_cmd."'"; ?>>
	</td>
</tr>
Add After:

Code: Select all

<tr>
	<td class="vst-text" style="padding: 12px 0 0 0;">
		<?php print __('Prevent Email');?>
	</td>
</tr>
<tr>
	<td>
		<input type="checkbox" class="vst-input" name="v_preventemail" <?php if (!empty($v_preventemail)) echo 'value="'.'prevent'.'"'; ?>>
	</td>
</tr>
Now your done.