Skip to content

Commit c4e0790

Browse files
author
Till Brehm
committed
Merge branch 'patch-misc' into 'stable-3.1'
Patch misc See merge request ispconfig/ispconfig3!1049
2 parents 14b5a0c + bf736d7 commit c4e0790

File tree

13 files changed

+30
-37
lines changed

13 files changed

+30
-37
lines changed

interface/web/admin/templates/server_ip_map_list.htm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ <h1><tmpl_var name="list_head_txt"></h1>
3838
</tmpl_loop>
3939
<tmpl_unless name="records">
4040
<tr class="tbl_row_noresults tbl_row_<tmpl_if name='__EVEN__'}even<tmpl_else>uneven</tmpl_if>">
41-
<td colspan="4">{tmpl_var name='globalsearch_noresults_text_txt'}</td>
41+
<td colspan="5">{tmpl_var name='globalsearch_noresults_text_txt'}</td>
4242
</tr>
4343
</tmpl_unless>
4444
</tbody>
4545
<tfoot>
4646
<tr>
47-
<td colspan="4"><tmpl_var name="paging"></td>
47+
<td colspan="5"><tmpl_var name="paging"></td>
4848
</tr>
4949
</tfoot>
5050
</table>

interface/web/admin/templates/server_php_list.htm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ <h1><tmpl_var name="list_head_txt"></h1>
4848
</tmpl_loop>
4949
<tmpl_unless name="records">
5050
<tr class="tbl_row_noresults tbl_row_<tmpl_if name='__EVEN__'}even<tmpl_else>uneven</tmpl_if>">
51-
<td colspan="4">{tmpl_var name='globalsearch_noresults_text_txt'}</td>
51+
<td colspan="6">{tmpl_var name='globalsearch_noresults_text_txt'}</td>
5252
</tr>
5353
</tmpl_unless>
5454
</tbody>
5555
<tfoot>
5656
<tr>
57-
<td colspan="4"><tmpl_var name="paging"></td>
57+
<td colspan="6"><tmpl_var name="paging"></td>
5858
</tr>
5959
</tfoot>
6060
</table>

server/cron.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,6 @@
128128
@unlink($conf['temppath'] . $conf['fs_div'] . '.ispconfig_cron_lock');
129129
$app->log('Remove Lock: ' . $conf['temppath'] . $conf['fs_div'] . '.ispconfig_cron_lock', LOGLEVEL_DEBUG);
130130

131-
if($conf['log_priority'] <= LOGLEVEL_DEBUG) die("finished.\n");
131+
if($conf['log_priority'] <= LOGLEVEL_DEBUG) die("finished cron run.\n");
132132

133133
?>

server/cron_debug.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,6 @@
6363
$cronjob = new $class_name();
6464
$cronjob->run(true);
6565

66-
die("finished.\n");
66+
die("finished cron debug.\n");
6767

6868
?>

server/lib/classes/backup.inc.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -856,6 +856,10 @@ protected static function get_files($directory, $prefix_list = null, $endings_li
856856
if (is_null($endings_list))
857857
$endings_list = $default_endings_list;
858858

859+
if (!is_dir($directory)) {
860+
return array();
861+
}
862+
859863
$dir_handle = dir($directory);
860864
$files = array();
861865
while (false !== ($entry = $dir_handle->read())) {

server/lib/classes/cron.d/100-monitor_fail2ban.inc.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,8 @@ public function onRunJob() {
6767
$type = 'log_fail2ban';
6868

6969
/* This monitoring is only available if fail2ban is installed */
70-
system('which fail2ban-client', $retval); // Debian, Ubuntu, Fedora
71-
if ($retval !== 0)
72-
system('which fail2ban', $retval); // CentOS
73-
if ($retval === 0) {
70+
if ($app->system->is_installed('fail2ban-client') // Debian, Ubuntu, Fedora
71+
|| $app->system->is_installed('fail2ban')) { // CentOS
7472
/* Get the data of the log */
7573
$data = $this->_tools->_getLogData($type);
7674

server/lib/classes/cron.d/100-monitor_iptables.inc.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ public function onRunJob() {
6767
$type = 'iptables_rules';
6868

6969
/* This monitoring is only available if fail2ban is installed */
70-
system('which iptables', $retval); // Debian, Ubuntu, Fedora
71-
if ($retval === 0) {
70+
if ($app->system->is_installed('iptables')) {
7271
/* Get the data of the log */
7372
$data['output'] = '<h2>iptables -S (ipv4)</h2>'.shell_exec('iptables -S 2>/dev/null');
7473

@@ -83,8 +82,7 @@ public function onRunJob() {
8382

8483

8584
/* This monitoring is only available if fail2ban is installed */
86-
system('which ip6tables', $retval); // Debian, Ubuntu, Fedora
87-
if ($retval === 0) {
85+
if ($app->system->is_installed('ip6tables')) {
8886
/* Get the data of the log */
8987
$data['output'] .= '<br><h2>ip6tables -S (ipv6)</h2>'.shell_exec('ip6tables -S 2>/dev/null');
9088

server/lib/classes/cron.d/100-monitor_raid.inc.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,7 @@ public function onRunJob() {
126126
* Check, if we have mpt-status installed (LSIsoftware-raid)
127127
*/
128128
if (file_exists('/proc/mpt/summary')) {
129-
system('which mpt-status', $retval);
130-
if ($retval === 0) {
129+
if ($app->system->is_installed('mpt-status')) {
131130
/*
132131
* Fetch the output
133132
*/
@@ -174,8 +173,7 @@ public function onRunJob() {
174173
/*
175174
* 3ware Controller
176175
*/
177-
system('which tw_cli', $retval);
178-
if($retval === 0) {
176+
if($app->system->is_installed('tw_cli')) {
179177

180178
// TYPOWORX FIX | Determine Controler-ID
181179
$availableControlers = shell_exec('tw_cli info | grep -Eo "c[0-9]+"');
@@ -232,8 +230,7 @@ public function onRunJob() {
232230
/*
233231
* HP Proliant
234232
*/
235-
system('which hpacucli', $retval);
236-
if($retval === 0) {
233+
if($app->system->is_installed('hpacucli')) {
237234
$state = 'ok';
238235
$data['output'] = shell_exec('/usr/sbin/hpacucli ctrl all show config');
239236
$tmp = explode("\n", $data['output']);
@@ -278,10 +275,14 @@ public function onRunJob() {
278275
/*
279276
* LSI MegaRaid
280277
*/
281-
system('which megacli', $retval);
282-
system('which megacli64', $retval64);
283-
if($retval === 0 || $retval64 === 0) {
284-
$binary=@($retval === 0)?'megacli':'megacli64';
278+
$binary = FALSE;
279+
if ($app->system->is_installed('megacli')) {
280+
$binary = 'megacli';
281+
}
282+
if ($app->system->is_installed('megacli64')) {
283+
$binary = 'megacli64';
284+
}
285+
if($binary) {
285286
$state = 'ok';
286287
$data['output'] = shell_exec($binary.' -LDInfo -Lall -aAll -NoLog');
287288
if (strpos($data['output'], 'Optimal') !== false) {
@@ -298,8 +299,7 @@ public function onRunJob() {
298299
/*
299300
* Adaptec-RAID
300301
*/
301-
system('which arcconf', $retval);
302-
if($retval === 0) {
302+
if($app->system->is_installed('arcconf')) {
303303
$state = 'ok';
304304
$data['output'] = shell_exec('arcconf GETCONFIG 1 LD');
305305
if(is_array($data['output'])) {

server/lib/classes/cron.d/100-monitor_rkhunter.inc.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ public function onRunJob() {
6767
$type = 'rkhunter';
6868

6969
/* This monitoring is only available if rkhunter is installed */
70-
system('which rkhunter', $retval);
71-
if ($retval === 0) {
70+
if ($app->system->is_installed('rkhunter')) {
7271
/*
7372
* Fetch the output
7473
*/

server/lib/classes/cron.d/150-awstats.inc.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ public function onRunJob() {
6060
$web_config = $app->getconf->get_server_config($conf['server_id'], 'web');
6161

6262
foreach($records as $rec) {
63-
//$yesterday = date('Ymd',time() - 86400);
6463
$yesterday = date('Ymd', strtotime("-1 day", time()));
6564

6665
$log_folder = 'log';
@@ -135,9 +134,6 @@ public function onRunJob() {
135134
}
136135
}
137136

138-
// awstats_buildstaticpages.pl -update -config=mydomain.com -lang=en -dir=/var/www/domain.com/'.$web_folder.'/stats -awstatsprog=/path/to/awstats.pl
139-
// $command = "$awstats_buildstaticpages_pl -update -config='$domain' -lang=".$conf['language']." -dir='$statsdir' -awstatsprog='$awstats_pl'";
140-
141137
$command = escapeshellcmd($awstats_buildstaticpages_pl) . ' -month=' . escapeshellarg($awmonth) . ' -year=' . escapeshellarg($awyear) . ' -update -config=' . escapeshellarg($domain) . ' -lang=' . escapeshellarg($conf['language']) . ' -dir=' . escapeshellarg($statsdir) . ' -awstatsprog=' . escapeshellarg($awstats_pl);
142138

143139
if (date("d") == 2) {

0 commit comments

Comments
 (0)