diff --git a/docs/autoinstall_samples/autoinstall.conf_sample.php b/docs/autoinstall_samples/autoinstall.conf_sample.php
index b5f3a577305e2780ae1c5de46138e08d72d53c6b..c7b5393758d212651511a1bc42a3ad2c80e83ead 100644
--- a/docs/autoinstall_samples/autoinstall.conf_sample.php
+++ b/docs/autoinstall_samples/autoinstall.conf_sample.php
@@ -57,7 +57,6 @@ $autoupdate['reconfigure_crontab'] = 'yes'; // yes (default), no
$autoupdate['svc_detect_change_mail_server'] = 'yes'; // yes (default), no
$autoupdate['svc_detect_change_web_server'] = 'yes'; // yes (default), no
$autoupdate['svc_detect_change_dns_server'] = 'yes'; // yes (default), no
-$autoupdate['svc_detect_change_xmpp_server'] = 'yes'; // yes (default), no
$autoupdate['svc_detect_change_firewall_server'] = 'yes'; // yes (default), no
$autoupdate['svc_detect_change_vserver_server'] = 'yes'; // yes (default), no
$autoupdate['svc_detect_change_db_server'] = 'yes'; // yes (default), no
diff --git a/install/apps/xmpp_libs/auth_prosody/authenticate_isp.sh b/install/apps/xmpp_libs/auth_prosody/authenticate_isp.sh
deleted file mode 100644
index 1992fae0b7f3ae54391ea9aa25a6582bd42aaa5c..0000000000000000000000000000000000000000
--- a/install/apps/xmpp_libs/auth_prosody/authenticate_isp.sh
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/bash
-
-IFS=":"
-AUTH_OK=1
-AUTH_FAILED=0
-LOGFILE="/var/log/prosody/auth.log"
-USELOG=true
-
-while read ACTION USER HOST PASS ; do
-
- [ $USELOG == true ] && { echo "Date: $(date) Action: $ACTION User: $USER Host: $HOST" >> $LOGFILE; }
-
- case $ACTION in
- "auth")
- if [ `/usr/bin/php /usr/local/lib/prosody/auth/db_auth.php $USER $HOST $PASS 2>/dev/null` == 1 ] ; then
- echo $AUTH_OK
- [ $USELOG == true ] && { echo "AUTH OK" >> $LOGFILE; }
- else
- echo $AUTH_FAILED
- [ $USELOG == true ] && { echo "AUTH FAILED" >> $LOGFILE; }
- fi
- ;;
- "isuser")
- if [ `/usr/bin/php /usr/local/lib/prosody/auth/db_isuser.php $USER $HOST 2>/dev/null` == 1 ] ; then
- echo $AUTH_OK
- [ $USELOG == true ] && { echo "ISUSER OK" >> $LOGFILE; }
- else
- echo $AUTH_FAILED
- [ $USELOG == true ] && { echo "ISUSER FAILED" >> $LOGFILE; }
- fi
- ;;
- *)
- echo $AUTH_FAILED
- [ $USELOG == true ] && { echo "UNKNOWN ACTION GIVEN: $ACTION" >> $LOGFILE; }
- ;;
- esac
-
-done
diff --git a/install/apps/xmpp_libs/auth_prosody/db_auth.php b/install/apps/xmpp_libs/auth_prosody/db_auth.php
deleted file mode 100644
index 2d3faa3379eb6765b20f9d12dff210cd47147f41..0000000000000000000000000000000000000000
--- a/install/apps/xmpp_libs/auth_prosody/db_auth.php
+++ /dev/null
@@ -1,48 +0,0 @@
-real_escape_string($arg_email);
- $query = $db->prepare("SELECT jid, password FROM xmpp_user WHERE jid LIKE ? AND active='y' AND server_id=?");
- $query->bind_param('si', $arg_email, $isp_server_id);
- $query->execute();
- $query->bind_result($jid, $password);
- $query->fetch();
- $query->close();
-
- result_false(is_null($jid));
- checkAuth($arg_password, $password);
-}catch(Exception $ex){
- echo 0;
- exit();
-}
-
-function result_false($cond = true){
- if(!$cond) return;
- echo 0;
- exit();
-}
-function result_true(){
- echo 1;
- exit();
-}
-function checkAuth($pw_arg, $pw_db){
- if(crypt($pw_arg, $pw_db) == $pw_db)
- result_true();
- result_false();
-}
-?>
\ No newline at end of file
diff --git a/install/apps/xmpp_libs/auth_prosody/db_conf.inc.php b/install/apps/xmpp_libs/auth_prosody/db_conf.inc.php
deleted file mode 100644
index 1aba63d6ea051ff4826312757b10af2a1c590525..0000000000000000000000000000000000000000
--- a/install/apps/xmpp_libs/auth_prosody/db_conf.inc.php
+++ /dev/null
@@ -1,6 +0,0 @@
-real_escape_string($arg_email);
- $query = $db->prepare("SELECT count(*) AS usercount FROM xmpp_user WHERE jid LIKE ? AND active='y' AND server_id=?");
- $query->bind_param('si', $arg_email, $isp_server_id);
- $query->execute();
- $query->bind_result($usercount);
- $query->fetch();
- $query->close();
-
- result_false($usercount != 1);
- result_true();
-
-}catch(Exception $ex){
- echo 0;
- exit();
-}
-
-function result_false($cond = true){
- if(!$cond) return;
- echo 0;
- exit();
-}
-function result_true(){
- echo 1;
- exit();
-}
-
-?>
diff --git a/install/apps/xmpp_libs/auth_prosody/prosody-purge b/install/apps/xmpp_libs/auth_prosody/prosody-purge
deleted file mode 100644
index df50105da01451d4577d6d5edb0c3ee7596c581e..0000000000000000000000000000000000000000
--- a/install/apps/xmpp_libs/auth_prosody/prosody-purge
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/usr/bin/php
- 4);
-
-$operation = $argv[1];
-$host = $argv[2];
-
-$configFile = file_get_contents('/etc/prosody/storage.cfg.lua');
-preg_match_all('/(host|database|port|username|password) *= *"?([^"\n]*)"?;/', $configFile, $matches);
-$config = array();
-foreach($matches[1] AS $ix => $key) {
- $config[$key] = $matches[2][$ix];
-}
-
-try {
- // Connect to database
- $db = new mysqli($config['host'], $config['username'], $config['password'], $config['database']);
-
- switch($operation){
- case 'user':
- usage(count($argv) != 4);
- $user = $argv[3];
- do_query($db->prepare("DELETE FROM prosody WHERE user = ? AND host = ?"), $host, $user);
- do_query($db->prepare("DELETE FROM prosodyarchive WHERE user = ? AND host = ?"), $host, $user);
- break;
- case 'domain':
- do_query($db->prepare("DELETE FROM prosody WHERE host = ?"), $host);
- do_query($db->prepare("DELETE FROM prosodyarchive WHERE host = ?"), $host);
- do_query($db->prepare("DELETE FROM prosody WHERE host LIKE ?"), "%.$host");
- do_query($db->prepare("DELETE FROM prosodyarchive WHERE host LIKE ?"), "%.$host");
- break;
- }
- $db->close();
-} catch (Exception $ex) {
- var_dump($ex);
-}
-
-
-function do_query($query, $host, $user = false){
- if($user !== false)
- $query->bind_param('ss', $user, $host);
- else
- $query->bind_param('s', $host);
- $query->execute();
- $entries = $query->affected_rows;
- $query->close();
- if(DEBUG) echo "$entries deleted!\n";
- return $entries;
-}
-
-function result_false($cond = true) {
- if(!$cond) return;
- exit(1);
-}
-
-function usage($cond = false){
- if(!$cond) return;
- echo "USAGE: \n prosody-purge domain my.domain.com \n prosody-purge user my.domain.com username \n";
- result_false();
-}
diff --git a/install/apps/xmpp_libs/mod_auth_external/authenticate_isp.sh b/install/apps/xmpp_libs/mod_auth_external/authenticate_isp.sh
deleted file mode 100644
index c5a0c8e6846b85087bcc6f3f1ba3ae764f1a7a3c..0000000000000000000000000000000000000000
--- a/install/apps/xmpp_libs/mod_auth_external/authenticate_isp.sh
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/bash
-
-IFS=":"
-AUTH_OK=1
-AUTH_FAILED=0
-LOGFILE="/var/log/metronome/auth.log"
-USELOG=true
-
-while read ACTION USER HOST PASS ; do
-
- [ $USELOG == true ] && { echo "Date: $(date) Action: $ACTION User: $USER Host: $HOST" >> $LOGFILE; }
-
- case $ACTION in
- "auth")
- if [ `/usr/bin/php /usr/lib/metronome/isp-modules/mod_auth_external/db_auth.php $USER $HOST $PASS 2>/dev/null` == 1 ] ; then
- echo $AUTH_OK
- [ $USELOG == true ] && { echo "AUTH OK" >> $LOGFILE; }
- else
- echo $AUTH_FAILED
- [ $USELOG == true ] && { echo "AUTH FAILED" >> $LOGFILE; }
- fi
- ;;
- "isuser")
- if [ `/usr/bin/php /usr/lib/metronome/isp-modules/mod_auth_external/db_isuser.php $USER $HOST 2>/dev/null` == 1 ] ; then
- echo $AUTH_OK
- [ $USELOG == true ] && { echo "ISUSER OK" >> $LOGFILE; }
- else
- echo $AUTH_FAILED
- [ $USELOG == true ] && { echo "ISUSER FAILED" >> $LOGFILE; }
- fi
- ;;
- *)
- echo $AUTH_FAILED
- [ $USELOG == true ] && { echo "UNKNOWN ACTION GIVEN: $ACTION" >> $LOGFILE; }
- ;;
- esac
-
-done
diff --git a/install/apps/xmpp_libs/mod_auth_external/db_auth.php b/install/apps/xmpp_libs/mod_auth_external/db_auth.php
deleted file mode 100644
index 2d3faa3379eb6765b20f9d12dff210cd47147f41..0000000000000000000000000000000000000000
--- a/install/apps/xmpp_libs/mod_auth_external/db_auth.php
+++ /dev/null
@@ -1,48 +0,0 @@
-real_escape_string($arg_email);
- $query = $db->prepare("SELECT jid, password FROM xmpp_user WHERE jid LIKE ? AND active='y' AND server_id=?");
- $query->bind_param('si', $arg_email, $isp_server_id);
- $query->execute();
- $query->bind_result($jid, $password);
- $query->fetch();
- $query->close();
-
- result_false(is_null($jid));
- checkAuth($arg_password, $password);
-}catch(Exception $ex){
- echo 0;
- exit();
-}
-
-function result_false($cond = true){
- if(!$cond) return;
- echo 0;
- exit();
-}
-function result_true(){
- echo 1;
- exit();
-}
-function checkAuth($pw_arg, $pw_db){
- if(crypt($pw_arg, $pw_db) == $pw_db)
- result_true();
- result_false();
-}
-?>
\ No newline at end of file
diff --git a/install/apps/xmpp_libs/mod_auth_external/db_conf.inc.php b/install/apps/xmpp_libs/mod_auth_external/db_conf.inc.php
deleted file mode 100644
index 1aba63d6ea051ff4826312757b10af2a1c590525..0000000000000000000000000000000000000000
--- a/install/apps/xmpp_libs/mod_auth_external/db_conf.inc.php
+++ /dev/null
@@ -1,6 +0,0 @@
-real_escape_string($arg_email);
- $query = $db->prepare("SELECT count(*) AS usercount FROM xmpp_user WHERE jid LIKE ? AND active='y' AND server_id=?");
- $query->bind_param('si', $arg_email, $isp_server_id);
- $query->execute();
- $query->bind_result($usercount);
- $query->fetch();
- $query->close();
-
- result_false($usercount != 1);
- result_true();
-
-}catch(Exception $ex){
- echo 0;
- exit();
-}
-
-function result_false($cond = true){
- if(!$cond) return;
- echo 0;
- exit();
-}
-function result_true(){
- echo 1;
- exit();
-}
-
-?>
diff --git a/install/apps/xmpp_libs/mod_auth_external/mod_auth_external.lua b/install/apps/xmpp_libs/mod_auth_external/mod_auth_external.lua
deleted file mode 100644
index c86400610e2389b61b502b52b6b277fdad9419e7..0000000000000000000000000000000000000000
--- a/install/apps/xmpp_libs/mod_auth_external/mod_auth_external.lua
+++ /dev/null
@@ -1,118 +0,0 @@
-local nodeprep = require "util.encodings".stringprep.nodeprep;
-local lpc = require "lpc";
-
-local config = require "core.configmanager";
-local log = module._log;
-local host = module.host;
-local script_type = config.get(host, "external_auth_protocol") or "generic";
-assert(script_type == "ejabberd" or script_type == "generic");
-local command = config.get(host, "external_auth_command") or "";
-assert(type(command) == "string");
-assert(not host:find(":"));
-local usermanager = require "core.usermanager";
-local jid_bare = require "util.jid".bare;
-local new_sasl = require "util.sasl".new;
-
-local pid;
-local readfile;
-local writefile;
-
-local function send_query(text)
- if pid and lpc.wait(pid,1) ~= nil then
- log("debug","error, process died, force reopen");
- pid=nil;
- end
- if not pid then
- log("debug", "Opening process " .. command);
- pid, writefile, readfile = lpc.run(command);
- end
- if not pid then
- log("debug", "Process failed to open");
- return nil;
- end
-
- writefile:write(text);
- writefile:flush();
- if script_type == "ejabberd" then
- return readfile:read(4);
- elseif script_type == "generic" then
- return readfile:read();
- end
-end
-
-function do_query(kind, username, password)
- if not username then return nil, "not-acceptable"; end
- username = nodeprep(username);
- if not username then return nil, "jid-malformed"; end
-
- local query = (password and "%s:%s:%s:%s" or "%s:%s:%s"):format(kind, username, host, password);
- local len = #query
- if len > 1000 then return nil, "policy-violation"; end
-
- if script_type == "ejabberd" then
- local lo = len % 256;
- local hi = (len - lo) / 256;
- query = string.char(hi, lo)..query;
- end
- if script_type == "generic" then
- query = query..'\n';
- end
-
- local response = send_query(query);
- if (script_type == "ejabberd" and response == "\0\2\0\0") or
- (script_type == "generic" and response == "0") then
- return nil, "not-authorized";
- elseif (script_type == "ejabberd" and response == "\0\2\0\1") or
- (script_type == "generic" and response == "1") then
- return true;
- else
- log("debug", "Nonsense back");
- return nil, "internal-server-error";
- end
-end
-
-function new_external_provider(host)
- local provider = { name = "external" };
-
- function provider.test_password(username, password)
- return do_query("auth", username, password);
- end
-
- function provider.set_password(username, password)
- return do_query("setpass", username, password);
- end
-
- function provider.user_exists(username)
- return do_query("isuser", username);
- end
-
- function provider.create_user(username, password) return nil, "Account creation/modification not available."; end
-
- function provider.get_sasl_handler()
- local testpass_authentication_profile = {
- plain_test = function(sasl, username, password, realm)
- return usermanager.test_password(username, realm, password), true;
- end,
- };
- return new_sasl(module.host, testpass_authentication_profile);
- end
-
- function provider.is_admin(jid)
- local admins = config.get(host, "admins");
- if admins ~= config.get("*", "admins") then
- if type(admins) == "table" then
- jid = jid_bare(jid);
- for _,admin in ipairs(admins) do
- if admin == jid then return true; end
- end
- elseif admins then
- log("error", "Option 'admins' for host '%s' is not a table", host);
- end
- end
- return usermanager.is_admin(jid);
- end
-
- return provider;
-end
-
-module:add_item("auth-provider", new_external_provider(host));
\ No newline at end of file
diff --git a/install/apps/xmpp_libs/mod_discoitems.lua b/install/apps/xmpp_libs/mod_discoitems.lua
deleted file mode 100644
index f05b9049073f540cef8686f4ed80579e9fa9ed28..0000000000000000000000000000000000000000
--- a/install/apps/xmpp_libs/mod_discoitems.lua
+++ /dev/null
@@ -1,24 +0,0 @@
--- * Metronome IM *
---
--- This file is part of the Metronome XMPP server and is released under the
--- ISC License, please see the LICENSE file in this source package for more
--- information about copyright and licensing.
---
--- As per the sublicensing clause, this file is also MIT/X11 Licensed.
--- ** Copyright (c) 2009, Waqas Hussain
-
-local st = require "util.stanza";
-
-local result_query = st.stanza("query", {xmlns = "http://jabber.org/protocol/disco#items"});
-for _, item in ipairs(module:get_option("disco_items") or {}) do
- result_query:tag("item", {jid = item[1], name = item[2]}):up();
-end
-
-module:hook("iq/host/http://jabber.org/protocol/disco#items:query", function(event)
- local stanza = event.stanza;
- local query = stanza.tags[1];
- if stanza.attr.type == "get" and not query.attr.node then
- event.origin.send(st.reply(stanza):add_child(result_query));
- return true;
- end
-end, 100);
diff --git a/install/apps/xmpp_libs/mod_webpresence/icons/status_away.png b/install/apps/xmpp_libs/mod_webpresence/icons/status_away.png
deleted file mode 100644
index 0de5c6ab3d35e958b2c2c9fa9ee6e5876312b54b..0000000000000000000000000000000000000000
Binary files a/install/apps/xmpp_libs/mod_webpresence/icons/status_away.png and /dev/null differ
diff --git a/install/apps/xmpp_libs/mod_webpresence/icons/status_chat.png b/install/apps/xmpp_libs/mod_webpresence/icons/status_chat.png
deleted file mode 100644
index 324f40baf379ec677e4b7b9791f94298481d7e86..0000000000000000000000000000000000000000
Binary files a/install/apps/xmpp_libs/mod_webpresence/icons/status_chat.png and /dev/null differ
diff --git a/install/apps/xmpp_libs/mod_webpresence/icons/status_dnd.png b/install/apps/xmpp_libs/mod_webpresence/icons/status_dnd.png
deleted file mode 100644
index 015f3da95dfe2a6c9dcdf414951c277104ae6b2e..0000000000000000000000000000000000000000
Binary files a/install/apps/xmpp_libs/mod_webpresence/icons/status_dnd.png and /dev/null differ
diff --git a/install/apps/xmpp_libs/mod_webpresence/icons/status_offline.png b/install/apps/xmpp_libs/mod_webpresence/icons/status_offline.png
deleted file mode 100644
index 12db2af7dd86308f5abed00e3930d7f961e1ecc3..0000000000000000000000000000000000000000
Binary files a/install/apps/xmpp_libs/mod_webpresence/icons/status_offline.png and /dev/null differ
diff --git a/install/apps/xmpp_libs/mod_webpresence/icons/status_online.png b/install/apps/xmpp_libs/mod_webpresence/icons/status_online.png
deleted file mode 100644
index fb257c3144736fd691d81ac82242f7d51f909679..0000000000000000000000000000000000000000
Binary files a/install/apps/xmpp_libs/mod_webpresence/icons/status_online.png and /dev/null differ
diff --git a/install/apps/xmpp_libs/mod_webpresence/icons/status_xa.png b/install/apps/xmpp_libs/mod_webpresence/icons/status_xa.png
deleted file mode 100644
index 321d35b5a3f1c832669154c1bc8f4f000c42e761..0000000000000000000000000000000000000000
Binary files a/install/apps/xmpp_libs/mod_webpresence/icons/status_xa.png and /dev/null differ
diff --git a/install/apps/xmpp_libs/mod_webpresence/mod_webpresence.lua b/install/apps/xmpp_libs/mod_webpresence/mod_webpresence.lua
deleted file mode 100644
index c1de0e0d37eaecba6afb4244a12d6d4a5245912d..0000000000000000000000000000000000000000
--- a/install/apps/xmpp_libs/mod_webpresence/mod_webpresence.lua
+++ /dev/null
@@ -1,118 +0,0 @@
-module:depends("http");
-
-local jid_split = require "util.jid".prepped_split;
-local b64 = require "util.encodings".base64.encode;
-local sha1 = require "util.hashes".sha1;
-local stanza = require "util.stanza".stanza;
-local json = require "util.json".encode_ordered;
-
-local function require_resource(name)
- local icon_path = module:get_option_string("presence_icons", "icons");
- local f, err = module:load_resource(icon_path.."/"..name);
- if f then
- return f:read("*a");
- end
- module:log("warn", "Failed to open image file %s", icon_path..name);
- return "";
-end
-
-local statuses = { online = {}, away = {}, xa = {}, dnd = {}, chat = {}, offline = {} };
-
-local function handle_request(event, path)
- local status, message;
- local jid, type = path:match("([^/]+)/?(.*)$");
- if jid then
- local user, host = jid_split(jid);
- if host and not user then
- user, host = host, event.request.headers.host;
- if host then host = host:gsub(":%d+$", ""); end
- end
- if user and host then
- local user_sessions = hosts[host] and hosts[host].sessions[user];
- if user_sessions then
- status = user_sessions.top_resources[1];
- if status and status.presence then
- message = status.presence:child_with_name("status");
- status = status.presence:child_with_name("show");
- if not status then
- status = "online";
- else
- status = status:get_text();
- end
- if message then
- message = message:get_text();
- end
- end
- end
- end
- end
- status = status or "offline";
-
- statuses[status].image = function()
- return { status_code = 200, headers = { content_type = "image/png" },
- body = require_resource("status_"..status..".png")
- };
- end;
- statuses[status].html = function()
- local jid_hash = sha1(jid, true);
- return { status_code = 200, headers = { content_type = "text/html" },
- body = [[]]..
- tostring(
- stanza("html")
- :tag("head")
- :tag("title"):text("XMPP Status Page for "..jid):up():up()
- :tag("body")
- :tag("div", { id = jid_hash.."_status", class = "xmpp_status" })
- :tag("img", { id = jid_hash.."_img", class = "xmpp_status_image xmpp_status_"..status,
- src = "data:image/png;base64,"..b64(require_resource("status_"..status..".png")) }):up()
- :tag("span", { id = jid_hash.."_status_name", class = "xmpp_status_name" })
- :text("\194\160"..status):up()
- :tag("span", { id = jid_hash.."_status_message", class = "xmpp_status_message" })
- :text(message and "\194\160"..message.."" or "")
- )
- };
- end;
- statuses[status].text = function()
- return { status_code = 200, headers = { content_type = "text/plain" },
- body = status
- };
- end;
- statuses[status].message = function()
- return { status_code = 200, headers = { content_type = "text/plain" },
- body = (message and message or "")
- };
- end;
- statuses[status].json = function()
- return { status_code = 200, headers = { content_type = "application/json" },
- body = json({
- jid = jid,
- show = status,
- status = (message and message or "null")
- })
- };
- end;
- statuses[status].xml = function()
- return { status_code = 200, headers = { content_type = "application/xml" },
- body = [[]]..
- tostring(
- stanza("result")
- :tag("jid"):text(jid):up()
- :tag("show"):text(status):up()
- :tag("status"):text(message)
- )
- };
- end
-
- if ((type == "") or (not statuses[status][type])) then
- type = "image"
- end;
-
- return statuses[status][type]();
-end
-
-module:provides("http", {
- default_path = "/status";
- route = {
- ["GET /*"] = handle_request;
- };
-});
diff --git a/install/dist/conf/debian60.conf.php b/install/dist/conf/debian60.conf.php
index 01c275bd59d815681d34153f2bc3a2e1248c3072..18b54cb4e9921374f6587d0277d8f24433d1032e 100644
--- a/install/dist/conf/debian60.conf.php
+++ b/install/dist/conf/debian60.conf.php
@@ -226,18 +226,5 @@ $conf['cron']['init_script'] = 'cron';
$conf['cron']['crontab_dir'] = '/etc/cron.d';
$conf['cron']['wget'] = '/usr/bin/wget';
-//* Metronome XMPP
-$conf['metronome']['installed'] = false;
-$conf['metronome']['init_script'] = 'metronome';
-$conf['metronome']['initial_modules'] = 'saslauth, tls, dialback, disco, discoitems, version, uptime, time, ping, admin_adhoc, admin_telnet, bosh, posix, announce, offline, webpresence, mam, stream_management, message_carbons';
-
-//* Prosody XMPP
-$conf['prosody']['installed'] = false;
-$conf['prosody']['init_script'] = 'prosody';
-$conf['prosody']['storage_database'] = 'prosody';
-$conf['prosody']['storage_user'] = 'prosody';
-$conf['prosody']['storage_password'] = md5(uniqid(rand()));
-$conf['prosody']['initial_modules'] = 'roster, saslauth, tls, dialback, disco, carbons, pep, private, blocklist, vcard, version, uptime, time, ping, admin_adhoc, mam, bosh, websocket, http_files, announce, proxy65, offline, posix, webpresence, smacks, csi_battery_saver, pep_vcard_avatar, omemo_all_access';
-
?>
diff --git a/install/dist/conf/debian90.conf.php b/install/dist/conf/debian90.conf.php
index 58aeff24364427510b3e00151b8140b0e3872c4c..68a47a04f17861a558eb2391879657ba0be3dc2f 100644
--- a/install/dist/conf/debian90.conf.php
+++ b/install/dist/conf/debian90.conf.php
@@ -226,17 +226,4 @@ $conf['cron']['init_script'] = 'cron';
$conf['cron']['crontab_dir'] = '/etc/cron.d';
$conf['cron']['wget'] = '/usr/bin/wget';
-//* Metronome XMPP
-$conf['metronome']['installed'] = false;
-$conf['metronome']['init_script'] = 'metronome';
-$conf['metronome']['initial_modules'] = 'saslauth, tls, dialback, disco, discoitems, version, uptime, time, ping, admin_adhoc, admin_telnet, bosh, posix, announce, offline, webpresence, mam, stream_management, message_carbons';
-
-//* Prosody XMPP
-$conf['prosody']['installed'] = false;
-$conf['prosody']['init_script'] = 'prosody';
-$conf['prosody']['storage_database'] = 'prosody';
-$conf['prosody']['storage_user'] = 'prosody';
-$conf['prosody']['storage_password'] = md5(uniqid(rand()));
-$conf['prosody']['initial_modules'] = 'roster, saslauth, tls, dialback, disco, carbons, pep, private, blocklist, vcard, version, uptime, time, ping, admin_adhoc, mam, bosh, websocket, http_files, announce, proxy65, offline, posix, webpresence, smacks, csi_battery_saver, pep_vcard_avatar, omemo_all_access';
-
?>
diff --git a/install/dist/conf/debiantesting.conf.php b/install/dist/conf/debiantesting.conf.php
index 4ad9b17325b5d002e29588dc6d38fd69b22782c0..2f911afdd1862a44b88dc6535261e21b0680db7a 100644
--- a/install/dist/conf/debiantesting.conf.php
+++ b/install/dist/conf/debiantesting.conf.php
@@ -226,18 +226,5 @@ $conf['cron']['init_script'] = 'cron';
$conf['cron']['crontab_dir'] = '/etc/cron.d';
$conf['cron']['wget'] = '/usr/bin/wget';
-//* Metronome XMPP
-$conf['metronome']['installed'] = false;
-$conf['metronome']['init_script'] = 'metronome';
-$conf['metronome']['initial_modules'] = 'saslauth, tls, dialback, disco, discoitems, version, uptime, time, ping, admin_adhoc, admin_telnet, bosh, posix, announce, offline, webpresence, mam, stream_management, message_carbons';
-
-//* Prosody XMPP
-$conf['prosody']['installed'] = false;
-$conf['prosody']['init_script'] = 'prosody';
-$conf['prosody']['storage_database'] = 'prosody';
-$conf['prosody']['storage_user'] = 'prosody';
-$conf['prosody']['storage_password'] = md5(uniqid(rand()));
-$conf['prosody']['initial_modules'] = 'roster, saslauth, tls, dialback, disco, carbons, pep, private, blocklist, vcard, version, uptime, time, ping, admin_adhoc, mam, bosh, websocket, http_files, announce, proxy65, offline, posix, webpresence, smacks, csi_battery_saver, pep_vcard_avatar, omemo_all_access';
-
?>
diff --git a/install/dist/conf/ubuntu1604.conf.php b/install/dist/conf/ubuntu1604.conf.php
index 6159638d0f99f86276be590aa2fc6c3218d07de1..ea07eb54ebaf007e234b40e32b12c102e3d67cc2 100644
--- a/install/dist/conf/ubuntu1604.conf.php
+++ b/install/dist/conf/ubuntu1604.conf.php
@@ -226,18 +226,5 @@ $conf['cron']['init_script'] = 'cron';
$conf['cron']['crontab_dir'] = '/etc/cron.d';
$conf['cron']['wget'] = '/usr/bin/wget';
-//* Metronome XMPP
-$conf['metronome']['installed'] = false;
-$conf['metronome']['init_script'] = 'metronome';
-$conf['metronome']['initial_modules'] = 'saslauth, tls, dialback, disco, discoitems, version, uptime, time, ping, admin_adhoc, admin_telnet, bosh, posix, announce, offline, webpresence, mam, stream_management, message_carbons';
-
-//* Prosody XMPP
-$conf['prosody']['installed'] = false;
-$conf['prosody']['init_script'] = 'prosody';
-$conf['prosody']['storage_database'] = 'prosody';
-$conf['prosody']['storage_user'] = 'prosody';
-$conf['prosody']['storage_password'] = md5(uniqid(rand()));
-$conf['prosody']['initial_modules'] = 'roster, saslauth, tls, dialback, disco, carbons, pep, private, blocklist, vcard, version, uptime, time, ping, admin_adhoc, mam, bosh, websocket, http_files, announce, proxy65, offline, posix, webpresence, smacks, csi_battery_saver, pep_vcard_avatar, omemo_all_access';
-
?>
diff --git a/install/dist/conf/ubuntu1710.conf.php b/install/dist/conf/ubuntu1710.conf.php
index e04f4116ff21711167e67bb57b86fbf29ce9461a..4f260b0ffdac70be29485e1a9603a4bf60f16d14 100644
--- a/install/dist/conf/ubuntu1710.conf.php
+++ b/install/dist/conf/ubuntu1710.conf.php
@@ -222,18 +222,4 @@ $conf['cron']['init_script'] = 'cron';
$conf['cron']['crontab_dir'] = '/etc/cron.d';
$conf['cron']['wget'] = '/usr/bin/wget';
-//* Metronome XMPP
-$conf['metronome']['installed'] = false;
-$conf['metronome']['init_script'] = 'metronome';
-$conf['metronome']['initial_modules'] = 'saslauth, tls, dialback, disco, discoitems, version, uptime, time, ping, admin_adhoc, admin_telnet, bosh, posix, announce, offline, webpresence, mam, stream_management, message_carbons';
-
-//* Prosody XMPP
-$conf['prosody']['installed'] = false;
-$conf['prosody']['init_script'] = 'prosody';
-$conf['prosody']['storage_database'] = 'prosody';
-$conf['prosody']['storage_user'] = 'prosody';
-$conf['prosody']['storage_password'] = md5(uniqid(rand()));
-$conf['prosody']['initial_modules'] = 'roster, saslauth, tls, dialback, disco, carbons, pep, private, blocklist, vcard, version, uptime, time, ping, admin_adhoc, mam, bosh, websocket, http_files, announce, proxy65, offline, posix, webpresence, smacks, csi_battery_saver, pep_vcard_avatar, omemo_all_access';
-
-
?>
diff --git a/install/dist/conf/ubuntu1804.conf.php b/install/dist/conf/ubuntu1804.conf.php
index 15cdb1c5ebbb74c45ab1f1df2f1c5caf8a008464..c2c6021c9db1de3b0260217f991a3ddb6ae309f5 100644
--- a/install/dist/conf/ubuntu1804.conf.php
+++ b/install/dist/conf/ubuntu1804.conf.php
@@ -222,9 +222,5 @@ $conf['cron']['init_script'] = 'cron';
$conf['cron']['crontab_dir'] = '/etc/cron.d';
$conf['cron']['wget'] = '/usr/bin/wget';
-//* Metronome XMPP
-$conf['xmpp']['installed'] = false;
-$conf['xmpp']['init_script'] = 'metronome';
-
?>
\ No newline at end of file
diff --git a/install/install.php b/install/install.php
index 524918454839238b73d4fe41a2ffdbc774dd8cd3..faa1463d71d039592a4845e97008717f93d00acb 100644
--- a/install/install.php
+++ b/install/install.php
@@ -255,7 +255,6 @@ $conf['services']['db'] = true;
$conf['services']['vserver'] = false;
$conf['services']['firewall'] = false;
$conf['services']['proxy'] = false;
-$conf['services']['xmpp'] = false;
//** Get Server ID
// $conf['server_id'] = $inst->free_query('Unique Numeric ID of the server','1');
@@ -520,22 +519,6 @@ if($install_mode == 'standard' || strtolower($inst->simple_query('Configure Fire
}
}
-if($install_mode == 'standard' || strtolower($inst->simple_query('Configure XMPP Server', array('y', 'n') , 'y','configure_xmpp') ) == 'y') {
-//* Configure XMPP Metronome
- if ($conf['metronome']['installed']) {
- swriteln('Configuring Metronome XMPP Server');
- $inst->configure_metronome();
- $conf['services']['xmpp'] = true;
- }
-
-//* Configure XMPP Prosody
- if ($conf['prosody']['installed']) {
- swriteln('Configuring Prosody XMPP Server');
- $inst->configure_prosody();
- $conf['services']['xmpp'] = true;
- }
-}
-
//* Configure Fail2ban
$force = @($conf['fail2ban']['installed']) ? true : $inst->force_configure_app('Fail2ban', ($install_mode == 'expert'));
if($force) {
diff --git a/install/lib/installer_base.lib.php b/install/lib/installer_base.lib.php
index 6011a2c4aaee5ccd0eb4d80c9c10c6f110dd23d6..b1b5dff70004076d1d3636d175cf2caa748b23c8 100644
--- a/install/lib/installer_base.lib.php
+++ b/install/lib/installer_base.lib.php
@@ -341,9 +341,6 @@ class installer_base {
$tpl_ini_array['web']['php_fpm_start_port'] = $conf['nginx']['php_fpm_start_port'];
$tpl_ini_array['web']['php_fpm_socket_dir'] = $conf['nginx']['php_fpm_socket_dir'];
- $tpl_ini_array['xmpp']['xmpp_daemon'] = ($conf['metronome']['installed'] == true)?'metronome':'prosody';
- $tpl_ini_array['xmpp']['xmpp_modules_enabled'] = $conf[$tpl_ini_array['xmpp']['xmpp_daemon']]['initial_modules'];
-
if ($conf['nginx']['installed'] == true) {
$tpl_ini_array['web']['server_type'] = 'nginx';
$tpl_ini_array['global']['webserver'] = 'nginx';
@@ -1722,215 +1719,6 @@ class installer_base {
$this->process_bind_file('named.conf.options', '/etc/bind/', true); //TODO replace hardcoded path
}
-
- public function configure_metronome($options = '') {
- global $conf;
-
- if($conf['metronome']['installed'] == false) return;
- //* Create the logging directory for xmpp server
- if(!@is_dir('/var/log/metronome')) mkdir('/var/log/metronome', 0755, true);
- chown('/var/log/metronome', 'metronome');
- if(!@is_dir('/var/run/metronome')) mkdir('/var/run/metronome', 0755, true);
- chown('/var/run/metronome', 'metronome');
- if(!@is_dir('/var/lib/metronome')) mkdir('/var/lib/metronome', 0755, true);
- chown('/var/lib/metronome', 'metronome');
- if(!@is_dir('/etc/metronome/hosts')) mkdir('/etc/metronome/hosts', 0755, true);
- if(!@is_dir('/etc/metronome/status')) mkdir('/etc/metronome/status', 0755, true);
- unlink('/etc/metronome/metronome.cfg.lua');
-
- $row = $this->db->queryOneRecord("SELECT server_name FROM server WHERE server_id = ?", $conf["server_id"]);
- $server_name = $row["server_name"];
-
- $tpl = new tpl('xmpp_metronome_conf_main.master');
- wf('/etc/metronome/metronome.cfg.lua', $tpl->grab());
- unset($tpl);
-
- $tpl = new tpl('xmpp_metronome_conf_global.master');
- $tpl->setVar('xmpp_admins','');
- wf('/etc/metronome/global.cfg.lua', $tpl->grab());
- unset($tpl);
-
- // Copy isp libs
- if(!@is_dir('/usr/lib/metronome/isp-modules')) mkdir('/usr/lib/metronome/isp-modules', 0755, true);
- caselog('cp -rf apps/xmpp_libs/* /usr/lib/metronome/isp-modules/', __FILE__, __LINE__);
- caselog('chmod 755 /usr/lib/metronome/isp-modules/mod_auth_external/authenticate_isp.sh', __FILE__, __LINE__);
- // Process db config
- $full_file_name = '/usr/lib/metronome/isp-modules/mod_auth_external/db_conf.inc.php';
- $content = rf($full_file_name);
- $content = str_replace('{mysql_server_ispconfig_user}', $conf['mysql']['ispconfig_user'], $content);
- $content = str_replace('{mysql_server_ispconfig_password}', $conf['mysql']['ispconfig_password'], $content);
- $content = str_replace('{mysql_server_database}', $conf['mysql']['database'], $content);
- $content = str_replace('{mysql_server_ip}', $conf['mysql']['ip'], $content);
- $content = str_replace('{server_id}', $conf['server_id'], $content);
- wf($full_file_name, $content);
-
- if(!stristr($options, 'dont-create-certs')){
- // Create SSL Certificate for localhost
- // Ensure no line is left blank
- echo "writing new private key to 'localhost.key'\n-----\n";
- $ssl_country = $this->free_query('Country Name (2 letter code)', 'AU','ssl_cert_country');
- $ssl_locality = $this->free_query('Locality Name (eg, city)', 'City Name','ssl_cert_locality');
- $ssl_organisation = $this->free_query('Organization Name (eg, company)', 'Internet Widgits Pty Ltd','ssl_cert_organisation');
- $ssl_organisation_unit = $this->free_query('Organizational Unit Name (eg, section)', 'Infrastructure','ssl_cert_organisation_unit');
- $ssl_domain = $this->free_query('Common Name (e.g. server FQDN or YOUR name)', $conf['hostname'],'ssl_cert_common_name');
- $ssl_email = $this->free_query('Email Address', 'hostmaster@'.$conf['hostname'],'ssl_cert_email');
-
- $tpl = new tpl('xmpp_conf_ssl.master');
- $tpl->setVar('ssl_country',$ssl_country);
- $tpl->setVar('ssl_locality',$ssl_locality);
- $tpl->setVar('ssl_organisation',$ssl_organisation);
- $tpl->setVar('ssl_organisation_unit',$ssl_organisation_unit);
- $tpl->setVar('domain',$ssl_domain);
- $tpl->setVar('ssl_email',$ssl_email);
- wf('/etc/metronome/certs/localhost.cnf', $tpl->grab());
- unset($tpl);
- // Generate new key, csr and cert
- exec("(cd /etc/metronome/certs && make localhost.key)");
- exec("(cd /etc/metronome/certs && make localhost.csr)");
- exec("(cd /etc/metronome/certs && make localhost.cert)");
- exec('chmod 0400 /etc/metronome/certs/localhost.key');
- exec('chown metronome /etc/metronome/certs/localhost.key');
-
- echo "IMPORTANT:\n";
- echo "Localhost Key, Csr and a self-signed Cert have been saved to /etc/metronome/certs\n";
- echo "In order to work with all clients, the server must have a trusted certificate, so use the Csr\n";
- echo "to get a trusted certificate from your CA or replace Key and Cert with already signed files for\n";
- echo "your domain. Clients like Pidgin dont allow to use untrusted self-signed certificates.\n";
- echo "\n";
-
- }else{
- /*
- echo "-----\n";
- echo "Metronome XMPP SSL server certificate is not renewed. Run the following command manual as root to recreate it:\n";
- echo "# (cd /etc/metronome/certs && make localhost.key && make localhost.csr && make localhost.cert && chmod 0400 localhost.key && chown metronome localhost.key)\n";
- echo "-----\n";
- */
- }
-
- // Copy init script
- caselog('cp -f apps/metronome-init /etc/init.d/metronome', __FILE__, __LINE__);
- caselog('chmod u+x /etc/init.d/metronome', __FILE__, __LINE__);
- caselog('update-rc.d metronome defaults', __FILE__, __LINE__);
-
- exec($this->getinitcommand($conf['metronome']['init_script'], 'restart'));
- }
-
- public function configure_prosody($options = '') {
- global $conf;
-
- if($conf['prosody']['installed'] == false) return;
- //* Create the logging directory for xmpp server
- if(!@is_dir('/var/log/prosody')) mkdir('/var/log/prosody', 0755, true);
- chown('/var/log/prosody', 'prosody');
- if(!@is_dir('/var/run/prosody')) mkdir('/var/run/prosody', 0755, true);
- chown('/var/run/prosody', 'prosody');
- if(!@is_dir('/var/lib/prosody')) mkdir('/var/lib/prosody', 0755, true);
- chown('/var/lib/prosody', 'prosody');
- if(!@is_dir('/etc/prosody/hosts')) mkdir('/etc/prosody/hosts', 0755, true);
- if(!@is_dir('/etc/prosody/status')) mkdir('/etc/prosody/status', 0755, true);
- unlink('/etc/prosody/prosody.cfg.lua');
-
- $tpl = new tpl('xmpp_prosody_conf_main.master');
- wf('/etc/prosody/prosody.cfg.lua', $tpl->grab());
- unset($tpl);
-
- $tpl = new tpl('xmpp_prosody_conf_global.master');
- $tpl->setVar('main_host', $conf['hostname']);
- $tpl->setVar('xmpp_admins','');
- wf('/etc/prosody/global.cfg.lua', $tpl->grab());
- unset($tpl);
-
- //** Create the database
- if(!$this->db->query('CREATE DATABASE IF NOT EXISTS ?? DEFAULT CHARACTER SET ?', $conf['prosody']['storage_database'], $conf['mysql']['charset'])) {
- $this->error('Unable to create MySQL database: '.$conf['prosody']['storage_database'].'.');
- }
- if($conf['mysql']['host'] == 'localhost') {
- $from_host = 'localhost';
- } else {
- $from_host = $conf['hostname'];
- }
- $this->dbmaster->query("CREATE USER ?@? IDENTIFIED BY ?", $conf['prosody']['storage_user'], $from_host, $conf['prosody']['storage_password']); // ignore the error
- $query = 'GRANT ALL PRIVILEGES ON ?? TO ?@? IDENTIFIED BY ?';
- if(!$this->db->query($query, $conf['prosody']['storage_database'] . ".*", $conf['prosody']['storage_user'], $from_host, $conf['prosody']['storage_password'])) {
- $this->error('Unable to create database user: '.$conf['prosody']['storage_user'].' Error: '.$this->db->errorMessage);
- }
-
-
-
- $tpl = new tpl('xmpp_prosody_conf_storage.master');
- $tpl->setVar('db_name', $conf['prosody']['storage_database']);
- $tpl->setVar('db_host', $conf['mysql']['host']);
- $tpl->setVar('db_port', $conf['mysql']['port']);
- $tpl->setVar('db_username', $conf['prosody']['storage_user']);
- $tpl->setVar('db_password', $conf['prosody']['storage_password']);
- wf('/etc/prosody/storage.cfg.lua', $tpl->grab());
- unset($tpl);
-
-
- // Copy isp libs
- if(!@is_dir('/usr/local/lib/prosody/auth')) mkdir('/usr/local/lib/prosody/auth', 0755, true);
- caselog('cp -rf apps/xmpp_libs/auth_prosody/* /usr/local/lib/prosody/auth/', __FILE__, __LINE__);
- caselog('chmod 755 /usr/local/lib/prosody/auth/authenticate_isp.sh', __FILE__, __LINE__);
- caselog('chown root:ispconfig /usr/local/lib/prosody/auth/prosody-purge', __FILE__, __LINE__);
- caselog('chmod 750 /usr/local/lib/prosody/auth/prosody-purge', __FILE__, __LINE__);
-
- // Process db config
- $full_file_name = '/usr/local/lib/prosody/auth/db_conf.inc.php';
- $content = rf($full_file_name);
- $content = str_replace('{mysql_server_ispconfig_user}', $conf['mysql']['ispconfig_user'], $content);
- $content = str_replace('{mysql_server_ispconfig_password}', $conf['mysql']['ispconfig_password'], $content);
- $content = str_replace('{mysql_server_database}', $conf['mysql']['database'], $content);
- $content = str_replace('{mysql_server_ip}', $conf['mysql']['ip'], $content);
- $content = str_replace('{server_id}', $conf['server_id'], $content);
- wf($full_file_name, $content);
-
- if(!stristr($options, 'dont-create-certs')){
- // Create SSL Certificate for localhost
- // Ensure no line is left blank
- echo "writing new private key to 'localhost.key'\n-----\n";
- $ssl_country = $this->free_query('Country Name (2 letter code)', 'AU','ssl_cert_country');
- $ssl_locality = $this->free_query('Locality Name (eg, city)', 'City Name','ssl_cert_locality');
- $ssl_organisation = $this->free_query('Organization Name (eg, company)', 'Internet Widgits Pty Ltd','ssl_cert_organisation');
- $ssl_organisation_unit = $this->free_query('Organizational Unit Name (eg, section)', 'Infrastructure','ssl_cert_organisation_unit');
- $ssl_domain = $this->free_query('Common Name (e.g. server FQDN or YOUR name)', $conf['hostname'],'ssl_cert_common_name');
- $ssl_email = $this->free_query('Email Address', 'hostmaster@'.$conf['hostname'],'ssl_cert_email');
-
- $tpl = new tpl('xmpp_prosody_conf_ssl.master');
- $tpl->setVar('ssl_country',$ssl_country);
- $tpl->setVar('ssl_locality',$ssl_locality);
- $tpl->setVar('ssl_organisation',$ssl_organisation);
- $tpl->setVar('ssl_organisation_unit',$ssl_organisation_unit);
- $tpl->setVar('domain',$ssl_domain);
- $tpl->setVar('ssl_email',$ssl_email);
- wf('/etc/prosody/certs/localhost.cnf', $tpl->grab());
- unset($tpl);
- // Generate new key, csr and cert
- exec("(cd /etc/prosody/certs && make localhost.key)");
- exec("(cd /etc/prosody/certs && make localhost.csr)");
- exec("(cd /etc/prosody/certs && make localhost.crt)");
- exec('chmod 0400 /etc/prosody/certs/localhost.key');
- exec('chown prosody /etc/prosody/certs/localhost.key');
-
- echo "IMPORTANT:\n";
- echo "Localhost Key, Csr and a self-signed Cert have been saved to /etc/prosody/certs\n";
- echo "In order to work with all clients, the server must have a trusted certificate, so use the Csr\n";
- echo "to get a trusted certificate from your CA or replace Key and Cert with already signed files for\n";
- echo "your domain. Clients like Pidgin dont allow to use untrusted self-signed certificates.\n";
- echo "\n";
-
- }else{
- /*
- echo "-----\n";
- echo "Prosody XMPP SSL server certificate is not renewed. Run the following command manual as root to recreate it:\n";
- echo "# (cd /etc/prosody/certs && make localhost.key && make localhost.csr && make localhost.cert && chmod 0400 localhost.key && chown prosody localhost.key)\n";
- echo "-----\n";
- */
- }
-
- exec($this->getinitcommand($conf['prosody']['init_script'], 'restart'));
- }
-
-
public function configure_apache() {
global $conf;
@@ -2602,9 +2390,8 @@ class installer_base {
$vserver_server_enabled = ($conf['openvz']['installed'])?1:0;
$proxy_server_enabled = ($conf['services']['proxy'])?1:0;
$firewall_server_enabled = ($conf['services']['firewall'])?1:0;
- $xmpp_server_enabled = ($conf['services']['xmpp'])?1:0;
- $sql = "UPDATE `server` SET mail_server = '$mail_server_enabled', web_server = '$web_server_enabled', dns_server = '$dns_server_enabled', file_server = '$file_server_enabled', db_server = '$db_server_enabled', vserver_server = '$vserver_server_enabled', proxy_server = '$proxy_server_enabled', firewall_server = '$firewall_server_enabled', xmpp_server = '$xmpp_server_enabled' WHERE server_id = ?";
+ $sql = "UPDATE `server` SET mail_server = '$mail_server_enabled', web_server = '$web_server_enabled', dns_server = '$dns_server_enabled', file_server = '$file_server_enabled', db_server = '$db_server_enabled', vserver_server = '$vserver_server_enabled', proxy_server = '$proxy_server_enabled', firewall_server = '$firewall_server_enabled WHERE server_id = ?";
$this->db->query($sql, $conf['server_id']);
if($conf['mysql']['master_slave_setup'] == 'y') {
diff --git a/install/lib/update.lib.php b/install/lib/update.lib.php
index f410722c4e3bf1873f946afe53ee2dda6d2918b3..3406b760b0565049562acbfb06200e05ec7f8cc8 100644
--- a/install/lib/update.lib.php
+++ b/install/lib/update.lib.php
@@ -352,8 +352,6 @@ function updateDbAndIni() {
$tpl_ini_array['web']['php_fpm_start_port'] = $conf['nginx']['php_fpm_start_port'];
$tpl_ini_array['web']['php_fpm_socket_dir'] = $conf['nginx']['php_fpm_socket_dir'];
- $tpl_ini_array['xmpp']['xmpp_daemon'] = ($conf['metronome']['installed'] == true)?'metronome':'prosody';
-
if ($conf['nginx']['installed'] == true) {
$tpl_ini_array['web']['server_type'] = 'nginx';
$tpl_ini_array['global']['webserver'] = 'nginx';
diff --git a/install/tpl/server.ini.master b/install/tpl/server.ini.master
index b6a8b8b42cfdee1f02047708f9cc7dc90d256d92..e6c44613eef62d5d843ff82d1a96ba4a78716005 100644
--- a/install/tpl/server.ini.master
+++ b/install/tpl/server.ini.master
@@ -155,14 +155,3 @@ try_rescue=n
do_not_try_rescue_httpd=n
do_not_try_rescue_mysql=n
do_not_try_rescue_mail=n
-
-[xmpp]
-xmpp_daemon=prosody
-xmpp_use_ispv6=n
-xmpp_bosh_max_inactivity=30
-xmpp_server_admins=
-xmpp_modules_enabled=roster, saslauth, tls, dialback, disco, carbons, pep, private, blocklist, vcard, version, uptime, time, ping, admin_adhoc, mam, bosh, websocket, http_files, announce, proxy65, offline, posix, webpresence, smacks, csi_battery_saver, pep_vcard_avatar, omemo_all_access
-xmpp_port_http=5290
-xmpp_port_https=5291
-xmpp_port_pastebin=5292
-xmpp_port_bosh=5280
diff --git a/install/tpl/xmpp_metronome_conf_global.master b/install/tpl/xmpp_metronome_conf_global.master
deleted file mode 100644
index 68f4c59b6b34badb6abb216eccbbbd053ac897f0..0000000000000000000000000000000000000000
--- a/install/tpl/xmpp_metronome_conf_global.master
+++ /dev/null
@@ -1,65 +0,0 @@
-pidfile = "/var/run/metronome/metronome.pid";
-metronome_max_files_soft = 200000;
-metronome_max_files_hard = 300000;
-plugin_paths = {
- "/usr/lib/metronome/isp-modules",
-};
-use_libevent = true;
-log = {
- debug = "/var/log/metronome/metronome.dbg",
- info = "/var/log/metronome/metronome.log",
- error = "/var/log/metronome/metronome.err",
-};
-use_ipv6 = true;
-http_ports = {
- 5290,
-};
-https_ports = {
- 5291,
-};
-pastebin_ports = {
- 5292,
-};
-bosh_ports = {
- 5280,
-};
-admins = {
- {tmpl_var xmpp_admins}
-};
-modules_enabled = {
- "saslauth",
- "tls",
- "dialback",
- "disco",
- "discoitems",
- "version",
- "uptime",
- "time",
- "ping",
- "admin_adhoc",
- "admin_telnet",
- "bosh",
- "posix",
- "announce",
- "offline",
- "webpresence",
- "mam",
- "stream_management",
- "message_carbons"
-};
-modules_disabled = {
-};
-bosh_max_inactivity = 30;
-consider_bosh_secure = true;
-cross_domain_bosh = true;
-allow_registration = false;
-ssl = {
- key = "/etc/metronome/certs/localhost.key",
- certificate = "/etc/metronome/certs/localhost.cert",
-};
-c2s_require_encryption = false;
-s2s_secure = true;
-s2s_insecure_domains = {
- "gmail.com",
-};
-authentication = "internal_plain";
diff --git a/install/tpl/xmpp_metronome_conf_main.master b/install/tpl/xmpp_metronome_conf_main.master
deleted file mode 100644
index f9c8fbdd655f0771c277df692916f5e1ba78cf5e..0000000000000000000000000000000000000000
--- a/install/tpl/xmpp_metronome_conf_main.master
+++ /dev/null
@@ -1,3 +0,0 @@
-Include "/etc/metronome/global.cfg.lua"
-Include "/etc/metronome/hosts/*.lua"
-Include "/etc/metronome/status/*.lua"
diff --git a/install/tpl/xmpp_metronome_conf_ssl.master b/install/tpl/xmpp_metronome_conf_ssl.master
deleted file mode 100644
index 922dfd22a1ab6c4f726fcc4b0eb84cdd60f73ec4..0000000000000000000000000000000000000000
--- a/install/tpl/xmpp_metronome_conf_ssl.master
+++ /dev/null
@@ -1,48 +0,0 @@
-oid_section = new_oids
-
-[ new_oids ]
-
-# RFC 3920 section 5.1.1 defines this OID
-xmppAddr = 1.3.6.1.5.5.7.8.5
-
-# RFC 4985 defines this OID
-SRVName = 1.3.6.1.5.5.7.8.7
-
-[ req ]
-
-default_bits = 4096
-default_keyfile = {tmpl_var name='domain'}.key
-distinguished_name = distinguished_name
-req_extensions = v3_extensions
-x509_extensions = v3_extensions
-
-# ask about the DN?
-prompt = no
-
-[ distinguished_name ]
-
-commonName = {tmpl_var name='domain'}
-countryName = {tmpl_var name='ssl_country'}
-localityName = {tmpl_var name='ssl_locality'}
-organizationName = {tmpl_var name='ssl_organisation'}
-organizationalUnitName = {tmpl_var name='ssl_organisation_unit'}
-emailAddress = {tmpl_var name='ssl_email'}
-
-[ v3_extensions ]
-
-# for certificate requests (req_extensions)
-# and self-signed certificates (x509_extensions)
-
-basicConstraints = CA:FALSE
-keyUsage = digitalSignature,keyEncipherment
-extendedKeyUsage = serverAuth,clientAuth
-subjectAltName = @subject_alternative_name
-
-[ subject_alternative_name ]
-
-# See http://tools.ietf.org/html/draft-ietf-xmpp-3920bis#section-13.7.1.2 for more info.
-
-DNS.0 = {tmpl_var name='domain'}
-otherName.0 = xmppAddr;FORMAT:UTF8,UTF8:{tmpl_var name='domain'}
-otherName.1 = SRVName;IA5STRING:_xmpp-client.{tmpl_var name='domain'}
-otherName.2 = SRVName;IA5STRING:_xmpp-server.{tmpl_var name='domain'}
\ No newline at end of file
diff --git a/install/tpl/xmpp_prosody_conf_global.master b/install/tpl/xmpp_prosody_conf_global.master
deleted file mode 100644
index 14a0ae970295b4c5bb25993bce2f3ecd6dc7f3d6..0000000000000000000000000000000000000000
--- a/install/tpl/xmpp_prosody_conf_global.master
+++ /dev/null
@@ -1,94 +0,0 @@
-plugin_paths = {
- "/usr/local/lib/prosody/modules",
-};
-use_libevent = true;
-log = {
- -- optional: uncomment debug log here
- -- debug = "/var/log/prosody/prosody.dbg",
- info = "/var/log/prosody/prosody.log",
- error = "/var/log/prosody/prosody.err",
- "syslog",
-};
-use_ipv6 = true;
-http_ports = {
- 5290,
-};
-https_ports = {
- 5291,
-};
-pastebin_ports = {
- 5292,
-};
-bosh_ports = {
- 5280,
-};
-admins = {
- {tmpl_var xmpp_admins}
-};
-modules_enabled = {
- "roster",
- "saslauth",
- "tls",
- "dialback",
- "disco",
- "carbons",
- "pep",
- "private",
- "blocklist",
- "vcard",
- "version",
- "uptime",
- "time",
- "ping",
- "admin_adhoc",
- "mam",
- "bosh",
- "websocket",
- "http_files",
- "announce",
- "proxy65",
- "offline",
- "posix",
- "websocket",
- -- community modules
- "webpresence",
- "smacks",
- "csi_battery_saver",
- "pep_vcard_avatar",
- "omemo_all_access",
-};
-modules_disabled = {
-};
-
-allow_registration = false;
-c2s_require_encryption = false;
-s2s_require_encryption = true;
-s2s_secure_auth = false;
-s2s_insecure_domains = {
- "gmail.com",
-};
-
-pidfile = "/var/run/prosody/prosody.pid";
-
-authentication = "external";
-
-archive_expires_after = "2w";
-
-statistics = "internal";
-
-certificates = "certs";
-bosh_max_inactivity = 60;
-consider_bosh_secure = true;
-cross_domain_bosh = true;
-consider_websocket_secure = true;
-
-ssl = {
- key = "/etc/prosody/certs/localhost.key",
- certificate = "/etc/prosody/certs/localhost.crt",
-};
-
-Component "{tmpl_var main_host}" "http_upload"
- ud_disco_name = "HTTP File Upload";
- http_upload_file_size_limit = 1024 * 1024 * 10;
- http_upload_quota = 1024 * 1024 * 10;
- http_upload_expire_after = 60 * 60 * 24 * 2;
\ No newline at end of file
diff --git a/install/tpl/xmpp_prosody_conf_main.master b/install/tpl/xmpp_prosody_conf_main.master
deleted file mode 100644
index 9c57f3292e292645bd4f1bd9b6184ddbc80e08c0..0000000000000000000000000000000000000000
--- a/install/tpl/xmpp_prosody_conf_main.master
+++ /dev/null
@@ -1,3 +0,0 @@
-Include "/etc/prosody/storage.cfg.lua"
-Include "/etc/prosody/global.cfg.lua"
-Include "/etc/prosody/hosts/*.lua"
diff --git a/install/tpl/xmpp_prosody_conf_ssl.master b/install/tpl/xmpp_prosody_conf_ssl.master
deleted file mode 100644
index 97b088a6adf0886203020a9d23a4f32266d46b59..0000000000000000000000000000000000000000
--- a/install/tpl/xmpp_prosody_conf_ssl.master
+++ /dev/null
@@ -1,48 +0,0 @@
-oid_section = new_oids
-
-[ new_oids ]
-
-# RFC 3920 section 5.1.1 defines this OID
-xmppAddr = 1.3.6.1.5.5.7.8.5
-
-# RFC 4985 defines this OID
-SRVName = 1.3.6.1.5.5.7.8.7
-
-[ req ]
-
-default_bits = 4096
-default_keyfile = {tmpl_var name='domain'}.key
-distinguished_name = distinguished_name
-req_extensions = v3_extensions
-x509_extensions = v3_extensions
-
-# ask about the DN?
-prompt = no
-
-[ distinguished_name ]
-
-commonName = {tmpl_var name='domain'}
-countryName = {tmpl_var name='ssl_country'}
-localityName = {tmpl_var name='ssl_locality'}
-organizationName = {tmpl_var name='ssl_organisation'}
-organizationalUnitName = {tmpl_var name='ssl_organisation_unit'}
-emailAddress = {tmpl_var name='ssl_email'}
-
-[ v3_extensions ]
-
-# for certificate requests (req_extensions)
-# and self-signed certificates (x509_extensions)
-
-basicConstraints = CA:TRUE
-keyUsage = digitalSignature,keyEncipherment
-extendedKeyUsage = serverAuth,clientAuth
-subjectAltName = @subject_alternative_name
-
-[ subject_alternative_name ]
-
-# See http://tools.ietf.org/html/draft-ietf-xmpp-3920bis#section-13.7.1.2 for more info.
-
-DNS.0 = {tmpl_var name='domain'}
-otherName.0 = xmppAddr;FORMAT:UTF8,UTF8:{tmpl_var name='domain'}
-otherName.1 = SRVName;IA5STRING:_xmpp-client.{tmpl_var name='domain'}
-otherName.2 = SRVName;IA5STRING:_xmpp-server.{tmpl_var name='domain'}
\ No newline at end of file
diff --git a/install/tpl/xmpp_prosody_conf_storage.master b/install/tpl/xmpp_prosody_conf_storage.master
deleted file mode 100644
index 217e5163b79ea5754f23afb12da36a0ef1b1041e..0000000000000000000000000000000000000000
--- a/install/tpl/xmpp_prosody_conf_storage.master
+++ /dev/null
@@ -1,9 +0,0 @@
-storage = "sql"
-sql = {
- driver = "MySQL";
- database = "{tmpl_var db_name}";
- host = "{tmpl_var db_host}";
- port = {tmpl_var db_port};
- username = "{tmpl_var db_username}";
- password = "{tmpl_var db_password}";
-}
\ No newline at end of file
diff --git a/install/update.php b/install/update.php
index 3361c3c1918c6bb8803bc67d44473bcbe0488016..68c5b76cf1a14891e46067c8787f8a9ad4a9bcc1 100644
--- a/install/update.php
+++ b/install/update.php
@@ -323,19 +323,18 @@ if($reconfigure_master_database_rights_answer == 'yes') {
$inst->find_installed_apps();
//** Check for current service config state and compare to our results
-if ($conf['mysql']['master_slave_setup'] == 'y') $current_svc_config = $inst->dbmaster->queryOneRecord("SELECT mail_server,web_server,dns_server,xmpp_server,firewall_server,vserver_server,db_server FROM ?? WHERE server_id=?", $conf['mysql']['master_database'] . '.server', $conf['server_id']);
-else $current_svc_config = $inst->db->queryOneRecord("SELECT mail_server,web_server,dns_server,xmpp_server,firewall_server,vserver_server,db_server FROM ?? WHERE server_id=?", $conf["mysql"]["database"] . '.server', $conf['server_id']);
+if ($conf['mysql']['master_slave_setup'] == 'y') $current_svc_config = $inst->dbmaster->queryOneRecord("SELECT mail_server,web_server,dns_server,firewall_server,vserver_server,db_server FROM ?? WHERE server_id=?", $conf['mysql']['master_database'] . '.server', $conf['server_id']);
+else $current_svc_config = $inst->db->queryOneRecord("SELECT mail_server,web_server,dns_server,firewall_server,vserver_server,db_server FROM ?? WHERE server_id=?", $conf["mysql"]["database"] . '.server', $conf['server_id']);
$conf['services']['mail'] = check_service_config_state('mail_server', $conf['postfix']['installed']);
$conf['services']['dns'] = check_service_config_state('dns_server', ($conf['powerdns']['installed'] || $conf['bind']['installed'] || $conf['mydns']['installed']));
$conf['services']['web'] = check_service_config_state('web_server', ($conf['apache']['installed'] || $conf['nginx']['installed']));
-$conf['services']['xmpp'] = check_service_config_state('xmpp_server', $conf['metronome']['installed']);
$conf['services']['firewall'] = check_service_config_state('firewall_server', ($conf['ufw']['installed'] || $conf['firewall']['installed']));
$conf['services']['vserver'] = check_service_config_state('vserver_server', $conf['services']['vserver']);
$conf['services']['db'] = check_service_config_state('db_server', true); /* Will always offer as MySQL is of course installed on this host as it's a requirement for ISPC to work... */
unset($current_svc_config);
//** Write new decisions into DB
-$sql = "UPDATE ?? SET mail_server = '{$conf['services']['mail']}', web_server = '{$conf['services']['web']}', dns_server = '{$conf['services']['dns']}', file_server = '{$conf['services']['file']}', db_server = '{$conf['services']['db']}', vserver_server = '{$conf['services']['vserver']}', proxy_server = '{$conf['services']['proxy']}', firewall_server = '$firewall_server_enabled', xmpp_server = '$xmpp_server_enabled' WHERE server_id = ?";
+$sql = "UPDATE ?? SET mail_server = '{$conf['services']['mail']}', web_server = '{$conf['services']['web']}', dns_server = '{$conf['services']['dns']}', file_server = '{$conf['services']['file']}', db_server = '{$conf['services']['db']}', vserver_server = '{$conf['services']['vserver']}', proxy_server = '{$conf['services']['proxy']}', firewall_server = '$firewall_server_enabled' WHERE server_id = ?";
$inst->db->query($sql, $conf['mysql']['database'].'.server', $conf['server_id']);
if($conf['mysql']['master_slave_setup'] == 'y') {
$inst->dbmaster->query($sql, $conf['mysql']['master_database'].'.server', $conf['server_id']);
@@ -465,17 +464,6 @@ if($reconfigure_services_answer == 'yes' || $reconfigure_services_answer == 'sel
}
- if($conf['services']['xmpp'] && $inst->reconfigure_app('XMPP', $reconfigure_services_answer)) {
- //** Configure Metronome XMPP
- if($conf['prosody']['installed'] == true) {
- swriteln('Configuring Prosody XMPP');
- $inst->configure_prosody('dont-create-certs');
- } elseif ($conf['metronome']['installed'] == true) {
- swriteln('Configuring Metronome XMPP');
- $inst->configure_metronome('dont-create-certs');
- }
- }
-
if($conf['services']['firewall'] && $inst->reconfigure_app('Firewall', $reconfigure_services_answer)) {
if($conf['ufw']['installed'] == true) {
//* Configure Ubuntu Firewall
@@ -570,11 +558,7 @@ if($reconfigure_services_answer == 'yes') {
if($conf['bind']['installed'] == true && $conf['bind']['init_script'] != '') system($inst->getinitcommand($conf['bind']['init_script'], 'restart').' &> /dev/null');
}
- if($conf['services']['xmpp']) {
- if($conf['metronome']['installed'] == true && $conf['metronome']['init_script'] != '') system($inst->getinitcommand($conf['metronome']['init_script'], 'restart').' &> /dev/null');
- }
-
- if($conf['services']['proxy']) {
+ if($conf['services']['proxy']) {
// if($conf['squid']['installed'] == true && $conf['squid']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['squid']['init_script'])) system($conf['init_scripts'].'/'.$conf['squid']['init_script'].' restart &> /dev/null');
if($conf['nginx']['installed'] == true && $conf['nginx']['init_script'] != '') system($inst->getinitcommand($conf['nginx']['init_script'], 'restart').' &> /dev/null');
}
diff --git a/interface/lib/classes/custom_datasource.inc.php b/interface/lib/classes/custom_datasource.inc.php
index cb4426a2e183a0ff2963e4b074b45028347641f3..f31296882d51a7cf0bcd4de2d8a30476e2e8ab3e 100644
--- a/interface/lib/classes/custom_datasource.inc.php
+++ b/interface/lib/classes/custom_datasource.inc.php
@@ -136,9 +136,6 @@ class custom_datasource {
case 'default_dbserver':
$field = 'db_server';
break;
- case 'default_xmppserver':
- $field = 'xmpp_server';
- break;
case 'default_vserverserver':
$field = 'vserver_server';
break;
@@ -154,9 +151,6 @@ class custom_datasource {
case 'db_servers':
$field = 'db_server';
break;
- case 'xmpp_servers':
- $field = 'xmpp_server';
- break;
default:
$field = 'web_server';
break;
diff --git a/interface/lib/classes/remote.d/mail.inc.php b/interface/lib/classes/remote.d/mail.inc.php
index 0a1f890b968742df8dd3874a66bc3393c79d59c9..ef4483bcedae79713927efcc5919f58b68b646e9 100644
--- a/interface/lib/classes/remote.d/mail.inc.php
+++ b/interface/lib/classes/remote.d/mail.inc.php
@@ -311,7 +311,7 @@ class remoting_mail extends remoting {
return $affected_rows;
}
- // Mail backup list function by Dominik Müller, info@profi-webdesign.net
+ // Mail backup list function by Dominik M�ller, info@profi-webdesign.net
public function mail_user_backup_list($session_id, $primary_id = null)
{
global $app;
@@ -334,7 +334,7 @@ class remoting_mail extends remoting {
return $result;
}
- // Mail backup restore/download functions by Dominik Müller, info@profi-webdesign.net
+ // Mail backup restore/download functions by Dominik M�ller, info@profi-webdesign.net
public function mail_user_backup($session_id, $primary_id, $action_type)
{
global $app;
@@ -1105,172 +1105,5 @@ class remoting_mail extends remoting {
return $app->quota_lib->get_mailquota_data($client_id, false);
}
- //** xmpp functions -----------------------------------------------------------------------------------
-
- public function xmpp_domain_get($session_id, $primary_id)
- {
- global $app;
-
- if(!$this->checkPerm($session_id, 'xmpp_domain_get')) {
- throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
- return false;
- }
- $app->uses('remoting_lib');
- $app->remoting_lib->loadFormDef('../mail/form/xmpp_domain.tform.php');
- return $app->remoting_lib->getDataRecord($primary_id);
- }
-
- public function xmpp_domain_add($session_id, $client_id, $params)
- {
- if(!$this->checkPerm($session_id, 'xmpp_domain_add')) {
- throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
- return false;
- }
- $primary_id = $this->insertQuery('../mail/form/xmpp_domain.tform.php', $client_id, $params);
- return $primary_id;
- }
-
- public function xmpp_domain_update($session_id, $client_id, $primary_id, $params)
- {
- if(!$this->checkPerm($session_id, 'xmpp_domain_update')) {
- throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
- return false;
- }
- $affected_rows = $this->updateQuery('../mail/form/xmpp_domain.tform.php', $client_id, $primary_id, $params);
- return $affected_rows;
- }
-
- public function xmpp_domain_delete($session_id, $primary_id)
- {
- if(!$this->checkPerm($session_id, 'xmpp_domain_delete')) {
- throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
- return false;
- }
- $affected_rows = $this->deleteQuery('../mail/form/xmpp_domain.tform.php', $primary_id);
- return $affected_rows;
- }
-
- public function xmpp_user_get($session_id, $primary_id)
- {
- global $app;
-
- if(!$this->checkPerm($session_id, 'xmpp_user_get')) {
- throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
- return false;
- }
- $app->uses('remoting_lib');
- $app->remoting_lib->loadFormDef('../mail/form/xmpp_user.tform.php');
- return $app->remoting_lib->getDataRecord($primary_id);
- }
-
- public function xmpp_user_add($session_id, $client_id, $params){
- global $app;
-
- if (!$this->checkPerm($session_id, 'xmpp_user_add')){
- throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
- return false;
- }
-
- $jid_parts = explode('@', $params['jid']);
- $tmp = $app->db->queryOneRecord("SELECT domain FROM xmpp_domain WHERE domain = ?", $jid_parts[1]);
- if($tmp['domain'] != $jid_parts[1]) {
- throw new SoapFault('xmpp_domain_does_not_exist', 'XMPP domain - '.$jid_parts[1].' - does not exist.');
- return false;
- }
-
- $affected_rows = $this->insertQuery('../mail/form/xmpp_user.tform.php', $client_id, $params);
- return $affected_rows;
- }
-
- public function xmpp_user_update($session_id, $client_id, $primary_id, $params)
- {
- global $app;
-
- if (!$this->checkPerm($session_id, 'xmpp_user_update'))
- {
- throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
- return false;
- }
-
- $jid_parts = explode('@', $jid_parts['jid']);
- $tmp = $app->db->queryOneRecord("SELECT domain FROM xmpp_domain WHERE domain = ?", $jid_parts[1]);
- if($tmp['domain'] != $jid_parts[1]) {
- throw new SoapFault('xmpp_domain_does_not_exist', 'Mail domain - '.$jid_parts[1].' - does not exist.');
- return false;
- }
-
- $affected_rows = $this->updateQuery('../mail/form/xmpp_user.tform.php', $client_id, $primary_id, $params);
- return $affected_rows;
- }
-
- public function xmpp_user_delete($session_id, $primary_id)
- {
- if (!$this->checkPerm($session_id, 'xmpp_user_delete'))
- {
- throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
- return false;
- }
- $affected_rows = $this->deleteQuery('../mail/form/xmpp_user.tform.php', $primary_id);
- return $affected_rows;
- }
-
- public function xmpp_domain_get_by_domain($session_id, $domain) {
- global $app;
- if(!$this->checkPerm($session_id, 'xmpp_domain_get_by_domain')) {
- throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
- return false;
- }
- if (!empty($domain)) {
- $sql = "SELECT * FROM xmpp_domain WHERE domain = ?";
- $result = $app->db->queryAllRecords($sql, $domain);
- return $result;
- }
- return false;
- }
-
- public function xmpp_domain_set_status($session_id, $primary_id, $status) {
- global $app;
- if(!$this->checkPerm($session_id, 'xmpp_domain_set_status')) {
- throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
- return false;
- }
- if(in_array($status, array('active', 'inactive'))) {
- if ($status == 'active') {
- $status = 'y';
- } else {
- $status = 'n';
- }
- $sql = "UPDATE xmpp_domain SET active = ? WHERE domain_id = ?";
- $app->db->query($sql, $status, $primary_id);
- $result = $app->db->affectedRows();
- return $result;
- } else {
- throw new SoapFault('status_undefined', 'The status is not available');
- return false;
- }
- }
-
- public function xmpp_user_set_status($session_id, $primary_id, $status) {
- global $app;
- if(!$this->checkPerm($session_id, 'xmpp_user_set_status')) {
- throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
- return false;
- }
- if(in_array($status, array('active', 'inactive'))) {
- if ($status == 'active') {
- $status = 'y';
- } else {
- $status = 'n';
- }
- $sql = "UPDATE xmpp_user SET active = ? WHERE xmppuser_id = ?";
- $app->db->query($sql, $status, $primary_id);
- $result = $app->db->affectedRows();
- return $result;
- } else {
- throw new SoapFault('status_undefined', 'The status is not available');
- return false;
- }
- }
-
}
-?>
+
diff --git a/interface/lib/classes/remote.d/server.inc.php b/interface/lib/classes/remote.d/server.inc.php
index 4e8179d06e7ec26a25de00ca50000ab01f634ef6..4f612c69c175e4e93fba8c8f5f801203334db5db 100644
--- a/interface/lib/classes/remote.d/server.inc.php
+++ b/interface/lib/classes/remote.d/server.inc.php
@@ -228,7 +228,7 @@ class remoting_server extends remoting {
return false;
}
if (!empty($session_id) && !empty($server_id)) {
- $sql = "SELECT mail_server, web_server, dns_server, file_server, db_server, vserver_server, proxy_server, firewall_server, xmpp_server, mirror_server_id FROM server WHERE server_id = ?";
+ $sql = "SELECT mail_server, web_server, dns_server, file_server, db_server, vserver_server, proxy_server, firewall_server, mirror_server_id FROM server WHERE server_id = ?";
$all = $app->db->queryOneRecord($sql, $server_id);
return $all;
} else {
diff --git a/interface/lib/classes/validate_client.inc.php b/interface/lib/classes/validate_client.inc.php
index 4652e2a07b1ddc65f5776a4538ec34d4ab382db4..980e6ffbb5a3b616fef71f65dc4213fda04a9857 100644
--- a/interface/lib/classes/validate_client.inc.php
+++ b/interface/lib/classes/validate_client.inc.php
@@ -124,9 +124,6 @@ class validate_client {
$used_servers = $app->db->queryAllRecords('SELECT domain_id FROM mail_domain INNER JOIN sys_user ON mail_domain.sys_userid = sys_user.userid WHERE client_id = ? AND server_id NOT IN ?', $client_id, $field_value);
break;
- case 'xmpp_servers':
- $used_servers = $app->db->queryAllRecords('SELECT domain_id FROM xmpp_domain INNER JOIN sys_user ON xmpp_domain.sys_userid = sys_user.userid WHERE client_id = ? AND server_id NOT IN ?', $client_id, $field_value);
- break;
}
if ($used_servers === null || count($used_servers))
diff --git a/interface/web/admin/form/server.tform.php b/interface/web/admin/form/server.tform.php
index 95dca6c33b5cb552b29692b3c0f27f2e76924024..2c74e6785b4351e60df8d1dfa74a5e8a62c5ddbb 100644
--- a/interface/web/admin/form/server.tform.php
+++ b/interface/web/admin/form/server.tform.php
@@ -108,12 +108,6 @@ $form["tabs"]['services'] = array (
'default' => '0',
'value' => array(0 => 0, 1 => 1)
),
- 'xmpp_server' => array (
- 'datatype' => 'INTEGER',
- 'formtype' => 'CHECKBOX',
- 'default' => '0',
- 'value' => array(0 => 0, 1 => 1)
- ),
'mirror_server_id' => array (
'datatype' => 'INTEGER',
'formtype' => 'TEXT',
diff --git a/interface/web/admin/form/server_config.tform.php b/interface/web/admin/form/server_config.tform.php
index aa0e1188a15fce6e7397e8a10e626ac1c1068d6b..b2009d96c21bda35e8285c18d20211f8cb675cd7 100644
--- a/interface/web/admin/form/server_config.tform.php
+++ b/interface/web/admin/form/server_config.tform.php
@@ -1618,104 +1618,6 @@ $form["tabs"]['fastcgi'] = array(
);
-$form["tabs"]['xmpp'] = array(
- 'title' => "XMPP",
- 'width' => 80,
- 'template' => "templates/server_config_xmpp_edit.htm",
- 'fields' => array(
- //#################################
- // Begin Datatable fields
- //#################################
- 'xmpp_daemon' => array(
- 'datatype' => 'VARCHAR',
- 'formtype' => 'SELECT',
- 'default' => '20',
- 'value' => array('prosody' => 'Prosody', 'metronome' => 'Metronome')
- ),
- 'xmpp_use_ipv6' => array(
- 'datatype' => 'VARCHAR',
- 'formtype' => 'CHECKBOX',
- 'default' => 'n',
- 'value' => array(0 => 'n', 1 => 'y')
- ),
- 'xmpp_bosh_max_inactivity' => array(
- 'datatype' => 'VARCHAR',
- 'formtype' => 'TEXT',
- 'default' => '30',
- 'validators' => array(0 => array('type' => 'ISINT',
- 'errmsg' => 'ip_address_error_wrong'),
- array('type'=>'RANGE', 'range'=>'15:360', 'errmsg' => 'xmpp_bosh_timeout_range_wrong')
- ),
- 'value' => '',
- 'width' => '15'
- ),
-
- 'xmpp_server_admins' => array(
- 'datatype' => 'VARCHAR',
- 'formtype' => 'TEXT',
- 'filters' => array(
- 0 => array( 'event' => 'SAVE',
- 'type' => 'STRIPTAGS'),
- 1 => array( 'event' => 'SAVE',
- 'type' => 'STRIPNL')
- ),
- 'default' => 'admin@service.com, superuser@service.com',
- 'value' => '',
- 'width' => '15'
- ),
-
- 'xmpp_modules_enabled' => array(
- 'datatype' => 'TEXT',
- 'formtype' => 'TEXT',
- 'filters' => array(
- 0 => array( 'event' => 'SAVE',
- 'type' => 'STRIPTAGS'),
- 1 => array( 'event' => 'SAVE',
- 'type' => 'STRIPNL')
- ),
- 'default' => "saslauth, tls, dialback, disco, discoitems, version, uptime, time, ping, admin_adhoc, admin_telnet, bosh, posix, announce, offline, webpresence, mam, stream_management, message_carbons",
- 'value' => '',
- 'separator' => ","
- ),
-
- 'xmpp_port_http' => array(
- 'datatype' => 'VARCHAR',
- 'formtype' => 'TEXT',
- 'default' => '5290',
- 'validators' => array(0 => array('type' => 'ISINT')),
- 'value' => '5290',
- 'width' => '15'
- ),
- 'xmpp_port_https' => array(
- 'datatype' => 'VARCHAR',
- 'formtype' => 'TEXT',
- 'default' => '5291',
- 'validators' => array(0 => array('type' => 'ISINT')),
- 'value' => '5291',
- 'width' => '15'
- ),
- 'xmpp_port_pastebin' => array(
- 'datatype' => 'VARCHAR',
- 'formtype' => 'TEXT',
- 'default' => '5292',
- 'validators' => array(0 => array('type' => 'ISINT')),
- 'value' => '5292',
- 'width' => '15'
- ),
- 'xmpp_port_bosh' => array(
- 'datatype' => 'VARCHAR',
- 'formtype' => 'TEXT',
- 'default' => '5280',
- 'validators' => array(0 => array('type' => 'ISINT')),
- 'value' => '5280',
- 'width' => '15'
- ),
- //#################################
- // ENDE Datatable fields
- //#################################
- )
-);
-
$form["tabs"]['jailkit'] = array(
'title' => "Jailkit",
'width' => 80,
diff --git a/interface/web/admin/list/server.list.php b/interface/web/admin/list/server.list.php
index 58779eec9c6a1e84c9c175b78fc3824969b71c42..5a44a7a2ba854057abcb1cedf2ae48b271849c76 100644
--- a/interface/web/admin/list/server.list.php
+++ b/interface/web/admin/list/server.list.php
@@ -110,13 +110,4 @@ $liste['item'][] = array( 'field' => 'vserver_server',
'width' => '',
'value' => array('1' => $app->lng('yes_txt'), '0' => $app->lng('no_txt')));
-$liste['item'][] = array( 'field' => 'xmpp_server',
- 'datatype' => 'VARCHAR',
- 'formtype' => 'SELECT',
- 'op' => 'like',
- 'prefix' => '%',
- 'suffix' => '%',
- 'width' => '',
- 'value' => array('1' => $app->lng('yes_txt'), '0' => $app->lng('no_txt')));
-
?>
diff --git a/interface/web/admin/templates/server_config_xmpp_edit.htm b/interface/web/admin/templates/server_config_xmpp_edit.htm
deleted file mode 100644
index 70dedd1d484400336ef059baf92c55bce4bde618..0000000000000000000000000000000000000000
--- a/interface/web/admin/templates/server_config_xmpp_edit.htm
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
{tmpl_var name='xmpp_ports_txt'}
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/interface/web/admin/templates/server_edit_services.htm b/interface/web/admin/templates/server_edit_services.htm
index 2775e029d3d6a1b85ab3012e40b6e0ca2b0b8ba9..0ee07d020e066b8b7e4eb7bcfefa9422559a9df5 100644
--- a/interface/web/admin/templates/server_edit_services.htm
+++ b/interface/web/admin/templates/server_edit_services.htm
@@ -44,13 +44,7 @@
{tmpl_var name='vserver_server'}
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/interface/web/client/templates/client_template_edit_limits.htm b/interface/web/client/templates/client_template_edit_limits.htm
index 4e10891c97a9a505d8d9d2a56e32159f122d086d..5ba0eca5d2f0aba2fd38bda4d7b164af2a497ead 100644
--- a/interface/web/client/templates/client_template_edit_limits.htm
+++ b/interface/web/client/templates/client_template_edit_limits.htm
@@ -200,91 +200,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/interface/web/client/templates/reseller_edit_limits.htm b/interface/web/client/templates/reseller_edit_limits.htm
index 87691e3d2ef2f7a02ff129c5fc232007f380a7db..d24ab0bf9d986d312fd1550812e7120ead2f082e 100644
--- a/interface/web/client/templates/reseller_edit_limits.htm
+++ b/interface/web/client/templates/reseller_edit_limits.htm
@@ -244,91 +244,7 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/interface/web/mail/form/xmpp_domain.tform.php b/interface/web/mail/form/xmpp_domain.tform.php
deleted file mode 100644
index b39d199df0cddd138ae1a37718ec2927640e22d8..0000000000000000000000000000000000000000
--- a/interface/web/mail/form/xmpp_domain.tform.php
+++ /dev/null
@@ -1,464 +0,0 @@
- 0 id must match with id of current user
-$form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user
-$form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete
-$form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete
-$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete
-
-$muc_available = $muc_pastebin_available = $muc_httparchive_available = $anon_available = $vjud_available = $proxy_available = $status_available = $webpresence_available = $http_upload_available = true;
-if(!$app->auth->is_admin()) {
- $client_group_id = $_SESSION["s"]["user"]["default_group"];
- $client = $app->db->queryOneRecord("SELECT limit_xmpp_muc, limit_xmpp_anon, limit_xmpp_vjud, limit_xmpp_proxy, limit_xmpp_status, limit_xmpp_pastebin, limit_xmpp_httparchive, limit_xmpp_webpresence, limit_xmpp_http_upload FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id);
-
- if($client['limit_xmpp_muc'] != 'y') $muc_available = false;
- if($client['limit_xmpp_pastebin'] != 'y' || $client['limit_xmpp_muc'] != 'y') $muc_pastebin_available = false;
- if($client['limit_xmpp_httparchive'] != 'y' || $client['limit_xmpp_muc'] != 'y') $muc_httparchive_available = false;
- if($client['limit_xmpp_anon'] != 'y') $anon_available = false;
- if($client['limit_xmpp_vjud'] != 'y') $vjud_available = false;
- if($client['limit_xmpp_proxy'] != 'y') $proxy_available= false;
- if($client['limit_xmpp_status'] != 'y') $status_available = false;
- if($client['limit_xmpp_webpresence'] != 'y') $webpresence_available = false;
- if($client['limit_xmpp_http_upload'] != 'y') $http_upload_available = false;
-}
-
-$app->uses('getconf');
-$xmpp_config = $app->getconf->get_global_config('xmpp');
-
-
-$form["tabs"]['domain'] = array (
- 'title' => "Domain",
- 'width' => 100,
- 'template' => "templates/xmpp_domain_edit.htm",
- 'fields' => array (
- //#################################
- // Begin Datatable fields
- //#################################
- 'server_id' => array (
- 'datatype' => 'INTEGER',
- 'formtype' => 'SELECT',
- 'default' => '',
- 'datasource' => array ( 'type' => 'SQL',
- 'querystring' => 'SELECT server_id,server_name FROM server WHERE xmpp_server = 1 AND mirror_server_id = 0 AND {AUTHSQL} ORDER BY server_name',
- 'keyfield'=> 'server_id',
- 'valuefield'=> 'server_name'
- ),
- 'value' => ''
- ),
- 'domain' => array (
- 'datatype' => 'VARCHAR',
- 'formtype' => 'TEXT',
- 'filters' => array( 0 => array( 'event' => 'SAVE',
- 'type' => 'IDNTOASCII'),
- 1 => array( 'event' => 'SHOW',
- 'type' => 'IDNTOUTF8'),
- 2 => array( 'event' => 'SAVE',
- 'type' => 'TOLOWER')
- ),
- 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
- 'errmsg'=> 'domain_error_empty'),
- 1 => array ( 'type' => 'UNIQUE',
- 'errmsg'=> 'domain_error_unique'),
- 2 => array ( 'type' => 'REGEX',
- 'regex' => '/^[\w\.\-]{2,255}\.[a-zA-Z0-9\-]{2,30}$/',
- 'errmsg'=> 'domain_error_regex'),
- ),
- 'default' => '',
- 'value' => '',
- 'width' => '30',
- 'maxlength' => '255',
- 'searchable' => 1
- ),
- 'management_method' => array (
- 'datatype' => 'VARCHAR',
- 'formtype' => 'SELECT',
- 'default' => '0',
- 'value' => array(0 => 'Normal', 1 => 'By Mail Domain')
- ),
- 'public_registration' => array (
- 'datatype' => 'VARCHAR',
- 'formtype' => 'CHECKBOX',
- 'default' => 'y',
- 'value' => array(0 => 'n', 1 => 'y')
- ),
- 'registration_url' => array (
- 'datatype' => 'VARCHAR',
- 'validators' => array ( 0 => array ( 'type' => 'REGEX',
- 'regex' => '@^(([\.]{0})|((ftp|https?)://([-\w\.]+)+(:\d+)?(/([\w/_\.\,\-\+\?\~!:%]*(\?\S+)?)?)?)|(\[scheme\]://([-\w\.]+)+(:\d+)?(/([\w/_\.\-\,\+\?\~!:%]*(\?\S+)?)?)?)|(/(?!.*\.\.)[\w/_\.\-]{1,255}/))$@',
- 'errmsg'=> 'redirect_error_regex'),
- ),
- 'formtype' => 'TEXT',
- 'default' => '',
- 'value' => '',
- 'width' => '30',
- 'maxlength' => '255'
- ),
- 'registration_message' => array(
- 'datatype' => 'TEXT',
- 'formtype' => 'TEXT',
- 'filters' => array(
- 0 => array( 'event' => 'SAVE',
- 'type' => 'STRIPTAGS')
- ),
- 'default' => "",
- 'value' => ''
- ),
- 'domain_admins' => array(
- 'datatype' => 'VARCHAR',
- 'formtype' => 'TEXT',
- 'filters' => array(
- 0 => array( 'event' => 'SAVE',
- 'type' => 'STRIPTAGS'),
- 1 => array( 'event' => 'SAVE',
- 'type' => 'STRIPNL')
- ),
- 'default' => '',
- 'value' => '',
- 'width' => '15',
- 'maxlength' => '3'
- ),
-
- 'active' => array (
- 'datatype' => 'VARCHAR',
- 'formtype' => 'CHECKBOX',
- 'default' => 'y',
- 'value' => array(0 => 'n', 1 => 'y')
- ),
- //#################################
- // ENDE Datatable fields
- //#################################
- )
-);
-
-$form["tabs"]['features'] = array (
- 'title' => "Modules",
- 'width' => 100,
- 'template' => "templates/xmpp_domain_edit_modules.htm",
- 'fields' => array (
- //#################################
- // Begin Datatable fields
- //#################################
- 'use_pubsub' => array (
- 'datatype' => 'VARCHAR',
- 'formtype' => 'CHECKBOX',
- 'default' => 'y',
- 'value' => array(0 => 'n', 1 => 'y')
- )
- //#################################
- // ENDE Datatable fields
- //#################################
- )
-);
-if($anon_available)
- $form['tabs']['features']['fields']['use_anon_host'] = array (
- 'datatype' => 'VARCHAR',
- 'formtype' => 'CHECKBOX',
- 'default' => 'y',
- 'value' => array(0 => 'n', 1 => 'y')
- );
-if($vjud_available){
- $form['tabs']['features']['fields']['use_vjud'] = array (
- 'datatype' => 'VARCHAR',
- 'formtype' => 'CHECKBOX',
- 'default' => 'y',
- 'value' => array(0 => 'n', 1 => 'y')
- );
- $form['tabs']['features']['fields']['vjud_opt_mode'] = array (
- 'datatype' => 'VARCHAR',
- 'formtype' => 'SELECT',
- 'default' => '0',
- 'value' => array(0 => 'Opt-In', 1 => 'Opt-Out')
- );
-}
-
-if($proxy_available)
- $form['tabs']['features']['fields']['use_proxy'] = array (
- 'datatype' => 'VARCHAR',
- 'formtype' => 'CHECKBOX',
- 'default' => 'y',
- 'value' => array(0 => 'n', 1 => 'y')
- );
-if($status_available)
- $form['tabs']['features']['fields']['use_status_host'] = array (
- 'datatype' => 'VARCHAR',
- 'formtype' => 'CHECKBOX',
- 'default' => 'y',
- 'value' => array(0 => 'n', 1 => 'y')
- );
-
-if($webpresence_available)
- $form['tabs']['features']['fields']['use_webpresence'] = array (
- 'datatype' => 'VARCHAR',
- 'formtype' => 'CHECKBOX',
- 'default' => 'y',
- 'value' => array(0 => 'n', 1 => 'y')
- );
-
-if($http_upload_available)
- $form['tabs']['features']['fields']['use_http_upload'] = array (
- 'datatype' => 'VARCHAR',
- 'formtype' => 'CHECKBOX',
- 'default' => 'y',
- 'value' => array(0 => 'n', 1 => 'y')
- );
-
-
-if($muc_available)
- $form["tabs"]['muc'] = array (
- 'title' => "MUC",
- 'width' => 100,
- 'template' => "templates/xmpp_domain_edit_muc.htm",
- 'fields' => array (
- //#################################
- // Begin Datatable fields
- //#################################
- 'use_muc_host' => array (
- 'datatype' => 'VARCHAR',
- 'formtype' => 'CHECKBOX',
- 'default' => 'y',
- 'value' => array(0 => 'n', 1 => 'y')
- ),
- 'muc_name' => array(
- 'datatype' => 'VARCHAR',
- 'formtype' => 'TEXT',
- 'default' => ''
- ),
- 'muc_restrict_room_creation' => array (
- 'datatype' => 'VARCHAR',
- 'formtype' => 'SELECT',
- 'default' => 'm',
- 'value' => array('n' => 'Everyone', 'm' => 'Members', 'y' => 'Admins')
- ),
- 'muc_admins' => array(
- 'datatype' => 'VARCHAR',
- 'formtype' => 'TEXT',
- 'default' => 'admin@service.com, superuser@service.com',
- 'value' => '',
- 'width' => '15',
- 'maxlength' => '3'
- ),
- //#################################
- // ENDE Datatable fields
- //#################################
- )
- );
-if($muc_available && $muc_pastebin_available){
- $form['tabs']['muc']['fields']['use_pastebin'] = array (
- 'datatype' => 'VARCHAR',
- 'formtype' => 'CHECKBOX',
- 'default' => 'y',
- 'value' => array(0 => 'n', 1 => 'y')
- );
- $form['tabs']['muc']['fields']['pastebin_expire_after'] = array(
- 'datatype' => 'VARCHAR',
- 'formtype' => 'TEXT',
- 'default' => '48',
- 'validators' => array(0 => array('type' => 'ISINT'),
- array('type'=>'RANGE', 'range'=>'1:168')
- ),
- 'value' => '',
- 'width' => '15'
- );
- $form['tabs']['muc']['fields']['pastebin_trigger'] = array(
- 'datatype' => 'VARCHAR',
- 'formtype' => 'TEXT',
- 'default' => '!paste',
- 'value' => '',
- 'width' => '15'
- );
-}
-if($muc_available && $muc_httparchive_available){
- $form['tabs']['muc']['fields']['use_http_archive'] = array (
- 'datatype' => 'VARCHAR',
- 'formtype' => 'CHECKBOX',
- 'default' => 'y',
- 'value' => array(0 => 'n', 1 => 'y')
- );
- $form['tabs']['muc']['fields']['http_archive_show_join'] = array (
- 'datatype' => 'VARCHAR',
- 'formtype' => 'CHECKBOX',
- 'default' => 'y',
- 'value' => array(0 => 'n', 1 => 'y')
- );
- $form['tabs']['muc']['fields']['http_archive_show_status'] = array (
- 'datatype' => 'VARCHAR',
- 'formtype' => 'CHECKBOX',
- 'default' => 'y',
- 'value' => array(0 => 'n', 1 => 'y')
- );
-}
-
-$form["tabs"]['ssl'] = array (
- 'title' => "SSL",
- 'width' => 100,
- 'template' => "templates/xmpp_domain_edit_ssl.htm",
- 'readonly' => false,
- 'fields' => array (
- //#################################
- // Begin Datatable fields
- //#################################
- 'ssl_state' => array (
- 'datatype' => 'VARCHAR',
- 'formtype' => 'TEXT',
- 'validators' => array ( 0 => array ( 'type' => 'REGEX',
- 'regex' => '/^(([\.]{0})|([-a-zA-Z0-9._,&äöüÄÖÜ ]{1,255}))$/',
- 'errmsg'=> 'ssl_state_error_regex'),
- ),
- 'default' => '',
- 'value' => '',
- 'width' => '30',
- 'maxlength' => '255'
- ),
- 'ssl_locality' => array (
- 'datatype' => 'VARCHAR',
- 'formtype' => 'TEXT',
- 'validators' => array ( 0 => array ( 'type' => 'REGEX',
- 'regex' => '/^(([\.]{0})|([-a-zA-Z0-9._,&äöüÄÖÜ ]{1,255}))$/',
- 'errmsg'=> 'ssl_locality_error_regex'),
- ),
- 'default' => '',
- 'value' => '',
- 'width' => '30',
- 'maxlength' => '255'
- ),
- 'ssl_organisation' => array (
- 'datatype' => 'VARCHAR',
- 'formtype' => 'TEXT',
- 'validators' => array ( 0 => array ( 'type' => 'REGEX',
- 'regex' => '/^(([\.]{0})|([-a-zA-Z0-9._,&äöüÄÖÜ ]{1,255}))$/',
- 'errmsg'=> 'ssl_organisation_error_regex'),
- ),
- 'default' => '',
- 'value' => '',
- 'width' => '30',
- 'maxlength' => '255'
- ),
- 'ssl_organisation_unit' => array (
- 'datatype' => 'VARCHAR',
- 'formtype' => 'TEXT',
- 'validators' => array ( 0 => array ( 'type' => 'REGEX',
- 'regex' => '/^(([\.]{0})|([-a-zA-Z0-9._,&äöüÄÖÜ ]{1,255}))$/',
- 'errmsg'=> 'ssl_organistaion_unit_error_regex'),
- ),
- 'default' => '',
- 'value' => '',
- 'width' => '30',
- 'maxlength' => '255'
- ),
- 'ssl_country' => array (
- 'datatype' => 'VARCHAR',
- 'formtype' => 'SELECT',
- 'default' => '',
- 'datasource' => array ( 'type' => 'SQL',
- 'querystring' => 'SELECT iso,printable_name FROM country ORDER BY printable_name',
- 'keyfield'=> 'iso',
- 'valuefield'=> 'printable_name'
- ),
- 'value' => ''
- ),
- 'ssl_email' => array (
- 'datatype' => 'VARCHAR',
- 'formtype' => 'TEXT',
- 'default' => '',
- 'value' => '',
- 'width' => '30',
- 'maxlength' => '255',
- 'validators' => array ( 0 => array ( 'type' => 'ISEMAIL',
- 'errmsg'=> 'ssl_error_isemail')
- ),
- ),
- 'ssl_key' => array (
- 'datatype' => 'TEXT',
- 'formtype' => 'TEXTAREA',
- 'default' => '',
- 'value' => '',
- 'cols' => '30',
- 'rows' => '10'
- ),
- 'ssl_request' => array (
- 'datatype' => 'TEXT',
- 'formtype' => 'TEXTAREA',
- 'default' => '',
- 'value' => '',
- 'cols' => '30',
- 'rows' => '10'
- ),
- 'ssl_cert' => array (
- 'datatype' => 'TEXT',
- 'formtype' => 'TEXTAREA',
- 'default' => '',
- 'value' => '',
- 'cols' => '30',
- 'rows' => '10'
- ),
- 'ssl_bundle' => array (
- 'datatype' => 'TEXT',
- 'formtype' => 'TEXTAREA',
- 'default' => '',
- 'value' => '',
- 'cols' => '30',
- 'rows' => '10'
- ),
- 'ssl_action' => array (
- 'datatype' => 'VARCHAR',
- 'formtype' => 'SELECT',
- 'default' => '',
- 'value' => array('' => 'none_txt', 'save' => 'save_certificate_txt', 'create' => 'create_certificate_txt', 'del' => 'delete_certificate_txt')
- ),
- //#################################
- // ENDE Datatable fields
- //#################################
- )
-);
-
-
-?>
diff --git a/interface/web/mail/form/xmpp_user.tform.php b/interface/web/mail/form/xmpp_user.tform.php
deleted file mode 100644
index c7360787349de587e6e13b7acb666951a96bfdea..0000000000000000000000000000000000000000
--- a/interface/web/mail/form/xmpp_user.tform.php
+++ /dev/null
@@ -1,127 +0,0 @@
-uses('getconf');
-$global_config = $app->getconf->get_global_config();
-
-$form["title"] = "XMPP Account";
-$form["description"] = "";
-$form["name"] = "xmpp_user";
-$form["action"] = "xmpp_user_edit.php";
-$form["db_table"] = "xmpp_user";
-$form["db_table_idx"] = "xmppuser_id";
-$form["db_history"] = "yes";
-$form["tab_default"] = "xmppuser";
-$form["list_default"] = "xmpp_user_list.php";
-$form["auth"] = 'yes'; // yes / no
-
-$form["auth_preset"]["userid"] = 0; // 0 = id of the user, > 0 id must match with id of current user
-$form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user
-$form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete
-$form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete
-$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete
-
-$form["tabs"]['xmppuser'] = array(
- 'title' => "XMPP Account",
- 'width' => 100,
- 'template' => "templates/xmpp_user_edit.htm",
- 'fields' => array (
- //#################################
- // Begin Datatable fields
- //#################################
- 'server_id' => array (
- 'datatype' => 'INTEGER',
- 'formtype' => 'TEXT',
- 'default' => '',
- 'value' => '',
- 'width' => '30',
- 'maxlength' => '255'
- ),
- 'jid' => array (
- 'datatype' => 'VARCHAR',
- 'formtype' => 'TEXT',
- 'filters' => array( 0 => array( 'event' => 'SAVE',
- 'type' => 'IDNTOASCII'),
- 1 => array( 'event' => 'SHOW',
- 'type' => 'IDNTOUTF8'),
- 2 => array( 'event' => 'SAVE',
- 'type' => 'TOLOWER')
- ),
- 'validators' => array ( 0 => array ( 'type' => 'ISEMAIL',
- 'errmsg'=> 'jid_error_isemail'),
- 1 => array ( 'type' => 'UNIQUE',
- 'errmsg'=> 'jid_error_unique'),
- ),
- 'default' => '',
- 'value' => '',
- 'width' => '30',
- 'maxlength' => '255',
- 'searchable' => 1
- ),
- 'password' => array (
- 'datatype' => 'VARCHAR',
- 'formtype' => 'PASSWORD',
- 'validators' => array(
- 0 => array(
- 'type' => 'CUSTOM',
- 'class' => 'validate_password',
- 'function' => 'password_check',
- 'errmsg' => 'weak_password_txt'
- )
- ),
- 'encryption'=> 'CRYPT',
- 'default' => '',
- 'value' => '',
- 'width' => '30',
- 'maxlength' => '255'
- ),
- 'active' => array (
- 'datatype' => 'VARCHAR',
- 'formtype' => 'CHECKBOX',
- 'default' => 'y',
- 'value' => array(1 => 'y', 0 => 'n')
- ),
- //#################################
- // END Datatable fields
- //#################################
- )
-);
-
-?>
diff --git a/interface/web/mail/lib/module.conf.php b/interface/web/mail/lib/module.conf.php
index 3b7875eaf9a9cbfe379846e7b17a8399135ec115..46cfe46812e79dd7051213db7aa4f70d83c29037 100644
--- a/interface/web/mail/lib/module.conf.php
+++ b/interface/web/mail/lib/module.conf.php
@@ -156,31 +156,6 @@ if($app->auth->get_client_limit($userid, 'fetchmail') != 0)
'items' => $items);
}
-//**** XMPP Menu
-$items = array();
-
-if($app->auth->get_client_limit($userid, 'xmpp_domain') != 0)
-{
- $items[] = array( 'title' => 'XMPP Domain',
- 'target' => 'content',
- 'link' => 'mail/xmpp_domain_list.php',
- 'html_id' => 'xmpp_domain_list');
-}
-
-if($app->auth->get_client_limit($userid, 'xmpp_user') != 0)
-{
- $items[] = array( 'title' => 'XMPP Account',
- 'target' => 'content',
- 'link' => 'mail/xmpp_user_list.php',
- 'html_id' => 'xmpp_user_list');
-}
-
-if(count($items) && $app->system->has_service($userid, 'xmpp'))
- $module['nav'][] = array( 'title' => 'Jabber / XMPP',
- 'open' => 1,
- 'items' => $items);
-
-
//**** Statistics menu
$items = array();
diff --git a/interface/web/mail/lib/remote.conf.php b/interface/web/mail/lib/remote.conf.php
index 012b3b673bcc17eeea9c449d6e136e0b50daded0..a0249d0a33ec3af7c2a3e81096f946db69bfe693 100644
--- a/interface/web/mail/lib/remote.conf.php
+++ b/interface/web/mail/lib/remote.conf.php
@@ -19,7 +19,5 @@ $function_list['mail_spamfilter_blacklist_get,mail_spamfilter_blacklist_add,mail
$function_list['mail_user_filter_get,mail_user_filter_add,mail_user_filter_update,mail_user_filter_delete'] = 'Mail user filter functions';
$function_list['mail_user_backup'] = 'Mail Backup functions';
$function_list['mail_filter_get,mail_filter_add,mail_filter_update,mail_filter_delete'] = 'Mail filter functions';
-$function_list['xmpp_domain_get,xmpp_domain_add,xmpp_domain_update,xmpp_domain_delete,xmpp_domain_set_status,xmpp_domain_get_by_domain'] = 'XMPP domain functions';
-$function_list['xmpp_user_get,xmpp_user_add,xmpp_user_update,xmpp_user_delete,xmpp_user_set_status'] = 'XMPP user functions';
?>
\ No newline at end of file
diff --git a/interface/web/mail/list/xmpp_domain.list.php b/interface/web/mail/list/xmpp_domain.list.php
deleted file mode 100644
index 191508db3919a67f8ec480eefc9bda476b068758..0000000000000000000000000000000000000000
--- a/interface/web/mail/list/xmpp_domain.list.php
+++ /dev/null
@@ -1,109 +0,0 @@
- "active",
- 'datatype' => "VARCHAR",
- 'formtype' => "SELECT",
- 'op' => "=",
- 'prefix' => "",
- 'suffix' => "",
- 'width' => "",
- 'value' => array('y' => $app->lng('yes_txt'), 'n' => $app->lng('no_txt')));
-
-
-if($_SESSION['s']['user']['typ'] == 'admin') {
- $liste["item"][] = array( 'field' => "sys_groupid",
- 'datatype' => "INTEGER",
- 'formtype' => "SELECT",
- 'op' => "=",
- 'prefix' => "",
- 'suffix' => "",
- 'datasource' => array ( 'type' => 'SQL',
- 'querystring' => 'SELECT groupid, name FROM sys_group WHERE groupid != 1 ORDER BY name',
- 'keyfield'=> 'groupid',
- 'valuefield'=> 'name'
- ),
- 'width' => "",
- 'value' => "");
-}
-
-
-$liste["item"][] = array( 'field' => "server_id",
- 'datatype' => "INTEGER",
- 'formtype' => "SELECT",
- 'op' => "like",
- 'prefix' => "",
- 'suffix' => "",
- 'datasource' => array ( 'type' => 'SQL',
- 'querystring' => 'SELECT a.server_id, a.server_name FROM server a, xmpp_domain b WHERE (a.server_id = b.server_id) AND ({AUTHSQL-B}) ORDER BY a.server_name',
- 'keyfield'=> 'server_id',
- 'valuefield'=> 'server_name'
- ),
- 'width' => "",
- 'value' => "");
-
-$liste["item"][] = array( 'field' => "domain",
- 'datatype' => "VARCHAR",
- 'filters' => array( 0 => array( 'event' => 'SHOW',
- 'type' => 'IDNTOUTF8')
- ),
- 'formtype' => "TEXT",
- 'op' => "like",
- 'prefix' => "%",
- 'suffix' => "%",
- 'width' => "",
- 'value' => "");
-
-
-?>
diff --git a/interface/web/mail/list/xmpp_user.list.php b/interface/web/mail/list/xmpp_user.list.php
deleted file mode 100644
index 075e7c4554ff5df6179069ba9ed9beddd86a0db7..0000000000000000000000000000000000000000
--- a/interface/web/mail/list/xmpp_user.list.php
+++ /dev/null
@@ -1,62 +0,0 @@
- "jid",
- 'datatype' => "VARCHAR",
- 'filters' => array( 0 => array( 'event' => 'SHOW',
- 'type' => 'IDNTOUTF8')
- ),
- 'formtype' => "TEXT",
- 'op' => "like",
- 'prefix' => "%",
- 'suffix' => "%",
- 'width' => "",
- 'value' => "");
-
-?>
diff --git a/interface/web/mail/templates/xmpp_domain_admin_list.htm b/interface/web/mail/templates/xmpp_domain_admin_list.htm
deleted file mode 100644
index ccda2d503263caa1a1dc00f61294b6bfa61c8b3d..0000000000000000000000000000000000000000
--- a/interface/web/mail/templates/xmpp_domain_admin_list.htm
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
{tmpl_var name="toolsarea_head_txt"}
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/interface/web/mail/templates/xmpp_domain_edit.htm b/interface/web/mail/templates/xmpp_domain_edit.htm
deleted file mode 100644
index 5c4e8d79a096fb594d574a7830479f0688139c0b..0000000000000000000000000000000000000000
--- a/interface/web/mail/templates/xmpp_domain_edit.htm
+++ /dev/null
@@ -1,130 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/interface/web/mail/templates/xmpp_domain_edit_modules.htm b/interface/web/mail/templates/xmpp_domain_edit_modules.htm
deleted file mode 100644
index 576e16043807c820e678c5df733433a856046770..0000000000000000000000000000000000000000
--- a/interface/web/mail/templates/xmpp_domain_edit_modules.htm
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/interface/web/mail/templates/xmpp_domain_edit_muc.htm b/interface/web/mail/templates/xmpp_domain_edit_muc.htm
deleted file mode 100644
index dd46514cae130308cc87bcf26c1df50c879d0d90..0000000000000000000000000000000000000000
--- a/interface/web/mail/templates/xmpp_domain_edit_muc.htm
+++ /dev/null
@@ -1,91 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/interface/web/mail/templates/xmpp_domain_edit_ssl.htm b/interface/web/mail/templates/xmpp_domain_edit_ssl.htm
deleted file mode 100644
index 2bb7d059aade1ee4015a8041c0df6f45f38cacf5..0000000000000000000000000000000000000000
--- a/interface/web/mail/templates/xmpp_domain_edit_ssl.htm
+++ /dev/null
@@ -1,100 +0,0 @@
-
-
-
-
-
-
{tmpl_var name='configuration_error_txt'}
-
-
{tmpl_var name='config_error_tstamp'} :
{tmpl_var name='config_error_msg'}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/interface/web/mail/templates/xmpp_domain_list.htm b/interface/web/mail/templates/xmpp_domain_list.htm
deleted file mode 100644
index 79579142d7e874d8a71524c4774ed163925892e3..0000000000000000000000000000000000000000
--- a/interface/web/mail/templates/xmpp_domain_list.htm
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
-
-
-
-
-
-
-
- {tmpl_var name="datalog_changes_txt"}
-
-
- - {tmpl_var name="text"}: {tmpl_var name="count"}
-
-
- {tmpl_var name="datalog_changes_end_txt"}
-
-
-
-
-
{tmpl_var name="toolsarea_head_txt"}
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/interface/web/mail/templates/xmpp_user_edit.htm b/interface/web/mail/templates/xmpp_user_edit.htm
deleted file mode 100644
index 467b83fb529ae7fe6babe48aca3659f2e66b02b2..0000000000000000000000000000000000000000
--- a/interface/web/mail/templates/xmpp_user_edit.htm
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/interface/web/mail/templates/xmpp_user_list.htm b/interface/web/mail/templates/xmpp_user_list.htm
deleted file mode 100644
index 1878ed98b6f0c76ba9f92f427870745ff807ad72..0000000000000000000000000000000000000000
--- a/interface/web/mail/templates/xmpp_user_list.htm
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
-
-
-
-
- {tmpl_var name="datalog_changes_txt"}
-
-
- - {tmpl_var name="text"}: {tmpl_var name="count"}
-
-
- {tmpl_var name="datalog_changes_end_txt"}
-
-
-
-
-
{tmpl_var name="toolsarea_head_txt"}
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/interface/web/mail/xmpp_domain_del.php b/interface/web/mail/xmpp_domain_del.php
deleted file mode 100644
index 5e4c826fd036f67fbd5b9d115fd4f8c93a1f8dfb..0000000000000000000000000000000000000000
--- a/interface/web/mail/xmpp_domain_del.php
+++ /dev/null
@@ -1,93 +0,0 @@
-auth->check_module_permissions('mail');
-
-// Loading classes
-$app->uses('tpl,tform,tform_actions');
-$app->load('tform_actions');
-
-class page_action extends tform_actions {
-
- function onBeforeDelete() {
- global $app, $conf;
-
- $domain = $this->dataRecord['domain'];
-
- // Before we delete the email domain,
- // we will delete all depending records.
- $this->delete_accounts($domain);
- // and DNS entries
- $soa = $app->db->queryOneRecord("SELECT id AS zone, sys_userid, sys_groupid, sys_perm_user, sys_perm_group, sys_perm_other, server_id, ttl, serial FROM dns_soa WHERE active = 'Y' AND origin = ?", $domain.'.');
- if ( isset($soa) && !empty($soa) ) $this->remove_dns($soa);
- }
-
- private function delete_accounts($domain){
- global $app;
- // get all accounts
- $sql = "SELECT * FROM xmpp_user WHERE jid LIKE ? AND " . $app->tform->getAuthSQL('d');
- $users = $app->db->queryAllRecords($sql, '%@'.$domain);
- foreach($users AS $u)
- $app->db->datalogDelete('xmpp_user', 'xmppuser_id', $u['xmppuser_id']);
- }
-
- private function remove_dns($new_rr) {
- global $app;
-
- // purge all xmpp related rr-record
- $sql = "SELECT * FROM dns_rr WHERE zone = ? AND (name IN ? AND type = 'CNAME' OR name LIKE ? AND type = 'SRV') AND " . $app->tform->getAuthSQL('r') . " ORDER BY serial DESC";
- $rec = $app->db->queryAllRecords($sql, $new_rr['zone'], array('xmpp', 'pubsub', 'proxy', 'anon', 'vjud', 'muc'), '_xmpp-%');
- if (is_array($rec[1])) {
- for ($i=0; $i < count($rec); ++$i)
- $app->db->datalogDelete('dns_rr', 'id', $rec[$i]['id']);
- }
- }
-
-}
-
-$page = new page_action;
-$page->onDelete();
-
-?>
diff --git a/interface/web/mail/xmpp_domain_edit.php b/interface/web/mail/xmpp_domain_edit.php
deleted file mode 100644
index aff4c292326642a874f75d063c8ea00dc3204f5f..0000000000000000000000000000000000000000
--- a/interface/web/mail/xmpp_domain_edit.php
+++ /dev/null
@@ -1,536 +0,0 @@
-auth->check_module_permissions('mail');
-
-// Loading classes
-$app->uses('tpl,tform,tform_actions,tools_sites');
-$app->load('tform_actions');
-
-class page_action extends tform_actions {
- var $_xmpp_type = 'server';
-
- function onLoad() {
- $show_type = 'server';
- if(isset($_REQUEST['type']) && $_REQUEST['type'] == 'modules') {
- $show_type = 'modules';
- } elseif(isset($_REQUEST['type']) && $_REQUEST['type'] == 'muc') {
- $show_type = 'muc';
- }elseif(isset($_REQUEST['type']) && $_REQUEST['type'] == 'ssl') {
- $show_type = 'ssl';
- }
-
- $_SESSION['s']['var']['xmpp_type'] = $show_type;
- $this->_xmpp_type = $show_type;
-
- parent::onLoad();
- }
-
- function onShowNew() {
- global $app, $conf;
-
- // we will check only users, not admins
- if($_SESSION["s"]["user"]["typ"] == 'user') {
- if(!$app->tform->checkClientLimit('limit_xmpp_domain')) {
- $app->error($app->tform->wordbook["limit_xmppdomain_txt"]);
- }
- if(!$app->tform->checkResellerLimit('limit_xmpp_domain')) {
- $app->error('Reseller: '.$app->tform->wordbook["limit_xmppdomain_txt"]);
- }
- } else {
- $settings = $app->getconf->get_global_config('xmpp');
- }
- $app->tform->formDef['tabs']['domain']['fields']['server_id']['default'] = intval($settings['default_xmppserver']);
-
- parent::onShowNew();
- }
-
- function onShowEnd() {
- global $app;
-
- $app->uses('ini_parser,getconf');
- $settings = $app->getconf->get_global_config('domains');
-
- $read_limits = array('limit_xmpp_pastebin', 'limit_xmpp_httparchive', 'limit_xmpp_anon', 'limit_xmpp_vjud', 'limit_xmpp_proxy', 'limit_xmpp_status', 'limit_xmpp_webpresence', 'limit_xmpp_http_upload');
- if($_SESSION["s"]["user"]["typ"] != 'admin') {
- $client_group_id = $app->functions->intval($_SESSION["s"]["user"]["default_group"]);
- $client = $app->db->queryOneRecord("SELECT client." . implode(", client.", $read_limits) . " FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id);
- // add limits to template to be able to hide settings
- foreach($read_limits as $limit) $app->tpl->setVar($limit, $client[$limit]);
- }else{
- foreach($read_limits as $limit) $app->tpl->setVar($limit, 'y');
- }
-
-
- if($_SESSION["s"]["user"]["typ"] == 'admin' && $settings['use_domain_module'] != 'y') {
- // Getting Clients of the user
- $sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND sys_group.client_id > 0 ORDER BY client.company_name, client.contact_name, sys_group.name";
-
- $clients = $app->db->queryAllRecords($sql);
- $clients = $app->functions->htmlentities($clients);
- $client_select = '';
- if($_SESSION["s"]["user"]["typ"] == 'admin') $client_select .= "
";
- //$tmp_data_record = $app->tform->getDataRecord($this->id);
- if(is_array($clients)) {
- foreach( $clients as $client) {
- $selected = @(is_array($this->dataRecord) && ($client["groupid"] == $this->dataRecord['client_group_id'] || $client["groupid"] == $this->dataRecord['sys_groupid']))?'SELECTED':'';
- $client_select .= "
\r\n";
- }
- }
- $app->tpl->setVar("client_group_id", $client_select);
-
- } elseif ($_SESSION["s"]["user"]["typ"] != 'admin' && $app->auth->has_clients($_SESSION['s']['user']['userid'])) {
-
- // Get the limits of the client
- $client_group_id = $_SESSION["s"]["user"]["default_group"];
- $client = $app->db->queryOneRecord("SELECT client.client_id, client.contact_name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname, sys_group.name FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ? order by client.contact_name", $client_group_id);
- $client = $app->functions->htmlentities($client);
-
- if ($settings['use_domain_module'] != 'y') {
- // Fill the client select field
- $sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ? ORDER BY client.company_name, client.contact_name, sys_group.name";
- $clients = $app->db->queryAllRecords($sql, $client['client_id']);
- $clients = $app->functions->htmlentities($clients);
- $tmp = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ?", $client['client_id']);
- $client_select = '
';
- //$tmp_data_record = $app->tform->getDataRecord($this->id);
- if(is_array($clients)) {
- foreach( $clients as $client) {
- $selected = @(is_array($this->dataRecord) && ($client["groupid"] == $this->dataRecord['client_group_id'] || $client["groupid"] == $this->dataRecord['sys_groupid']))?'SELECTED':'';
- $client_select .= "
\r\n";
- }
- }
- $app->tpl->setVar("client_group_id", $client_select);
- }
- }
-
- if($_SESSION["s"]["user"]["typ"] != 'admin')
- {
- $client_group_id = $_SESSION["s"]["user"]["default_group"];
- $client_xmpp = $app->db->queryOneRecord("SELECT xmpp_servers FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id);
-
- $client_xmpp['xmpp_servers_ids'] = explode(',', $client_xmpp['xmpp_servers']);
-
- $only_one_server = count($client_xmpp['xmpp_servers_ids']) === 1;
- $app->tpl->setVar('only_one_server', $only_one_server);
-
- if ($only_one_server) {
- $app->tpl->setVar('server_id_value', $client_xmpp['xmpp_servers_ids'][0]);
- }
-
- $sql = "SELECT server_id, server_name FROM server WHERE server_id IN ?";
- $xmpp_servers = $app->db->queryAllRecords($sql, $client_xmpp['xmpp_servers_ids']);
-
- $options_xmpp_servers = "";
-
- foreach ($xmpp_servers as $xmpp_server) {
- $options_xmpp_servers .= "
";
- }
-
- $app->tpl->setVar("client_server_id", $options_xmpp_servers);
- unset($options_xmpp_servers);
-
- }
-
- /*
- * Now we have to check, if we should use the domain-module to select the domain
- * or not
- */
- if ($settings['use_domain_module'] == 'y') {
- /*
- * The domain-module is in use.
- */
- $domains = $app->tools_sites->getDomainModuleDomains("xmpp_domain", $this->dataRecord["domain"]);
- $domain_select = '';
- if(is_array($domains) && sizeof($domains) > 0) {
- /* We have domains in the list, so create the drop-down-list */
- foreach( $domains as $domain) {
- $domain_select .= "
\r\n";
- }
- }
- else {
- /*
- * We have no domains in the domain-list. This means, we can not add ANY new domain.
- * To avoid, that the variable "domain_option" is empty and so the user can
- * free enter a domain, we have to create a empty option!
- */
- $domain_select .= "
\r\n";
- }
- $app->tpl->setVar("domain_option", $domain_select);
- $app->tpl->setVar("domain_module", 1);
- } else {
- $app->tpl->setVar("domain_module", 0);
- }
-
-
- if($this->id > 0) {
- //* we are editing a existing record
- $app->tpl->setVar("edit_disabled", 1);
- $app->tpl->setVar("server_id_value", $this->dataRecord["server_id"], true);
- } else {
- $app->tpl->setVar("edit_disabled", 0);
- }
-
-
- parent::onShowEnd();
- }
-
- function onSubmit() {
- global $app;
-
- /* check if the domain module is used - and check if the selected domain can be used! */
- $app->uses('ini_parser,getconf');
- $settings = $app->getconf->get_global_config('domains');
- if ((isset($this->dataRecord['domain'])) && ($settings['use_domain_module'] == 'y')) {
- if ($_SESSION["s"]["user"]["typ"] == 'admin' || $app->auth->has_clients($_SESSION['s']['user']['userid'])) {
- $this->dataRecord['client_group_id'] = $app->tools_sites->getClientIdForDomain($this->dataRecord['domain']);
- }
- $domain_check = $app->tools_sites->checkDomainModuleDomain($this->dataRecord['domain']);
- if(!$domain_check) {
- // invalid domain selected
- $app->tform->errorMessage .= $app->tform->lng("domain_error_empty")."
";
- } else {
- $this->dataRecord['domain'] = $domain_check;
- }
- }
-
- if($_SESSION["s"]["user"]["typ"] != 'admin') {
- // Get the limits of the client
- $client_group_id = $app->functions->intval($_SESSION["s"]["user"]["default_group"]);
- $client = $app->db->queryOneRecord("SELECT limit_xmpp_domain FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id);
- // When the record is updated
- if($this->id > 0) {
- // restore the server ID if the user is not admin and record is edited
- $tmp = $app->db->queryOneRecord("SELECT server_id FROM xmpp_domain WHERE domain_id = ?", $this->id);
- $this->dataRecord["server_id"] = $tmp["server_id"];
- unset($tmp);
- // When the record is inserted
- } else {
- $client['xmpp_servers_ids'] = explode(',', $client['xmpp_servers']);
-
- // Check if chosen server is in authorized servers for this client
- if (!(is_array($client['xmpp_servers_ids']) && in_array($this->dataRecord["server_id"], $client['xmpp_servers_ids']))) {
- $app->error($app->tform->wordbook['error_not_allowed_server_id']);
- }
-
- if($client["limit_xmpp_domain"] >= 0) {
- $tmp = $app->db->queryOneRecord("SELECT count(domain_id) as number FROM xmpp_domain WHERE sys_groupid = ?", $client_group_id);
- if($tmp["number"] >= $client["limit_xmpp_domain"]) {
- $app->error($app->tform->wordbook["limit_xmppdomain_txt"]);
- }
- }
- }
-
- // Clients may not set the client_group_id, so we unset them if user is not a admin
- if(!$app->auth->has_clients($_SESSION['s']['user']['userid'])) unset($this->dataRecord["client_group_id"]);
- }
-
- //* make sure that the xmpp domain is lowercase
- if(isset($this->dataRecord["domain"])) $this->dataRecord["domain"] = strtolower($this->dataRecord["domain"]);
-
- // Read management method
- if(isset($this->dataRecord["management_method"]))
- // Set management method to 0 as long as the mailaccount hook is not implemented
- $this->dataRecord["management_method"] = 0;
- switch($this->dataRecord["management_method"]){
- case 0:
- $this->dataRecord["management_method"] = 'normal';
- break;
- case 1:
- $this->dataRecord["management_method"] = 'maildomain';
- // Check for corresponding mail domain
- $tmp = $app->db->queryOneRecord("SELECT count(domain_id) AS number FROM mail_domain WHERE domain = ? AND ".$app->tform->getAuthSQL('r')." ORDER BY domain", $this->dataRecord["domain"]);
- if($tmp['number']==0){
- $app->error($app->tform->wordbook["no_corresponding_maildomain_txt"]);
- break;
- }
- break;
- }
- // vjud opt mode
- if(isset($this->dataRecord["vjud_opt_mode"]))
- $this->dataRecord["vjud_opt_mode"] = $this->dataRecord["vjud_opt_mode"] == 0 ? 'in' : 'out';
-
- // Reset public registration to 'n', is not yet supported
- $this->dataRecord["public_registration"] = 'n';
-
- parent::onSubmit();
- }
-
- function onAfterInsert() {
- global $app, $conf;
-
- // make sure that the record belongs to the client group and not the admin group when admin inserts it
- // also make sure that the user can not delete domain created by a admin
- if($_SESSION["s"]["user"]["typ"] == 'admin' && isset($this->dataRecord["client_group_id"])) {
- $client_group_id = $app->functions->intval($this->dataRecord["client_group_id"]);
- $app->db->query("UPDATE xmpp_domain SET sys_groupid = ?, sys_perm_group = 'ru' WHERE domain_id = ?", $client_group_id, $this->id);
- }
- if($app->auth->has_clients($_SESSION['s']['user']['userid']) && isset($this->dataRecord["client_group_id"])) {
- $client_group_id = $app->functions->intval($this->dataRecord["client_group_id"]);
- $app->db->query("UPDATE xmpp_domain SET sys_groupid = ?, sys_perm_group = 'riud' WHERE domain_id = ?", $client_group_id, $this->id);
- }
-
- //* make sure that the xmpp domain is lowercase
- if(isset($this->dataRecord["domain"])) $this->dataRecord["domain"] = strtolower($this->dataRecord["domain"]);
-
- // create new accounts from mail domain
- //if($this->dataRecord['management_method']=='maildomain')
- // $this->syncMailusers($this->dataRecord['domain']);
-
- // Insert DNS Records
- $soa = $app->db->queryOneRecord("SELECT id AS zone, sys_userid, sys_groupid, sys_perm_user, sys_perm_group, sys_perm_other, server_id, ttl, serial FROM dns_soa WHERE active = 'Y' AND origin = ?", $this->dataRecord['domain'].'.');
- if ( isset($soa) && !empty($soa) ) $this->update_dns($this->dataRecord, $soa);
- }
-
- function onBeforeUpdate() {
- global $app, $conf;
-
- if($this->_xmpp_type == 'server') {
- // Check if the domain has been changed
- $rec = $app->db->queryOneRecord("SELECT domain from xmpp_domain WHERE domain_id = ?", $this->id);
- if($this->dataRecord['domain']!=$rec['domain'])
- $app->error($app->tform->wordbook["cant_change_domainname_txt"]);
-
- //* Check if the server has been changed
- // We do this only for the admin or reseller users, as normal clients can not change the server ID anyway
- if($_SESSION["s"]["user"]["typ"] == 'admin' || $app->auth->has_clients($_SESSION['s']['user']['userid'])) {
- if (isset($this->dataRecord["server_id"])) {
- $rec = $app->db->queryOneRecord("SELECT server_id from xmpp_domain WHERE domain_id = ?", $this->id);
- if($rec['server_id'] != $this->dataRecord["server_id"]) {
- //* Add a error message and switch back to old server
- $app->tform->errorMessage .= $app->lng('The Server can not be changed.');
- $this->dataRecord["server_id"] = $rec['server_id'];
- }
- unset($rec);
- }
- //* If the user is neither admin nor reseller
- } else {
- //* We do not allow users to change a domain which has been created by the admin
- $rec = $app->db->queryOneRecord("SELECT sys_perm_group, domain from xmpp_domain WHERE domain_id = ?", $this->id);
- if(isset($this->dataRecord["domain"]) && $rec['domain'] != $this->dataRecord["domain"] && $app->tform->checkPerm($this->id, 'u')) {
- //* Add a error message and switch back to old server
- $app->tform->errorMessage .= $app->lng('The Domain can not be changed. Please ask your Administrator if you want to change the domain name.');
- $this->dataRecord["domain"] = $rec['domain'];
- }
- unset($rec);
- }
- }
-
- if($this->_xmpp_type == 'ssl'){
- //* Check that all fields for the SSL cert creation are filled
- if(isset($this->dataRecord['ssl_action']) && $this->dataRecord['ssl_action'] == 'create') {
- if($this->dataRecord['ssl_state'] == '') $app->tform->errorMessage .= $app->tform->lng('error_ssl_state_empty').'
';
- if($this->dataRecord['ssl_locality'] == '') $app->tform->errorMessage .= $app->tform->lng('error_ssl_locality_empty').'
';
- if($this->dataRecord['ssl_organisation'] == '') $app->tform->errorMessage .= $app->tform->lng('error_ssl_organisation_empty').'
';
- if($this->dataRecord['ssl_organisation_unit'] == '') $app->tform->errorMessage .= $app->tform->lng('error_ssl_organisation_unit_empty').'
';
- if($this->dataRecord['ssl_country'] == '') $app->tform->errorMessage .= $app->tform->lng('error_ssl_country_empty').'
';
- }
-
- if(isset($this->dataRecord['ssl_action']) && $this->dataRecord['ssl_action'] == 'save') {
- if(trim($this->dataRecord['ssl_cert']) == '') $app->tform->errorMessage .= $app->tform->lng('error_ssl_cert_empty').'
';
- }
- }
-
- //* make sure that the xmpp domain is lowercase
- if(isset($this->dataRecord["domain"])) $this->dataRecord["domain"] = strtolower($this->dataRecord["domain"]);
-
- }
-
- function onAfterUpdate() {
- global $app, $conf;
-
- // create new accounts from mail domain
- //if($this->oldDataRecord['management_method'] != 'maildomain' && $this->dataRecord['management_method']=='maildomain')
- // $this->syncMailusers($this->dataRecord['domain']);
- // or reset to normal permissions
- //elseif($this->oldDataRecord['management_method'] == 'maildomain' && $this->dataRecord['management_method']!='maildomain')
- // $this->desyncMailusers($this->dataRecord['domain']);
- // Update DNS Records
- // TODO: Update gets only triggered from main form. WHY?
- $soa = $app->db->queryOneRecord("SELECT id AS zone, sys_userid, sys_groupid, sys_perm_user, sys_perm_group, sys_perm_other, server_id FROM dns_soa WHERE active = 'Y' AND `origin` = ?", $this->dataRecord['domain'].'.');
- if ( isset($soa) && !empty($soa) ) $this->update_dns($this->dataRecord, $soa);
- }
-
-
-
- private function update_dns($dataRecord, $new_rr) {
- global $app, $conf;
-
- $sql = "SELECT server_name from server WHERE server_id = " . intval($dataRecord['server_id']);
- $xmpp_server = $app->db->queryOneRecord($sql);
-
- $rec = $app->db->queryOneRecord("SELECT use_pubsub, use_proxy, use_anon_host, use_vjud, use_muc_host from xmpp_domain WHERE domain_id = ?", $this->id);
- $required_hosts = array('xmpp');
- if($rec['use_pubsub']=='y')
- $required_hosts[] = 'pubsub';
- if($rec['use_proxy']=='y')
- $required_hosts[] = 'proxy';
- if($rec['use_anon_host']=='y')
- $required_hosts[] = 'anon';
- if($rec['use_vjud']=='y')
- $required_hosts[] = 'vjud';
- if($rec['use_muc_host']=='y')
- $required_hosts[] = 'muc';
-
- // purge old rr-record
- $sql = "SELECT * FROM dns_rr WHERE zone = ? AND (name IN ? AND type = 'CNAME' OR name LIKE ? AND type = 'SRV') AND " . $app->tform->getAuthSQL('r') . " ORDER BY serial DESC";
- $rec = $app->db->queryAllRecords($sql, $new_rr['zone'], array('xmpp', 'pubsub', 'proxy', 'anon', 'vjud', 'muc', 'upload'), '_xmpp-%');
- if (is_array($rec[1])) {
- for ($i=0; $i < count($rec); ++$i)
- $app->db->datalogDelete('dns_rr', 'id', $rec[$i]['id']);
- }
-
- // create new cname rr-records
- foreach($required_hosts AS $h){
- $rr = $new_rr;
- $rr['name'] = $h;
- $rr['type'] = 'CNAME';
- $rr['data'] = $xmpp_server['server_name'] . '.';
- $rr['aux'] = 0;
- $rr['active'] = 'Y';
- $rr['stamp'] = date('Y-m-d H:i:s');
- $rr['serial'] = $app->validate_dns->increase_serial($new_rr['serial']);
- $app->db->datalogInsert('dns_rr', $rr, 'id', $rr['zone']);
- }
-
- //create new srv rr-records
- $rr = $new_rr;
- $rr['name'] = '_xmpp-client._tcp.'.$dataRecord['domain'].'.';
- $rr['type'] = 'SRV';
- $rr['data'] = '5 5222 ' . $xmpp_server['server_name'] . '.';
- $rr['aux'] = 0;
- $rr['active'] = 'Y';
- $rr['stamp'] = date('Y-m-d H:i:s');
- $rr['serial'] = $app->validate_dns->increase_serial($new_rr['serial']);
- $app->db->datalogInsert('dns_rr', $rr, 'id', $rr['zone']);
- $rr = $new_rr;
- $rr['name'] = '_xmpp-server._tcp.'.$dataRecord['domain'].'.';
- $rr['type'] = 'SRV';
- $rr['data'] = '5 5269 ' . $xmpp_server['server_name'] . '.';
- $rr['aux'] = 0;
- $rr['active'] = 'Y';
- $rr['stamp'] = date('Y-m-d H:i:s');
- $rr['serial'] = $app->validate_dns->increase_serial($new_rr['serial']);
- $app->db->datalogInsert('dns_rr', $rr, 'id', $rr['zone']);
-
- // Refresh zone
- $zone = $app->db->queryOneRecord("SELECT id, serial FROM dns_soa WHERE active = 'Y' AND id = ?", $new_rr['zone']);
- $new_serial = $app->validate_dns->increase_serial($zone['serial']);
- $app->db->datalogUpdate('dns_soa', array("serial" => $new_serial), 'id', $zone['id']);
- }
-
- /*
- * NOT YET FINISHED
-
- private function syncMailusers($domain){
- global $app, $conf;
- // get all mailusers
- $db_mailusers = $app->db->queryAllRecords("SELECT email, password, sys_userid, sys_groupid, sys_perm_user, sys_perm_group, sys_perm_other FROM mail_user WHERE email like ?", '@'.$this->dataRecord['domain'].'.');
- // get existing xmpp users
- $db_xmppusers = $app->db->queryAllRecords("SELECT jid, password, sys_userid, sys_groupid, sys_perm_user, sys_perm_group, sys_perm_other FROM xmpp_user WHERE jid like ?", '@'.$this->dataRecord['domain'].'.');
-
- // Migrate user accounts
- $users_delete = array();
- $users_update = array();
- $users_create = array();
- foreach($db_xmppusers AS $ix=>$x){
- $matched = false;
- foreach($db_mailusers AS $im=>$m){
- if($x['jid']==$m['email']){
- // User matched, mark for update
- $x['password'] = $m['password'];
- $users_update[] = $x;
- unset($db_xmppusers[$ix]);
- unset($db_mailusers[$im]);
- $matched = true;
- break;
- }
- }
- // XMPP user not matched, mark for deletion
- if(!$matched){
- $users_delete[] = $x;
- unset($db_xmppusers[$ix]);
- }
- }
- // Mark remaining mail users for creation
- $users_create = $db_xmppusers;
- foreach($users_create AS $u){
- $u['server_id'] = $this->dataRecord['server_id'];
- $u['sys_perm_user'] = 'r';
- $u['sys_perm_group'] = 'r';
- $app->db->datalogInsert('xmpp_user', $u, 'xmppuser_id');
- }
- foreach($users_update AS $u){
- $u['sys_perm_user'] = 'r';
- $u['sys_perm_group'] = 'r';
- $app->db->datalogUpdate('xmpp_user', $u, 'xmppuser_id', $u['xmppuser_id']);
- }
- foreach($users_delete AS $u){
- $app->db->datalogDelete('xmpp_user', 'xmppuser_id', $u['xmppuser_id']);
- }
-
- }
-
- private function desyncMailusers($domain){
- global $app, $conf;
- // get existing xmpp users
- $db_xmppusers = $app->db->queryAllRecords("SELECT jid, password, sys_userid, sys_groupid, sys_perm_user, sys_perm_group, sys_perm_other FROM xmpp_user WHERE jid like ?", '@'.$this->dataRecord['domain'].'.');
- foreach($db_xmppusers AS $u){
- $u['sys_perm_user'] = 'riud';
- $u['sys_perm_group'] = 'riud';
- $app->db->datalogUpdate('xmpp_user', $u, 'xmppuser_id', $u['xmppuser_id']);
- }
- }
- */
-
-}
-
-$page = new page_action;
-$page->onLoad();
-
-?>
diff --git a/interface/web/mail/xmpp_domain_list.php b/interface/web/mail/xmpp_domain_list.php
deleted file mode 100644
index ff632e38ca9422ec76125f128989e211ff8e2ee0..0000000000000000000000000000000000000000
--- a/interface/web/mail/xmpp_domain_list.php
+++ /dev/null
@@ -1,28 +0,0 @@
-auth->check_module_permissions('mail');
-
-$app->uses('listform_actions');
-
-// Limit the results to alias domains
-// $app->listform_actions->SQLExtWhere = "type = 'local'";
-
-$app->listform_actions->SQLOrderBy = 'ORDER BY xmpp_domain.domain';
-$app->listform_actions->onLoad();
-
-
-?>
diff --git a/interface/web/mail/xmpp_user_del.php b/interface/web/mail/xmpp_user_del.php
deleted file mode 100644
index cf0cc62a104f397d6b0a390f79203e00a0f128f1..0000000000000000000000000000000000000000
--- a/interface/web/mail/xmpp_user_del.php
+++ /dev/null
@@ -1,72 +0,0 @@
-auth->check_module_permissions('mail');
-
-// Loading classes
-$app->uses('tpl,tform,tform_actions');
-$app->load('tform_actions');
-
-class page_action extends tform_actions {
-
- function onBeforeDelete() {
- global $app, $conf;
-
- $jid_parts = explode("@", $this->dataRecord['jid']);
- $domain = $jid_parts[1];
-
- // check if domain is managed through mail domain
- // if yes, manual deletion is not allowed
- //$app->error('blubb');
-
-
- }
-
-}
-
-$page = new page_action;
-$page->onDelete();
-
-?>
diff --git a/interface/web/mail/xmpp_user_edit.php b/interface/web/mail/xmpp_user_edit.php
deleted file mode 100644
index 188de01ae240d7f3331509e581c82df5df0b1494..0000000000000000000000000000000000000000
--- a/interface/web/mail/xmpp_user_edit.php
+++ /dev/null
@@ -1,172 +0,0 @@
-auth->check_module_permissions('mail');
-
-// Loading classes
-$app->uses('tpl,tform,tform_actions');
-$app->load('tform_actions');
-
-class page_action extends tform_actions {
-
-
- function onShowNew() {
- global $app, $conf;
-
- // we will check only users, not admins
- if($_SESSION["s"]["user"]["typ"] == 'user') {
- if(!$app->tform->checkClientLimit('limit_xmpp_user')) {
- $app->error($app->tform->wordbook["limit_xmpp_user_txt"]);
- }
- if(!$app->tform->checkResellerLimit('limit_xmpp_user')) {
- $app->error('Reseller: '.$app->tform->wordbook["limit_xmpp_user_txt"]);
- }
- }
-
- parent::onShowNew();
- }
-
- function onShowEnd() {
- global $app, $conf;
-
- $jid = $this->dataRecord["jid"];
- $jid_parts = explode("@", $jid);
- $app->tpl->setVar("jid_local_part", $jid_parts[0]);
- $jid_parts[1] = $app->functions->idn_decode($jid_parts[1]);
-
- // Getting Domains of the user
- $sql = "SELECT domain, server_id FROM xmpp_domain WHERE ".$app->tform->getAuthSQL('r')." ORDER BY domain";
- $domains = $app->db->queryAllRecords($sql);
- $domain_select = '';
- if(is_array($domains)) {
- foreach( $domains as $domain) {
- $domain['domain'] = $app->functions->idn_decode($domain['domain']);
- $selected = ($domain["domain"] == @$jid_parts[1])?'SELECTED':'';
- $domain_select .= "
\r\n";
- }
- }
- $app->tpl->setVar("jid_domain", $domain_select);
- unset($domains);
- unset($domain_select);
-
-
- parent::onShowEnd();
- }
-
- function onSubmit() {
- global $app, $conf;
- //* Check if Domain belongs to user
- if(isset($_POST["jid_domain"])) {
- $domain = $app->db->queryOneRecord("SELECT server_id, domain FROM xmpp_domain WHERE domain = ? AND ".$app->tform->getAuthSQL('r'), $app->functions->idn_encode($_POST["jid_domain"]));
- if($domain["domain"] != $app->functions->idn_encode($_POST["jid_domain"])) $app->tform->errorMessage .= $app->tform->lng("no_domain_perm");
- }
-
-
- //* if its an insert, check that the password is not empty
- if($this->id == 0 && $_POST["password"] == '') {
- $app->tform->errorMessage .= $app->tform->lng("error_no_pwd")."
";
- }
-
- //* Check the client limits, if user is not the admin
- if($_SESSION["s"]["user"]["typ"] != 'admin') { // if user is not admin
- // Get the limits of the client
- $client_group_id = $app->functions->intval($_SESSION["s"]["user"]["default_group"]);
- $client = $app->db->queryOneRecord("SELECT limit_xmpp_user, parent_client_id FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id);
-
-
- // Check if the user may add another xmpp user.
- if($this->id == 0 && $client["limit_xmpp_user"] >= 0) {
- $tmp = $app->db->queryOneRecord("SELECT count(xmppuser_id) as number FROM xmpp_user WHERE sys_groupid = ?", $client_group_id);
- if($tmp["number"] >= $client["limit_xmpp_user"]) {
- $app->tform->errorMessage .= $app->tform->lng("limit_xmpp_user_txt")."
";
- }
- unset($tmp);
- }
- } // end if user is not admin
-
-
- $app->uses('getconf');
- $xmpp_config = $app->getconf->get_server_config(!empty($domain["server_id"]) ? $domain["server_id"] : '', 'xmpp');
-
- //* compose the xmpp field
- if(isset($_POST["jid_local_part"]) && isset($_POST["jid_domain"])) {
- $this->dataRecord["jid"] = strtolower($_POST["jid_local_part"]."@".$app->functions->idn_encode($_POST["jid_domain"]));
-
- // Set the server id of the xmpp user = server ID of xmpp domain.
- $this->dataRecord["server_id"] = $domain["server_id"];
-
- unset($this->dataRecord["jid_local_part"]);
- unset($this->dataRecord["jid_domain"]);
-
- }
-
- parent::onSubmit();
- }
-
- function onAfterInsert() {
- global $app, $conf;
-
- // Set the domain owner as xmpp user owner
- $domain = $app->db->queryOneRecord("SELECT sys_groupid, server_id FROM xmpp_domain WHERE domain = ? AND ".$app->tform->getAuthSQL('r'), $app->functions->idn_encode($_POST["jid_domain"]));
- $app->db->query("UPDATE xmpp_user SET sys_groupid = ? WHERE xmppuser_id = ?", $domain["sys_groupid"], $this->id);
-
- }
-
- function onAfterUpdate() {
- global $app, $conf;
-
- // Set the domain owner as mailbox owner
- if(isset($_POST["xmpp_domain"])) {
- $domain = $app->db->queryOneRecord("SELECT sys_groupid, server_id FROM xmpp_domain WHERE domain = ? AND ".$app->tform->getAuthSQL('r'), $app->functions->idn_encode($_POST["jid_domain"]));
- $app->db->query("UPDATE xmpp_user SET sys_groupid = ? WHERE xmppuser_id = ?", $domain["sys_groupid"], $this->id);
-
- }
- }
-
-}
-
-$app->tform_actions = new page_action;
-$app->tform_actions->onLoad();
-
-?>
diff --git a/interface/web/mail/xmpp_user_list.php b/interface/web/mail/xmpp_user_list.php
deleted file mode 100644
index ea44e4dfc0cea3204b07362a8052253b4ef09cca..0000000000000000000000000000000000000000
--- a/interface/web/mail/xmpp_user_list.php
+++ /dev/null
@@ -1,39 +0,0 @@
-auth->check_module_permissions('mail');
-
-$app->load('listform_actions');
-
-
-class list_action extends listform_actions {
-
- function onShow() {
- global $app, $conf;
-
- $app->uses('getconf');
- $global_config = $app->getconf->get_global_config('xmpp');
-
- parent::onShow();
- }
-
-}
-
-$list = new list_action;
-$list->SQLOrderBy = 'ORDER BY xmpp_user.jid';
-$list->onLoad();
-
-
-?>
diff --git a/server/conf/xmpp_conf_ssl.master b/server/conf/xmpp_conf_ssl.master
deleted file mode 100644
index 73ab3a8a3580313f9879c5e50ccd6a01c6e71547..0000000000000000000000000000000000000000
--- a/server/conf/xmpp_conf_ssl.master
+++ /dev/null
@@ -1,72 +0,0 @@
-oid_section = new_oids
-
-[ new_oids ]
-
-# RFC 3920 section 5.1.1 defines this OID
-xmppAddr = 1.3.6.1.5.5.7.8.5
-
-# RFC 4985 defines this OID
-SRVName = 1.3.6.1.5.5.7.8.7
-
-[ req ]
-
-default_bits = 4096
-default_keyfile = {tmpl_var name='domain'}.key
-distinguished_name = distinguished_name
-req_extensions = v3_extensions
-x509_extensions = v3_extensions
-
-# ask about the DN?
-prompt = no
-
-[ distinguished_name ]
-
-commonName = {tmpl_var name='domain'}
-countryName = {tmpl_var name='ssl_country'}
-localityName = {tmpl_var name='ssl_locality'}
-organizationName = {tmpl_var name='ssl_organisation'}
-organizationalUnitName = {tmpl_var name='ssl_organisation_unit'}
-emailAddress = {tmpl_var name='ssl_email'}
-
-[ v3_extensions ]
-
-# for certificate requests (req_extensions)
-# and self-signed certificates (x509_extensions)
-
-basicConstraints = CA:FALSE
-keyUsage = digitalSignature,keyEncipherment
-extendedKeyUsage = serverAuth,clientAuth
-subjectAltName = @subject_alternative_name
-
-[ subject_alternative_name ]
-
-# See http://tools.ietf.org/html/draft-ietf-xmpp-3920bis#section-13.7.1.2 for more info.
-
-DNS.0 = {tmpl_var name='domain'}
-otherName.0 = xmppAddr;FORMAT:UTF8,UTF8:{tmpl_var name='domain'}
-otherName.1 = SRVName;IA5STRING:_xmpp-client.{tmpl_var name='domain'}
-otherName.2 = SRVName;IA5STRING:_xmpp-server.{tmpl_var name='domain'}
-
-DNS.1 = muc.{tmpl_var name='domain'}
-otherName.3 = xmppAddr;FORMAT:UTF8,UTF8:muc.{tmpl_var name='domain'}
-otherName.4 = SRVName;IA5STRING:_xmpp-server.muc.{tmpl_var name='domain'}
-
-DNS.2 = pubsub.{tmpl_var name='domain'}
-otherName.5 = xmppAddr;FORMAT:UTF8,UTF8:pubsub.{tmpl_var name='domain'}
-otherName.6 = SRVName;IA5STRING:_xmpp-server.pubsub.{tmpl_var name='domain'}
-
-DNS.3 = anon.{tmpl_var name='domain'}
-otherName.7 = xmppAddr;FORMAT:UTF8,UTF8:anon.{tmpl_var name='domain'}
-otherName.8 = SRVName;IA5STRING:_xmpp-server.anon.{tmpl_var name='domain'}
-
-DNS.4 = xmpp.{tmpl_var name='domain'}
-otherName.9 = xmppAddr;FORMAT:UTF8,UTF8:xmpp.{tmpl_var name='domain'}
-otherName.10= SRVName;IA5STRING:_xmpp-server.xmpp.{tmpl_var name='domain'}
-
-DNS.5 = proxy.{tmpl_var name='domain'}
-otherName.11= xmppAddr;FORMAT:UTF8,UTF8:proxy.{tmpl_var name='domain'}
-otherName.12= SRVName;IA5STRING:_xmpp-server.proxy.{tmpl_var name='domain'}
-
-DNS.6 = vjud.{tmpl_var name='domain'}
-otherName.13= xmppAddr;FORMAT:UTF8,UTF8:vjud.{tmpl_var name='domain'}
-otherName.14= SRVName;IA5STRING:_xmpp-server.vjud.{tmpl_var name='domain'}
\ No newline at end of file
diff --git a/server/conf/xmpp_metronome_conf_global.master b/server/conf/xmpp_metronome_conf_global.master
deleted file mode 100644
index 71920caea101408f7c1cf8f0e77f2bf5a7c89763..0000000000000000000000000000000000000000
--- a/server/conf/xmpp_metronome_conf_global.master
+++ /dev/null
@@ -1,48 +0,0 @@
-pidfile = "/var/run/metronome/metronome.pid";
-metronome_max_files_soft = 200000;
-metronome_max_files_hard = 300000;
-plugin_paths = {
- "/usr/lib/metronome/isp-modules",
-};
-use_libevent = true;
-log = {
- debug = "/var/log/metronome/metronome.dbg",
- info = "/var/log/metronome/metronome.log",
- error = "/var/log/metronome/metronome.err",
-};
-use_ipv6 = {tmpl_var name='ipv6'};
-http_ports = {
- {tmpl_var name='port_http'},
-};
-https_ports = {
- {tmpl_var name='port_https'},
-};
-pastebin_ports = {
- {tmpl_var name='port_pastebin'},
-};
-bosh_ports = {
- {tmpl_var name='port_bosh'},
-};
-admins = {
-{tmpl_var name='server_admins'}
-};
-modules_enabled = {
-{tmpl_var name='modules_enabled'}
-};
-modules_disabled = {
-};
-bosh_max_inactivity = {tmpl_var name='bosh_timeout'};
-consider_bosh_secure = true;
-cross_domain_bosh = true;
-allow_registration = true;
--- TODO generate ssl key during setup
-ssl = {
- key = "/etc/metronome/certs/localhost.key",
- certificate = "/etc/metronome/certs/localhost.cert",
-};
-c2s_require_encryption = false;
-s2s_secure = true;
-s2s_insecure_domains = {
- "gmail.com",
-};
-authentication = "internal_plain";
\ No newline at end of file
diff --git a/server/conf/xmpp_metronome_conf_host.master b/server/conf/xmpp_metronome_conf_host.master
deleted file mode 100644
index 3dea69257bc8cc2b637570196500ff64df24f1ea..0000000000000000000000000000000000000000
--- a/server/conf/xmpp_metronome_conf_host.master
+++ /dev/null
@@ -1,135 +0,0 @@
-VirtualHost "{tmpl_var name='domain'}"
- enabled = {tmpl_var name='active'};
- authentication = "external";
- external_auth_command = "/usr/lib/metronome/isp-modules/mod_auth_external/authenticate_isp.sh";
- allow_registration = {tmpl_var name='public_registration'};
-
- registration_url = "{tmpl_var name='registration_url'}";
- registration_text = "{tmpl_var name='registration_message'}";
-
- no_registration_whitelist = true;
-
- modules_enabled = {
- "roster",
- "private",
- "vcard",
- "privacy",
- "pep",
-
- "register",
-
- "register_redirect",
-
- "admin_adhoc",
- };
- disco_items = {
-
- {
- "muc.{tmpl_var name='domain'}",
- "{tmpl_var name='muc_name'}",
- },
-
-
- {
- "pubsub.{tmpl_var name='domain'}",
- "{tmpl_var name='domain'} Publish/Subscribe",
- },
-
-
- {
- "proxy.{tmpl_var name='domain'}",
- "{tmpl_var name='domain'} Bytestream Proxy",
- },
-
-
- {
- "vjud.{tmpl_var name='domain'}",
- "{tmpl_var name='domain'} User Directory",
- },
-
- };
-
- admins = {
-{tmpl_var name='domain_admins'}
- };
-
- ssl = {
- key = "/etc/metronome/certs/{tmpl_var name='domain'}.key",
- certificate = "/etc/metronome/certs/{tmpl_var name='domain'}.cert",
- };
-
-
-
-VirtualHost "anon.{tmpl_var name='domain'}"
- enabled = true;
- authentication = "anonymous";
- allow_anonymous_multiresourcing = true;
- anonymous_jid_gentoken = "{tmpl_var name='domain'} Anonymous User";
- admins = {
- };
-
-
-
-
-Component "muc.{tmpl_var name='domain'}" "muc"
- modules_enabled = {
- "muc_limits",
- "muc_log",
-
- "muc_log_http",
-
-
- "pastebin",
-
- };
- muc_event_rate = 0.7;
- muc_burst_factor = 13;
- muc_log_presences = false;
-
- muc_log_http_config = {
- show_join = {tmpl_var name='archive_join'},
- show_status = {tmpl_var name='archive_status'},
- theme = "metronome",
- url_base = "logs",
- };
-
-
- pastebin_path = "/pastes/";
- pastebin_expire_after = {tmpl_var name='pastebin_expire'};
- pastebin_trigger = "{tmpl_var name='pastebin_trigger'}";
-
- name = "{tmpl_var name='muc_name'}";
- restrict_room_creation = "{tmpl_var name='muc_restrict_room_creation'}";
- admins = {
-{tmpl_var name='muc_admins'}
- };
-
-
-
-
-Component "pubsub.{tmpl_var name='domain'}" "pubsub"
- name = "{tmpl_var name='domain'} Publish/Subscribe";
- unrestricted_node_creation = false;
-
-
-
-Component "proxy.{tmpl_var name='domain'}" "proxy65"
- proxy65_acl = {
- "{tmpl_var name='domain'}",
- };
- proxy65_interfaces = {
- "*",
- "::",
- };
- proxy65_ports = {
- 5000,
- };
-
-
-
-
-Component "vjud.{tmpl_var name='domain'}" "vjud"
- ud_disco_name = "{tmpl_var name='domain'} User Directory";
- synchronize_to_host_vcards = "{tmpl_var name='domain'}";
- vjud_mode = "{tmpl_var name='vjud_opt_mode'}";
-
\ No newline at end of file
diff --git a/server/conf/xmpp_metronome_conf_status.master b/server/conf/xmpp_metronome_conf_status.master
deleted file mode 100644
index daa82054915da514e053059180ff4da34a5b929e..0000000000000000000000000000000000000000
--- a/server/conf/xmpp_metronome_conf_status.master
+++ /dev/null
@@ -1,12 +0,0 @@
-Component "xmpp.{tmpl_var name='domain'}" "http"
- modules_enabled = {
- "server_status",
- "webpresence"
- };
- server_status_basepath = "/xmppd/";
- server_status_show_hosts = {
-{tmpl_var name='status_hosts'}
- };
- server_status_show_comps = {
-{tmpl_var name='status_comps'}
- };
\ No newline at end of file
diff --git a/server/conf/xmpp_prosody_conf_global.master b/server/conf/xmpp_prosody_conf_global.master
deleted file mode 100644
index ded6f753c6964f9c1056c190d785572dc157d596..0000000000000000000000000000000000000000
--- a/server/conf/xmpp_prosody_conf_global.master
+++ /dev/null
@@ -1,60 +0,0 @@
-plugin_paths = {
- "/usr/local/lib/prosody/modules",
-};
-use_libevent = true;
-log = {
- -- optional: uncomment debug log here
- -- debug = "/var/log/prosody/prosody.dbg",
- info = "/var/log/prosody/prosody.log",
- error = "/var/log/prosody/prosody.err",
- "syslog",
-};
-use_ipv6 = {tmpl_var name='ipv6'};
-http_ports = {
- {tmpl_var name='port_http'},
-};
-https_ports = {
- {tmpl_var name='port_https'},
-};
-pastebin_ports = {
- {tmpl_var name='port_pastebin'},
-};
-bosh_ports = {
- {tmpl_var name='port_bosh'},
-};
-admins = {
-{tmpl_var name='server_admins'}
-};
-modules_enabled = {
-{tmpl_var name='modules_enabled'}
-};
-modules_disabled = {
-};
-
-allow_registration = false;
-c2s_require_encryption = false;
-s2s_require_encryption = true;
-s2s_secure_auth = false;
-s2s_insecure_domains = {
- "gmail.com",
-};
-
-pidfile = "/var/run/prosody/prosody.pid";
-
-authentication = "external";
-
-archive_expires_after = "2w";
-
-statistics = "internal";
-
-certificates = "certs";
-bosh_max_inactivity = {tmpl_var name='bosh_timeout'};
-consider_bosh_secure = true;
-cross_domain_bosh = true;
-consider_websocket_secure = true;
-
-ssl = {
- key = "/etc/prosody/certs/localhost.key",
- certificate = "/etc/prosody/certs/localhost.crt",
-};
-
diff --git a/server/conf/xmpp_prosody_conf_host.master b/server/conf/xmpp_prosody_conf_host.master
deleted file mode 100644
index b45e955eb4a1e8f307787a2bb8e3f855f359ec81..0000000000000000000000000000000000000000
--- a/server/conf/xmpp_prosody_conf_host.master
+++ /dev/null
@@ -1,166 +0,0 @@
-VirtualHost "{tmpl_var name='domain'}"
- enabled = {tmpl_var name='active'};
- authentication = "external";
- external_auth_command = "/usr/local/lib/prosody/auth/authenticate_isp.sh";
- allow_registration = {tmpl_var name='public_registration'};
-
- registration_url = "{tmpl_var name='registration_url'}";
-
-
- registration_text = "{tmpl_var name='registration_message'}";
-
- no_registration_whitelist = true;
-
- modules_enabled = {
- "roster",
- "private",
- "vcard",
- "blocklist",
- "pep",
-
- "register",
-
- "register_redirect",
-
- "admin_adhoc",
- "http",
-
- "server_status",
-
-
- "webpresence"
-
- };
- disco_items = {
- {
- "{tmpl_var main_host}",
- "HTTP File Upload",
- },
-
- {
- "muc.{tmpl_var name='domain'}",
- "{tmpl_var name='muc_name'}",
- },
-
-
- {
- "pubsub.{tmpl_var name='domain'}",
- "{tmpl_var name='domain'} Publish/Subscribe",
- },
-
-
- {
- "proxy.{tmpl_var name='domain'}",
- "{tmpl_var name='domain'} Bytestream Proxy",
- },
-
-
- {
- "vjud.{tmpl_var name='domain'}",
- "{tmpl_var name='domain'} User Directory",
- },
-
- };
- admins = {
-{tmpl_var name='domain_admins'}
- };
-
- ssl = {
- key = "/etc/prosody/certs/{tmpl_var name='domain'}.key",
- certificate = "/etc/prosody/certs/{tmpl_var name='domain'}.crt",
- };
-
-
- http_host = 'xmpp.{tmpl_var name='domain'}';
-
- server_status_basepath = "/xmppd/";
- server_status_json = true;
- server_status_shown_hosts = {
- "{tmpl_var name='domain'}",
-
- "anon.fuermann.net",
-
- };
- server_status_shown_comps = {
-
- "pubsub.{tmpl_var name='domain'}",
-
-
- "proxy.{tmpl_var name='domain'}",
-
-
- "vjud.{tmpl_var name='domain'}",
-
-
- "muc.{tmpl_var name='domain'}",
-
- }
-
-
-
-Component "muc.{tmpl_var name='domain'}" "muc"
- modules_enabled = {
- "muc_limits",
- "muc_log",
-
- "muc_log_http",
-
-
- "pastebin",
-
- };
- muc_event_rate = 0.5;
- muc_burst_factor = 8;
- muc_log_presences = false;
-
- muc_log_http = {
- show_join = {tmpl_var name='archive_join'},
- show_presence = {tmpl_var name='archive_join'},
- show_status = {tmpl_var name='archive_status'},
- theme = "prosody",
- url_base = "logs",
- };
-
-
- pastebin_threshold = 500;
- pastebin_line_threshold = 4;
- pastebin_expire_after = {tmpl_var name='pastebin_expire'};
- pastebin_trigger = "{tmpl_var name='pastebin_trigger'}";
-
- name = "{tmpl_var name='muc_name'}";
- restrict_room_creation = "{tmpl_var name='muc_restrict_room_creation'}";
- max_history_messages = 20;
- admins = {
-{tmpl_var name='muc_admins'}
- };
-
-
-
-
-Component "pubsub.{tmpl_var name='domain'}" "pubsub"
- name = "{tmpl_var name='domain'} Publish/Subscribe";
-
-
-
-Component "proxy.{tmpl_var name='domain'}" "proxy65"
- proxy65_acl = {
- "{tmpl_var name='domain'}",
- };
-
-
-
-
-Component "vjud.{tmpl_var name='domain'}" "vjud"
- ud_disco_name = "{tmpl_var name='domain'} User Directory";
- vjud_mode = "{tmpl_var name='vjud_opt_mode'}";
-
-
-
-VirtualHost "anon.{tmpl_var name='domain'}"
- enabled = true;
- authentication = "anonymous";
- allow_anonymous_multiresourcing = true;
- anonymous_jid_gentoken = "{tmpl_var name='domain'} Anonymous User";
- admins = {
- };
-
diff --git a/server/conf/xmpp_prosody_conf_status.master b/server/conf/xmpp_prosody_conf_status.master
deleted file mode 100644
index 298ec88e92722ad3e07df72a673cabea76e641b7..0000000000000000000000000000000000000000
--- a/server/conf/xmpp_prosody_conf_status.master
+++ /dev/null
@@ -1,20 +0,0 @@
-Component "xmpp.{tmpl_var name='domain'}" "http"
- modules_enabled = {
-
- "server_status",
-
-
- "webpresence",
-
- };
-
-
- server_status_basepath = "/xmppd/";
- server_status_json = true;
- server_status_show_hosts = {
-{tmpl_var name='status_hosts'}
- };
- server_status_show_comps = {
-{tmpl_var name='status_comps'}
- };
-
\ No newline at end of file
diff --git a/server/mods-available/xmpp_module.inc.php b/server/mods-available/xmpp_module.inc.php
deleted file mode 100644
index f24f349aed37ee1e4596c637d4d064236f320ef9..0000000000000000000000000000000000000000
--- a/server/mods-available/xmpp_module.inc.php
+++ /dev/null
@@ -1,132 +0,0 @@
-plugins->announceEvents($this->module_name, $this->actions_available);
-
- /*
- As we want to get notified of any changes on several database tables,
- we register for them.
-
- The following function registers the function "functionname"
- to be executed when a record for the table "dbtable" is
- processed in the sys_datalog. "classname" is the name of the
- class that contains the function functionname.
- */
-
- $app->modules->registerTableHook('xmpp_domain', 'xmpp_module', 'process');
- $app->modules->registerTableHook('xmpp_user', 'xmpp_module', 'process');
- $app->services->registerService('xmpp', 'xmpp_module', 'reloadXMPP');
- $app->services->registerService('xmpp', 'xmpp_module', 'restartXMPP');
-
- }
-
- /*
- This function is called when a change in one of the registered tables is detected.
- The function then raises the events for the plugins.
- */
-
- function process($tablename, $action, $data) {
- global $app;
-
- switch ($tablename) {
- case 'xmpp_domain':
- if($action == 'i') $app->plugins->raiseEvent('xmpp_domain_insert', $data);
- if($action == 'u') $app->plugins->raiseEvent('xmpp_domain_update', $data);
- if($action == 'd') $app->plugins->raiseEvent('xmpp_domain_delete', $data);
- break;
- case 'xmpp_user':
- if($action == 'i') $app->plugins->raiseEvent('xmpp_user_insert', $data);
- if($action == 'u') $app->plugins->raiseEvent('xmpp_user_update', $data);
- if($action == 'd') $app->plugins->raiseEvent('xmpp_user_delete', $data);
- break;
- } // end switch
- } // end function
-
-
- function restartXMPP($action = 'restart') {
- global $app, $conf;
-
- // load the server configuration options
- $app->uses('getconf,system');
-
- $xmpp_config = $app->getconf->get_server_config($conf['server_id'], 'xmpp');
- $daemon = $xmpp_config['xmpp_daemon'];
-
- $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
-
-?>
diff --git a/server/plugins-available/server_services_plugin.inc.php b/server/plugins-available/server_services_plugin.inc.php
index 29710a72852376cf3bb0d4b34676f506787447ae..5b2eff74fc7ea849f03e914550566c95782cbb33 100644
--- a/server/plugins-available/server_services_plugin.inc.php
+++ b/server/plugins-available/server_services_plugin.inc.php
@@ -36,7 +36,7 @@ class server_services_plugin {
var $plugin_name = 'server_services_plugin';
var $class_name = 'server_services_plugin';
- var $services = array('mail_server', 'web_server', 'dns_server', 'db_server', 'vserver_server', 'xmpp_server');
+ var $services = array('mail_server', 'web_server', 'dns_server', 'db_server', 'vserver_server');
var $mail_plugins = array('getmail_plugin', 'mail_plugin', 'mail_plugin_dkim', 'mailman_plugin', 'postfix_filter_plugin', 'postfix_server_plugin');
var $courier_plugins = array('maildrop_plugin');
@@ -53,8 +53,6 @@ class server_services_plugin {
var $openvz_plugins = array('openvz_plugin');
- var $xmpp_plugins = array('xmpp_plugin');
-
function onInstall() {
return true;
@@ -118,9 +116,6 @@ class server_services_plugin {
case 'vserver_server':
$this->change_state($this->openvz_plugins, $value, $config);
break;
- case 'xmpp_server':
- $this->change_state($this->xmpp_plugins, $value, $config);
- break;
}
}
diff --git a/server/plugins-available/xmpp_plugin.inc.php b/server/plugins-available/xmpp_plugin.inc.php
deleted file mode 100644
index 7803e632366088ff997df52038db62b88ee7c72d..0000000000000000000000000000000000000000
--- a/server/plugins-available/xmpp_plugin.inc.php
+++ /dev/null
@@ -1,464 +0,0 @@
-uses("getconf");
- /*
- Register for the events
- */
-
- $app->plugins->registerEvent('server_insert', 'xmpp_plugin', 'insert');
- $app->plugins->registerEvent('server_update', 'xmpp_plugin', 'update');
-
- $app->plugins->registerEvent('xmpp_domain_insert', 'xmpp_plugin', 'ssl');
- $app->plugins->registerEvent('xmpp_domain_update', 'xmpp_plugin', 'ssl');
- $app->plugins->registerEvent('xmpp_domain_delete', 'xmpp_plugin', 'ssl');
-
- $app->plugins->registerEvent('xmpp_domain_insert', 'xmpp_plugin', 'domainInsert');
- $app->plugins->registerEvent('xmpp_domain_update', 'xmpp_plugin', 'domainUpdate');
- $app->plugins->registerEvent('xmpp_domain_delete', 'xmpp_plugin', 'domainDelete');
- $app->plugins->registerEvent('xmpp_user_insert', 'xmpp_plugin', 'userInsert');
- $app->plugins->registerEvent('xmpp_user_update', 'xmpp_plugin', 'userUpdate');
- $app->plugins->registerEvent('xmpp_user_delete', 'xmpp_plugin', 'userDelete');
-
- // set some params
- $xmpp_config = $app->getconf->get_server_config($conf['server_id'], 'xmpp');
- $daemon = $xmpp_config['xmpp_daemon'];
- $this->daemon = $daemon;
- $this->xmpp_config_dir = "/etc/${daemon}";
- }
-
- function insert($event_name, $data) {
- global $app, $conf;
-
- $this->update($event_name, $data);
-
- }
-
- // The purpose of this plugin is to rewrite the main.cf file
- function update($event_name, $data) {
- global $app, $conf;
-
- // get the config
- $app->uses("getconf,system,tpl");
-
- $old_ini_data = $app->ini_parser->parse_ini_string($data['old']['config']);
- $xmpp_config = $app->getconf->get_server_config($conf['server_id'], 'xmpp');
-
- // Global server config
- $tpl = new tpl();
- $tpl->newTemplate("xmpp_{$this->daemon}_conf_global.master");
- $tpl->setVar('ipv6', $xmpp_config['xmpp_use_ipv6']=='y'?'true':'false');
- $tpl->setVar('bosh_timeout', intval($xmpp_config['xmpp_bosh_max_inactivity']));
- $tpl->setVar('port_http', intval($xmpp_config['xmpp_port_http']));
- $tpl->setVar('port_https', intval($xmpp_config['xmpp_port_https']));
- $tpl->setVar('port_pastebin', intval($xmpp_config['xmpp_port_pastebin']));
- $tpl->setVar('port_bosh', intval($xmpp_config['xmpp_port_bosh']));
- // Global server admins (for all hosted domains)
- $admins = '';
- foreach(explode(',', $xmpp_config['xmpp_server_admins']) AS $a)
- $admins.= "\t\"".trim($a)."\",\n";
- $tpl->setVar('server_admins', $admins);
- unset($admins);
- // enabled modules, so own modules or simmilar prosody-modules can easily be added
- $modules = '';
- foreach(explode(',', $xmpp_config['xmpp_modules_enabled']) AS $m)
- $modules.= "\t\"".trim($m)."\",\n";
- $tpl->setVar('modules_enabled', $modules);
- unset($modules);
- $app->system->file_put_contents($this->xmpp_config_dir.'/global.cfg.lua', $tpl->grab());
- unset($tpl);
-
- $app->services->restartServiceDelayed('xmpp', 'restart');
- return;
- }
-
- function domainInsert($event_name, $data) {
- global $app, $conf;
-
- $this->domainUpdate($event_name, $data);
- // Need to restart the server
- $app->services->restartServiceDelayed('xmpp', 'restart');
-
- }
-
- function domainUpdate($event_name, $data){
- global $app, $conf;
-
- // get the config
- $app->uses("getconf,system,tpl");
-
- // Collections
- $status_hosts = array($data['new']['domain']);
- $status_comps = array();
-
- // Create main host file
- $tpl = new tpl();
- $tpl->newTemplate("xmpp_{$this->daemon}_conf_host.master");
- $tpl->setVar('main_host', $conf['serverconfig']['server']['hostname']);
- $tpl->setVar('domain', $data['new']['domain']);
- $tpl->setVar('active', $data['new']['active'] == 'y' ? 'true' : 'false');
- $tpl->setVar('public_registration', $data['new']['public_registration'] == 'y' ? 'true' : 'false');
- $tpl->setVar('registration_url', $data['new']['registration_url']);
- $tpl->setVar('registration_message', $data['new']['registration_message']);
-
- // Domain admins
- $admins = array();
- foreach(explode(',',$data['new']['domain_admins']) AS $adm){
- $admins[] = trim($adm);
- }
- $tpl->setVar('domain_admins', "\t\t\"".implode("\",\n\t\t\"",$admins)."\"\n");
-
- // Enable / Disable features
- $tpl->setVar('use_status_host', $data['new']['use_status_host'] == 'y' ? 'true' : 'false');
- $tpl->setVar('use_webpresence', $data['new']['use_webpresence'] == 'y' ? 'true' : 'false');
- if($data['new']['use_pubsub']=='y'){
- $tpl->setVar('use_pubsub', 'true');
- $status_comps[] = 'pubsub.'.$data['new']['domain'];
- }else{
- $tpl->setVar('use_pubsub', 'false');
- }
- if($data['new']['use_proxy']=='y'){
- $tpl->setVar('use_proxy', 'true');
- $status_comps[] = 'proxy.'.$data['new']['domain'];
- }else{
- $tpl->setVar('use_proxy', 'false');
- }
-
- if($data['new']['use_anon_host']=='y'){
- $tpl->setVar('use_anon_host', 'true');
- $status_hosts[] = 'anon.'.$data['new']['domain'];
- }else{
- $tpl->setVar('use_anon_host', 'false');
- }
- if($data['new']['use_vjud']=='y'){
- $tpl->setVar('use_vjud', 'true');
- $tpl->setVar('vjud_opt_mode', 'opt-'.$data['new']['vjud_opt_mode']);
- $status_comps[] = 'vjud.'.$data['new']['domain'];
- }else{
- $tpl->setVar('use_vjud', 'false');
- }
- if($data['new']['use_muc_host']=='y'){
- $tpl->setVar('use_http_upload', 'true');
- $status_comps[] = 'upload.'.$data['new']['domain'];
- }else{
- $tpl->setVar('use_http_upload', 'false');
- }
-
- $tpl->setVar('use_muc', $data['new']['use_muc_host']=='y'?'true':'false');
- if($data['new']['use_muc_host'] == 'y'){
- $status_comps[] = 'muc.'.$data['new']['domain'];
- switch($data['new']['muc_restrict_room_creation']) {
- case 'n':
- $tpl->setVar('muc_restrict_room_creation', 'false');
- break;
- case 'y':
- $tpl->setVar('muc_restrict_room_creation', 'admin');
- break;
- case 'm':
- $tpl->setVar('muc_restrict_room_creation', 'local');
- break;
- }
- $tpl->setVar('muc_name', strlen($data['new']['muc_name']) ? $data['new']['muc_name'] : $data['new']['domain'].' Chatrooms');
- // Admins for MUC channels
- $admins = array();
- foreach(explode(',',$data['new']['muc_admins']) AS $adm){
- $admins[] = trim($adm);
- }
- $tpl->setVar('muc_admins', "\t\t\"".implode("\",\n\t\t\"",$admins)."\"\n");
- $tpl->setVar('use_pastebin', $data['new']['use_pastebin']=='y'?'true':'false');
- $tpl->setVar('pastebin_expire', intval($data['new']['pastebin_expire_after']));
- $tpl->setVar('pastebin_trigger', $data['new']['pastebin_trigger']);
- $tpl->setVar('use_archive', $data['new']['use_http_archive']=='y'?'true':'false');
- $tpl->setVar('archive_join', $data['new']['http_archive_show_join']=='y'?'true':'false');
- $tpl->setVar('archive_status', $data['new']['http_archive_show_status']=='y'?'true':'false');
-
- }
-
- // Check for SSL
- if(strlen($data['new']['ssl_cert']) && strlen($data['new']['ssl_key']) && !$this->ssl_certificate_deleted || $this->ssl_certificate_changed)
- $tpl->setVar('ssl_cert', true);
-
- $app->system->file_put_contents($this->xmpp_config_dir.'/hosts/'.$data['new']['domain'].'.cfg.lua', $tpl->grab());
- unset($tpl);
-
- // Create http host file
- //$tpl = new tpl;
- //$tpl->newTemplate("xmpp_{$this->daemon}_conf_status.master");
- //$tpl->setVar('domain', $data['new']['domain']);
- //$httpMods = 0;
- //$tpl->setVar('use_webpresence', $data['new']['use_webpresence'] == 'y' ? 'true' : 'false');
- //if($data['new']['use_webpresence']=='y') {
- // $httpMods++;
- //}
- //$tpl->setVar('use_status_host', $data['new']['use_status_host'] == 'y' ? 'true' : 'false');
- //if($data['new']['use_status_host']=='y'){
- // $httpMods++;
- // $tpl->setVar('status_hosts', "\t\t\"".implode("\",\n\t\t\"",$status_hosts)."\"\n");
- // $tpl->setVar('status_comps', "\t\t\"".implode("\",\n\t\t\"",$status_comps)."\"\n");
- //}
- //if($httpMods > 0){
- // $app->system->file_put_contents($this->xmpp_config_dir.'/status/'.$data['new']['domain'].'.cfg.lua', $tpl->grab());
- //} else {
- // unlink($this->xmpp_config_dir.'/status/'.$data['new']['domain'].'.cfg.lua');
- //}
- //unset($tpl);
-
- $app->services->restartServiceDelayed('xmpp', 'reload');
- }
-
- function domainDelete($event_name, $data){
- global $app, $conf;
-
- // get the config
- $app->uses("system");
- $domain = $data['old']['domain'];
-
- // Remove config files
- $app->system->unlink("/etc/{$this->daemon}/hosts/$domain.cfg.lua");
- $app->system->unlink("/etc/{$this->daemon}/status/$domain.cfg.lua");
- if($this->daemon === 'prosody')
- $app->system->unlink("/etc/{$this->daemon}/certs/$domain.crt");
- else
- $app->system->unlink("/etc/{$this->daemon}/certs/$domain.cert");
- $app->system->unlink("/etc/{$this->daemon}/certs/$domain.key");
- $app->system->unlink("/etc/{$this->daemon}/certs/$domain.csr");
- // Remove all stored data
- $folder = str_replace('-', '%2d', str_replace('.', '%2e', $str = urlencode($domain)));
-
- exec("rm -rf /var/lib/{$this->daemon}/{$folder}");
- exec("rm -rf /var/lib/{$this->daemon}/*%2e{$folder}");
- switch($this->daemon) {
- case 'metronome':
- break;
- case 'prosody':
- exec("php /usr/local/lib/prosody/auth/prosody-purge domain {$domain}");
- break;
- }
-
- $app->services->restartServiceDelayed('xmpp', 'restart');
- }
-
- function userInsert($event_name, $data){
- //$data['new']['auth_method']
- // Check domain for auth settings
- // Don't allow manual user creation for mailaccount controlled domains
-
- // maybe metronomectl adduser for new local users
- }
- function userUpdate($event_name, $data){
- // Check domain for auth settings
- // Don't allow manual user update for mailaccount controlled domains
-
- // maybe metronomectl passwd for existing local users
- }
- function userDelete($event_name, $data){
- // Check domain for auth settings
- // Don't allow manual user deletion for mailaccount controlled domains
-
- $jid_parts = explode('@', $data['old']['jid']);
-
- switch($this->daemon) {
- case 'metronome':
- // Remove account from metronome
- exec("{$this->daemon}ctl deluser {$data['old']['jid']}");
- break;
- case 'prosody':
- exec("php /usr/local/lib/prosody/auth/prosody-purge user {$jid_parts[1]} {$jid_parts[0]}");
- break;
- }
- }
-
- // Handle the creation of SSL certificates
- function ssl($event_name, $data) {
- global $app, $conf;
-
- $app->uses('system,tpl');
-
- // load the server configuration options
- $app->uses('getconf');
-
- $ssl_dir = "/etc/{$this->daemon}/certs";
- $domain = $data['new']['domain'];
- $cnf_file = $ssl_dir.'/'.$domain.'.cnf';
- $key_file = $ssl_dir.'/'.$domain.'.key';
- $csr_file = $ssl_dir.'/'.$domain.'.csr';
- if ($this->daemon === 'prosody') {
- $crt_file = $ssl_dir.'/'.$domain.'.crt';
- } else {
- $crt_file = $ssl_dir.'/'.$domain.'.cert';
- }
-
-
- //* Create a SSL Certificate, but only if this is not a mirror server.
- if($data['new']['ssl_action'] == 'create' && $conf['mirror_server_id'] == 0) {
-
- $this->ssl_certificate_changed = true;
-
- //* Rename files if they exist
- if(file_exists($cnf_file)) $app->system->rename($cnf_file, $cnf_file.'.bak');
- if(file_exists($key_file)){
- $app->system->rename($key_file, $key_file.'.bak');
- $app->system->chmod($key_file.'.bak', 0400);
- $app->system->chown($key_file.'.bak', $this->daemon);
- }
- if(file_exists($csr_file)) $app->system->rename($csr_file, $csr_file.'.bak');
- if(file_exists($crt_file)) $app->system->rename($crt_file, $crt_file.'.bak');
-
- // Write new CNF file
- $tpl = new tpl();
- $tpl->newTemplate('xmpp_conf_ssl.master');
- $tpl->setVar('domain', $domain);
- $tpl->setVar('ssl_country', $data['new']['ssl_country']);
- $tpl->setVar('ssl_locality', $data['new']['ssl_locality']);
- $tpl->setVar('ssl_organisation', $data['new']['ssl_organisation']);
- $tpl->setVar('ssl_organisation_unit', $data['new']['ssl_organisation_unit']);
- $tpl->setVar('ssl_email', $data['new']['ssl_email']);
- $app->system->file_put_contents($cnf_file, $tpl->grab());
-
- // Generate new key, csr and cert
- exec("(cd /etc/{$this->daemon}/certs && make $domain.key)");
- exec("(cd /etc/{$this->daemon}/certs && make $domain.csr)");
- if ($this->daemon === 'prosody') {
- exec("(cd /etc/{$this->daemon}/certs && make $domain.crt)");
- } else {
- exec("(cd /etc/{$this->daemon}/certs && make $domain.cert)");
- }
-
- $ssl_key = $app->system->file_get_contents($key_file);
- $app->system->chmod($key_file, 0400);
- $app->system->chown($key_file, $this->daemon);
- $ssl_request = $app->system->file_get_contents($csr_file);
- $ssl_cert = $app->system->file_get_contents($crt_file);
- /* Update the DB of the (local) Server */
- $app->db->query("UPDATE xmpp_domain SET ssl_request = ?, ssl_cert = ?, ssl_key = ? WHERE domain = ?", $ssl_request, $ssl_cert, $ssl_key, $data['new']['domain']);
- $app->db->query("UPDATE xmpp_domain SET ssl_action = '' WHERE domain = ?", $data['new']['domain']);
- /* Update also the master-DB of the Server-Farm */
- $app->dbmaster->query("UPDATE xmpp_domain SET ssl_request = ?, ssl_cert = ?, ssl_key = ? WHERE domain = ?", $ssl_request, $ssl_cert, $ssl_key, $data['new']['domain']);
- $app->dbmaster->query("UPDATE xmpp_domain SET ssl_action = '' WHERE domain = ?", $data['new']['domain']);
- $app->log('Creating XMPP SSL Cert for: '.$domain, LOGLEVEL_DEBUG);
- }
-
- //* Save a SSL certificate to disk
- if($data["new"]["ssl_action"] == 'save') {
- $this->ssl_certificate_changed = true;
-
- //* Rename files if they exist
- if(file_exists($cnf_file)) $app->system->rename($cnf_file, $cnf_file.'.bak');
- if(file_exists($key_file)){
- $app->system->rename($key_file, $key_file.'.bak');
- $app->system->chmod($key_file.'.bak', 0400);
- $app->system->chown($key_file.'.bak', $this->daemon);
- }
- if(file_exists($csr_file)) $app->system->rename($csr_file, $csr_file.'.bak');
- if(file_exists($crt_file)) $app->system->rename($crt_file, $crt_file.'.bak');
-
- //* Write new ssl files
- if(trim($data["new"]["ssl_request"]) != '')
- $app->system->file_put_contents($csr_file, $data["new"]["ssl_request"]);
- if(trim($data["new"]["ssl_cert"]) != '')
- $app->system->file_put_contents($crt_file, $data["new"]["ssl_cert"]);
-
- //* Write the key file, if field is empty then import the key into the db
- if(trim($data["new"]["ssl_key"]) != '') {
- $app->system->file_put_contents($key_file, $data["new"]["ssl_key"]);
- $app->system->chmod($key_file, 0400);
- $app->system->chown($key_file, $this->daemon);
- } else {
- $ssl_key = $app->system->file_get_contents($key_file);
- /* Update the DB of the (local) Server */
- $app->db->query("UPDATE xmpp_domain SET ssl_key = ? WHERE domain = ?", $ssl_key, $data['new']['domain']);
- /* Update also the master-DB of the Server-Farm */
- $app->dbmaster->query("UPDATE xmpp_domain SET ssl_key = '$ssl_key' WHERE domain = ?", $data['new']['domain']);
- }
-
- /* Update the DB of the (local) Server */
- $app->db->query("UPDATE xmpp_domain SET ssl_action = '' WHERE domain = ?", $data['new']['domain']);
-
- /* Update also the master-DB of the Server-Farm */
- $app->dbmaster->query("UPDATE xmpp_domain SET ssl_action = '' WHERE domain = ?", $data['new']['domain']);
- $app->log('Saving XMPP SSL Cert for: '.$domain, LOGLEVEL_DEBUG);
- }
-
- //* Delete a SSL certificate
- if($data['new']['ssl_action'] == 'del') {
- $this->ssl_certificate_deleted = true;
- $app->system->unlink($csr_file);
- $app->system->unlink($crt_file);
- $app->system->unlink($key_file);
- $app->system->unlink($cnf_file);
- $app->system->unlink($csr_file.'.bak');
- $app->system->unlink($crt_file.'.bak');
- $app->system->unlink($key_file.'.bak');
- $app->system->unlink($cnf_file.'.bak');
- /* Update the DB of the (local) Server */
- $app->db->query("UPDATE xmpp_domain SET ssl_request = '', ssl_cert = '', ssl_key = '' WHERE domain = ?", $data['new']['domain']);
- $app->db->query("UPDATE xmpp_domain SET ssl_action = '' WHERE domain = ?", $data['new']['domain']);
- /* Update also the master-DB of the Server-Farm */
- $app->dbmaster->query("UPDATE xmpp_domain SET ssl_request = '', ssl_cert = '', ssl_key = '' WHERE domain = ?", $data['new']['domain']);
- $app->dbmaster->query("UPDATE xmpp_domain SET ssl_action = '' WHERE domain = ?", $data['new']['domain']);
- $app->log('Deleting SSL Cert for: '.$domain, LOGLEVEL_DEBUG);
- }
-
- }
-
-} // end class
-
-?>