From 8b5ccd302bd1497de721a25e4ce086bebf95173f Mon Sep 17 00:00:00 2001 From: tbrehm <t.brehm@ispconfig.org> Date: Sun, 08 Jun 2008 15:32:42 -0400 Subject: [PATCH] Fixed a problem with the logout when the php session has ended. --- server/plugins-available/mail_plugin.inc.php | 18 +++++++++++++----- 1 files changed, 13 insertions(+), 5 deletions(-) diff --git a/server/plugins-available/mail_plugin.inc.php b/server/plugins-available/mail_plugin.inc.php index 9140708..1c7195d 100644 --- a/server/plugins-available/mail_plugin.inc.php +++ b/server/plugins-available/mail_plugin.inc.php @@ -45,10 +45,15 @@ Register for the events */ + //* Mailboxes $app->plugins->registerEvent('mail_user_insert',$this->plugin_name,'user_insert'); $app->plugins->registerEvent('mail_user_update',$this->plugin_name,'user_update'); $app->plugins->registerEvent('mail_user_delete',$this->plugin_name,'user_delete'); + //* Mail Domains + //$app->plugins->registerEvent('mail_domain_insert',$this->plugin_name,'domain_insert'); + //$app->plugins->registerEvent('mail_domain_update',$this->plugin_name,'domain_update'); + //$app->plugins->registerEvent('mail_domain_delete',$this->plugin_name,'domain_delete'); } @@ -56,13 +61,18 @@ function user_insert($event_name,$data) { global $app, $conf; + // get the config + $app->uses("getconf"); + $mail_config = $app->getconf->get_server_config($conf["server_id"], 'mail'); + // Create the maildir, if it does not exist if(!is_dir($data['new']['maildir'])) { - exec('mkdir -p '.escapeshellcmd($data['new']['maildir'])); - exec('chown '.$mail_config['mailuser_name'].':'.$mail_config['mailuser_group'].' '.escapeshellcmd($data['new']['maildir'])); + exec("su -c 'mkdir -p ".escapeshellcmd($data['new']['maildir'])."' ".$mail_config['mailuser_name']); + exec("su -c 'maildirmake ".escapeshellcmd($data['new']['maildir'])."' ".$mail_config['mailuser_name']); + //exec('maildirmake '.escapeshellcmd($data['new']['maildir'])); + exec('chown -R '.$mail_config['mailuser_name'].':'.$mail_config['mailuser_group'].' '.escapeshellcmd($data['new']['maildir'])); $app->log('Created Maildir: '.$data['new']['maildir'],LOGLEVEL_DEBUG); } - } function user_update($event_name,$data) { @@ -86,7 +96,6 @@ rmdir($data['old']['maildir']); $app->log('Moved Maildir from: '.$data['old']['maildir'].' to '.$data['new']['maildir'],LOGLEVEL_DEBUG); } - } function user_delete($event_name,$data) { @@ -99,7 +108,6 @@ } else { $app->log('Possible security violation when deleting the maildir: '.$data['old']['maildir'],LOGLEVEL_ERROR); } - } -- Gitblit v1.9.1