From 0cd87e682012f224e2b74531190bb983fdcbb430 Mon Sep 17 00:00:00 2001
From: Florian Schaal <florian@schaal-24.de>
Date: Sun, 10 Jan 2016 03:31:27 -0500
Subject: [PATCH] Revert "allow 0 for ISINT"
---
server/mods-available/xmpp_module.inc.php | 21 +++++++++++++++++++++
1 files changed, 21 insertions(+), 0 deletions(-)
diff --git a/server/mods-available/xmpp_module.inc.php b/server/mods-available/xmpp_module.inc.php
index 145b7f0..aace256 100644
--- a/server/mods-available/xmpp_module.inc.php
+++ b/server/mods-available/xmpp_module.inc.php
@@ -79,6 +79,8 @@
*/
$app->modules->registerTableHook('xmpp_domain', 'xmpp_module', 'process');
+ $app->services->registerService('metronome', 'xmpp_module', 'reloadXMPP');
+ $app->services->registerService('metronome', 'xmpp_module', 'restartXMPP');
}
@@ -104,6 +106,25 @@
} // end switch
} // end function
+
+ function restartXMPP($action = 'restart') {
+ global $app, $conf;
+
+ // load the server configuration options
+ $app->uses('getconf,system');
+
+ $daemon = 'metronome';
+
+ $retval = array('output' => '', 'retval' => 0);
+ if($action == 'restart') {
+ $cmd = $app->system->getinitcommand($daemon, 'restart');
+ } else {
+ $cmd = $app->system->getinitcommand($daemon, 'reload');
+ }
+ exec($cmd.' 2>&1', $retval['output'], $retval['retval']);
+ $app->log("Restarting xmpp: $cmd", LOGLEVEL_DEBUG);
+ return $retval;
+ }
} // end class
?>
--
Gitblit v1.9.1