From f686264ad6d82cfaf4e401da2e259880f57bfade Mon Sep 17 00:00:00 2001
From: Marius Burkard <m.burkard@pixcept.de>
Date: Sat, 30 Jan 2016 07:44:29 -0500
Subject: [PATCH] Merge branch 'master' into 'stable-3.1'
---
server/plugins-available/mailman_plugin.inc.php | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/server/plugins-available/mailman_plugin.inc.php b/server/plugins-available/mailman_plugin.inc.php
index 9ebb2aa..b15cd73 100644
--- a/server/plugins-available/mailman_plugin.inc.php
+++ b/server/plugins-available/mailman_plugin.inc.php
@@ -73,7 +73,15 @@
$this->update_config();
- exec("nohup /usr/lib/mailman/bin/newlist -u ".escapeshellcmd($data["new"]["domain"])." -e ".escapeshellcmd($data["new"]["domain"])." ".escapeshellcmd($data["new"]["listname"])." ".escapeshellcmd($data["new"]["email"])." ".escapeshellcmd($data["new"]["password"])." >/dev/null 2>&1 &");
+ $pid = exec("nohup /usr/lib/mailman/bin/newlist -u ".escapeshellcmd($data["new"]["domain"])." -e ".escapeshellcmd($data["new"]["domain"])." ".escapeshellcmd($data["new"]["listname"])." ".escapeshellcmd($data["new"]["email"])." ".escapeshellcmd($data["new"]["password"])." >/dev/null 2>&1 & echo $!;");
+ // wait for /usr/lib/mailman/bin/newlist-call
+ $running = true;
+ do {
+ exec('ps -p '.intval($pid), $out);
+ if (count($out) ==1) $running=false; else sleep(1);
+ unset($out);
+ } while ($running);
+ unset($out);
if(is_file('/var/lib/mailman/data/virtual-mailman')) exec('postmap /var/lib/mailman/data/virtual-mailman');
if(is_file('/var/lib/mailman/data/transport-mailman')) exec('postmap /var/lib/mailman/data/transport-mailman');
exec('nohup '.$conf['init_scripts'] . '/' . 'mailman reload >/dev/null 2>&1 &');
@@ -115,7 +123,7 @@
function update_config() {
global $app, $conf;
- copy($this->mailman_config_dir.'mm_cfg.py', $this->mailman_config_dir.'mm_cfg.py');
+ copy($this->mailman_config_dir.'mm_cfg.py', $this->mailman_config_dir.'mm_cfg.py~');
// load the server configuration options
$app->uses('getconf');
@@ -136,7 +144,7 @@
if (strlen($line) && substr($line, 0, 1) != '#')
{
list($key, $value) = explode("=", $line);
- if (!empty($value))
+ if ($value && $value !== '')
{
$key = rtrim($key);
$old_options[$key] = trim($value);
--
Gitblit v1.9.1