Skip to content

Commit 82ca275

Browse files
committed
- Fixed bug in logview refresh function.
- Fixed bug with maildir creation in mail plugin.
1 parent fa79580 commit 82ca275

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

interface/web/js/scrigo.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function loadContentRefresh(pagename) {
66
document.getElementById('pageContent').innerHTML = o.responseText;
77
},
88
failure: function(o) {
9-
alert('Ajax Request was not successful.');
9+
alert('Ajax Request was not successful.'+pagename);
1010
}
1111
}
1212

interface/web/monitor/logview.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@
104104

105105
$app->tpl->setVar("log",$log);
106106
$app->tpl->setVar("logfile",$logfile);
107+
$app->tpl->setVar("logfile_id",$logfile_id);
107108

108109

109110
$app->tpl_defaults();
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div style="margin-left:30px;margin-top:30px;"><b><tmpl_var name="logfile"></b><br /><br />
2-
<select name="refreshinterval" id="refreshinterval" onChange="loadContentRefresh('monitor/index.php?log=mail_log')">
2+
<select name="refreshinterval" id="refreshinterval" onChange="loadContentRefresh('monitor/logview.php?log={tmpl_var name="logfile_id"}')">
33
{tmpl_var name="refresh"}
44
</select><br /><br />
55
<tmpl_var name="log"></div>

server/plugins-available/mail_plugin.inc.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,16 @@ function user_insert($event_name,$data) {
6767

6868
// Create the maildir, if it does not exist
6969
if(!is_dir($data['new']['maildir'])) {
70-
exec("su -c 'mkdir -p ".escapeshellcmd($data['new']['maildir'])."' ".$mail_config['mailuser_name']);
70+
$tmp_path = $data['new']['maildir'];
71+
$tmp_path_parts = explode('/',$tmp_path);
72+
unset($tmp_path_parts[count($tmp_path_parts)-2]);
73+
$maildomain_path = implode('/',$tmp_path_parts);
74+
if(!is_dir($maildomain_path)) {
75+
exec("su -c 'mkdir -p ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name']);
76+
$app->log('Created Directory: '.$maildomain_path,LOGLEVEL_DEBUG);
77+
}
7178
exec("su -c 'maildirmake ".escapeshellcmd($data['new']['maildir'])."' ".$mail_config['mailuser_name']);
79+
$app->log('Executed: '."su -c 'maildirmake ".escapeshellcmd($data['new']['maildir'])."' ".$mail_config['mailuser_name'],LOGLEVEL_DEBUG);
7280
//exec('maildirmake '.escapeshellcmd($data['new']['maildir']));
7381
exec('chown -R '.$mail_config['mailuser_name'].':'.$mail_config['mailuser_group'].' '.escapeshellcmd($data['new']['maildir']));
7482
$app->log('Created Maildir: '.$data['new']['maildir'],LOGLEVEL_DEBUG);

0 commit comments

Comments
 (0)