Skip to content

Commit ae07621

Browse files
committed
Merge branch 'stable-3.1' of git.ispconfig.org:ispconfig/ispconfig3 into stable-3.1
2 parents de9a85a + 029e643 commit ae07621

File tree

14 files changed

+560
-38
lines changed

14 files changed

+560
-38
lines changed

install/dist/lib/fedora.lib.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,6 @@ function configure_postfix($options = '')
121121
$content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/postfix-'.$filename.'.master', 'tpl/postfix-'.$filename.'.master');
122122
wf($full_file_name, $content);
123123

124-
//* Changing mode and group of the new created config files.
125-
caselog('chmod o= '.$config_dir.'/mysql-virtual_*.cf* &> /dev/null',
126-
__FILE__, __LINE__, 'chmod on mysql-virtual_*.cf*', 'chmod on mysql-virtual_*.cf* failed');
127-
caselog('chgrp '.$cf['group'].' '.$config_dir.'/mysql-virtual_*.cf* &> /dev/null',
128-
__FILE__, __LINE__, 'chgrp on mysql-virtual_*.cf*', 'chgrp on mysql-virtual_*.cf* failed');
129-
130124
//* Creating virtual mail user and group
131125
$command = 'groupadd -g '.$cf['vmail_groupid'].' '.$cf['vmail_groupname'];
132126
if(!is_group($cf['vmail_groupname'])) caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");

install/dist/lib/opensuse.lib.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,6 @@ function configure_postfix($options = '')
118118
$content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/postfix-'.$filename.'.master', 'tpl/postfix-'.$filename.'.master');
119119
wf($full_file_name, $content);
120120

121-
//* Changing mode and group of the new created config files.
122-
caselog('chmod o= '.$config_dir.'/mysql-virtual_*.cf* &> /dev/null',
123-
__FILE__, __LINE__, 'chmod on mysql-virtual_*.cf*', 'chmod on mysql-virtual_*.cf* failed');
124-
caselog('chgrp '.$cf['group'].' '.$config_dir.'/mysql-virtual_*.cf* &> /dev/null',
125-
__FILE__, __LINE__, 'chgrp on mysql-virtual_*.cf*', 'chgrp on mysql-virtual_*.cf* failed');
126-
127121
if(!is_dir($cf['vmail_mailbox_base'])) mkdir($cf['vmail_mailbox_base']);
128122

129123
//* Creating virtual mail user and group

install/lib/installer_base.lib.php

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -737,18 +737,30 @@ public function process_postfix_config($configfile) {
737737
global $conf;
738738

739739
$config_dir = $conf['postfix']['config_dir'].'/';
740+
$postfix_group = $conf['postfix']['group'];
740741
$full_file_name = $config_dir.$configfile;
742+
741743
//* Backup exiting file
742744
if(is_file($full_file_name)) {
743745
copy($full_file_name, $config_dir.$configfile.'~');
746+
chmod($config_dir.$configfile.'~',0600);
744747
}
748+
749+
//* Replace variables in config file template
745750
$content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$configfile.'.master', 'tpl/'.$configfile.'.master');
746751
$content = str_replace('{mysql_server_ispconfig_user}', $conf['mysql']['ispconfig_user'], $content);
747752
$content = str_replace('{mysql_server_ispconfig_password}', $conf['mysql']['ispconfig_password'], $content);
748753
$content = str_replace('{mysql_server_database}', $conf['mysql']['database'], $content);
749754
$content = str_replace('{mysql_server_ip}', $conf['mysql']['ip'], $content);
750755
$content = str_replace('{server_id}', $conf['server_id'], $content);
751756
wf($full_file_name, $content);
757+
758+
//* Changing mode and group of the new created config file
759+
caselog('chmod u=rw,g=r,o= '.escapeshellarg($full_file_name).' &> /dev/null',
760+
__FILE__, __LINE__, 'chmod on '.$full_file_name, 'chmod on '.$full_file_name.' failed');
761+
caselog('chgrp '.escapeshellarg($postfix_group).' '.escapeshellarg($full_file_name).' &> /dev/null',
762+
__FILE__, __LINE__, 'chgrp on '.$full_file_name, 'chgrp on '.$full_file_name.' failed');
763+
752764
}
753765

754766
public function configure_jailkit() {
@@ -1028,12 +1040,6 @@ public function configure_postfix($options = '') {
10281040
}
10291041
wf($full_file_name, $content);
10301042

1031-
//* Changing mode and group of the new created config files.
1032-
caselog('chmod u=rw,g=r,o= '.$config_dir.'/mysql-virtual_*.cf* &> /dev/null',
1033-
__FILE__, __LINE__, 'chmod on mysql-virtual_*.cf*', 'chmod on mysql-virtual_*.cf* failed');
1034-
caselog('chgrp '.$cf['group'].' '.$config_dir.'/mysql-virtual_*.cf* &> /dev/null',
1035-
__FILE__, __LINE__, 'chgrp on mysql-virtual_*.cf*', 'chgrp on mysql-virtual_*.cf* failed');
1036-
10371043
//* Creating virtual mail user and group
10381044
$command = 'groupadd -g '.$cf['vmail_groupid'].' '.$cf['vmail_groupname'];
10391045
if(!is_group($cf['vmail_groupname'])) caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");

interface/web/admin/directive_snippets_edit.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,6 @@ function onShowEnd() {
7777
}
7878

7979
$app->tpl->setVar("is_master", $is_master);
80-
81-
if($this->dataRecord['managed_snippet_id'] > 0) {
82-
}
8380

8481
parent::onShowEnd();
8582
}

interface/web/dashboard/dashlets/mailquota.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,17 @@ function show() {
2121

2222
$has_mailquota = false;
2323
if(is_array($emails) && !empty($emails)){
24+
foreach($emails as &$email) {
25+
$email['email'] = $app->functions->idn_decode($email['email']);
26+
}
27+
unset($email);
2428
// email username is quoted in quota.lib already, so no htmlentities here to prevent double encoding
2529
//$emails = $app->functions->htmlentities($emails);
2630
$tpl->setloop('mailquota', $emails);
2731
$has_mailquota = isset($emails[0]['used']);
2832
}
2933
$tpl->setVar('has_mailquota', $has_mailquota);
30-
34+
3135
return $tpl->grab();
3236
}
3337

interface/web/dashboard/dashlets/quota.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ function show() {
77

88
//* Loading Template
99
$app->uses('tpl,quota_lib');
10-
if (!$app->auth->verify_module_permissions('sites')) {
11-
return;
12-
}
10+
if (!$app->auth->verify_module_permissions('sites')) {
11+
return;
12+
}
1313

1414
$tpl = new tpl;
1515
$tpl->newTemplate("dashlets/templates/quota.htm");
@@ -24,6 +24,11 @@ function show() {
2424

2525
$has_quota = false;
2626
if(is_array($sites) && !empty($sites)){
27+
foreach($sites as &$site) {
28+
$site['domain'] = $app->functions->idn_decode($site['domain']);
29+
}
30+
unset($site);
31+
2732
$sites = $app->functions->htmlentities($sites);
2833
$tpl->setloop('quota', $sites);
2934
$has_quota = isset($sites[0]['used']);

interface/web/sites/form/web_vhost_domain.tform.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@
629629
'datatype' => 'VARCHAR',
630630
'formtype' => 'SELECT',
631631
'default' => 'awstats',
632-
'value' => array('webalizer' => 'Webalizer', 'awstats' => 'AWStats', '' => 'None')
632+
'value' => array('awstats' => 'AWStats', 'goaccess' => 'GoAccess', 'webalizer' => 'Webalizer','' => 'None')
633633
),
634634
//#################################
635635
// END Datatable fields

interface/web/tools/form/user_settings.tform.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
$form['db_table_idx'] = 'userid';
6969
$form["db_history"] = "no";
7070
$form['tab_default'] = 'users';
71-
$form['list_default'] = 'index.php';
71+
$form['list_default'] = 'user_settings.php';
7272
$form['auth'] = 'no';
7373

7474
//* 0 = id of the user, > 0 id must match with id of current user

server/conf/awstats_index.php.master

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,21 @@ arsort($awprev);
4545
$options = "";
4646
foreach ($awprev as $key => $value)
4747
{
48+
49+
if(file_exists($value.'/awsindex.html') && file_exists($value.'/goaindex.html')) {
50+
$awstatsindex = 'awsindex.html';
51+
} elseif(file_exists($value.'/awsindex.html') && !file_exists($value.'/goaindex.html')) {
52+
$awstatsindex = 'awsindex.html';
53+
} else {
54+
$awstatsindex = 'goaindex.html';
55+
}
56+
4857
if($key == $current) $options .= "<option selected=\"selected\" value=\"{$awstatsindex}\">{$value}</option>\n";
4958
else $options .= "<option value=\"{$value}/{$awstatsindex}\">{$value}</option>\n";
5059
}
5160

61+
$awstatsindex = 'awsindex.html';
62+
5263
$html = "<!DOCTYPE html>\n<html>\n<head>\n<title>Stats</title>\n";
5364
$html .= "<style>\nhtml,body {margin:0px;padding:0px;width:100%;height:100%;background-color: #ccc;}\n";
5465
$html .= "#header\n{\nwidth:100%;margin:0px auto;\nheight:20px;\nposition:fixed;\npadding:4px;\ntext-align:center;\n}\n";
@@ -60,4 +71,4 @@ $html .= $options;
6071
$html .= "</select>\n</div>\n<iframe src=\"{$awstatsindex}\" id=\"content\"></iframe>\n";
6172
$html .= "</body></html>";
6273
echo $html;
63-
?>
74+
?>
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<?php
2+
$yearmonth_text = "Jump to previous stats: ";
3+
$script = "<script>function load_content(url){var iframe = document.getElementById(\"content\");iframe.src = url;}</script>\n";
4+
5+
if ($handle = opendir('.'))
6+
{
7+
while(false !== ($file = readdir($handle)))
8+
{
9+
if (substr($file,0,1) != "." && is_dir($file))
10+
{
11+
$orderkey = substr($file,0,4).substr($file,5,2);
12+
if (substr($file,5,2) < 10 )
13+
{
14+
$orderkey = substr($file,0,4)."0".substr($file,5,2);
15+
}
16+
$goaprev[$orderkey] = $file;
17+
}
18+
}
19+
20+
$month = date("n");
21+
$year = date("Y");
22+
23+
if (date("d") == 1)
24+
{
25+
$month = date("m")-1;
26+
if (date("m") == 1)
27+
{
28+
$year = date("Y")-1;
29+
$month = "12";
30+
}
31+
}
32+
33+
$current = $year.$month;
34+
if ( $month < 10 ) {
35+
$current = $year."0".$month;
36+
}
37+
$goaprev[$current] = $year."-".$month;
38+
39+
closedir($handle);
40+
}
41+
42+
arsort($goaprev);
43+
44+
$options = "";
45+
foreach ($goaprev as $key => $value)
46+
{
47+
48+
if(file_exists($value.'/awsindex.html') && file_exists($value.'/goaindex.html')) {
49+
$goaccessindex = 'goaindex.html';
50+
} elseif(file_exists($value.'/awsindex.html') && !file_exists($value.'/goaindex.html')) {
51+
$goaccessindex = 'awsindex.html';
52+
} else {
53+
$goaccessindex = 'goaindex.html';
54+
}
55+
56+
if($key == $current) $options .= "<option selected=\"selected\" value=\"{$goaccessindex}\">{$value}</option>\n";
57+
else $options .= "<option value=\"{$value}/{$goaccessindex}\">{$value}</option>\n";
58+
59+
}
60+
$goaccessindex = 'goaindex.html';
61+
62+
$html = "<!DOCTYPE html>\n<html>\n<head>\n<title>Stats</title>\n";
63+
$html .= "<style>\nhtml,body {margin:0px;padding:0px;width:100%;height:100%;background-color: #ccc;}\n";
64+
$html .= "#header\n{\nwidth:100%;margin:0px auto;\nheight:20px;\nposition:fixed;\npadding:4px;\ntext-align:center;\n}\n";
65+
$html .= "iframe {width:100%;height:95%;margin:0px;margin-top:40px;border:0px;padding:0px;}\n</style>\n</head>\n<body>\n";
66+
$html .= $script;
67+
$html .= "<div id=\"header\">{$yearmonth_text}\n";
68+
$html .= "<select name=\"goadate\" onchange=\"load_content(this.value)\">\n";
69+
$html .= $options;
70+
$html .= "</select>\n</div>\n<iframe src=\"{$goaccessindex}\" id=\"content\"></iframe>\n";
71+
$html .= "</body></html>";
72+
echo $html;
73+
?>

0 commit comments

Comments
 (0)