diff --git a/addons/empty.dir b/addons/empty.dir new file mode 100644 index 0000000000000000000000000000000000000000..95ba9ef37cca69318bcba17e67cd44ae84bd41e1 --- /dev/null +++ b/addons/empty.dir @@ -0,0 +1 @@ +This empty directory is needed by ISPConfig. diff --git a/docs/autoinstall_samples/autoinstall.conf_sample.php b/docs/autoinstall_samples/autoinstall.conf_sample.php index b5f3a577305e2780ae1c5de46138e08d72d53c6b..922664629f93bf66f7ac4adb0d53e1d8c1c24f2a 100644 --- a/docs/autoinstall_samples/autoinstall.conf_sample.php +++ b/docs/autoinstall_samples/autoinstall.conf_sample.php @@ -57,9 +57,7 @@ $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 ?> \ No newline at end of file diff --git a/helper_scripts/setup_in_openvz/diff_openssl.cnf b/helper_scripts/setup_in_openvz/diff_openssl.cnf deleted file mode 100644 index 4a3c7e6aa19504cb5f646cefe8c29ee57952826e..0000000000000000000000000000000000000000 --- a/helper_scripts/setup_in_openvz/diff_openssl.cnf +++ /dev/null @@ -1,25 +0,0 @@ -# diff openssl.cnf /usr/lib/ssl/openssl.cnf -68c68 -< default_days = 3653 # how long to certify for ---- -> default_days = 365 # how long to certify for -125c125 -< countryName_default = YOURCOUNTRY ---- -> countryName_default = AU -130c130 -< stateOrProvinceName_default = YOURPROVINCE ---- -> stateOrProvinceName_default = Some-State -135c135 -< 0.organizationName_default = YOURDOMAIN ---- -> 0.organizationName_default = Internet Widgits Pty Ltd -142c142 -< organizationalUnitName_default = ISP ---- -> #organizationalUnitName_default = -145d144 -< commonName_default = YOURHOSTNAME -149d147 -< emailAddress_default = postmaster@YOURDOMAIN diff --git a/helper_scripts/setup_in_openvz/install_server.sh b/helper_scripts/setup_in_openvz/install_server.sh deleted file mode 100644 index 1cc05841703b3fe7cb268b4086ea90d8991a9261..0000000000000000000000000000000000000000 --- a/helper_scripts/setup_in_openvz/install_server.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash -# Script to configuring an ispconfig3 server in a Debian VPS -# by calocen [at] gmail [dot] com - -# getting some enviromment values -myhostname=`hostname -f` -mydomain=`hostname -d` -myip=`hostname -i` -[ ! -x /usr/bin/geoiplookup ] && apt-get --assume-yes install geoip-bin -mycountry=`geoiplookup $myip | cut -f4 -d" " | cut -f1 -d","` -myprovince=`geoiplookup $myip | cut -f5 -d" "` - -# reconfiguring webalizer, postfix -# could be cool to modify here webalizer values -dpkg-reconfigure -u webalizer -postconf -e "myhostname = $myhostname" -postconf -e "mydestination = $myhostname, localhost" -echo $myhostname > /etc/mailname -dpkg-reconfigure -u postfix - -# request new password -oldpwd=`grep password /root/.my.cnf | tr "\t" " " | tr -s " " | cut -f3 -d" "` -read -p "mysql password: [$oldpwd] " mysqlpwd -[ -z $mysqlpwd ] && mysqlpwd=$oldpwd -echo $mysqlpwd -#read -p "Are you sure? (y/n) " sure -## who said fear ## -set -x -mysqladmin -u root -p$oldpwd password $mysqlpwd -mysqladmin -u root -p$mysqlpwd -h localhost password $mysqlpwd -cat << EOF > /root/.my.cnf -[client] -password = $mysqlpwd -EOF -chmod 600 /root/.my.cnf - -# changing mydns password -mysql -e "SET PASSWORD FOR 'mydns'@'%' = PASSWORD( '$mysqlpwd' )" -mysql -e "SET PASSWORD FOR 'mydns'@'localhost' = PASSWORD( '$mysqlpwd' )" -cp -ax /etc/mydns.conf /etc/mydns.conf~ -sed s/$oldpwd/$mysqlpwd/g < /etc/mydns.conf~ > /etc/mydns.conf - -# enabling mydns -mydns --create-tables > /tmp/mydns.sql -mysql -e "CREATE DATABASE IF NOT EXISTS mydns ; USE mydns ; SOURCE /tmp/mydns.sql;" -rm /tmp/mydns.* -invoke-rc.d mydns restart - -# preparing server installation -mv /etc/ssl/openssl.cnf /etc/ssl/openssl.cnf~ -sed s/"YOURHOSTNAME"/"$myhostname"/g < /usr/local/bin/openssl.cnf | -sed s/"YOURDOMAIN"/"$mydomain"/g | \ -sed s/"YOURCOUNTRY"/"$mycountry"/g | \ -sed s/"YOURPROVINCE"/"$myprovince"/g > /etc/ssl/openssl.cnf - -tar xfz /root/downloads/ISPConfig-3.0.0.7-beta.tar.gz -C /usr/local/src -# here would be some stuff to update from SVN -cd /usr/local/src/ispconfig3_install/install/ -php -q install.php - - diff --git a/helper_scripts/setup_in_openvz/recreate_ssh_and_hostname.sh b/helper_scripts/setup_in_openvz/recreate_ssh_and_hostname.sh deleted file mode 100644 index 72c2ab61a2779f8acaa69ae32225c89e31187862..0000000000000000000000000000000000000000 --- a/helper_scripts/setup_in_openvz/recreate_ssh_and_hostname.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -set -x -echo "" > /etc/resolv.conf -echo "" > /etc/hostname -echo "" > /etc/mailname -rm -f /etc/ssh/ssh_host_* -cat << EOF > /etc/rc2.d/S15ssh_gen_host_keys -#!/bin/bash -ssh-keygen -f /etc/ssh/ssh_host_rsa_key -t rsa -N '' -ssh-keygen -f /etc/ssh/ssh_host_dsa_key -t dsa -N '' -dpkg-reconfigure -u webalizer -postconf -e "myhostname = $(hostname -f)" -postconf -e "mydestination = $(hostname -f), localhost" -echo $(hostname -f) > /etc/mailname -dpkg-reconfigure -u postfix -rm -f \$0 -EOF -chmod a+x /etc/rc2.d/S15ssh_gen_host_keys diff --git a/helper_scripts/test_mailqueue.php b/helper_scripts/test_mailqueue.php new file mode 100644 index 0000000000000000000000000000000000000000..0d5600b390ae02020d4a19e766bc7186060fe99a --- /dev/null +++ b/helper_scripts/test_mailqueue.php @@ -0,0 +1,45 @@ +auth->check_module_permissions('admin'); + +$app->uses('getconf,ispcmail'); +$mail_config = $app->getconf->get_global_config('mail'); +if($mail_config['smtp_enabled'] == 'y') { + $mail_config['use_smtp'] = true; + $app->ispcmail->setOptions($mail_config); +} + +$to = 't.heller@timmehosting.de'; +$subject = 'Test von ISPConfig-Mailqueue'; +$text = '123'."\n\n".date(DATE_RFC822)."\n\n".'SMTP: '.$mail_config['use_smtp']; +$from = 'ispconfig@thomas.timmeserver.de'; +$filepath = ''; +$filetype = 'application/pdf'; +$filename = ''; +$cc = ''; +$bcc = ''; +$from_name = 'ISPConfig'; + +$app->ispcmail->setSender($from, $from_name); +$app->ispcmail->setSubject($subject); +$app->ispcmail->setMailText($text); + +if($filepath != '') { + if(!file_exists($filepath)) $app->error("Mail attachement does not exist ".$filepath); + $app->ispcmail->readAttachFile($filepath); +} + +if($cc != '') $app->ispcmail->setHeader('Cc', $cc); +if($bcc != '') $app->ispcmail->setHeader('Bcc', $bcc); + +$app->ispcmail->send($to); +$app->ispcmail->finish(); + +echo $text; + diff --git a/install/apps/metronome-init b/install/apps/metronome-init deleted file mode 100644 index 19e0a19c086dc43954a0a6921e49b89f1d0327ef..0000000000000000000000000000000000000000 --- a/install/apps/metronome-init +++ /dev/null @@ -1,75 +0,0 @@ -#! /bin/sh -# -# metronome Start/stop metronome server -# - -### BEGIN INIT INFO -# Provides: metronome -# Required-Start: $remote_fs $network $named $time -# Required-Stop: $remote_fs $network $named $time -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Starts metronome server -# Description: Starts metronome server, an XMPP server written in Lua. -### END INIT INFO - -METRONOME=/usr/bin/metronomectl -PIDDIR=/var/run/metronome -NAME=metronome - -test -e $METRONOME || exit 0 - -start() -{ - mkdir $PIDDIR -p - chown metronome:metronome $PIDDIR - chmod 750 $PIDDIR - - $METRONOME start >> /dev/null -} - -stop() -{ - $METRONOME stop >> /dev/null -} - -reload() -{ - $METRONOME reload >> /dev/null -} - -restart() -{ - $METRONOME restart >> /dev/null -} - -case "$1" in - start) - echo -n "Starting Metronome..." - start & - ;; - stop) - echo -n "Stopping Metronome..." - stop & - ;; - reload) - echo -n "Reloading Metronome config..." - reload & - ;; - restart) - echo -n "Restarting Metronome..." - restart & - ;; - *) - echo "Usage: $0 {start|stop|reload|restart}" >&2 - exit 1 - ;; -esac - -if [ $? -eq 0 ]; then - echo . -else - echo " failed!" -fi - -exit 0 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/centos52.conf.php b/install/dist/conf/centos52.conf.php deleted file mode 100644 index 77462bd7f4a1cb8392832853a8af10308205a30b..0000000000000000000000000000000000000000 --- a/install/dist/conf/centos52.conf.php +++ /dev/null @@ -1,223 +0,0 @@ - diff --git a/install/dist/conf/centos53.conf.php b/install/dist/conf/centos53.conf.php deleted file mode 100644 index 77462bd7f4a1cb8392832853a8af10308205a30b..0000000000000000000000000000000000000000 --- a/install/dist/conf/centos53.conf.php +++ /dev/null @@ -1,223 +0,0 @@ - diff --git a/install/dist/conf/centos70.conf.php b/install/dist/conf/centos70.conf.php index c3076c4aab5c8fb531bbe898d683aff0341d1dac..08afc5441ef22ca2bd24868b94c6cc7e32afa55d 100644 --- a/install/dist/conf/centos70.conf.php +++ b/install/dist/conf/centos70.conf.php @@ -50,7 +50,8 @@ $conf['services']['web'] = true; $conf['services']['dns'] = true; $conf['services']['file'] = true; $conf['services']['db'] = true; -$conf['services']['vserver'] = true; +$conf['services']['proxy'] = false; +$conf['services']['firewall'] = false; //* MySQL $conf['mysql']['installed'] = false; // will be detected automatically during installation @@ -113,44 +114,26 @@ $conf['postfix']['vmail_groupid'] = '5000'; $conf['postfix']['vmail_groupname'] = 'vmail'; $conf['postfix']['vmail_mailbox_base'] = '/var/vmail'; -//* Mailman -$conf['mailman']['installed'] = false; // will be detected automatically during installation -$conf['mailman']['config_dir'] = '/etc/mailman'; -$conf['mailman']['init_script'] = 'mailman'; - -//* mlmmj -$conf['mlmmj']['installed'] = false; // will be detected automatically during installation -$conf['mlmmj']['config_dir'] = '/etc/mlmmj'; - //* Getmail $conf['getmail']['installed'] = false; // will be detected automatically during installation $conf['getmail']['config_dir'] = '/etc/getmail'; $conf['getmail']['program'] = '/usr/bin/getmail'; -//* Courier -$conf['courier']['installed'] = false; // will be detected automatically during installation -$conf['courier']['config_dir'] = '/etc/authlib'; -$conf['courier']['courier-authdaemon'] = 'courier-authlib'; -$conf['courier']['courier-imap'] = 'courier-imap'; -$conf['courier']['courier-imap-ssl'] = ''; -$conf['courier']['courier-pop'] = ''; -$conf['courier']['courier-pop-ssl'] = ''; - //* Dovecot $conf['dovecot']['installed'] = false; // will be detected automatically during installation $conf['dovecot']['config_dir'] = '/etc'; $conf['dovecot']['init_script'] = 'dovecot'; -//* SASL -$conf['saslauthd']['installed'] = false; // will be detected automatically during installation -$conf['saslauthd']['config'] = '/etc/sysconfig/saslauthd'; -$conf['saslauthd']['init_script'] = 'saslauthd'; - //* Amavisd $conf['amavis']['installed'] = false; // will be detected automatically during installation $conf['amavis']['config_dir'] = '/etc/amavisd'; $conf['amavis']['init_script'] = 'amavisd'; +//* Rspamd +$conf['rspamd']['installed'] = false; // will be detected automatically during installation +$conf['rspamd']['config_dir'] = '/etc/rspamd'; +$conf['rspamd']['init_script'] = 'rspamd'; + //* ClamAV $conf['clamav']['installed'] = false; // will be detected automatically during installation $conf['clamav']['init_script'] = 'clamd@amavisd'; @@ -209,6 +192,10 @@ $conf['nginx']['php_fpm_pool_dir'] = '/etc/php-fpm.d'; $conf['nginx']['php_fpm_start_port'] = 9010; $conf['nginx']['php_fpm_socket_dir'] = '/var/lib/php5-fpm'; +//*Bastille-Firwall +$conf['bastille']['installed'] = false; +$conf['bastille']['config_dir'] = '/etc/Bastille'; + //* vlogger $conf['vlogger']['config_dir'] = '/etc'; @@ -216,8 +203,3 @@ $conf['vlogger']['config_dir'] = '/etc'; $conf['cron']['init_script'] = 'crond'; $conf['cron']['crontab_dir'] = '/etc/cron.d'; $conf['cron']['wget'] = '/usr/bin/wget'; - -//* OpenVZ -$conf['openvz']['installed'] = false; - -?> diff --git a/install/dist/conf/centos72.conf.php b/install/dist/conf/centos72.conf.php index b6cbcabe216328f736d22ef4b0b12f24b5ef0c6b..a0b118308108f4897d29569fcf639977e0a97a4b 100644 --- a/install/dist/conf/centos72.conf.php +++ b/install/dist/conf/centos72.conf.php @@ -50,7 +50,8 @@ $conf['services']['web'] = true; $conf['services']['dns'] = true; $conf['services']['file'] = true; $conf['services']['db'] = true; -$conf['services']['vserver'] = true; +$conf['services']['proxy'] = false; +$conf['services']['firewall'] = false; //* MySQL $conf['mysql']['installed'] = false; // will be detected automatically during installation @@ -113,44 +114,26 @@ $conf['postfix']['vmail_groupid'] = '5000'; $conf['postfix']['vmail_groupname'] = 'vmail'; $conf['postfix']['vmail_mailbox_base'] = '/var/vmail'; -//* Mailman -$conf['mailman']['installed'] = false; // will be detected automatically during installation -$conf['mailman']['config_dir'] = '/etc/mailman'; -$conf['mailman']['init_script'] = 'mailman'; - -//* mlmmj -$conf['mlmmj']['installed'] = false; // will be detected automatically during installation -$conf['mlmmj']['config_dir'] = '/etc/mlmmj'; - //* Getmail $conf['getmail']['installed'] = false; // will be detected automatically during installation $conf['getmail']['config_dir'] = '/etc/getmail'; $conf['getmail']['program'] = '/usr/bin/getmail'; -//* Courier -$conf['courier']['installed'] = false; // will be detected automatically during installation -$conf['courier']['config_dir'] = '/etc/authlib'; -$conf['courier']['courier-authdaemon'] = 'courier-authlib'; -$conf['courier']['courier-imap'] = 'courier-imap'; -$conf['courier']['courier-imap-ssl'] = ''; -$conf['courier']['courier-pop'] = ''; -$conf['courier']['courier-pop-ssl'] = ''; - //* Dovecot $conf['dovecot']['installed'] = false; // will be detected automatically during installation $conf['dovecot']['config_dir'] = '/etc/dovecot'; $conf['dovecot']['init_script'] = 'dovecot'; -//* SASL -$conf['saslauthd']['installed'] = false; // will be detected automatically during installation -$conf['saslauthd']['config'] = '/etc/sysconfig/saslauthd'; -$conf['saslauthd']['init_script'] = 'saslauthd'; - //* Amavisd $conf['amavis']['installed'] = false; // will be detected automatically during installation $conf['amavis']['config_dir'] = '/etc/amavisd'; $conf['amavis']['init_script'] = 'amavisd'; +//* Rspamd +$conf['rspamd']['installed'] = false; // will be detected automatically during installation +$conf['rspamd']['config_dir'] = '/etc/rspamd'; +$conf['rspamd']['init_script'] = 'rspamd'; + //* ClamAV $conf['clamav']['installed'] = false; // will be detected automatically during installation $conf['clamav']['init_script'] = 'clamd@amavisd'; @@ -209,6 +192,10 @@ $conf['nginx']['php_fpm_pool_dir'] = '/etc/php-fpm.d'; $conf['nginx']['php_fpm_start_port'] = 9010; $conf['nginx']['php_fpm_socket_dir'] = '/var/lib/php5-fpm'; +//*Bastille-Firwall +$conf['bastille']['installed'] = false; +$conf['bastille']['config_dir'] = '/etc/Bastille'; + //* vlogger $conf['vlogger']['config_dir'] = '/etc'; @@ -216,8 +203,3 @@ $conf['vlogger']['config_dir'] = '/etc'; $conf['cron']['init_script'] = 'crond'; $conf['cron']['crontab_dir'] = '/etc/cron.d'; $conf['cron']['wget'] = '/usr/bin/wget'; - -//* OpenVZ -$conf['openvz']['installed'] = false; - -?> diff --git a/install/dist/conf/debian40.conf.php b/install/dist/conf/debian40.conf.php index a85841e4ff6c6d40b53cd70880313f0c2a867245..c2eb4953380b47b814ac7b4beb6d1da3b258e991 100644 --- a/install/dist/conf/debian40.conf.php +++ b/install/dist/conf/debian40.conf.php @@ -50,7 +50,6 @@ $conf['services']['web'] = true; $conf['services']['dns'] = true; $conf['services']['file'] = true; $conf['services']['db'] = true; -$conf['services']['vserver'] = true; $conf['services']['proxy'] = false; $conf['services']['firewall'] = false; @@ -115,44 +114,26 @@ $conf['postfix']['vmail_groupid'] = '5000'; $conf['postfix']['vmail_groupname'] = 'vmail'; $conf['postfix']['vmail_mailbox_base'] = '/var/vmail'; -//* Mailman -$conf['mailman']['installed'] = false; // will be detected automatically during installation -$conf['mailman']['config_dir'] = '/etc/mailman'; -$conf['mailman']['init_script'] = 'mailman'; - -//* mlmmj -$conf['mlmmj']['installed'] = false; // will be detected automatically during installation -$conf['mlmmj']['config_dir'] = '/etc/mlmmj'; - //* Getmail $conf['getmail']['installed'] = false; // will be detected automatically during installation $conf['getmail']['config_dir'] = '/etc/getmail'; $conf['getmail']['program'] = '/usr/bin/getmail'; -//* Courier -$conf['courier']['installed'] = false; // will be detected automatically during installation -$conf['courier']['config_dir'] = '/etc/courier'; -$conf['courier']['courier-authdaemon'] = 'courier-authdaemon'; -$conf['courier']['courier-imap'] = 'courier-imap'; -$conf['courier']['courier-imap-ssl'] = 'courier-imap-ssl'; -$conf['courier']['courier-pop'] = 'courier-pop'; -$conf['courier']['courier-pop-ssl'] = 'courier-pop-ssl'; - //* Dovecot $conf['dovecot']['installed'] = false; // will be detected automatically during installation $conf['dovecot']['config_dir'] = '/etc/dovecot'; $conf['dovecot']['init_script'] = 'dovecot'; -//* SASL -$conf['saslauthd']['installed'] = false; // will be detected automatically during installation -$conf['saslauthd']['config'] = '/etc/default/saslauthd'; -$conf['saslauthd']['init_script'] = 'saslauthd'; - //* Amavisd $conf['amavis']['installed'] = false; // will be detected automatically during installation $conf['amavis']['config_dir'] = '/etc/amavis'; $conf['amavis']['init_script'] = 'amavis'; +//* Rspamd +$conf['rspamd']['installed'] = false; // will be detected automatically during installation +$conf['rspamd']['config_dir'] = '/etc/rspamd'; +$conf['rspamd']['init_script'] = 'rspamd'; + //* ClamAV $conf['clamav']['installed'] = false; // will be detected automatically during installation $conf['clamav']['init_script'] = 'clamav-daemon'; @@ -170,7 +151,7 @@ $conf['mydns']['init_script'] = 'mydns'; //* PowerDNS $conf['powerdns']['installed'] = false; // will be detected automatically during installation $conf['powerdns']['database'] = 'powerdns'; -$conf["powerdns"]["config_dir"] = '/etc/powerdns/pdns.d'; +$conf['powerdns']['config_dir'] = '/etc/powerdns/pdns.d'; $conf['powerdns']['init_script'] = 'pdns'; //* BIND DNS Server @@ -215,7 +196,6 @@ $conf['nginx']['php_fpm_socket_dir'] = '/var/lib/php5-fpm'; $conf['bastille']['installed'] = false; $conf['bastille']['config_dir'] = '/etc/Bastille'; - //* vlogger $conf['vlogger']['config_dir'] = '/etc'; @@ -223,9 +203,3 @@ $conf['vlogger']['config_dir'] = '/etc'; $conf['cron']['init_script'] = 'cron'; $conf['cron']['crontab_dir'] = '/etc/cron.d'; $conf['cron']['wget'] = '/usr/bin/wget'; - -//* OpenVZ -$conf['openvz']['installed'] = false; - - -?> diff --git a/install/dist/conf/debian60.conf.php b/install/dist/conf/debian60.conf.php index 01c275bd59d815681d34153f2bc3a2e1248c3072..09356dbe1824d28e1fd74eaaeff46d64ab95cc4d 100644 --- a/install/dist/conf/debian60.conf.php +++ b/install/dist/conf/debian60.conf.php @@ -50,7 +50,6 @@ $conf['services']['web'] = true; $conf['services']['dns'] = true; $conf['services']['file'] = true; $conf['services']['db'] = true; -$conf['services']['vserver'] = true; $conf['services']['proxy'] = false; $conf['services']['firewall'] = false; @@ -115,44 +114,26 @@ $conf['postfix']['vmail_groupid'] = '5000'; $conf['postfix']['vmail_groupname'] = 'vmail'; $conf['postfix']['vmail_mailbox_base'] = '/var/vmail'; -//* Mailman -$conf['mailman']['installed'] = false; // will be detected automatically during installation -$conf['mailman']['config_dir'] = '/etc/mailman'; -$conf['mailman']['init_script'] = 'mailman'; - -//* mlmmj -$conf['mlmmj']['installed'] = false; // will be detected automatically during installation -$conf['mlmmj']['config_dir'] = '/etc/mlmmj'; - //* Getmail $conf['getmail']['installed'] = false; // will be detected automatically during installation $conf['getmail']['config_dir'] = '/etc/getmail'; $conf['getmail']['program'] = '/usr/bin/getmail'; -//* Courier -$conf['courier']['installed'] = false; // will be detected automatically during installation -$conf['courier']['config_dir'] = '/etc/courier'; -$conf['courier']['courier-authdaemon'] = 'courier-authdaemon'; -$conf['courier']['courier-imap'] = 'courier-imap'; -$conf['courier']['courier-imap-ssl'] = 'courier-imap-ssl'; -$conf['courier']['courier-pop'] = 'courier-pop'; -$conf['courier']['courier-pop-ssl'] = 'courier-pop-ssl'; - //* Dovecot $conf['dovecot']['installed'] = false; // will be detected automatically during installation $conf['dovecot']['config_dir'] = '/etc/dovecot'; $conf['dovecot']['init_script'] = 'dovecot'; -//* SASL -$conf['saslauthd']['installed'] = false; // will be detected automatically during installation -$conf['saslauthd']['config'] = '/etc/default/saslauthd'; -$conf['saslauthd']['init_script'] = 'saslauthd'; - //* Amavisd $conf['amavis']['installed'] = false; // will be detected automatically during installation $conf['amavis']['config_dir'] = '/etc/amavis'; $conf['amavis']['init_script'] = 'amavis'; +//* Rspamd +$conf['rspamd']['installed'] = false; // will be detected automatically during installation +$conf['rspamd']['config_dir'] = '/etc/rspamd'; +$conf['rspamd']['init_script'] = 'rspamd'; + //* ClamAV $conf['clamav']['installed'] = false; // will be detected automatically during installation $conf['clamav']['init_script'] = 'clamav-daemon'; @@ -211,9 +192,6 @@ $conf['nginx']['php_fpm_pool_dir'] = '/etc/php5/fpm/pool.d'; $conf['nginx']['php_fpm_start_port'] = 9010; $conf['nginx']['php_fpm_socket_dir'] = '/var/lib/php5-fpm'; -//* OpenVZ -$conf['openvz']['installed'] = false; - //*Bastille-Firwall $conf['bastille']['installed'] = false; $conf['bastille']['config_dir'] = '/etc/Bastille'; @@ -225,19 +203,3 @@ $conf['vlogger']['config_dir'] = '/etc'; $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..a92ed1049b275ec09dead63ccad659215366154a 100644 --- a/install/dist/conf/debian90.conf.php +++ b/install/dist/conf/debian90.conf.php @@ -50,7 +50,6 @@ $conf['services']['web'] = true; $conf['services']['dns'] = true; $conf['services']['file'] = true; $conf['services']['db'] = true; -$conf['services']['vserver'] = true; $conf['services']['proxy'] = false; $conf['services']['firewall'] = false; @@ -115,44 +114,26 @@ $conf['postfix']['vmail_groupid'] = '5000'; $conf['postfix']['vmail_groupname'] = 'vmail'; $conf['postfix']['vmail_mailbox_base'] = '/var/vmail'; -//* Mailman -$conf['mailman']['installed'] = false; // will be detected automatically during installation -$conf['mailman']['config_dir'] = '/etc/mailman'; -$conf['mailman']['init_script'] = 'mailman'; - -//* mlmmj -$conf['mlmmj']['installed'] = false; // will be detected automatically during installation -$conf['mlmmj']['config_dir'] = '/etc/mlmmj'; - //* Getmail $conf['getmail']['installed'] = false; // will be detected automatically during installation $conf['getmail']['config_dir'] = '/etc/getmail'; $conf['getmail']['program'] = '/usr/bin/getmail'; -//* Courier -$conf['courier']['installed'] = false; // will be detected automatically during installation -$conf['courier']['config_dir'] = '/etc/courier'; -$conf['courier']['courier-authdaemon'] = 'courier-authdaemon'; -$conf['courier']['courier-imap'] = 'courier-imap'; -$conf['courier']['courier-imap-ssl'] = 'courier-imap-ssl'; -$conf['courier']['courier-pop'] = 'courier-pop'; -$conf['courier']['courier-pop-ssl'] = 'courier-pop-ssl'; - //* Dovecot $conf['dovecot']['installed'] = false; // will be detected automatically during installation $conf['dovecot']['config_dir'] = '/etc/dovecot'; $conf['dovecot']['init_script'] = 'dovecot'; -//* SASL -$conf['saslauthd']['installed'] = false; // will be detected automatically during installation -$conf['saslauthd']['config'] = '/etc/default/saslauthd'; -$conf['saslauthd']['init_script'] = 'saslauthd'; - //* Amavisd $conf['amavis']['installed'] = false; // will be detected automatically during installation $conf['amavis']['config_dir'] = '/etc/amavis'; $conf['amavis']['init_script'] = 'amavis'; +//* Rspamd +$conf['rspamd']['installed'] = false; // will be detected automatically during installation +$conf['rspamd']['config_dir'] = '/etc/rspamd'; +$conf['rspamd']['init_script'] = 'rspamd'; + //* ClamAV $conf['clamav']['installed'] = false; // will be detected automatically during installation $conf['clamav']['init_script'] = 'clamav-daemon'; @@ -211,9 +192,6 @@ $conf['nginx']['php_fpm_pool_dir'] = '/etc/php/7.0/fpm/pool.d'; $conf['nginx']['php_fpm_start_port'] = 9010; $conf['nginx']['php_fpm_socket_dir'] = '/var/lib/php7.0-fpm'; -//* OpenVZ -$conf['openvz']['installed'] = false; - //*Bastille-Firwall $conf['bastille']['installed'] = false; $conf['bastille']['config_dir'] = '/etc/Bastille'; @@ -225,18 +203,3 @@ $conf['vlogger']['config_dir'] = '/etc'; $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..350be08cb5e52e773a2a7cce4db4fc846a02ff03 100644 --- a/install/dist/conf/debiantesting.conf.php +++ b/install/dist/conf/debiantesting.conf.php @@ -50,7 +50,6 @@ $conf['services']['web'] = true; $conf['services']['dns'] = true; $conf['services']['file'] = true; $conf['services']['db'] = true; -$conf['services']['vserver'] = true; $conf['services']['proxy'] = false; $conf['services']['firewall'] = false; @@ -115,44 +114,26 @@ $conf['postfix']['vmail_groupid'] = '5000'; $conf['postfix']['vmail_groupname'] = 'vmail'; $conf['postfix']['vmail_mailbox_base'] = '/var/vmail'; -//* Mailman -$conf['mailman']['installed'] = false; // will be detected automatically during installation -$conf['mailman']['config_dir'] = '/etc/mailman'; -$conf['mailman']['init_script'] = 'mailman'; - -//* mlmmj -$conf['mlmmj']['installed'] = false; // will be detected automatically during installation -$conf['mlmmj']['config_dir'] = '/etc/mlmmj'; - //* Getmail $conf['getmail']['installed'] = false; // will be detected automatically during installation $conf['getmail']['config_dir'] = '/etc/getmail'; $conf['getmail']['program'] = '/usr/bin/getmail'; -//* Courier -$conf['courier']['installed'] = false; // will be detected automatically during installation -$conf['courier']['config_dir'] = '/etc/courier'; -$conf['courier']['courier-authdaemon'] = 'courier-authdaemon'; -$conf['courier']['courier-imap'] = 'courier-imap'; -$conf['courier']['courier-imap-ssl'] = 'courier-imap-ssl'; -$conf['courier']['courier-pop'] = 'courier-pop'; -$conf['courier']['courier-pop-ssl'] = 'courier-pop-ssl'; - //* Dovecot $conf['dovecot']['installed'] = false; // will be detected automatically during installation $conf['dovecot']['config_dir'] = '/etc/dovecot'; $conf['dovecot']['init_script'] = 'dovecot'; -//* SASL -$conf['saslauthd']['installed'] = false; // will be detected automatically during installation -$conf['saslauthd']['config'] = '/etc/default/saslauthd'; -$conf['saslauthd']['init_script'] = 'saslauthd'; - //* Amavisd $conf['amavis']['installed'] = false; // will be detected automatically during installation $conf['amavis']['config_dir'] = '/etc/amavis'; $conf['amavis']['init_script'] = 'amavis'; +//* Rspamd +$conf['rspamd']['installed'] = false; // will be detected automatically during installation +$conf['rspamd']['config_dir'] = '/etc/rspamd'; +$conf['rspamd']['init_script'] = 'rspamd'; + //* ClamAV $conf['clamav']['installed'] = false; // will be detected automatically during installation $conf['clamav']['init_script'] = 'clamav-daemon'; @@ -170,7 +151,7 @@ $conf['mydns']['init_script'] = 'mydns'; //* PowerDNS $conf['powerdns']['installed'] = false; // will be detected automatically during installation $conf['powerdns']['database'] = 'powerdns'; -$conf["powerdns"]["config_dir"] = '/etc/powerdns/pdns.d'; +$conf['powerdns']['config_dir'] = '/etc/powerdns/pdns.d'; $conf['powerdns']['init_script'] = 'pdns'; //* BIND DNS Server @@ -211,9 +192,6 @@ $conf['nginx']['php_fpm_pool_dir'] = '/etc/php/7.0/fpm/pool.d'; $conf['nginx']['php_fpm_start_port'] = 9010; $conf['nginx']['php_fpm_socket_dir'] = '/var/lib/php7.0-fpm'; -//* OpenVZ -$conf['openvz']['installed'] = false; - //*Bastille-Firwall $conf['bastille']['installed'] = false; $conf['bastille']['config_dir'] = '/etc/Bastille'; @@ -225,19 +203,3 @@ $conf['vlogger']['config_dir'] = '/etc'; $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/fedora9.conf.php b/install/dist/conf/fedora9.conf.php index 85121e7c841658e39935ba6548ada4c8a105f2dc..46f3da03ce06a894dc8dfe94cb06475d70c945f2 100644 --- a/install/dist/conf/fedora9.conf.php +++ b/install/dist/conf/fedora9.conf.php @@ -50,7 +50,8 @@ $conf['services']['web'] = true; $conf['services']['dns'] = true; $conf['services']['file'] = true; $conf['services']['db'] = true; -$conf['services']['vserver'] = true; +$conf['services']['proxy'] = false; +$conf['services']['firewall'] = false; //* MySQL $conf['mysql']['installed'] = false; // will be detected automatically during installation @@ -113,44 +114,26 @@ $conf['postfix']['vmail_groupid'] = '5000'; $conf['postfix']['vmail_groupname'] = 'vmail'; $conf['postfix']['vmail_mailbox_base'] = '/var/vmail'; -//* Mailman -$conf['mailman']['installed'] = false; // will be detected automatically during installation -$conf['mailman']['config_dir'] = '/etc/mailman'; -$conf['mailman']['init_script'] = 'mailman'; - -//* mlmmj -$conf['mlmmj']['installed'] = false; // will be detected automatically during installation -$conf['mlmmj']['config_dir'] = '/etc/mlmmj'; - //* Getmail $conf['getmail']['installed'] = false; // will be detected automatically during installation $conf['getmail']['config_dir'] = '/etc/getmail'; $conf['getmail']['program'] = '/usr/bin/getmail'; -//* Courier -$conf['courier']['installed'] = false; // will be detected automatically during installation -$conf['courier']['config_dir'] = '/etc/authlib'; -$conf['courier']['courier-authdaemon'] = 'courier-authlib'; -$conf['courier']['courier-imap'] = 'courier-imap'; -$conf['courier']['courier-imap-ssl'] = 'courier-imap'; -$conf['courier']['courier-pop'] = 'courier-imap'; -$conf['courier']['courier-pop-ssl'] = 'courier-imap'; - //* Dovecot $conf['dovecot']['installed'] = false; // will be detected automatically during installation $conf['dovecot']['config_dir'] = '/etc'; $conf['dovecot']['init_script'] = 'dovecot'; -//* SASL -$conf['saslauthd']['installed'] = false; // will be detected automatically during installation -$conf['saslauthd']['config'] = '/etc/sysconfig/saslauthd'; -$conf['saslauthd']['init_script'] = 'saslauthd'; - //* Amavisd $conf['amavis']['installed'] = false; // will be detected automatically during installation $conf['amavis']['config_dir'] = '/etc/amavisd'; $conf['amavis']['init_script'] = 'amavisd'; +//* Rspamd +$conf['rspamd']['installed'] = false; // will be detected automatically during installation +$conf['rspamd']['config_dir'] = '/etc/rspamd'; +$conf['rspamd']['init_script'] = 'rspamd'; + //* ClamAV $conf['clamav']['installed'] = false; // will be detected automatically during installation $conf['clamav']['init_script'] = 'clamd.amavisd'; @@ -209,6 +192,10 @@ $conf['nginx']['php_fpm_pool_dir'] = '/etc/php-fpm.d'; $conf['nginx']['php_fpm_start_port'] = 9010; $conf['nginx']['php_fpm_socket_dir'] = '/var/lib/php5-fpm'; +//*Bastille-Firwall +$conf['bastille']['installed'] = false; +$conf['bastille']['config_dir'] = '/etc/Bastille'; + //* vlogger $conf['vlogger']['config_dir'] = '/etc'; @@ -216,8 +203,3 @@ $conf['vlogger']['config_dir'] = '/etc'; $conf['cron']['init_script'] = 'crond'; $conf['cron']['crontab_dir'] = '/etc/cron.d'; $conf['cron']['wget'] = '/usr/bin/wget'; - -//* OpenVZ -$conf['openvz']['installed'] = false; - -?> diff --git a/install/dist/conf/gentoo.conf.php b/install/dist/conf/gentoo.conf.php index f15eac65d305e95c185e9c317c61c90af99f7fbc..15ecefb6c34ff6897777a73279d31382f145b72c 100644 --- a/install/dist/conf/gentoo.conf.php +++ b/install/dist/conf/gentoo.conf.php @@ -50,7 +50,8 @@ $conf['services']['web'] = true; $conf['services']['dns'] = true; $conf['services']['file'] = true; $conf['services']['db'] = true; -$conf['services']['vserver'] = true; +$conf['services']['proxy'] = false; +$conf['services']['firewall'] = false; //* MySQL $conf['mysql']['installed'] = false; // will be detected automatically during installation @@ -123,46 +124,27 @@ $conf['postfix']['vmail_groupid'] = '5000'; $conf['postfix']['vmail_groupname'] = 'vmail'; $conf['postfix']['vmail_mailbox_base'] = '/var/vmail'; -//* Mailman -$conf['mailman']['installed'] = false; // will be detected automatically during installation -$conf['mailman']['config_dir'] = '/etc/mailman'; -$conf['mailman']['init_script'] = 'mailman'; - -//* mlmmj -$conf['mlmmj']['installed'] = false; // will be detected automatically during installation -$conf['mlmmj']['config_dir'] = '/etc/mlmmj'; - //* Getmail $conf['getmail']['installed'] = false; // will be detected automatically during installation $conf['getmail']['user'] = 'getmail'; $conf['getmail']['config_dir'] = '/etc/getmail'; $conf['getmail']['program'] = '/usr/bin/getmail'; -//* Courier -$conf['courier']['installed'] = false; // will be detected automatically during installation -$conf['courier']['config_dir'] = '/etc/courier/authlib'; -$conf['courier']['courier-authdaemon'] = 'courier-authlib'; -$conf['courier']['courier-imap'] = 'courier-imapd'; -$conf['courier']['courier-imap-ssl'] = 'courier-imapd-ssl'; -$conf['courier']['courier-pop'] = 'courier-pop3d'; -$conf['courier']['courier-pop-ssl'] = 'courier-pop3d-ssl'; - //* Dovecot $conf['dovecot']['installed'] = false; // will be detected automatically during installation $conf['dovecot']['config_dir'] = '/etc/dovecot'; $conf['dovecot']['init_script'] = 'dovecot'; -//* SASL -$conf['saslauthd']['installed'] = false; // will be detected automatically during installation -$conf['saslauthd']['config_file'] = '/etc/conf.d/saslauthd'; -$conf['saslauthd']['config_dir'] = '/etc/sasl2'; -$conf['saslauthd']['init_script'] = 'saslauthd'; - //* Amavisd $conf['amavis']['installed'] = false; // will be detected automatically during installation $conf['amavis']['config_file'] = '/etc/amavisd.conf'; $conf['amavis']['init_script'] = 'amavisd'; +//* Rspamd +$conf['rspamd']['installed'] = false; // will be detected automatically during installation +$conf['rspamd']['config_dir'] = '/etc/rspamd'; +$conf['rspamd']['init_script'] = 'rspamd'; + //* ClamAV $conf['clamav']['installed'] = false; // will be detected automatically during installation $conf['clamav']['init_script'] = 'clamd'; @@ -222,6 +204,10 @@ $conf['nginx']['php_fpm_pool_dir'] = '/etc/php5/fpm/pool.d'; $conf['nginx']['php_fpm_start_port'] = 9010; $conf['nginx']['php_fpm_socket_dir'] = '/var/lib/php5-fpm'; +//*Bastille-Firwall +$conf['bastille']['installed'] = false; +$conf['bastille']['config_dir'] = '/etc/Bastille'; + //* vlogger $conf['vlogger']['config_dir'] = '/etc/vlogger'; @@ -230,8 +216,3 @@ $conf['cron']['init_script'] = 'vixie-cron'; $conf['cron']['crontab_dir'] = '/etc/cron.d'; $conf['cron']['group'] = 'cron'; $conf['cron']['wget'] = '/usr/bin/wget'; - -//* OpenVZ -$conf['openvz']['installed'] = false; - -?> diff --git a/install/dist/conf/opensuse110.conf.php b/install/dist/conf/opensuse110.conf.php deleted file mode 100644 index 909a53aba0ecf727e4da0004b148fdae8b0bb5f6..0000000000000000000000000000000000000000 --- a/install/dist/conf/opensuse110.conf.php +++ /dev/null @@ -1,223 +0,0 @@ - diff --git a/install/dist/conf/opensuse112.conf.php b/install/dist/conf/opensuse112.conf.php index 648a9222e4c092c1ac4b091569a0b141d9c2aeb2..12b5748fbe9714cb8c05e9adec322d554233e07e 100644 --- a/install/dist/conf/opensuse112.conf.php +++ b/install/dist/conf/opensuse112.conf.php @@ -50,7 +50,8 @@ $conf['services']['web'] = true; $conf['services']['dns'] = true; $conf['services']['file'] = true; $conf['services']['db'] = true; -$conf['services']['vserver'] = true; +$conf['services']['proxy'] = false; +$conf['services']['firewall'] = false; //* MySQL $conf['mysql']['installed'] = false; // will be detected automatically during installation @@ -113,44 +114,26 @@ $conf['postfix']['vmail_groupid'] = '5000'; $conf['postfix']['vmail_groupname'] = 'vmail'; $conf['postfix']['vmail_mailbox_base'] = '/var/vmail'; -//* Mailman -$conf['mailman']['installed'] = false; // will be detected automatically during installation -$conf['mailman']['config_dir'] = '/etc/mailman'; -$conf['mailman']['init_script'] = 'mailman'; - -//* mlmmj -$conf['mlmmj']['installed'] = false; // will be detected automatically during installation -$conf['mlmmj']['config_dir'] = '/etc/mlmmj'; - //* Getmail $conf['getmail']['installed'] = false; // will be detected automatically during installation $conf['getmail']['config_dir'] = '/etc/getmail'; $conf['getmail']['program'] = '/usr/bin/getmail'; -//* Courier -$conf['courier']['installed'] = false; // will be detected automatically during installation -$conf['courier']['config_dir'] = '/etc/authlib'; -$conf['courier']['courier-authdaemon'] = 'courier-authdaemon'; -$conf['courier']['courier-imap'] = 'courier-imap'; -$conf['courier']['courier-imap-ssl'] = 'courier-imap-ssl'; -$conf['courier']['courier-pop'] = 'courier-pop'; -$conf['courier']['courier-pop-ssl'] = 'courier-pop-ssl'; - //* Dovecot $conf['dovecot']['installed'] = false; // will be detected automatically during installation $conf['dovecot']['config_dir'] = '/etc/dovecot'; $conf['dovecot']['init_script'] = 'dovecot'; -//* SASL -$conf['saslauthd']['installed'] = false; // will be detected automatically during installation -$conf['saslauthd']['config'] = '/etc/default/saslauthd'; -$conf['saslauthd']['init_script'] = 'saslauthd'; - //* Amavisd $conf['amavis']['installed'] = false; // will be detected automatically during installation $conf['amavis']['config_dir'] = '/etc'; $conf['amavis']['init_script'] = 'amavis'; +//* Rspamd +$conf['rspamd']['installed'] = false; // will be detected automatically during installation +$conf['rspamd']['config_dir'] = '/etc/rspamd'; +$conf['rspamd']['init_script'] = 'rspamd'; + //* ClamAV $conf['clamav']['installed'] = false; // will be detected automatically during installation $conf['clamav']['init_script'] = 'clamd'; @@ -209,6 +192,10 @@ $conf['nginx']['php_fpm_pool_dir'] = '/etc/php5/fpm/pool.d'; $conf['nginx']['php_fpm_start_port'] = 9010; $conf['nginx']['php_fpm_socket_dir'] = '/var/lib/php5-fpm'; +//*Bastille-Firwall +$conf['bastille']['installed'] = false; +$conf['bastille']['config_dir'] = '/etc/Bastille'; + //* vlogger $conf['vlogger']['config_dir'] = '/etc'; @@ -216,8 +203,3 @@ $conf['vlogger']['config_dir'] = '/etc'; $conf['cron']['init_script'] = 'cron'; $conf['cron']['crontab_dir'] = '/etc/cron.d'; $conf['cron']['wget'] = '/usr/bin/wget'; - -//* OpenVZ -$conf['openvz']['installed'] = false; - -?> diff --git a/install/dist/conf/ubuntu1604.conf.php b/install/dist/conf/ubuntu1604.conf.php index 6159638d0f99f86276be590aa2fc6c3218d07de1..afa0ea7c94bc6843e52e3906761c7e3600bfee67 100644 --- a/install/dist/conf/ubuntu1604.conf.php +++ b/install/dist/conf/ubuntu1604.conf.php @@ -50,7 +50,6 @@ $conf['services']['web'] = true; $conf['services']['dns'] = true; $conf['services']['file'] = true; $conf['services']['db'] = true; -$conf['services']['vserver'] = true; $conf['services']['proxy'] = false; $conf['services']['firewall'] = false; @@ -115,44 +114,26 @@ $conf['postfix']['vmail_groupid'] = '5000'; $conf['postfix']['vmail_groupname'] = 'vmail'; $conf['postfix']['vmail_mailbox_base'] = '/var/vmail'; -//* Mailman -$conf['mailman']['installed'] = false; // will be detected automatically during installation -$conf['mailman']['config_dir'] = '/etc/mailman'; -$conf['mailman']['init_script'] = 'mailman'; - -//* mlmmj -$conf['mlmmj']['installed'] = false; // will be detected automatically during installation -$conf['mlmmj']['config_dir'] = '/etc/mlmmj'; - //* Getmail $conf['getmail']['installed'] = false; // will be detected automatically during installation $conf['getmail']['config_dir'] = '/etc/getmail'; $conf['getmail']['program'] = '/usr/bin/getmail'; -//* Courier -$conf['courier']['installed'] = false; // will be detected automatically during installation -$conf['courier']['config_dir'] = '/etc/courier'; -$conf['courier']['courier-authdaemon'] = 'courier-authdaemon'; -$conf['courier']['courier-imap'] = 'courier-imap'; -$conf['courier']['courier-imap-ssl'] = 'courier-imap-ssl'; -$conf['courier']['courier-pop'] = 'courier-pop'; -$conf['courier']['courier-pop-ssl'] = 'courier-pop-ssl'; - //* Dovecot $conf['dovecot']['installed'] = false; // will be detected automatically during installation $conf['dovecot']['config_dir'] = '/etc/dovecot'; $conf['dovecot']['init_script'] = 'dovecot'; -//* SASL -$conf['saslauthd']['installed'] = false; // will be detected automatically during installation -$conf['saslauthd']['config'] = '/etc/default/saslauthd'; -$conf['saslauthd']['init_script'] = 'saslauthd'; - //* Amavisd $conf['amavis']['installed'] = false; // will be detected automatically during installation $conf['amavis']['config_dir'] = '/etc/amavis'; $conf['amavis']['init_script'] = 'amavis'; +//* Rspamd +$conf['rspamd']['installed'] = false; // will be detected automatically during installation +$conf['rspamd']['config_dir'] = '/etc/rspamd'; +$conf['rspamd']['init_script'] = 'rspamd'; + //* ClamAV $conf['clamav']['installed'] = false; // will be detected automatically during installation $conf['clamav']['init_script'] = 'clamav-daemon'; @@ -211,9 +192,6 @@ $conf['nginx']['php_fpm_pool_dir'] = '/etc/php/7.0/fpm/pool.d'; $conf['nginx']['php_fpm_start_port'] = 9010; $conf['nginx']['php_fpm_socket_dir'] = '/var/lib/php7.0-fpm'; -//* OpenVZ -$conf['openvz']['installed'] = false; - //*Bastille-Firwall $conf['bastille']['installed'] = false; $conf['bastille']['config_dir'] = '/etc/Bastille'; @@ -225,19 +203,3 @@ $conf['vlogger']['config_dir'] = '/etc'; $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..2a4c364f740174c27907493ba8eb95f7edf8e5b6 100644 --- a/install/dist/conf/ubuntu1710.conf.php +++ b/install/dist/conf/ubuntu1710.conf.php @@ -50,7 +50,6 @@ $conf['services']['web'] = true; $conf['services']['dns'] = true; $conf['services']['file'] = true; $conf['services']['db'] = true; -$conf['services']['vserver'] = true; $conf['services']['proxy'] = false; $conf['services']['firewall'] = false; @@ -115,40 +114,26 @@ $conf['postfix']['vmail_groupid'] = '5000'; $conf['postfix']['vmail_groupname'] = 'vmail'; $conf['postfix']['vmail_mailbox_base'] = '/var/vmail'; -//* Mailman -$conf['mailman']['installed'] = false; // will be detected automatically during installation -$conf['mailman']['config_dir'] = '/etc/mailman'; -$conf['mailman']['init_script'] = 'mailman'; - //* Getmail $conf['getmail']['installed'] = false; // will be detected automatically during installation $conf['getmail']['config_dir'] = '/etc/getmail'; $conf['getmail']['program'] = '/usr/bin/getmail'; -//* Courier -$conf['courier']['installed'] = false; // will be detected automatically during installation -$conf['courier']['config_dir'] = '/etc/courier'; -$conf['courier']['courier-authdaemon'] = 'courier-authdaemon'; -$conf['courier']['courier-imap'] = 'courier-imap'; -$conf['courier']['courier-imap-ssl'] = 'courier-imap-ssl'; -$conf['courier']['courier-pop'] = 'courier-pop'; -$conf['courier']['courier-pop-ssl'] = 'courier-pop-ssl'; - //* Dovecot $conf['dovecot']['installed'] = false; // will be detected automatically during installation $conf['dovecot']['config_dir'] = '/etc/dovecot'; $conf['dovecot']['init_script'] = 'dovecot'; -//* SASL -$conf['saslauthd']['installed'] = false; // will be detected automatically during installation -$conf['saslauthd']['config'] = '/etc/default/saslauthd'; -$conf['saslauthd']['init_script'] = 'saslauthd'; - //* Amavisd $conf['amavis']['installed'] = false; // will be detected automatically during installation $conf['amavis']['config_dir'] = '/etc/amavis'; $conf['amavis']['init_script'] = 'amavis'; +//* Rspamd +$conf['rspamd']['installed'] = false; // will be detected automatically during installation +$conf['rspamd']['config_dir'] = '/etc/rspamd'; +$conf['rspamd']['init_script'] = 'rspamd'; + //* ClamAV $conf['clamav']['installed'] = false; // will be detected automatically during installation $conf['clamav']['init_script'] = 'clamav-daemon'; @@ -207,9 +192,6 @@ $conf['nginx']['php_fpm_pool_dir'] = '/etc/php/7.1/fpm/pool.d'; $conf['nginx']['php_fpm_start_port'] = 9010; $conf['nginx']['php_fpm_socket_dir'] = '/var/lib/php7.1-fpm'; -//* OpenVZ -$conf['openvz']['installed'] = false; - //*Bastille-Firwall $conf['bastille']['installed'] = false; $conf['bastille']['config_dir'] = '/etc/Bastille'; @@ -221,19 +203,3 @@ $conf['vlogger']['config_dir'] = '/etc'; $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..d7eb1972db97529943fcac854471fbf0b1de2f19 100644 --- a/install/dist/conf/ubuntu1804.conf.php +++ b/install/dist/conf/ubuntu1804.conf.php @@ -50,7 +50,6 @@ $conf['services']['web'] = true; $conf['services']['dns'] = true; $conf['services']['file'] = true; $conf['services']['db'] = true; -$conf['services']['vserver'] = true; $conf['services']['proxy'] = false; $conf['services']['firewall'] = false; @@ -115,40 +114,26 @@ $conf['postfix']['vmail_groupid'] = '5000'; $conf['postfix']['vmail_groupname'] = 'vmail'; $conf['postfix']['vmail_mailbox_base'] = '/var/vmail'; -//* Mailman -$conf['mailman']['installed'] = false; // will be detected automatically during installation -$conf['mailman']['config_dir'] = '/etc/mailman'; -$conf['mailman']['init_script'] = 'mailman'; - //* Getmail $conf['getmail']['installed'] = false; // will be detected automatically during installation $conf['getmail']['config_dir'] = '/etc/getmail'; $conf['getmail']['program'] = '/usr/bin/getmail'; -//* Courier -$conf['courier']['installed'] = false; // will be detected automatically during installation -$conf['courier']['config_dir'] = '/etc/courier'; -$conf['courier']['courier-authdaemon'] = 'courier-authdaemon'; -$conf['courier']['courier-imap'] = 'courier-imap'; -$conf['courier']['courier-imap-ssl'] = 'courier-imap-ssl'; -$conf['courier']['courier-pop'] = 'courier-pop'; -$conf['courier']['courier-pop-ssl'] = 'courier-pop-ssl'; - //* Dovecot $conf['dovecot']['installed'] = false; // will be detected automatically during installation $conf['dovecot']['config_dir'] = '/etc/dovecot'; $conf['dovecot']['init_script'] = 'dovecot'; -//* SASL -$conf['saslauthd']['installed'] = false; // will be detected automatically during installation -$conf['saslauthd']['config'] = '/etc/default/saslauthd'; -$conf['saslauthd']['init_script'] = 'saslauthd'; - //* Amavisd $conf['amavis']['installed'] = false; // will be detected automatically during installation $conf['amavis']['config_dir'] = '/etc/amavis'; $conf['amavis']['init_script'] = 'amavis'; +//* Rspamd +$conf['rspamd']['installed'] = false; // will be detected automatically during installation +$conf['rspamd']['config_dir'] = '/etc/rspamd'; +$conf['rspamd']['init_script'] = 'rspamd'; + //* ClamAV $conf['clamav']['installed'] = false; // will be detected automatically during installation $conf['clamav']['init_script'] = 'clamav-daemon'; @@ -207,9 +192,6 @@ $conf['nginx']['php_fpm_pool_dir'] = '/etc/php/7.2/fpm/pool.d'; $conf['nginx']['php_fpm_start_port'] = 9010; $conf['nginx']['php_fpm_socket_dir'] = '/var/lib/php7.2-fpm'; -//* OpenVZ -$conf['openvz']['installed'] = false; - //*Bastille-Firwall $conf['bastille']['installed'] = false; $conf['bastille']['config_dir'] = '/etc/Bastille'; @@ -221,10 +203,3 @@ $conf['vlogger']['config_dir'] = '/etc'; $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/dist/lib/centos52.lib.php b/install/dist/lib/centos52.lib.php deleted file mode 100644 index 2cec3447b58059d38e3cfadb905e9c3a882e8075..0000000000000000000000000000000000000000 --- a/install/dist/lib/centos52.lib.php +++ /dev/null @@ -1,40 +0,0 @@ - diff --git a/install/dist/lib/centos53.lib.php b/install/dist/lib/centos53.lib.php deleted file mode 100644 index b7f45bcfb375b86fbe0b58aa3c81176f4bd2d83d..0000000000000000000000000000000000000000 --- a/install/dist/lib/centos53.lib.php +++ /dev/null @@ -1,40 +0,0 @@ - diff --git a/install/dist/lib/debian60.lib.php b/install/dist/lib/debian60.lib.php index 730058f6e77d499dec6a23dcf7455ff1eba26bb7..69d9758b3d1731c89a071588071be6057c9c3878 100644 --- a/install/dist/lib/debian60.lib.php +++ b/install/dist/lib/debian60.lib.php @@ -68,7 +68,6 @@ class installer extends installer_base { } //* Reconfigure postfix to use dovecot authentication - // Adding the amavisd commands to the postfix configuration $postconf_commands = array ( 'dovecot_destination_recipient_limit = 1', 'virtual_transport = '.$virtual_transport, diff --git a/install/dist/lib/fedora.lib.php b/install/dist/lib/fedora.lib.php index 176245cea9034b2924379576d640ecefe901f3d0..88da3fb0ddae1cc59f0c0d46b795ca0d8c8291a5 100644 --- a/install/dist/lib/fedora.lib.php +++ b/install/dist/lib/fedora.lib.php @@ -29,7 +29,6 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ class installer_dist extends installer_base { - protected $mailman_group = 'mailman'; public function __construct() { //** check apache modules */ @@ -183,19 +182,6 @@ class installer_dist extends installer_base { touch($config_dir.'/nested_header_checks'); touch($config_dir.'/body_checks'); - //* Create the mailman files - if(!is_dir('/var/lib/mailman/data')) exec('mkdir -p /var/lib/mailman/data'); - //if(!is_file('/var/lib/mailman/data/aliases')) touch('/var/lib/mailman/data/aliases'); - if(is_file('/var/lib/mailman/data/aliases')) unlink('/var/lib/mailman/data/aliases'); - if(!is_link('/var/lib/mailman/data/aliases')) symlink('/etc/mailman/aliases', '/var/lib/mailman/data/aliases'); - if(!is_dir('/etc/mailman')) mkdir('/etc/mailman'); - if(!is_file('/etc/mailman/aliases')) touch('/etc/mailman/aliases'); - exec('postalias /var/lib/mailman/data/aliases'); - if(!is_file('/etc/mailman/virtual-mailman')) touch('/etc/mailman/virtual-mailman'); - exec('postmap /etc/mailman/virtual-mailman'); - if(!is_file('/var/lib/mailman/data/transport-mailman')) touch('/var/lib/mailman/data/transport-mailman'); - exec('/usr/sbin/postmap /var/lib/mailman/data/transport-mailman'); - //* Create auxillary postfix conf files $configfile = 'helo_access'; if(is_file($config_dir.'/'.$configfile)) { @@ -241,10 +227,6 @@ class installer_dist extends installer_base { caselog($command.' &> /dev/null', __FILE__, __LINE__, 'EXECUTED: '.$command, 'Failed to execute the command '.$command); } - //** We have to change the permissions of the courier authdaemon directory to make it accessible for maildrop. - $command = 'chmod 755 /var/spool/authdaemon'; - caselog($command.' &> /dev/null', __FILE__, __LINE__, 'EXECUTED: '.$command, 'Failed to execute the command '.$command); - //* Changing maildrop lines in posfix master.cf if(is_file($config_dir.'/master.cf')){ copy($config_dir.'/master.cf', $config_dir.'/master.cf~'); @@ -297,70 +279,6 @@ class installer_dist extends installer_base { } - public function configure_saslauthd() { - global $conf; - - $configfile = 'tpl/fedora_saslauthd_smtpd_conf.master'; - $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/fedora_saslauthd_smtpd_conf.master', $configfile); - wf('/usr/lib/sasl2/smtpd.conf', $content); - if(is_dir('/usr/lib64')) wf('/usr/lib64/sasl/smtpd.conf', $content); - if(is_dir('/usr/lib64')) wf('/usr/lib64/sasl2/smtpd.conf', $content); - - } - - public function configure_pam() - { - global $conf; - $pam = $conf['pam']; - //* configure pam for SMTP authentication agains the ispconfig database - $configfile = 'pamd_smtp'; - if(is_file("$pam/smtp")) copy("$pam/smtp", "$pam/smtp~"); - if(is_file("$pam/smtp~")) exec("chmod 400 $pam/smtp~"); - - $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$configfile.'.master', "tpl/$configfile.master"); - $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); - wf("$pam/smtp", $content); - // On some OSes smtp is world readable which allows for reading database information. Removing world readable rights should have no effect. - if(is_file("$pam/smtp")) exec("chmod o= $pam/smtp"); - } - - public function configure_courier() - { - global $conf; - $config_dir = $conf['courier']['config_dir']; - //* authmysqlrc - $configfile = 'authmysqlrc'; - if(is_file("$config_dir/$configfile")){ - copy("$config_dir/$configfile", "$config_dir/$configfile~"); - } - exec("chmod 400 $config_dir/$configfile~"); - $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$configfile.'.master', "tpl/$configfile.master"); - $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_host}', $conf['mysql']['host'], $content); - $content = str_replace('{mysql_server_port}', $conf['mysql']['port'], $content); - wf("$config_dir/$configfile", $content); - - exec("chmod 660 $config_dir/$configfile"); - exec("chown root:root $config_dir/$configfile"); - - //* authdaemonrc - $configfile = $conf['courier']['config_dir'].'/authdaemonrc'; - if(is_file($configfile)){ - copy($configfile, $configfile.'~'); - } - if(is_file($configfile.'~')){ - exec('chmod 400 '.$configfile.'~'); - } - $content = rf($configfile); - $content = str_replace('authmodulelist=', 'authmodulelist="authmysql"', $content); - wf($configfile, $content); - } - public function configure_dovecot() { global $conf; @@ -401,7 +319,6 @@ class installer_dist extends installer_base { } //* Reconfigure postfix to use dovecot authentication - // Adding the amavisd commands to the postfix configuration $postconf_commands = array ( 'dovecot_destination_recipient_limit = 1', 'virtual_transport = '.$virtual_transport, @@ -1054,12 +971,11 @@ class installer_dist extends installer_base { $dns_server_enabled = ($conf['services']['dns'])?1:0; $file_server_enabled = ($conf['services']['file'])?1:0; $db_server_enabled = ($conf['services']['db'])?1:0; - $vserver_server_enabled = ($conf['services']['vserver'])?1:0; - $sql = "UPDATE `server` SET mail_server = ?, web_server = ?, dns_server = ?, file_server = ?, db_server = ?, vserver_server = ? WHERE server_id = ?"; + $sql = "UPDATE `server` SET mail_server = ?, web_server = ?, dns_server = ?, file_server = ?, db_server = ? WHERE server_id = ?"; - $this->db->query($sql, $mail_server_enabled, $web_server_enabled, $dns_server_enabled, $file_server_enabled, $db_server_enabled, $vserver_server_enabled, $conf['server_id']); + $this->db->query($sql, $mail_server_enabled, $web_server_enabled, $dns_server_enabled, $file_server_enabled, $db_server_enabled, $conf['server_id']); if($conf['mysql']['master_slave_setup'] == 'y') { - $this->dbmaster->query($sql, $mail_server_enabled, $web_server_enabled, $dns_server_enabled, $file_server_enabled, $db_server_enabled, $vserver_server_enabled, $conf['server_id']); + $this->dbmaster->query($sql, $mail_server_enabled, $web_server_enabled, $dns_server_enabled, $file_server_enabled, $db_server_enabled, $conf['server_id']); } // chown install dir to root and chmod 755 diff --git a/install/dist/lib/gentoo.lib.php b/install/dist/lib/gentoo.lib.php index dad0f880e6906835326abd1b17ea0dd109ae8c6c..511ed69718a87ab99974ba70f1faf82001682420 100644 --- a/install/dist/lib/gentoo.lib.php +++ b/install/dist/lib/gentoo.lib.php @@ -181,12 +181,6 @@ class installer extends installer_base caselog($command.' &> /dev/null', __FILE__, __LINE__, 'EXECUTED: '.$command, 'Failed to execute the command '.$command); } - //* We have to change the permissions of the courier authdaemon directory to make it accessible for maildrop. - $command = 'chmod 755 /var/lib/courier/authdaemon/'; - if (is_dir('/var/lib/courier/authdaemon')) { - caselog($command.' &> /dev/null', __FILE__, __LINE__, 'EXECUTED: '.$command, 'Failed to execute the command '.$command); - } - //* Changing maildrop lines in posfix master.cf $configfile = $config_dir.'/master.cf'; $content = rf($configfile); @@ -233,43 +227,6 @@ class installer extends installer_base } - public function configure_saslauthd() - { - global $conf; - - $content = $this->get_template_file('sasl_smtpd.conf', true, true); //* get contents & insert db cred - $this->write_config_file($conf['saslauthd']['config_dir'].'/smtpd.conf', $content); - - //* Edit the file saslauthd config file - $content = rf($conf['saslauthd']['config_file']); - $content = preg_replace('/(?<=\n)SASLAUTHD_OPTS="\$\{SASLAUTHD_OPTS\}[^"]+"/', 'SASLAUTHD_OPTS="${SASLAUTHD_OPTS} -a pam -r -c -s 128 -t 30 -n 5"', $content); - - $this->write_config_file($conf['saslauthd']['config_file'], $content); - } - - public function configure_courier() - { - global $conf; - - //* authmysqlrc - $content = $this->get_template_file('authmysqlrc', true, true); //* get contents & insert db cred - $this->write_config_file($conf['courier']['config_dir'].'/authmysqlrc', $content); - - //* authdaemonrc - $configfile = $conf['courier']['config_dir'].'/authdaemonrc'; - - $content = rf($configfile); - $content = preg_replace('/(?<=\n)authmodulelist="[^"]+"/', "authmodulelist=\"authmysql\"", $content); - $this->write_config_file($configfile, $content); - - //* create certificates - $command = 'mkimapdcert'; - caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); - - $command = 'mkpop3dcert'; - caselog($command." &> /dev/null", __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); - } - public function configure_dovecot() { global $conf; @@ -948,13 +905,12 @@ class installer extends installer_base $dns_server_enabled = ($conf['services']['dns'])?1:0; $file_server_enabled = ($conf['services']['file'])?1:0; $db_server_enabled = ($conf['services']['db'])?1:0; - $vserver_server_enabled = ($conf['services']['vserver'])?1:0; - $sql = "UPDATE `server` SET mail_server = ?, web_server = ?, dns_server = ?, file_server = ?, db_server = ?, vserver_server = ? WHERE server_id = ?"; + $sql = "UPDATE `server` SET mail_server = ?, web_server = ?, dns_server = ?, file_server = ?, db_server = ? WHERE server_id = ?"; - $this->db->query($sql, $mail_server_enabled, $web_server_enabled, $dns_server_enabled, $file_server_enabled, $db_server_enabled, $vserver_server_enabled, $conf['server_id']); + $this->db->query($sql, $mail_server_enabled, $web_server_enabled, $dns_server_enabled, $file_server_enabled, $db_server_enabled, $conf['server_id']); if($conf['mysql']['master_slave_setup'] == 'y') { - $this->dbmaster->query($sql, $mail_server_enabled, $web_server_enabled, $dns_server_enabled, $file_server_enabled, $db_server_enabled, $vserver_server_enabled, $conf['server_id']); + $this->dbmaster->query($sql, $mail_server_enabled, $web_server_enabled, $dns_server_enabled, $file_server_enabled, $db_server_enabled, $conf['server_id']); } // chown install dir to root and chmod 755 diff --git a/install/dist/lib/opensuse.lib.php b/install/dist/lib/opensuse.lib.php index ea862a67e2ecc76ac5fcef73cdce20f1fcc8866b..0688471cda1590d2d443f37184cf2a1d911b9801 100644 --- a/install/dist/lib/opensuse.lib.php +++ b/install/dist/lib/opensuse.lib.php @@ -29,8 +29,6 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ class installer_dist extends installer_base { - protected $mailman_group = 'mailman'; - public function __construct() { //** check apache modules */ $mods = getapachemodules(); @@ -194,15 +192,6 @@ class installer_dist extends installer_base { touch($config_dir.'/nested_header_checks'); touch($config_dir.'/body_checks'); - //* Create the mailman files - if(!is_dir('/var/lib/mailman/data')) exec('mkdir -p /var/lib/mailman/data'); - if(!is_file('/var/lib/mailman/data/aliases')) touch('/var/lib/mailman/data/aliases'); - exec('postalias /var/lib/mailman/data/aliases'); - if(!is_file('/var/lib/mailman/data/virtual-mailman')) touch('/var/lib/mailman/data/virtual-mailman'); - exec('postmap /var/lib/mailman/data/virtual-mailman'); - if(!is_file('/var/lib/mailman/data/transport-mailman')) touch('/var/lib/mailman/data/transport-mailman'); - exec('/usr/sbin/postmap /var/lib/mailman/data/transport-mailman'); - //* Create auxillary postfix conf files $configfile = 'helo_access'; if(is_file($config_dir.'/'.$configfile)) { @@ -248,10 +237,6 @@ class installer_dist extends installer_base { caselog($command.' &> /dev/null', __FILE__, __LINE__, 'EXECUTED: '.$command, 'Failed to execute the command '.$command); } - //** We have to change the permissions of the courier authdaemon directory to make it accessible for maildrop. - $command = 'chmod 755 /var/run/authdaemon.courier-imap'; - caselog($command.' &> /dev/null', __FILE__, __LINE__, 'EXECUTED: '.$command, 'Failed to execute the command '.$command); - //* Check maildrop service in posfix master.cf $regex = "/^maildrop unix.*pipe flags=DRhu user=vmail argv=\\/usr\\/bin\\/maildrop -d ".$cf['vmail_username']." \\$\{extension} \\$\{recipient} \\$\{user} \\$\{nexthop} \\$\{sender}/"; $configfile = $config_dir.'/master.cf'; @@ -304,73 +289,6 @@ class installer_dist extends installer_base { } - public function configure_saslauthd() { - global $conf; - - // Edit the file /etc/init.d/saslauthd - $configfile = $conf["init_scripts"].'/'.$conf["saslauthd"]["init_script"]; - $content = rf($configfile); - $content = str_replace('/sbin/startproc $AUTHD_BIN -a $SASLAUTHD_AUTHMECH -n $SASLAUTHD_THREADS > /dev/null 2>&1', '/sbin/startproc $AUTHD_BIN -r -a $SASLAUTHD_AUTHMECH -n $SASLAUTHD_THREADS > /dev/null 2>&1', $content); - $content = str_replace('/sbin/startproc $AUTHD_BIN $SASLAUTHD_PARAMS -a $SASLAUTHD_AUTHMECH -n $SASLAUTHD_THREADS > /dev/null 2>&1', '/sbin/startproc $AUTHD_BIN $SASLAUTHD_PARAMS -r -a $SASLAUTHD_AUTHMECH -n $SASLAUTHD_THREADS > /dev/null 2>&1', $content); - - - if(is_file($configfile)) wf($configfile, $content); - - } - - public function configure_pam() - { - global $conf; - $pam = $conf['pam']; - //* configure pam for SMTP authentication agains the ispconfig database - $configfile = 'pamd_smtp'; - if(is_file("$pam/smtp")) copy("$pam/smtp", "$pam/smtp~"); - if(is_file("$pam/smtp~")) exec("chmod 400 $pam/smtp~"); - - $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$configfile.'.master', "tpl/$configfile.master"); - $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); - wf("$pam/smtp", $content); - // On some OSes smtp is world readable which allows for reading database information. Removing world readable rights should have no effect. - if(is_file("$pam/smtp")) exec("chmod o= $pam/smtp"); - } - - public function configure_courier() - { - global $conf; - $config_dir = $conf['courier']['config_dir']; - //* authmysqlrc - $configfile = 'authmysqlrc'; - if(is_file("$config_dir/$configfile")){ - copy("$config_dir/$configfile", "$config_dir/$configfile~"); - } - exec("chmod 400 $config_dir/$configfile~"); - $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$configfile.'.master', "tpl/$configfile.master"); - $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_host}', $conf['mysql']['host'], $content); - $content = str_replace('{mysql_server_port}', $conf['mysql']['port'], $content); - wf("$config_dir/$configfile", $content); - - exec("chmod 660 $config_dir/$configfile"); - exec("chown root:root $config_dir/$configfile"); - - //* authdaemonrc - $configfile = $conf['courier']['config_dir'].'/authdaemonrc'; - if(is_file($configfile)){ - copy($configfile, $configfile.'~'); - } - if(is_file($configfile.'~')){ - exec('chmod 400 '.$configfile.'~'); - } - $content = rf($configfile); - $content = str_replace('authmodulelist=', 'authmodulelist="authmysql"', $content); - wf($configfile, $content); - } - public function configure_dovecot() { global $conf; @@ -1062,12 +980,11 @@ class installer_dist extends installer_base { $dns_server_enabled = ($conf['services']['dns'])?1:0; $file_server_enabled = ($conf['services']['file'])?1:0; $db_server_enabled = ($conf['services']['db'])?1:0; - $vserver_server_enabled = ($conf['services']['vserver'])?1:0; - $sql = "UPDATE `server` SET mail_server = ?, web_server = ?, dns_server = ?, file_server = ?, db_server = ?, vserver_server = ? WHERE server_id = ?"; + $sql = "UPDATE `server` SET mail_server = ?, web_server = ?, dns_server = ?, file_server = ?, db_server = ? WHERE server_id = ?"; - $this->db->query($sql, $mail_server_enabled, $web_server_enabled, $dns_server_enabled, $file_server_enabled, $db_server_enabled, $vserver_server_enabled, $conf['server_id']); + $this->db->query($sql, $mail_server_enabled, $web_server_enabled, $dns_server_enabled, $file_server_enabled, $db_server_enabled, $conf['server_id']); if($conf['mysql']['master_slave_setup'] == 'y') { - $this->dbmaster->query($sql, $mail_server_enabled, $web_server_enabled, $dns_server_enabled, $file_server_enabled, $db_server_enabled, $vserver_server_enabled, $conf['server_id']); + $this->dbmaster->query($sql, $mail_server_enabled, $web_server_enabled, $dns_server_enabled, $file_server_enabled, $db_server_enabled, $conf['server_id']); } // chown install dir to root and chmod 755 diff --git a/install/dist/lib/opensuse110.lib.php b/install/dist/lib/opensuse110.lib.php deleted file mode 100644 index aeda9b9fd1c6b83d7388fc91bde429a6e4dd5b81..0000000000000000000000000000000000000000 --- a/install/dist/lib/opensuse110.lib.php +++ /dev/null @@ -1,36 +0,0 @@ - diff --git a/install/dist/tpl/gentoo/apache_apps.vhost.master b/install/dist/tpl/gentoo/apache_apps.vhost.master index ac29f81bb3ba72fbc1e06d075e5c039151e5635a..aff93d06ffd9d0c5c3e8ff5e74005cc2777c7711 100644 --- a/install/dist/tpl/gentoo/apache_apps.vhost.master +++ b/install/dist/tpl/gentoo/apache_apps.vhost.master @@ -21,8 +21,7 @@ SetHandler fcgid-script FCGIWrapper {website_basedir}/php-fcgi-scripts/apps/.php-fcgi-starter .php - Order allow,deny - Allow from all + Require all granted DirectoryIndex index.php @@ -33,8 +32,7 @@ Options +FollowSymLinks AllowOverride None - Order allow,deny - Allow from all + Require all granted diff --git a/install/dist/tpl/gentoo/apache_ispconfig.conf.master b/install/dist/tpl/gentoo/apache_ispconfig.conf.master index 799a39601ab99c0362079627ffc90444cbf37459..2cd17d3f1890e532252098a89244b44d7f5a7f52 100644 --- a/install/dist/tpl/gentoo/apache_ispconfig.conf.master +++ b/install/dist/tpl/gentoo/apache_ispconfig.conf.master @@ -9,13 +9,11 @@ CustomLog "| /usr/local/ispconfig/server/scripts/vlogger -s access.log -t \"%Y%m AllowOverride None - Order Deny,Allow - Deny from all + Require all denied # allow path to awstats and alias for awstats icons - Order allow,deny - Allow from all + Require all granted Alias /awstats/icon "/usr/share/awstats/htdocs/icon" diff --git a/install/dist/tpl/gentoo/apache_ispconfig.vhost.master b/install/dist/tpl/gentoo/apache_ispconfig.vhost.master index f4f08d2bb6e878d742ae023de172f9d664b189b1..fb1b9d2a1ffd2d359fd108f96b19f0df34768f54 100644 --- a/install/dist/tpl/gentoo/apache_ispconfig.vhost.master +++ b/install/dist/tpl/gentoo/apache_ispconfig.vhost.master @@ -20,8 +20,7 @@ NameVirtualHost *:{vhost_port} SetHandler fcgid-script FCGIWrapper /var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter .php - Order allow,deny - Allow from all + Require all granted DirectoryIndex index.php @@ -32,8 +31,7 @@ NameVirtualHost *:{vhost_port} Options +FollowSymLinks AllowOverride None - Order allow,deny - Allow from all + Require all granted php_value magic_quotes_gpc 0 diff --git a/install/install.php b/install/install.php index 524918454839238b73d4fe41a2ffdbc774dd8cd3..bb41927b33566f18df0b45a17def9f0648b2dc91 100644 --- a/install/install.php +++ b/install/install.php @@ -99,13 +99,14 @@ require_once 'lib/classes/tpl.inc.php'; die('We will stop here. There is already a ISPConfig installation, use the update script to update this installation.'); }*/ -// Patch is required to reapir latest amavis versions +// Patch is required to repair latest amavis versions if(is_installed('amavisd-new') && !is_installed('patch')) die('The patch command is missing. Install patch command and start installation again.'); //** Get distribution identifier $dist = get_distname(); if($dist['id'] == '') die('Linux distribution or version not recognized.'); +if(!$dist['supported']) die('This distribution is not supported.'); //** Include the autoinstaller configuration (for non-interactive setups) error_reporting(E_ALL ^ E_NOTICE); @@ -170,7 +171,9 @@ if(is_dir('/usr/local/ispconfig')) { } //** Detect the installed applications +$inst->raiseEvent('find_installed_apps::before'); $inst->find_installed_apps(); +$inst->raiseEvent('find_installed_apps::after'); //** Select the language and set default timezone $conf['language'] = $inst->simple_query('Select language', array('en', 'de'), 'en','language'); @@ -182,6 +185,7 @@ $conf['language_file_import_enabled'] = true; //** Select installation mode $install_mode = $inst->simple_query('Installation mode', array('standard', 'expert'), 'standard','install_mode'); +$inst->set_install_mode($install_mode); //** tRNG dependencies $conf['tRNG']=''; @@ -252,10 +256,8 @@ $conf['services']['web'] = false; $conf['services']['dns'] = false; $conf['services']['file'] = false; $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'); @@ -339,48 +341,16 @@ if($install_mode == 'standard' || strtolower($inst->simple_query('Configure Mail } if($conf['services']['mail']) { - //* Configure Mailman - $force = @($conf['mailman']['installed']) ? true : $inst->force_configure_app('Mailman', ($install_mode == 'expert')); - if($force) { - swriteln('Configuring Mailman'); - $inst->configure_mailman(); - } - - //* Configure mlmmj - if($conf['mlmmj']['installed'] == true) { - swriteln('Configuring Mlmmj'); - $inst->configure_mlmmj(/*install*/); - } - - //* Check for Dovecot and Courier - if(!$conf['dovecot']['installed'] && !$conf['courier']['installed']) { + //* Check for Dovecot + if(!$conf['dovecot']['installed']) { $conf['dovecot']['installed'] = $inst->force_configure_app('Dovecot', ($install_mode == 'expert')); - $conf['courier']['installed'] = $inst->force_configure_app('Courier', ($install_mode == 'expert')); - } - //* Configure Mailserver - Dovecot or Courier - if($conf['dovecot']['installed'] && $conf['courier']['installed']) { - $mail_server_to_use = $inst->simple_query('Dovecot and Courier detected. Select server to use with ISPConfig:', array('dovecot', 'courier'), 'dovecot','mail_server'); - if($mail_server_to_use == 'dovecot'){ - $conf['courier']['installed'] = false; - } else { - $conf['dovecot']['installed'] = false; - } } //* Configure Dovecot if($conf['dovecot']['installed']) { swriteln('Configuring Dovecot'); $inst->configure_dovecot(); } - //* Configure Courier - if($conf['courier']['installed']) { - swriteln('Configuring Courier'); - $inst->configure_courier(); - swriteln('Configuring SASL'); - $inst->configure_saslauthd(); - swriteln('Configuring PAM'); - $inst->configure_pam(); - } - + //* Configure Spamasassin $force = @($conf['spamassassin']['installed']) ? true : $inst->force_configure_app('Spamassassin', ($install_mode == 'expert')); if($force) { @@ -395,6 +365,12 @@ if($install_mode == 'standard' || strtolower($inst->simple_query('Configure Mail $inst->configure_amavis(); } + //* Configure Rspamd + $force = @($conf['rspamd']['installed']) ? true : $inst->force_configure_app('Rspamd', ($install_mode == 'expert')); + if($force) { + swriteln('Configuring Rspamd'); + $inst->configure_rspamd(); + } //* Configure Getmail $force = @($conf['getmail']['installed']) ? true : $inst->force_configure_app('Getmail', ($install_mode == 'expert')); if($force) { @@ -483,12 +459,7 @@ if($install_mode == 'standard' || strtolower($inst->simple_query('Configure Web } } -//* Configure OpenVZ -$force = @($conf['openvz']['installed']) ? true : $inst->force_configure_app('OpenVZ', ($install_mode == 'expert')); -if($force) { - $conf['services']['vserver'] = true; - swriteln('Configuring OpenVZ'); -} +$inst->raiseEvent('configure_webserver_selection::after'); if($install_mode == 'standard' || strtolower($inst->simple_query('Configure Firewall Server', array('y', 'n'), 'y','configure_firewall')) == 'y') { //* Check for Firewall @@ -520,22 +491,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) { @@ -597,7 +552,9 @@ if($install_mode == 'standard' || strtolower($inst->simple_query('Install ISPCon $inst->install_ispconfig_interface = false; } +$inst->raiseEvent('install_ispconfig::before'); $inst->install_ispconfig(); +$inst->raiseEvent('install_ispconfig::after'); //* Configure DBServer swriteln('Configuring DBServer'); @@ -606,7 +563,6 @@ $inst->configure_dbserver(); //* Configure ISPConfig swriteln('Installing ISPConfig crontab'); if($conf['cron']['installed']) { - swriteln('Installing ISPConfig crontab'); $inst->install_crontab(); } else swriteln('[ERROR] Cron not found'); @@ -616,18 +572,10 @@ $inst->detect_ips(); swriteln('Restarting services ...'); if($conf['mysql']['installed'] == true && $conf['mysql']['init_script'] != '') system($inst->getinitcommand($conf['mysql']['init_script'], 'restart').' >/dev/null 2>&1'); if($conf['postfix']['installed'] == true && $conf['postfix']['init_script'] != '') system($inst->getinitcommand($conf['postfix']['init_script'], 'restart')); -if($conf['saslauthd']['installed'] == true && $conf['saslauthd']['init_script'] != '') system($inst->getinitcommand($conf['saslauthd']['init_script'], 'restart')); if($conf['amavis']['installed'] == true && $conf['amavis']['init_script'] != '') system($inst->getinitcommand($conf['amavis']['init_script'], 'restart')); +if($conf['rspamd']['installed'] == true && $conf['rspamd']['init_script'] != '') system($inst->getinitcommand($conf['rspamd']['init_script'], 'restart')); if($conf['clamav']['installed'] == true && $conf['clamav']['init_script'] != '') system($inst->getinitcommand($conf['clamav']['init_script'], 'restart')); -if($conf['courier']['installed'] == true){ - if($conf['courier']['courier-authdaemon'] != '') system($inst->getinitcommand($conf['courier']['courier-authdaemon'], 'restart')); - if($conf['courier']['courier-imap'] != '') system($inst->getinitcommand($conf['courier']['courier-imap'], 'restart')); - if($conf['courier']['courier-imap-ssl'] != '') system($inst->getinitcommand($conf['courier']['courier-imap-ssl'], 'restart')); - if($conf['courier']['courier-pop'] != '') system($inst->getinitcommand($conf['courier']['courier-pop'], 'restart')); - if($conf['courier']['courier-pop-ssl'] != '') system($inst->getinitcommand($conf['courier']['courier-pop-ssl'], 'restart')); -} if($conf['dovecot']['installed'] == true && $conf['dovecot']['init_script'] != '') system($inst->getinitcommand($conf['dovecot']['init_script'], 'restart')); -if($conf['mailman']['installed'] == true && $conf['mailman']['init_script'] != '') system('nohup '.$inst->getinitcommand($conf['mailman']['init_script'], 'restart').' >/dev/null 2>&1 &'); if($conf['apache']['installed'] == true && $conf['apache']['init_script'] != '') system($inst->getinitcommand($conf['apache']['init_script'], 'restart')); //* Reload is enough for nginx if($conf['nginx']['installed'] == true){ @@ -641,7 +589,6 @@ if($conf['bind']['installed'] == true && $conf['bind']['init_script'] != '') sys //if($conf['squid']['installed'] == true && $conf['squid']['init_script'] != '' && is_file($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'); if($conf['ufw']['installed'] == true && $conf['ufw']['init_script'] != '') system($inst->getinitcommand($conf['ufw']['init_script'], 'restart').' &> /dev/null'); -if($conf['metronome']['installed'] == true && $conf['metronome']['init_script'] != '') system($inst->getinitcommand($conf['metronome']['init_script'], 'restart').' &> /dev/null'); //* test tRNG if($conf['tRNG']) tRNG(); diff --git a/install/lib/classes/ispconfig_addon_installer.inc.php b/install/lib/classes/ispconfig_addon_installer.inc.php new file mode 100644 index 0000000000000000000000000000000000000000..f1b457af8c7b18c4fcb1c96e2b2baeb03f6de51c --- /dev/null +++ b/install/lib/classes/ispconfig_addon_installer.inc.php @@ -0,0 +1,20 @@ +addon_ident = preg_replace('/_addon_installer$/', '', get_called_class()); + } + + public function onRaisedInstallerEvent($event_name, $data = false) { + + } +} diff --git a/install/lib/install.lib.php b/install/lib/install.lib.php index b2d9e66f76deec5cc3697c77e7f1c20ac04b2769..fd0510faf53c164a4b6a2ea49ea906252fe5c8bc 100644 --- a/install/lib/install.lib.php +++ b/install/lib/install.lib.php @@ -48,6 +48,7 @@ function get_distname() { $distver = ''; $distid = ''; $distbaseid = ''; + $distsupported = false; //** Debian or Ubuntu if(file_exists('/etc/debian_version')) { @@ -100,22 +101,27 @@ function get_distname() { case "18.04": $relname = "(Bionic Beaver)"; $distconfid = 'ubuntu1804'; + $distsupported = true; break; case "17.10": $relname = "(Artful Aardvark)"; $distconfid = 'ubuntu1710'; + $distsupported = true; break; case "17.04": $relname = "(Zesty Zapus)"; $distconfid = 'ubuntu1604'; + $distsupported = true; break; case "16.10": $relname = "(Yakkety Yak)"; $distconfid = 'ubuntu1604'; + $distsupported = true; break; case "16.04": $relname = "(Xenial Xerus)"; $distconfid = 'ubuntu1604'; + $distsupported = true; break; case "15.10": $relname = "(Wily Werewolf)"; @@ -221,6 +227,7 @@ function get_distname() { $distver = 'Jessie'; $distid = 'debian60'; $distbaseid = 'debian'; + $distsupported = true; swriteln("Operating System: Debian 8.0 (Jessie) or compatible\n"); } elseif(strstr(trim(file_get_contents('/etc/debian_version')), '9') || substr(trim(file_get_contents('/etc/debian_version')),0,1) == '9') { $distname = 'Debian'; @@ -228,6 +235,7 @@ function get_distname() { $distconfid = 'debian90'; $distid = 'debian60'; $distbaseid = 'debian'; + $distsupported = true; swriteln("Operating System: Debian 9.0 (Stretch) or compatible\n"); } elseif(strstr(trim(file_get_contents('/etc/debian_version')), '/sid')) { $distname = 'Debian'; @@ -235,6 +243,7 @@ function get_distname() { $distid = 'debian60'; $distconfid = 'debiantesting'; $distbaseid = 'debian'; + $distsupported = true; swriteln("Operating System: Debian Testing\n"); } else { $distname = 'Debian'; @@ -242,6 +251,7 @@ function get_distname() { $distid = 'debian60'; $distconfid = 'debian90'; $distbaseid = 'debian'; + $distsupported = true; swriteln("Operating System: Debian or compatible, unknown version.\n"); } } @@ -259,6 +269,7 @@ function get_distname() { $distver = 'Ceres'; $distid = 'debiantesting'; $distbaseid = 'debian'; + $distsupported = true; swriteln("Operating System: Devuan Unstable (Ceres) or compatible\n"); } } @@ -282,12 +293,14 @@ function get_distname() { $distver = '11.2'; $distid = 'opensuse112'; $distbaseid = 'opensuse'; + $distsupported = true; swriteln("Operating System: openSUSE 11.2 or compatible\n"); } else { $distname = 'openSUSE'; $distver = 'Unknown'; $distid = 'opensuse112'; $distbaseid = 'opensuse'; + $distsupported = true; swriteln("Operating System: openSUSE or compatible, unknown version.\n"); } } @@ -321,6 +334,7 @@ function get_distname() { $distver = '5.2'; $distid = 'centos52'; $distbaseid = 'fedora'; + $distsupported = true; swriteln("Operating System: CentOS 5.2 or compatible\n"); } elseif(stristr($content, 'CentOS release 5.3 (Final)')) { $distname = 'CentOS'; @@ -347,6 +361,8 @@ function get_distname() { $var=explode(" ", $content); $var=explode(".", $var[3]); $var=$var[0].".".$var[1]; + $distver = $var; + $distsupported = true; if($var=='7.0' || $var=='7.1') { $distid = 'centos70'; } else { @@ -372,6 +388,7 @@ function get_distname() { $distver = $version[0][0].$version[0][1]; $distid = 'gentoo'; $distbaseid = 'gentoo'; + $distsupported = true; swriteln("Operating System: Gentoo $distver or compatible\n"); } else { @@ -381,7 +398,7 @@ function get_distname() { // Set $distconfid to distid, if no different id for the config is defined if(!isset($distconfid)) $distconfid = $distid; - return array('name' => $distname, 'version' => $distver, 'id' => $distid, 'confid' => $distconfid, 'baseid' => $distbaseid); + return array('name' => $distname, 'version' => $distver, 'id' => $distid, 'confid' => $distconfid, 'baseid' => $distbaseid, 'supported' => $distsupported); } function sread() { @@ -970,20 +987,20 @@ function getapacheversion($get_minor = false) { elseif(is_installed('apachectl')) $cmd = 'apachectl -v'; else { ilog("Could not check apache version, apachectl not found."); - return '2.2'; + return '2.4'; } exec($cmd, $output, $return_var); if($return_var != 0 || !$output[0]) { ilog("Could not check apache version, apachectl did not return any data."); - return '2.2'; + return '2.4'; } if(preg_match('/version:\s*Apache\/(\d+)(\.(\d+)(\.(\d+))*)?(\D|$)/i', $output[0], $matches)) { return $matches[1] . (isset($matches[3]) ? '.' . $matches[3] : '') . (isset($matches[5]) && $get_minor == true ? '.' . $matches[5] : ''); } else { ilog("Could not check apache version, did not find version string in apachectl output."); - return '2.2'; + return '2.4'; } } diff --git a/install/lib/installer_base.lib.php b/install/lib/installer_base.lib.php index 6011a2c4aaee5ccd0eb4d80c9c10c6f110dd23d6..57df2702e86abab7b9ce8afd13cd46a00e278ab6 100644 --- a/install/lib/installer_base.lib.php +++ b/install/lib/installer_base.lib.php @@ -28,6 +28,8 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +require_once realpath(dirname(__FILE__)) . '/classes/ispconfig_addon_installer.inc.php'; + class installer_base { var $wb = array(); @@ -37,9 +39,9 @@ class installer_base { public $install_ispconfig_interface = true; public $is_update = false; // true if it is an update, falsi if it is a new install public $min_php = '5.3.3'; // minimal php-version for update / install - protected $mailman_group = 'list'; - - + private $addon_classes = null; + private $install_mode = ''; + public function __construct() { global $conf; //TODO: maybe $conf should be passed to constructor //$this->conf = $conf; @@ -58,6 +60,14 @@ class installer_base { echo 'WARNING: '.$msg."\n"; } + public function set_install_mode($mode) { + $this->install_mode = $mode; + } + + public function get_install_mode() { + return $this->install_mode; + } + public function simple_query($query, $answers, $default, $name = '') { global $autoinstall, $autoupdate; $finished = false; @@ -152,18 +162,15 @@ class installer_base { //** Detect installed applications public function find_installed_apps() { global $conf; - + if(is_installed('mysql') || is_installed('mysqld')) $conf['mysql']['installed'] = true; if(is_installed('postfix')) $conf['postfix']['installed'] = true; if(is_installed('postgrey')) $conf['postgrey']['installed'] = true; - if(is_installed('mailman') || is_installed('mmsitepass')) $conf['mailman']['installed'] = true; - if(is_installed('mlmmj') || is_installed('mlmmj-make-ml')) $conf['mlmmj']['installed'] = true; if(is_installed('apache') || is_installed('apache2') || is_installed('httpd') || is_installed('httpd2')) $conf['apache']['installed'] = true; if(is_installed('getmail')) $conf['getmail']['installed'] = true; - if(is_installed('courierlogger')) $conf['courier']['installed'] = true; if(is_installed('dovecot')) $conf['dovecot']['installed'] = true; - if(is_installed('saslauthd')) $conf['saslauthd']['installed'] = true; if(is_installed('amavisd-new') || is_installed('amavisd')) $conf['amavis']['installed'] = true; + if(is_installed('rspamd')) $conf['rspamd']['installed'] = true; if(is_installed('clamdscan')) $conf['clamav']['installed'] = true; if(is_installed('pure-ftpd') || is_installed('pure-ftpd-wrapper')) $conf['pureftpd']['installed'] = true; if(is_installed('mydns') || is_installed('mydns-ng')) $conf['mydns']['installed'] = true; @@ -178,9 +185,6 @@ class installer_base { $conf['firewall']['installed'] = true; } if(is_installed('fail2ban-server')) $conf['fail2ban']['installed'] = true; - if(is_installed('vzctl')) $conf['openvz']['installed'] = true; - if(is_installed('metronome') && is_installed('metronomectl')) $conf['metronome']['installed'] = true; - if(is_installed('prosody') && is_installed('prosodyctl')) $conf['prosody']['installed'] = true; if(is_installed('spamassassin')) $conf['spamassassin']['installed'] = true; // if(is_installed('vlogger')) $conf['vlogger']['installed'] = true; // ISPConfig ships with vlogger, so it is always installed. @@ -288,7 +292,6 @@ class installer_base { // Delete ISPConfig user in the local database, in case that it exists $this->db->query("DROP USER ?@?", $conf['mysql']['ispconfig_user'], $from_host); - $this->db->query("DROP DATABASE IF EXISTS ?", $conf['mysql']['database']); //* Create the ISPConfig database user in the local database $query = 'GRANT SELECT, INSERT, UPDATE, DELETE ON ?? TO ?@? IDENTIFIED BY ?'; @@ -321,9 +324,6 @@ class installer_base { $tpl_ini_array['web']['group'] = $conf['apache']['group']; $tpl_ini_array['web']['php_ini_path_apache'] = $conf['apache']['php_ini_path_apache']; $tpl_ini_array['web']['php_ini_path_cgi'] = $conf['apache']['php_ini_path_cgi']; - $tpl_ini_array['mail']['pop3_imap_daemon'] = ($conf['dovecot']['installed'] == true)?'dovecot':'courier'; - $tpl_ini_array['mail']['mail_filter_syntax'] = ($conf['dovecot']['installed'] == true)?'sieve':'maildrop'; - $tpl_ini_array['mail']['mailinglist_manager'] = ($conf['mlmmj']['installed'] == true)?'mlmmj':'mailman'; $tpl_ini_array['dns']['bind_user'] = $conf['bind']['bind_user']; $tpl_ini_array['dns']['bind_group'] = $conf['bind']['bind_group']; $tpl_ini_array['dns']['bind_zonefiles_dir'] = $conf['bind']['bind_zonefiles_dir']; @@ -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'; @@ -362,7 +359,6 @@ class installer_base { $dns_server_enabled = ($conf['services']['dns'])?1:0; $file_server_enabled = ($conf['services']['file'])?1:0; $db_server_enabled = ($conf['services']['db'])?1:0; - $vserver_server_enabled = ($conf['openvz']['installed'])?1:0; $proxy_server_enabled = (isset($conf['services']['proxy']) && $conf['services']['proxy'])?1:0; $firewall_server_enabled = (isset($conf['services']['firewall']) && $conf['services']['firewall'])?1:0; @@ -384,14 +380,13 @@ class installer_base { if($conf['mysql']['master_slave_setup'] == 'y') { //* Insert the server record in master DB - $sql = "INSERT INTO `server` (`sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `server_name`, `mail_server`, `web_server`, `dns_server`, `file_server`, `db_server`, `vserver_server`, `config`, `updated`, `active`, `dbversion`,`firewall_server`,`proxy_server`) VALUES (1, 1, 'riud', 'riud', 'r', ?, ?, ?, ?, ?, ?, ?, ?, 0, 1, ?, ?, ?);"; - $this->dbmaster->query($sql, $conf['hostname'], $mail_server_enabled, $web_server_enabled, $dns_server_enabled, $file_server_enabled, $db_server_enabled, $vserver_server_enabled, $server_ini_content, $current_db_version, $proxy_server_enabled, $firewall_server_enabled); + $sql = "INSERT INTO `server` (`sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `server_name`, `mail_server`, `web_server`, `dns_server`, `file_server`, `db_server`, `config`, `updated`, `active`, `dbversion`,`firewall_server`,`proxy_server`) VALUES (1, 1, 'riud', 'riud', 'r', ?, ?, ?, ?, ?, ?, ?, 0, 1, ?, ?, ?);"; + $this->dbmaster->query($sql, $conf['hostname'], $mail_server_enabled, $web_server_enabled, $dns_server_enabled, $file_server_enabled, $db_server_enabled, $server_ini_content, $current_db_version, $proxy_server_enabled, $firewall_server_enabled); $conf['server_id'] = $this->dbmaster->insertID(); - $conf['server_id'] = $conf['server_id']; //* Insert the same record in the local DB - $sql = "INSERT INTO `server` (`server_id`, `sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `server_name`, `mail_server`, `web_server`, `dns_server`, `file_server`, `db_server`, `vserver_server`, `config`, `updated`, `active`, `dbversion`,`firewall_server`,`proxy_server`) VALUES (?,1, 1, 'riud', 'riud', 'r', ?, ?, ?, ?, ?, ?, ?, ?, 0, 1, ?, ?, ?);"; - $this->db->query($sql, $conf['server_id'], $conf['hostname'], $mail_server_enabled, $web_server_enabled, $dns_server_enabled, $file_server_enabled, $db_server_enabled, $vserver_server_enabled, $server_ini_content, $current_db_version, $proxy_server_enabled, $firewall_server_enabled); + $sql = "INSERT INTO `server` (`server_id`, `sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `server_name`, `mail_server`, `web_server`, `dns_server`, `file_server`, `db_server``, `config`, `updated`, `active`, `dbversion`,`firewall_server`,`proxy_server`) VALUES (?,1, 1, 'riud', 'riud', 'r', ?, ?, ?, ?, ?, ?, ?, 0, 1, ?, ?, ?);"; + $this->db->query($sql, $conf['server_id'], $conf['hostname'], $mail_server_enabled, $web_server_enabled, $dns_server_enabled, $file_server_enabled, $db_server_enabled, $server_ini_content, $current_db_version, $proxy_server_enabled, $firewall_server_enabled); //* username for the ispconfig user $conf['mysql']['master_ispconfig_user'] = 'ispcsrv'.$conf['server_id']; @@ -400,13 +395,10 @@ class installer_base { } else { //* Insert the server, if its not a mster / slave setup - $sql = "INSERT INTO `server` (`sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `server_name`, `mail_server`, `web_server`, `dns_server`, `file_server`, `db_server`, `vserver_server`, `config`, `updated`, `active`, `dbversion`,`firewall_server`,`proxy_server`) VALUES (1, 1, 'riud', 'riud', 'r', ?, ?, ?, ?, ?, ?, ?, ?, 0, 1, ?, ?, ?);"; - $this->db->query($sql, $conf['hostname'], $mail_server_enabled, $web_server_enabled, $dns_server_enabled, $file_server_enabled, $db_server_enabled, $vserver_server_enabled, $server_ini_content, $current_db_version, $proxy_server_enabled, $firewall_server_enabled); + $sql = "INSERT INTO `server` (`sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `server_name`, `mail_server`, `web_server`, `dns_server`, `file_server`, `db_server`, `config`, `updated`, `active`, `dbversion`,`firewall_server`,`proxy_server`) VALUES (1, 1, 'riud', 'riud', 'r', ?, ?, ?, ?, ?, ?, ?, 0, 1, ?, ?, ?);"; + $this->db->query($sql, $conf['hostname'], $mail_server_enabled, $web_server_enabled, $dns_server_enabled, $file_server_enabled, $db_server_enabled, $server_ini_content, $current_db_version, $proxy_server_enabled, $firewall_server_enabled); $conf['server_id'] = $this->db->insertID(); - $conf['server_id'] = $conf['server_id']; } - - } public function detect_ips(){ @@ -757,171 +749,6 @@ class installer_base { } - public function configure_mailman($status = 'insert') { - global $conf; - - $config_dir = $conf['mailman']['config_dir'].'/'; - $full_file_name = $config_dir.'mm_cfg.py'; - //* Backup exiting file - if(is_file($full_file_name)) { - copy($full_file_name, $config_dir.'mm_cfg.py~'); - } - - // load files - $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/mm_cfg.py.master', 'tpl/mm_cfg.py.master'); - $old_file = rf($full_file_name); - - $old_options = array(); - $lines = explode("\n", $old_file); - foreach ($lines as $line) - { - if (trim($line) != '' && substr($line, 0, 1) != '#') - { - @list($key, $value) = @explode("=", $line); - if (isset($value) && $value !== '') - { - $key = rtrim($key); - $old_options[$key] = trim($value); - } - } - } - - $virtual_domains = ''; - if($status == 'update') - { - // create virtual_domains list - $domainAll = $this->db->queryAllRecords("SELECT domain FROM mail_mailinglist GROUP BY domain"); - - if(is_array($domainAll)) { - foreach($domainAll as $domain) - { - if ($domainAll[0]['domain'] == $domain['domain']) - $virtual_domains .= "'".$domain['domain']."'"; - else - $virtual_domains .= ", '".$domain['domain']."'"; - } - } - } - else - $virtual_domains = "' '"; - - $content = str_replace('{hostname}', $conf['hostname'], $content); - if(!isset($old_options['DEFAULT_SERVER_LANGUAGE']) || $old_options['DEFAULT_SERVER_LANGUAGE'] == '') $old_options['DEFAULT_SERVER_LANGUAGE'] = "'en'"; - $content = str_replace('{default_language}', $old_options['DEFAULT_SERVER_LANGUAGE'], $content); - $content = str_replace('{virtual_domains}', $virtual_domains, $content); - - wf($full_file_name, $content); - - //* Write virtual_to_transport.sh script - $config_dir = $conf['mailman']['config_dir'].'/'; - $full_file_name = $config_dir.'virtual_to_transport.sh'; - - //* Backup exiting virtual_to_transport.sh script - if(is_file($full_file_name)) { - copy($full_file_name, $config_dir.'virtual_to_transport.sh~'); - } - - if(is_dir('/etc/mailman')) { - if(is_file($conf['ispconfig_install_dir'].'/server/conf-custom/install/mailman-virtual_to_transport.sh')) { - copy($conf['ispconfig_install_dir'].'/server/conf-custom/install/mailman-virtual_to_transport.sh', $full_file_name); - } else { - copy('tpl/mailman-virtual_to_transport.sh', $full_file_name); - } - chgrp($full_file_name, $this->mailman_group); - chmod($full_file_name, 0755); - } - - //* Create aliasaes - if($status == 'install') exec('/usr/lib/mailman/bin/genaliases 2>/dev/null'); - - if(!is_file('/var/lib/mailman/data/transport-mailman')) touch('/var/lib/mailman/data/transport-mailman'); - exec('/usr/sbin/postmap /var/lib/mailman/data/transport-mailman'); - } - - public function configure_mlmmj() { - global $conf; - - $configDir = $conf['mlmmj']['config_dir']; - @mkdir($configDir, 0755, true); - - $configFile = 'mlmmj.conf'; - - //* Backup exiting file - if(is_file("$configDir/$configFile")) { - copy("$configDir/$configFile", "$configDir/$configFile~"); - } - - // load files - if(is_file($conf['ispconfig_install_dir']."/server/conf-custom/install/$configFile.master")) { - copy($conf['ispconfig_install_dir']."/server/conf-custom/install/$configFile.master", "$configDir/$configFile"); - } else { - copy("tpl/$configFile.master", "$configDir/$configFile"); - } - - $mlConfig = @parse_ini_file("$configDir/$configFile"); - // Force PHP7 to use # to mark comments - if(PHP_MAJOR_VERSION >= 7) - $mlConfig = array_filter($mlConfig, function($v){return(substr($v,0,1)!=='#');}, ARRAY_FILTER_USE_KEY); - - $command = 'useradd --system mlmmj --home '.$mlConfig['spool_dir'].' --shell /usr/false'; - if(!is_user('mlmmj')) caselog("$command &> /dev/null", __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); - - @mkdir($mlConfig['spool_dir'], 0755, true); - chown($mlConfig['spool_dir'], 'mlmmj'); - chgrp($mlConfig['spool_dir'], 'mlmmj'); - - // Make a backup copy of master.cf and main.cf files - copy($conf['postfix']['config_dir'].'/main.cf', $conf['postfix']['config_dir'].'/main.cf~mlmmj'); - - //* Update postfix main.cf - $content = rf($conf['postfix']['config_dir'].'/main.cf'); - - if(!preg_match("/^alias_maps = .*hash:\/etc\/mlmmj\/aliases.*/m", $content)) { - $content = preg_replace("/^alias_maps = (.*)/m", "$0, hash:$configDir/aliases", $content); - } - - if(!preg_match("/^alias_database = .*hash:\/etc\/mlmmj\/aliases.*/m", $content)) { - $content = preg_replace("/^alias_database = (.*)/m", "$0, hash:$configDir/aliases", $content); - } - - if(!preg_match("/^virtual_alias_maps = .*hash:\/etc\/mlmmj\/virtual.*/m", $content)) { - $content = preg_replace("/^virtual_alias_maps = (.*)/m", "$0, hash:$configDir/virtual", $content); - } - - if(!preg_match("/^transport_maps = .*hash:\/etc\/mlmmj\/transport.*/m", $content)) { - $content = preg_replace("/transport_maps = (.*)/m", "$0, hash:$configDir/transport", $content); - } - - if(!preg_match("/^mlmmj_destination_recipient_limit.*/m", $content)) { - $content .= "\n# Only deliver one message to Mlmmj at a time\nmlmmj_destination_recipient_limit = 1\n"; - } - - wf($conf['postfix']['config_dir'].'/main.cf', $content); - - //* Update postfix master.cf - $content = rf($conf['postfix']['config_dir'].'/master.cf'); - if(!preg_match('/^mlmmj\s+unix\s+-\s+n\s+n\s+-\s+-\s+pipe\s*$/m', $content)) { - copy($conf['postfix']['config_dir'].'/master.cf', $conf['postfix']['config_dir'].'/master.cf~mlmmj'); - $content .= "\n# mlmmj mailing lists\n"; - $content .= "mlmmj unix - n n - - pipe\n"; - $content .= " flags=ORhu user=mlmmj argv=/usr/bin/mlmmj-receive -F -L "; - $content .= $mlConfig['spool_dir']."/\$nexthop\n\n"; - wf($conf['postfix']['config_dir'].'/master.cf', $content); - } - - //* Create aliasaes - touch("$configDir/aliases"); - exec("nohup /usr/sbin/postalias $configDir/aliases >/dev/null 2>&1"); - touch("$configDir/virtual"); - exec("nohup /usr/sbin/postmap $configDir/virtual >/dev/null 2>&1"); - touch("$configDir/transport"); - exec("nohup /usr/sbin/postmap $configDir/transport >/dev/null 2>&1"); - - //* Create/update cron entry - $cronEntry = '0 */2 * * * find /var'.$mlConfig['spool_dir'].'/ -mindepth 1 -maxdepth 1 -type d -exec /usr/bin/mlmmj-maintd -F -d {} \;'; - file_put_contents('/etc/cron.d/mlmmj', $cronEntry); - } - public function get_postfix_service($service, $type) { global $conf; @@ -1081,15 +908,6 @@ class installer_base { touch($config_dir.'/nested_header_checks'); touch($config_dir.'/body_checks'); - //* Create the mailman files - if(!is_dir('/var/lib/mailman/data')) exec('mkdir -p /var/lib/mailman/data'); - if(!is_file('/var/lib/mailman/data/aliases')) touch('/var/lib/mailman/data/aliases'); - exec('postalias /var/lib/mailman/data/aliases'); - if(!is_file('/var/lib/mailman/data/virtual-mailman')) touch('/var/lib/mailman/data/virtual-mailman'); - exec('postmap /var/lib/mailman/data/virtual-mailman'); - if(!is_file('/var/lib/mailman/data/transport-mailman')) touch('/var/lib/mailman/data/transport-mailman'); - exec('/usr/sbin/postmap /var/lib/mailman/data/transport-mailman'); - //* Create auxillary postfix conf files $configfile = 'helo_access'; if(is_file($config_dir.'/'.$configfile)) { @@ -1135,10 +953,6 @@ class installer_base { caselog($command.' &> /dev/null', __FILE__, __LINE__, 'EXECUTED: '.$command, 'Failed to execute the command '.$command); } - //** We have to change the permissions of the courier authdaemon directory to make it accessible for maildrop. - $command = 'chmod 755 /var/run/courier/authdaemon/'; - if(is_file('/var/run/courier/authdaemon/')) caselog($command.' &> /dev/null', __FILE__, __LINE__, 'EXECUTED: '.$command, 'Failed to execute the command '.$command); - //* Check maildrop service in posfix master.cf $regex = "/^maildrop unix.*pipe flags=DRhu user=vmail argv=\\/usr\\/bin\\/maildrop -d ".$cf['vmail_username']." \\$\{extension} \\$\{recipient} \\$\{user} \\$\{nexthop} \\$\{sender}/"; $configfile = $config_dir.'/master.cf'; @@ -1188,119 +1002,6 @@ class installer_base { } - public function configure_saslauthd() { - global $conf; - - //* Get saslsauthd version - exec('saslauthd -v 2>&1', $out); - $parts = explode(' ', $out[0]); - $saslversion = $parts[1]; - unset($parts); - unset($out); - - if(version_compare($saslversion , '2.1.23', '<=')) { - //* Configfile for saslauthd versions up to 2.1.23 - $configfile = 'sasl_smtpd.conf'; - } else { - //* Configfile for saslauthd versions 2.1.24 and newer - $configfile = 'sasl_smtpd2.conf'; - } - - if(is_file($conf['postfix']['config_dir'].'/sasl/smtpd.conf')) copy($conf['postfix']['config_dir'].'/sasl/smtpd.conf', $conf['postfix']['config_dir'].'/sasl/smtpd.conf~'); - if(is_file($conf['postfix']['config_dir'].'/sasl/smtpd.conf~')) chmod($conf['postfix']['config_dir'].'/sasl/smtpd.conf~', 0400); - $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$configfile.'.master', 'tpl/'.$configfile.'.master'); - $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); - wf($conf['postfix']['config_dir'].'/sasl/smtpd.conf', $content); - - // TODO: Chmod and chown on the config file - - - // Recursively create the spool directory - if(!@is_dir('/var/spool/postfix/var/run/saslauthd')) mkdir('/var/spool/postfix/var/run/saslauthd', 0755, true); - - // Edit the file /etc/default/saslauthd - $configfile = $conf['saslauthd']['config']; - if(is_file($configfile)) copy($configfile, $configfile.'~'); - if(is_file($configfile.'~')) chmod($configfile.'~', 0400); - $content = rf($configfile); - $content = str_replace('START=no', 'START=yes', $content); - // Debian - $content = str_replace('OPTIONS="-c"', 'OPTIONS="-m /var/spool/postfix/var/run/saslauthd -r"', $content); - // Ubuntu - $content = str_replace('OPTIONS="-c -m /var/run/saslauthd"', 'OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd -r"', $content); - wf($configfile, $content); - - // Edit the file /etc/init.d/saslauthd - $configfile = $conf['init_scripts'].'/'.$conf['saslauthd']['init_script']; - $content = rf($configfile); - $content = str_replace('PIDFILE=$RUN_DIR/saslauthd.pid', 'PIDFILE="/var/spool/postfix/var/run/${NAME}/saslauthd.pid"', $content); - wf($configfile, $content); - - // add the postfix user to the sasl group (at least necessary for Ubuntu 8.04 and most likely Debian Lenny as well. - exec('adduser postfix sasl'); - - - } - - public function configure_pam() { - global $conf; - $pam = $conf['pam']; - //* configure pam for SMTP authentication agains the ispconfig database - $configfile = 'pamd_smtp'; - if(is_file($pam.'/smtp')) copy($pam.'/smtp', $pam.'/smtp~'); - if(is_file($pam.'/smtp~')) chmod($pam.'/smtp~', 0400); - - $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$configfile.'.master', 'tpl/'.$configfile.'.master'); - $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); - wf($pam.'/smtp', $content); - // On some OSes smtp is world readable which allows for reading database information. Removing world readable rights should have no effect. - if(is_file($pam.'/smtp')) exec("chmod o= $pam/smtp"); - chmod($pam.'/smtp', 0660); - chown($pam.'/smtp', 'daemon'); - chgrp($pam.'/smtp', 'daemon'); - - } - - public function configure_courier() { - global $conf; - $config_dir = $conf['courier']['config_dir']; - //* authmysqlrc - $configfile = 'authmysqlrc'; - if(is_file($config_dir.'/'.$configfile)) { - copy($config_dir.'/'.$configfile, $config_dir.'/'.$configfile.'~'); - } - chmod($config_dir.'/'.$configfile.'~', 0400); - $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$configfile.'.master', 'tpl/'.$configfile.'.master'); - $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_host}', $conf['mysql']['host'], $content); - $content = str_replace('{mysql_server_port}', $conf['mysql']['port'], $content); - wf($config_dir.'/'.$configfile, $content); - - chmod($config_dir.'/'.$configfile, 0660); - chown($config_dir.'/'.$configfile, 'daemon'); - chgrp($config_dir.'/'.$configfile, 'daemon'); - - //* authdaemonrc - $configfile = $config_dir.'/authdaemonrc'; - if(is_file($configfile)) { - copy($configfile, $configfile.'~'); - } - if(is_file($configfile.'~')) { - chmod($configfile.'~', 0400); - } - $content = rf($configfile); - $content = str_replace('authmodulelist="authpam"', 'authmodulelist="authmysql"', $content); - wf($configfile, $content); - } - public function configure_dovecot() { global $conf; @@ -1340,7 +1041,6 @@ class installer_base { } //* Reconfigure postfix to use dovecot authentication - // Adding the amavisd commands to the postfix configuration $postconf_commands = array ( 'dovecot_destination_recipient_limit = 1', 'virtual_transport = '.$virtual_transport, @@ -1518,6 +1218,171 @@ class installer_base { if(!empty($amavis_group)) exec('chgrp -R '.$amavis_group.' /var/lib/amavis/dkim'); } + + public function configure_rspamd() { + global $conf; + + //* These postconf commands will be executed on installation and update + $server_ini_rec = $this->db->queryOneRecord("SELECT config FROM ?? WHERE server_id = ?", $conf["mysql"]["database"] . '.server', $conf['server_id']); + $server_ini_array = ini_to_array(stripslashes($server_ini_rec['config'])); + unset($server_ini_rec); + + $mail_config = $server_ini_array['mail']; + if($mail_config['content_filter'] === 'rspamd') { + exec("postconf -X 'receive_override_options'"); + exec("postconf -X 'content_filter'"); + + exec("postconf -e 'smtpd_milters = inet:localhost:11332'"); + exec("postconf -e 'non_smtpd_milters = inet:localhost:11332'"); + exec("postconf -e 'milter_protocol = 6'"); + exec("postconf -e 'milter_mail_macros = i {mail_addr} {client_addr} {client_name} {auth_authen}'"); + exec("postconf -e 'milter_default_action = accept'"); + + exec("postconf -e 'smtpd_sender_restrictions = check_sender_access mysql:/etc/postfix/mysql-virtual_sender.cf, permit_mynetworks, permit_sasl_authenticated'"); + + $new_options = array(); + $options = preg_split("/,\s*/", exec("postconf -h smtpd_recipient_restrictions")); + foreach ($options as $value) { + if (!preg_match('/check_policy_service\s+inet:127.0.0.1:10023/', $value)) { + $new_options[] = $value; + } + } + exec("postconf -e 'smtpd_recipient_restrictions = ".implode(", ", $new_options)."'"); + } + + if(!is_dir('/etc/rspamd/local.d/')){ + mkdir('/etc/rspamd/local.d/', 0755, true); + } + + if(!is_dir('/etc/rspamd/override.d/')){ + mkdir('/etc/rspamd/override.d/', 0755, true); + } + + $tpl = new tpl(); + $tpl->newTemplate('rspamd_users.conf.master'); + + $whitelist_ips = array(); + $ips = $this->db->queryAllRecords("SELECT * FROM server_ip WHERE server_id = ?", $conf['server_id']); + if(is_array($ips) && !empty($ips)){ + foreach($ips as $ip){ + $whitelist_ips[] = array('ip' => $ip['ip_address']); + } + } + $tpl->setLoop('whitelist_ips', $whitelist_ips); + wf('/etc/rspamd/local.d/users.conf', $tpl->grab()); + + if(file_exists($conf['ispconfig_install_dir'].'/server/conf-custom/install/rspamd_groups.conf.master')) { + exec('cp '.$conf['ispconfig_install_dir'].'/server/conf-custom/install/rspamd_groups.conf.master /etc/rspamd/local.d/groups.conf'); + } else { + exec('cp tpl/rspamd_groups.conf.master /etc/rspamd/local.d/groups.conf'); + } + + if(file_exists($conf['ispconfig_install_dir'].'/server/conf-custom/install/rspamd_antivirus.conf.master')) { + exec('cp '.$conf['ispconfig_install_dir'].'/server/conf-custom/install/rspamd_antivirus.conf.master /etc/rspamd/local.d/antivirus.conf'); + } else { + exec('cp tpl/rspamd_antivirus.conf.master /etc/rspamd/local.d/antivirus.conf'); + } + + if(file_exists($conf['ispconfig_install_dir'].'/server/conf-custom/install/rspamd_classifier-bayes.conf.master')) { + exec('cp '.$conf['ispconfig_install_dir'].'/server/conf-custom/install/rspamd_classifier-bayes.conf.master /etc/rspamd/local.d/classifier-bayes.conf'); + } else { + exec('cp tpl/rspamd_classifier-bayes.conf.master /etc/rspamd/local.d/classifier-bayes.conf'); + } + + if(file_exists($conf['ispconfig_install_dir'].'/server/conf-custom/install/rspamd_greylist.conf.master')) { + exec('cp '.$conf['ispconfig_install_dir'].'/server/conf-custom/install/rspamd_greylist.conf.master /etc/rspamd/local.d/greylist.conf'); + } else { + exec('cp tpl/rspamd_greylist.conf.master /etc/rspamd/local.d/greylist.conf'); + } + + if(file_exists($conf['ispconfig_install_dir'].'/server/conf-custom/install/rspamd_symbols_antivirus.conf.master')) { + exec('cp '.$conf['ispconfig_install_dir'].'/server/conf-custom/install/rspamd_symbols_antivirus.conf.master /etc/rspamd/local.d/antivirus_group.conf'); + } else { + exec('cp tpl/rspamd_symbols_antivirus.conf.master /etc/rspamd/local.d/antivirus_group.conf'); + } + + if(file_exists($conf['ispconfig_install_dir'].'/server/conf-custom/install/rspamd_override_rbl.conf.master')) { + exec('cp '.$conf['ispconfig_install_dir'].'/server/conf-custom/install/rspamd_override_rbl.conf.master /etc/rspamd/override.d/rbl_group.conf'); + } else { + exec('cp tpl/rspamd_override_rbl.conf.master /etc/rspamd/override.d/rbl_group.conf'); + } + + if(file_exists($conf['ispconfig_install_dir'].'/server/conf-custom/install/rspamd_override_surbl.conf.master')) { + exec('cp '.$conf['ispconfig_install_dir'].'/server/conf-custom/install/rspamd_override_surbl.conf.master /etc/rspamd/override.d/surbl_group.conf'); + } else { + exec('cp tpl/rspamd_override_surbl.conf.master /etc/rspamd/override.d/surbl_group.conf'); + } + + if(file_exists($conf['ispconfig_install_dir'].'/server/conf-custom/install/rspamd_mx_check.conf.master')) { + exec('cp '.$conf['ispconfig_install_dir'].'/server/conf-custom/install/rspamd_mx_check.conf.master /etc/rspamd/local.d/mx_check.conf'); + } else { + exec('cp tpl/rspamd_mx_check.conf.master /etc/rspamd/local.d/mx_check.conf'); + } + + if(file_exists($conf['ispconfig_install_dir'].'/server/conf-custom/install/rspamd_redis.conf.master')) { + exec('cp '.$conf['ispconfig_install_dir'].'/server/conf-custom/install/rspamd_redis.conf.master /etc/rspamd/local.d/redis.conf'); + } else { + exec('cp tpl/rspamd_redis.conf.master /etc/rspamd/local.d/redis.conf'); + } + + if(file_exists($conf['ispconfig_install_dir'].'/server/conf-custom/install/rspamd_milter_headers.conf.master')) { + exec('cp '.$conf['ispconfig_install_dir'].'/server/conf-custom/install/rspamd_milter_headers.conf.master /etc/rspamd/local.d/milter_headers.conf'); + } else { + exec('cp tpl/rspamd_milter_headers.conf.master /etc/rspamd/local.d/milter_headers.conf'); + } + + if(file_exists($conf['ispconfig_install_dir'].'/server/conf-custom/install/rspamd_options.inc.master')) { + exec('cp '.$conf['ispconfig_install_dir'].'/server/conf-custom/install/rspamd_options.inc.master /etc/rspamd/local.d/options.inc'); + } else { + exec('cp tpl/rspamd_options.inc.master /etc/rspamd/local.d/options.inc'); + } + + if(file_exists($conf['ispconfig_install_dir'].'/server/conf-custom/install/rspamd_neural.conf.master')) { + exec('cp '.$conf['ispconfig_install_dir'].'/server/conf-custom/install/rspamd_neural.conf.master /etc/rspamd/local.d/neural.conf'); + } else { + exec('cp tpl/rspamd_neural.conf.master /etc/rspamd/local.d/neural.conf'); + } + + if(file_exists($conf['ispconfig_install_dir'].'/server/conf-custom/install/rspamd_neural_group.conf.master')) { + exec('cp '.$conf['ispconfig_install_dir'].'/server/conf-custom/install/rspamd_neural_group.conf.master /etc/rspamd/local.d/neural_group.conf'); + } else { + exec('cp tpl/rspamd_neural_group.conf.master /etc/rspamd/local.d/neural_group.conf'); + } + + exec('chmod a+r /etc/rspamd/local.d/* /etc/rspamd/override.d/*'); + + $tpl = new tpl(); + $tpl->newTemplate('rspamd_dkim_signing.conf.master'); + $tpl->setVar('dkim_path', $mail_config['dkim_path']); + wf('/etc/rspamd/local.d/dkim_signing.conf', $tpl->grab()); + + $command = 'usermod -a -G amavis _rspamd'; + caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); + + if(strpos(rf('/etc/rspamd/rspamd.conf'), '.include "$LOCAL_CONFDIR/local.d/users.conf"') === false){ + af('/etc/rspamd/rspamd.conf', '.include "$LOCAL_CONFDIR/local.d/users.conf"'); + } + + if(!isset($mail_config['rspamd_password']) || !$mail_config['rspamd_password']) { + $mail_config['rspamd_password'] = str_shuffle(bin2hex(openssl_random_pseudo_bytes(12))); + + $server_ini_array['mail']['rspamd_password'] = $mail_config['rspamd_password']; + } + + $server_ini_array['mail']['rspamd_available'] = 'y'; + $server_ini_string = array_to_ini($server_ini_array); + if($this->dbmaster != $this->db) { + $this->dbmaster->query('UPDATE `server` SET `config` = ? WHERE `server_id` = ?', $server_ini_string, $conf['server_id']); + } + $this->db->query('UPDATE `server` SET `config` = ? WHERE `server_id` = ?', $server_ini_string, $conf['server_id']); + unset($server_ini_array); + unset($server_ini_string); + + $tpl = new tpl(); + $tpl->newTemplate('rspamd_worker-controller.inc.master'); + $tpl->setVar('rspamd_password', $mail_config['rspamd_password']); + wf('/etc/rspamd/local.d/worker-controller.inc', $tpl->grab()); + } public function configure_spamassassin() { global $conf; @@ -1722,215 +1587,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; @@ -2539,7 +2195,7 @@ class installer_base { // TODO: Implement a selector which modules and plugins shall be enabled. $dir = $install_dir.'/server/mods-available/'; if (is_dir($dir)) { - if ($dh = opendir($dir)) { + if (($dh = opendir($dir))) { while (($file = readdir($dh)) !== false) { if($file != '.' && $file != '..' && substr($file, -8, 8) == '.inc.php') { include_once $install_dir.'/server/mods-available/'.$file; @@ -2566,7 +2222,7 @@ class installer_base { $dir = $install_dir.'/server/plugins-available/'; if (is_dir($dir)) { - if ($dh = opendir($dir)) { + if (($dh = opendir($dir))) { while (($file = readdir($dh)) !== false) { if($conf['apache']['installed'] == true && $file == 'nginx_plugin.inc.php') continue; if($conf['nginx']['installed'] == true && $file == 'apache2_plugin.inc.php') continue; @@ -2599,12 +2255,10 @@ class installer_base { $dns_server_enabled = ($conf['services']['dns'])?1:0; $file_server_enabled = ($conf['services']['file'])?1:0; $db_server_enabled = ($conf['services']['db'])?1:0; - $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', 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') { @@ -2936,6 +2590,7 @@ class installer_base { $content = str_replace('{hostname}', $conf['mysql']['host'], $content); $content = str_replace('{username}', $conf['mysql']['admin_user'], $content); $content = str_replace('{password}', addslashes($conf['mysql']['admin_password']), $content); + $content = str_replace('{port}', addslashes($conf['mysql']['port']), $content); wf($install_dir.'/server/lib/mysql_clientdb.conf', $content); chmod($install_dir.'/server/lib/mysql_clientdb.conf', 0600); chown($install_dir.'/server/lib/mysql_clientdb.conf', 'root'); @@ -3184,7 +2839,62 @@ class installer_base { return $tContents; } + + private function loadAddonClasses($path) { + if(!is_dir($path)) { + return false; + } + $libpath = $path; + if(($dir = opendir($libpath))) { + while(false !== ($cur = readdir($dir))) { + if($cur === '.' || $cur === '..' || strpos($cur, '..') !== false || !is_dir($libpath . '/' . $cur)) { + continue; + } + $addon_file = $libpath . '/' . $cur . '/' . $cur . '.addon.php'; + if(!is_file($addon_file)) { + continue; + } -} + $class_name = $cur . '_addon_installer'; + + if(isset($this->addon_classes[$class_name]) && is_object($this->addon_classes[$class_name])) { + // don't override + continue; + } + + include_once $addon_file; + if(!class_exists($class_name)) { + continue; + } -?> + if(!is_array($this->addon_classes)) { + $this->addon_classes = array(); + } + + $this->addon_classes[$class_name] = new $class_name; + } + closedir($dir); + } + } + + public function raiseEvent($event_name, $data = false) { + global $conf; + + if(is_null($this->addon_classes)) { + // load addon libs + $this->addon_classes = array(); + + $addonpath = $conf['ispconfig_install_dir'] . '/addons'; + $this->loadAddonClasses($addonpath); + } + + $call_method = 'onRaisedInstallerEvent'; + reset($this->addon_classes); + foreach($this->addon_classes as $cl) { + if(method_exists($cl, $call_method)) { + call_user_func(array($cl, $call_method), $event_name, $data); + } + } + } + +} diff --git a/install/lib/update.lib.php b/install/lib/update.lib.php index f410722c4e3bf1873f946afe53ee2dda6d2918b3..2351fbd4de1496db1c51c8d1565a6fed36dee949 100644 --- a/install/lib/update.lib.php +++ b/install/lib/update.lib.php @@ -103,7 +103,8 @@ function checkDbHealth() { $notok = array(); echo "Checking ISPConfig database .. "; - exec("mysqlcheck -h ".escapeshellarg($conf['mysql']['host'])." -u ".escapeshellarg($conf['mysql']['admin_user'])." -p".escapeshellarg($conf['mysql']['admin_password'])." -P ".escapeshellarg($conf['mysql']['port'])." -r ".escapeshellarg($conf["mysql"]["database"]), $result); + $result = null; + exec("mysqlcheck -h ".escapeshellarg($conf['mysql']['host'])." -u ".escapeshellarg($conf['mysql']['admin_user'])." -p".escapeshellarg($conf['mysql']['admin_password'])." -P ".escapeshellarg($conf['mysql']['port'])." ".escapeshellarg($conf["mysql"]["database"]), $result); for( $i=0; $i - ServerAdmin webmaster@localhost - {tmpl_var name='apps_vhost_servername'} - - - SetHandler None - - - - RequestHeader unset Proxy early - - - - DocumentRoot {tmpl_var name='apps_vhost_dir'} - AddType application/x-httpd-php .php - - Options FollowSymLinks - AllowOverride None - - Require all granted - - Order allow,deny - Allow from all - - - - - - DocumentRoot {tmpl_var name='apps_vhost_dir'} - AddType application/x-httpd-php .php - - Options FollowSymLinks - AllowOverride None - - Require all granted - - Order allow,deny - Allow from all - - - - - - DocumentRoot {tmpl_var name='apps_vhost_dir'} - SuexecUserGroup ispapps ispapps - - Options +Indexes +FollowSymLinks +MultiViews +ExecCGI - AllowOverride AuthConfig Indexes Limit Options FileInfo - - SetHandler fcgid-script - - FCGIWrapper {tmpl_var name='apps_vhost_basedir'}/php-fcgi-scripts/apps/.php-fcgi-starter .php - - Require all granted - - Order allow,deny - Allow from all - - - - - - - diff --git a/install/tpl/apache_apps.vhost.master b/install/tpl/apache_apps.vhost.master new file mode 120000 index 0000000000000000000000000000000000000000..098d52b9f134ebddcaaa86ecbb832d2d8f8aac4c --- /dev/null +++ b/install/tpl/apache_apps.vhost.master @@ -0,0 +1 @@ +../../server/conf/apache_apps.vhost.master \ No newline at end of file diff --git a/install/tpl/apache_ispconfig.conf.master b/install/tpl/apache_ispconfig.conf.master deleted file mode 100644 index 333450726ba8f407b76d1e214bae6e80f99c78fa..0000000000000000000000000000000000000000 --- a/install/tpl/apache_ispconfig.conf.master +++ /dev/null @@ -1,157 +0,0 @@ -################################################ -# ISPConfig General Apache Options -################################################ -ServerTokens ProductOnly -ServerSignature Off - - - -SSLStaplingCache shmcb:/var/run/ocsp(128000) - - - -################################################ -# ISPConfig Logfile configuration for vlogger -################################################ - - -LogFormat '%v %h %l %u %t "%r" %>s %S "%{Referer}i" "%{User-Agent}i"' combined_ispconfig - -LogFormat "%v %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined_ispconfig - -CustomLog "| /usr/local/ispconfig/server/scripts/vlogger -p -s access.log -t \"%Y%m%d-access.log\" /var/log/ispconfig/httpd" combined_ispconfig env=!dontlog - - -CustomLog "| /usr/local/ispconfig/server/scripts/vlogger -s access.log -t \"%Y%m%d-access.log\" /var/log/ispconfig/httpd" combined_ispconfig env=!dontlog - - - - AllowOverride None - - Require all denied - - Order Deny,Allow - Deny from all - - - -# Do not allow access to the root file system of the server for security reasons - - Options -Indexes - AllowOverride None - - Require all denied - - Order Deny,Allow - Deny from all - - - - - AllowOverride None - - Require all denied - - Order Deny,Allow - Deny from all - - - -# Except of the following directories that contain website scripts - - - Require all granted - - Order allow,deny - Allow from all - - - - - - Require all granted - - Order allow,deny - Allow from all - - - - - - Require all granted - - Order allow,deny - Allow from all - - - - - - Require all granted - - Order allow,deny - Allow from all - - - -# Allow access to mailman on OpenSuSE - - - Require all granted - - Order allow,deny - Allow from all - - - - - - Require all granted - - Order allow,deny - Allow from all - - - - - Options +FollowSymLinks - - Require all granted - - Order allow,deny - Allow from all - - - -# allow path to awstats and alias for awstats icons - - - Require all granted - - Order allow,deny - Allow from all - - - -Alias /awstats-icon "/usr/share/awstats/icon" - -Alias /.well-known/acme-challenge /usr/local/ispconfig/interface/acme/.well-known/acme-challenge - - - Require all granted - - Order allow,deny - Allow from all - - - AssignUserId www-data www-data - - - - -NameVirtualHost *:80 -NameVirtualHost *:443 - -NameVirtualHost {tmpl_var name="ip_address"}:{tmpl_var name="port"} - - diff --git a/install/tpl/apache_ispconfig.conf.master b/install/tpl/apache_ispconfig.conf.master new file mode 120000 index 0000000000000000000000000000000000000000..f67719f45ee7477245b0f2f3d083bd12fb85efec --- /dev/null +++ b/install/tpl/apache_ispconfig.conf.master @@ -0,0 +1 @@ +../../server/conf/apache_ispconfig.conf.master \ No newline at end of file diff --git a/install/tpl/apache_ispconfig.vhost.master b/install/tpl/apache_ispconfig.vhost.master index eab55f3226f6fb2b16f019f40db2cf2608de4f30..f97dad85b4bbaf89a8d1c93579cfe6abfc945997 100644 --- a/install/tpl/apache_ispconfig.vhost.master +++ b/install/tpl/apache_ispconfig.vhost.master @@ -4,7 +4,6 @@ ###################################################### Listen -NameVirtualHost *: > ServerAdmin webmaster@localhost @@ -33,12 +32,7 @@ SetHandler fcgid-script FCGIWrapper /var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter .php - Require all granted - - Order allow,deny - Allow from all - IPCCommTimeout 7200 MaxRequestLen 15728640 @@ -52,12 +46,7 @@ # php_admin_value open_basedir "/usr/local/ispconfig/interface:/usr/share:/tmp" Options +FollowSymLinks AllowOverride None - Require all granted - - Order allow,deny - Allow from all - php_value magic_quotes_gpc 0 @@ -121,20 +110,10 @@ AllowOverride None - Require all denied - - Order Deny,Allow - Deny from all - AllowOverride None - Require all denied - - Order Deny,Allow - Deny from all - diff --git a/install/tpl/apps_php_fpm_pool.conf.master b/install/tpl/apps_php_fpm_pool.conf.master deleted file mode 100644 index 74597272c0e998f5b1d7412188b9e71e18ed9ee0..0000000000000000000000000000000000000000 --- a/install/tpl/apps_php_fpm_pool.conf.master +++ /dev/null @@ -1,20 +0,0 @@ -[{fpm_pool}-{fpm_domain}] - -listen = {fpm_socket} -listen.owner = {fpm_user} -listen.group = {fpm_group} -listen.mode = 0660 - -user = {fpm_user} -group = {fpm_group} - -pm = dynamic -pm.max_children = 500 -pm.start_servers = 2 -pm.min_spare_servers = 1 -pm.max_spare_servers = 5 - -chdir = / - -; php_admin_value[open_basedir] = /var/www/apps:/srv/www/apps:/usr/share -php_admin_flag[magic_quotes_gpc] = off \ No newline at end of file diff --git a/install/tpl/apps_php_fpm_pool.conf.master b/install/tpl/apps_php_fpm_pool.conf.master new file mode 120000 index 0000000000000000000000000000000000000000..02e5c53cf56cc09399c43613d22111c0f8479a6f --- /dev/null +++ b/install/tpl/apps_php_fpm_pool.conf.master @@ -0,0 +1 @@ +../../server/conf/apps_php_fpm_pool.conf.master \ No newline at end of file diff --git a/install/tpl/bastille-firewall.cfg.master b/install/tpl/bastille-firewall.cfg.master deleted file mode 100644 index 408713d74631a8922bafc4348d8168bebf396a1c..0000000000000000000000000000000000000000 --- a/install/tpl/bastille-firewall.cfg.master +++ /dev/null @@ -1,320 +0,0 @@ -# -# /etc/bastille-firewall.cfg -# -# Configuration file for both 2.2/ipchains and 2.4/netfilter scripts -# -# $Source: /cvsroot/bastille-linux/dev/working_tree/Bastille/bastille-firewall.cfg,v $ -# Modified by: $Author: peterw $ -# $Date: 2002/01/04 13:34:18 $ -# $Revision: 1.7 $ -# -# Copyright (C) 1999-2001 Peter Watkins -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# Thanks to David Ranch, Brad A, Don G, and others for their suggestions - -# the configuration values should be whitespace-delimited lists of -# appropriate values, e.g. -# TCP_PUBLIC_SERVICES="80 smtp ssh" -# lists Web (port 80), SMTP mail, and Secure Shell ports -# -# This script is suitable for workstations or simple NAT firewalls; -# you may want to add more "output" restrictions for serious servers - -# 0) DNS servers (Linux 2.2/ipchains only) -# You must list your DNS servers here so that -# the firewall will allow them to service your lookup requests -# -# List of DNS servers/networks to allow "domain" responses from -# This _could_ be nameservers as a list of /32 entries -#DNS_SERVERS="a.b.c.d/32 e.f.g.h/32" -# If you are running a caching nameserver, you'll need to allow from -# "0.0.0.0/0" so named can query any arbitrary nameserver -# (To enable a caching nameserver, you will also probably need to -# add "domain" to the TCP and UDP public service lists.) -#DNS_SERVERS="0.0.0.0/0" -# -# To have the DNS servers parsed from /etc/resolv.conf at runtime, -# as normal workstations will want, make this variable empty -#DNS_SERVERS="" -# -# Please make sure variable assignments are on single lines; do NOT -# use the "\" continuation character (so Bastille can change the -# values if it is run more than once) -DNS_SERVERS="{DNS_SERVERS}" - - -# 1) define your interfaces (all systems) -# Note a "+" acts as a wildcard, e.g. ppp+ would match any PPP -# interface -# -# list internal/trusted interfaces -# traffic from these interfaces will be allowed -# through the firewall, no restrictions -#TRUSTED_IFACES="lo" # MINIMAL/SAFEST -# -# list external/untrusted interfaces -#PUBLIC_IFACES="eth+ ppp+ slip+" # SAFEST -# -# list internal/partially-trusted interfaces -# e.g. if this acts as a NAT/IP Masq server and you -# don't want clients on those interfaces having -# full network access to services running on this -# server (as the TRUSTED_IFACES allows) -#INTERNAL_IFACES="" # SAFEST -# -# Please make sure variable assignments are on single lines; do NOT -# use the "\" continuation character (so Bastille can change the -# values if it is run more than once) -TRUSTED_IFACES="lo" # MINIMAL/SAFEST -PUBLIC_IFACES="eth+ ppp+ slip+ venet+ bond+ en+" # SAFEST -INTERNAL_IFACES="" # SAFEST - - -# 2) services for which we want to log access attempts to syslog (all systems) -# Note this only audits connection attempts from public interfaces -# -# Also see item 12, LOG_FAILURES -# -#TCP_AUDIT_SERVICES="telnet ftp imap pop3 finger sunrpc exec login linuxconf ssh" -# anyone probing for BackOrifice? -#UDP_AUDIT_SERVICES="31337" -# how about ICMP? -#ICMP_AUDIT_TYPES="" -#ICMP_AUDIT_TYPES="echo-request" # ping/MS tracert -# -# To enable auditing, you must have syslog configured to log "kern" -# messages of "info" level; typically you'd do this with a line in -# syslog.conf like -# kern.info /var/log/messages -# though the Bastille port monitor will normally want these messages -# logged to a named pipe instead, and the Bastille script normally -# configures syslog for "kern.*" which catches these messages -# -# Please make sure variable assignments are on single lines; do NOT -# use the "\" continuation character (so Bastille can change the -# values if it is run more than once) -#TCP_AUDIT_SERVICES="telnet ftp imap pop3 finger sunrpc exec login linuxconf ssh" -#UDP_AUDIT_SERVICES="31337" -#ICMP_AUDIT_TYPES="" - - -# 3) services we allow connections to (all systems) -# -# FTP note: -# To allow your machine to service "passive" FTP clients, -# you will need to make allowances for the passive data -# ports; Bastille users should read README.FTP for more -# information -# -# "public" interfaces: -# TCP services that "public" hosts should be allowed to connect to -#TCP_PUBLIC_SERVICES="" # MINIMAL/SAFEST -# -# UDP services that "public" hosts should be allowed to connect to -#UDP_PUBLIC_SERVICES="" # MINIMAL/SAFEST -# -# "internal" interfaces: -# (NB: you will need to repeat the "public" services if you want -# to allow "internal" hosts to reach those services, too.) -# TCP services that internal clients can connect to -#TCP_INTERNAL_SERVICES="" # MINIMAL/SAFEST -# -# UDP services that internal clients can connect to -#UDP_INTERNAL_SERVICES="" # MINIMAL/SAFEST -# -# Please make sure variable assignments are on single lines; do NOT -# use the "\" continuation character (so Bastille can change the -# values if it is run more than once) -TCP_PUBLIC_SERVICES="{TCP_PUBLIC_SERVICES}" # MINIMAL/SAFEST -UDP_PUBLIC_SERVICES="{UDP_PUBLIC_SERVICES}" # MINIMAL/SAFEST -TCP_INTERNAL_SERVICES="" # MINIMAL/SAFEST -UDP_INTERNAL_SERVICES="" # MINIMAL/SAFEST - -# 4) passive/active FTP (Linux 2.2/ipchains only) -# FTP is a firewall nightmare; if you allow "normal" FTP connections, -# you must be careful to block any TCP services that are listening -# on high ports; it's safer to require your FTP clients to use -# "passive" mode. -# -# Note this will also force clients on machines -# that use this one for NAT/IP Masquerading to use passive mode -# for connections that go through this server (e.g. from the -# internal network to public Internet machines -# -# For more information about FTP, see the Bastille README.FTP doc -# -#FORCE_PASV_FTP="N" -#FORCE_PASV_FTP="Y" # SAFEST -# -FORCE_PASV_FTP="Y" # SAFEST - - -# 5) Services to explicitly block. (Linux 2.2/ipchains only) -# See FTP note above -# Note that ranges of ports are specified with colons, and you -# can specify an open range by using only one number, e.g. -# 1024: means ports >= 1024 and :6000 means ports <= 6000 -# -# TCP services on high ports that should be blocked if not forcing passive FTP -# This should include X (6000:6010) and anything else revealed by 'netstat -an' -# (this does not matter unless you're not forcing "passive" FTP) -#TCP_BLOCKED_SERVICES="6000:6020" -# -# UDP services to block: this should be UDP services on high ports. -# Your only vulnerability from public interfaces are the DNS and -# NTP servers/networks (those with 0.0.0.0 for DNS servers should -# obviously be very careful here!) -#UDP_BLOCKED_SERVICES="2049" -# -# types of ICMP packets to allow -#ICMP_ALLOWED_TYPES="destination-unreachable" # MINIMAL/SAFEST -# the following allows you to ping/traceroute outbound -#ICMP_ALLOWED_TYPES="destination-unreachable echo-reply time-exceeded" -# -# Please make sure variable assignments are on single lines; do NOT -# use the "\" continuation character (so Bastille can change the -# values if it is run more than once) -TCP_BLOCKED_SERVICES="6000:6020" -UDP_BLOCKED_SERVICES="2049" -ICMP_ALLOWED_TYPES="destination-unreachable echo-reply time-exceeded echo-request" - - -# 6) Source Address Verification (all Linux systems) -# This helps prevent "IP Spoofing" attacks -# -ENABLE_SRC_ADDR_VERIFY="Y" # SAFEST - - -# 7) IP Masquerading / NAT. (all systems) -# List your internal/masq'ed networks here -# -# Also see item 4, FORCE_PASV_FTP, as that setting affects -# clients using IP Masquerading through this machine -# -# Set this variable if you're using IP Masq / NAT for a local network -#IP_MASQ_NETWORK="" # DISABLE/SAFEST -#IP_MASQ_NETWORK="10.0.0.0/8" # example -#IP_MASQ_NETWORK="192.168.0.0/16" # example -# -# Have lots of masq hosts? uncomment the following six lines -# and list the hosts/networks in /etc/firewall-masqhosts -# the script assumes any address without a "/" netmask afterwards -# is an individual address (netmask /255.255.255.255): -#if [ -f /etc/firewall-masqhosts ]; then -# echo "Reading list of masq hosts from /etc/firewall-masqhosts" -# # Read the file, but use 'awk' to strip comments -# # Note the sed bracket phrase includes a space and tab char -# IP_MASQ_NETWORK=`cat /etc/firewall-masqhosts | awk -F\# '/\// {print $1; next} /[0-9]/ {print $1"/32"}' |sed 's:[ ]*::g'` -#fi -# -# Masq modules -# NB: The script will prepend "ip_masq_" to each module name -#IP_MASQ_MODULES="cuseeme ftp irc quake raudio vdolive" # ALL (?) -#IP_MASQ_MODULES="ftp raudio vdolive" # RECOMMENDED -# -# Please make sure variable assignments are on single lines; do NOT -# use the "\" continuation character (so Bastille can change the -# values if it is run more than once) -IP_MASQ_NETWORK="" # DISABLE/SAFEST -IP_MASQ_MODULES="ftp raudio vdolive" # RECOMMENDED - - -# 8) How to react to disallowed packets (all systems) -# whether to "REJECT" or "DROP" disallowed packets; if you're running any -# public services, you probably ought to use "REJECT"; if in serious stealth -# mode, choose "DROP" so simple probes don't know if there's anything out there -# NOTE: disallowed ICMP packets are discarded with "DROP", as -# it would not make sense to "reject" the packet if you're -# trying to disallow ping/traceroute -# NOTE: the scripts that set up the filter rules will interpret these -# keywords as needed, e.g. "DROP" becomes "DENY" for Linux 2.2/ipchains -# -REJECT_METHOD="DROP" - - -# 9) DHCP (Linux 2.2/ipchains only) -# In case your server needs to get a DHCP address from some other -# machine (e.g. cable modem) -#DHCP_IFACES="eth0" # example, to allow you to query on eth0 -#DHCP_IFACES="" # DISABLED -# -# Please make sure variable assignments are on single lines; do NOT -# use the "\" continuation character (so Bastille can change the -# values if it is run more than once) -DHCP_IFACES="" # DISABLED - - -# 10) NTP servers (Linux 2.2/ipchains only) -# more UDP fun. List IP addresses or network space of NTP servers -# -#NTP_SERVERS="" # DISABLE NTP QUERIES / SAFEST -#NTP_SERVERS="a.b.c.d/32 e.f.g.h/32" # example, to allow querying 2 servers -# -# Please make sure variable assignments are on single lines; do NOT -# use the "\" continuation character (so Bastille can change the -# values if it is run more than once) -NTP_SERVERS="" # DISABLE NTP QUERIES / SAFEST - - -# 11) more ICMP. (Linux 2.2/ipchains only) -# Control the outbound ICMP to make yourself invisible to -# traceroute probes -# -#ICMP_OUTBOUND_DISABLED_TYPES="destination-unreachable time-exceeded" -# -# Please make sure variable assignments are on single lines; do NOT -# use the "\" continuation character (so Bastille can change the -# values if it is run more than once) -ICMP_OUTBOUND_DISABLED_TYPES="destination-unreachable time-exceeded" - - -# 12) Logging (all systems) -# With this enabled, ipchains will log all blocked packets. -# ** this could generate huge logs ** -# This is primarily intended for the port mointoring system; -# also note that you probably do not want to "AUDIT" any services -# that you are not allowing, as doing so would mean duplicate -# logging -LOG_FAILURES="N" # do not log blocked packets - -# 13) Block fragmented packets (all systems) -# There's no good reason to allow these -#ALLOW_FRAGMENTS="N" # safest -ALLOW_FRAGMENTS="Y" # old behavior - -# 14) Prevent SMB broadcasts from leaking out NAT setup (all systems) -# Windows machines will poll teh net with SMB broadcasts, -# basically advertising their existence. Most folks agree -# that this traffic should be dropped -#DROP_SMB_NAT_BCAST="N" # allow them (are you sure?) -DROP_SMB_NAT_BCAST="Y" # drop those packets - -# 15) Log level (iptables/netfilter/Linux 2.4 only) -# Control what level of logging is used when the firewall logs -# information. Default is warning (4). Lowest priority is -# debug (7); highest is emergency (0). To prevent syslog -# from copying iptables error messages to the console, set -# this to 6 (7 would also work, but 6 is recommended) -# You can also stop syslogd/klogd from printing kernel -# messages to the console by issuing the command -# setterm -msg off -#IP_LOG_LEVEL=6 # level used in 2.2/ipchains -IP_LOG_LEVEL=4 # iptables/netfilter default - -# 16) Always attempt to use stateful features for inbound connections -# Always using state will allow the firewall to reject invalid -# packets sent to otherwise open TCP services, e.g. XMAS, NULL -# and SIN/FYN scans. The downside to choosing this behavior is that -# services may become unreachable if the packet filter's state -# table becomes full. -IP_ALWAYS_USE_STATE="N" # default, ensures services remain available -#IP_ALWAYS_USE_STATE="Y" # disallow invalid packets \ No newline at end of file diff --git a/install/tpl/bastille-firewall.cfg.master b/install/tpl/bastille-firewall.cfg.master new file mode 120000 index 0000000000000000000000000000000000000000..42986da0c60aee3df21520aaba3052082715d61c --- /dev/null +++ b/install/tpl/bastille-firewall.cfg.master @@ -0,0 +1 @@ +../../server/conf/bastille-firewall.cfg.master \ No newline at end of file diff --git a/install/tpl/config.inc.php.master b/install/tpl/config.inc.php.master index 02a7b2f65ccccde2db89cfcaac24e86307e88843..c3ed1c06b90a58f3c48dfcc1c827a42aedcf3f72 100644 --- a/install/tpl/config.inc.php.master +++ b/install/tpl/config.inc.php.master @@ -56,7 +56,7 @@ $revision = str_replace(array('Revision:','$',' '), '', $svn_revision); //** Application define('ISPC_APP_TITLE', 'ISPConfig'); -define('ISPC_APP_VERSION', '3.1dev'); +define('ISPC_APP_VERSION', '3.2.0dev'); define('DEVSYSTEM', 0); diff --git a/install/tpl/debian_postfix.conf.master b/install/tpl/debian_postfix.conf.master index 22a9484b13304b02279e35454179b00100bad882..7549fe53bc0915da3e3d9784b02b9e97d68662e1 100644 --- a/install/tpl/debian_postfix.conf.master +++ b/install/tpl/debian_postfix.conf.master @@ -1,7 +1,5 @@ -alias_maps = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases -alias_database = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases virtual_alias_domains = -virtual_alias_maps = hash:/var/lib/mailman/data/virtual-mailman, proxy:mysql:{config_dir}/mysql-virtual_forwardings.cf, proxy:mysql:{config_dir}/mysql-virtual_email2email.cf +virtual_alias_maps = proxy:mysql:{config_dir}/mysql-virtual_forwardings.cf, proxy:mysql:{config_dir}/mysql-virtual_email2email.cf virtual_mailbox_domains = proxy:mysql:{config_dir}/mysql-virtual_domains.cf virtual_mailbox_maps = proxy:mysql:{config_dir}/mysql-virtual_mailboxes.cf virtual_mailbox_base = {vmail_mailbox_base} @@ -20,7 +18,7 @@ smtpd_use_tls = yes smtpd_tls_security_level = may smtpd_tls_cert_file = {config_dir}/smtpd.cert smtpd_tls_key_file = {config_dir}/smtpd.key -transport_maps = hash:/var/lib/mailman/data/transport-mailman, proxy:mysql:{config_dir}/mysql-virtual_transports.cf +transport_maps = proxy:mysql:{config_dir}/mysql-virtual_transports.cf relay_domains = mysql:{config_dir}/mysql-virtual_relaydomains.cf relay_recipient_maps = mysql:{config_dir}/mysql-virtual_relayrecipientmaps.cf smtpd_sender_login_maps = proxy:mysql:{config_dir}/mysql-virtual_sender_login_maps.cf diff --git a/install/tpl/fedora_postfix.conf.master b/install/tpl/fedora_postfix.conf.master index f06af8228807cf896136004256ae21eea75fc9b9..f9eff2d64858a34fe9157ccb00da2925d6ea51c9 100644 --- a/install/tpl/fedora_postfix.conf.master +++ b/install/tpl/fedora_postfix.conf.master @@ -1,5 +1,5 @@ virtual_alias_domains = -virtual_alias_maps = hash:/etc/mailman/virtual-mailman, proxy:mysql:{config_dir}/mysql-virtual_forwardings.cf, proxy:mysql:{config_dir}/mysql-virtual_email2email.cf +virtual_alias_maps = proxy:mysql:{config_dir}/mysql-virtual_forwardings.cf, proxy:mysql:{config_dir}/mysql-virtual_email2email.cf virtual_mailbox_domains = proxy:mysql:{config_dir}/mysql-virtual_domains.cf virtual_mailbox_maps = proxy:mysql:{config_dir}/mysql-virtual_mailboxes.cf virtual_mailbox_base = {vmail_mailbox_base} @@ -16,7 +16,7 @@ smtpd_use_tls = yes smtpd_tls_security_level = may smtpd_tls_cert_file = {config_dir}/smtpd.cert smtpd_tls_key_file = {config_dir}/smtpd.key -transport_maps = hash:/var/lib/mailman/data/transport-mailman, proxy:mysql:{config_dir}/mysql-virtual_transports.cf +transport_maps = proxy:mysql:{config_dir}/mysql-virtual_transports.cf relay_domains = mysql:{config_dir}/mysql-virtual_relaydomains.cf relay_recipient_maps = mysql:{config_dir}/mysql-virtual_relayrecipientmaps.cf smtpd_sender_login_maps = proxy:mysql:{config_dir}/mysql-virtual_sender_login_maps.cf diff --git a/install/tpl/gentoo_postfix.conf.master b/install/tpl/gentoo_postfix.conf.master index dc20e02c13c44b00b89b030f9a6b99aa4ce9a142..1c7f9814b8a6b8ebf505f3f205aa2bad7a3103d8 100644 --- a/install/tpl/gentoo_postfix.conf.master +++ b/install/tpl/gentoo_postfix.conf.master @@ -15,7 +15,7 @@ smtpd_use_tls = yes smtpd_tls_security_level = may smtpd_tls_cert_file = {config_dir}/smtpd.cert smtpd_tls_key_file = {config_dir}/smtpd.key -transport_maps = hash:/var/lib/mailman/data/transport-mailman, proxy:mysql:{config_dir}/mysql-virtual_transports.cf +transport_maps = proxy:mysql:{config_dir}/mysql-virtual_transports.cf relay_domains = mysql:{config_dir}/mysql-virtual_relaydomains.cf relay_recipient_maps = mysql:{config_dir}/mysql-virtual_relayrecipientmaps.cf smtpd_sender_login_maps = proxy:mysql:{config_dir}/mysql-virtual_sender_login_maps.cf diff --git a/install/tpl/mailfilter.master b/install/tpl/mailfilter.master deleted file mode 100644 index ba0e94539b4e2bc1fe0980969a4edb734bc15433..0000000000000000000000000000000000000000 --- a/install/tpl/mailfilter.master +++ /dev/null @@ -1,90 +0,0 @@ -# -# Import variables -# - -LOGNAME=tolower("$LOGNAME") -EXTENSION="$1" -RECIPIENT=tolower("$2") -USER=tolower("$3") -HOST=tolower("$4") -SENDER="$5" -DEFAULT="{dist_postfix_vmail_mailbox_base}/$HOST/$USER/." - -# Workaround for broken tolower function in some current fedora releases - -if(!$USER) -{ - USER=$3 -} -if(!$HOST) -{ - HOST=$4 -} - -if ( "$EXTENSION" ne "" ) -{ - DELIMITER="+" -} - -if (!$SENDER) -{ - SENDER = "<>" -} - -# -# Autocreate maildir, if not existant -# - -#`test -e {dist_postfix_vmail_mailbox_base}/$HOST` -#if ( $RETURNCODE != 0 ) -#{ -# `mkdir {dist_postfix_vmail_mailbox_base}/$HOST` -#} - -#`test -e {dist_postfix_vmail_mailbox_base}/$HOST/$USER` -#if ( $RETURNCODE != 0 ) -#{ -# `maildirmake {dist_postfix_vmail_mailbox_base}/$HOST/$USER` -# `chmod -R 0700 {dist_postfix_vmail_mailbox_base}/$HOST` -#} - -# Check if the user has a autoresponder enabled - -`test -f {dist_postfix_vmail_mailbox_base}/mailfilters/$HOST/$USER/.autoresponder` -if ( $RETURNCODE == 0 ) -{ - include "{dist_postfix_vmail_mailbox_base}/mailfilters/$HOST/$USER/.autoresponder" -} - -# Create a mailsize file -`test -e {dist_postfix_vmail_mailbox_base}/$HOST/$USER` -if ( $RETURNCODE == 0 ) -{ -`echo $SIZE >> {dist_postfix_vmail_mailbox_base}/$HOST/$USER/ispconfig_mailsize` -} - - -# -# Test if the user has his own maildrop include, -# if not available, check if $DEFAULT is set -# (newer maildrop get's that from the DB and updates -# it) and deliver or fail temporarily if not available -# - -`test -f {dist_postfix_vmail_mailbox_base}/mailfilters/$HOST/$USER/.mailfilter` -if ( $RETURNCODE == 0 ) -{ - include "{dist_postfix_vmail_mailbox_base}/mailfilters/$HOST/$USER/.mailfilter" -} -else -{ - if ( "$DEFAULT" ne "" ) - { - to "$DEFAULT" - } - else - { - EXITCODE=75 - exit - } -} \ No newline at end of file diff --git a/install/tpl/mailman-virtual_to_transport.sh b/install/tpl/mailman-virtual_to_transport.sh deleted file mode 100644 index 6c57d25c06620922774823aa9e798823302fd5c5..0000000000000000000000000000000000000000 --- a/install/tpl/mailman-virtual_to_transport.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -sed -r -e 's/(^[^#]\S+\s+).+$/\1local/' $1 > /var/lib/mailman/data/transport-mailman -/usr/sbin/postmap /var/lib/mailman/data/transport-mailman \ No newline at end of file diff --git a/install/tpl/mlmmj.conf.master b/install/tpl/mlmmj.conf.master deleted file mode 100644 index 44ba9e8728d2f9b08168525c232377491fe946a3..0000000000000000000000000000000000000000 --- a/install/tpl/mlmmj.conf.master +++ /dev/null @@ -1,5 +0,0 @@ -# Path of the skeleton for mailing lists -skel_dir = /usr/share/mlmmj/text.skel - -# Where to store ML data and archive -spool_dir = /var/spool/mlmmj \ No newline at end of file diff --git a/install/tpl/mm_cfg.py.master b/install/tpl/mm_cfg.py.master deleted file mode 100644 index c0de780e0d19eec4ca07e900a7e1beb8459a3ba5..0000000000000000000000000000000000000000 --- a/install/tpl/mm_cfg.py.master +++ /dev/null @@ -1,108 +0,0 @@ -# -*- python -*- - -# Copyright (C) 1998,1999,2000 by the Free Software Foundation, Inc. -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -# 02110-1301 USA - - -"""This is the module which takes your site-specific settings. - -From a raw distribution it should be copied to mm_cfg.py. If you -already have an mm_cfg.py, be careful to add in only the new settings -you want. The complete set of distributed defaults, with annotation, -are in ./Defaults. In mm_cfg, override only those you want to -change, after the - - from Defaults import * - -line (see below). - -Note that these are just default settings - many can be overridden via the -admin and user interfaces on a per-list or per-user basis. - -Note also that some of the settings are resolved against the active list -setting by using the value as a format string against the -list-instance-object's dictionary - see the distributed value of -DEFAULT_MSG_FOOTER for an example.""" - - -####################################################### -# Here's where we get the distributed defaults. # - -from Defaults import * - -############################################################## -# Put YOUR site-specific configuration below, in mm_cfg.py . # -# See Defaults.py for explanations of the values. # - -#------------------------------------------------------------- -# The name of the list Mailman uses to send password reminders -# and similar. Don't change if you want mailman-owner to be -# a valid local part. -MAILMAN_SITE_LIST = 'mailman' - -#------------------------------------------------------------- -# If you change these, you have to configure your http server -# accordingly (Alias and ScriptAlias directives in most httpds) -DEFAULT_URL_PATTERN = 'https://%s/cgi-bin/mailman/' -PRIVATE_ARCHIVE_URL = '/cgi-bin/mailman/private' -IMAGE_LOGOS = '/images/mailman/' - -#------------------------------------------------------------- -# Default domain for email addresses of newly created MLs -DEFAULT_EMAIL_HOST = '{hostname}' -#------------------------------------------------------------- -# Default host for web interface of newly created MLs -DEFAULT_URL_HOST = '{hostname}' -#------------------------------------------------------------- -# Required when setting any of its arguments. -add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST) - -#------------------------------------------------------------- -# The default language for this server. -DEFAULT_SERVER_LANGUAGE = {default_language} - -#------------------------------------------------------------- -# Iirc this was used in pre 2.1, leave it for now -USE_ENVELOPE_SENDER = 0 # Still used? - -#------------------------------------------------------------- -# Unset send_reminders on newly created lists -DEFAULT_SEND_REMINDERS = 0 - -#------------------------------------------------------------- -# Uncomment this if you configured your MTA such that it -# automatically recognizes newly created lists. -# (see /usr/share/doc/mailman/README.Exim4.Debian or -# /usr/share/mailman/postfix-to-mailman.py) -# MTA=None # Misnomer, suppresses alias output on newlist - -#------------------------------------------------------------- -# Uncomment if you use Postfix virtual domains (but not -# postfix-to-mailman.py), but be sure to see -# /usr/share/doc/mailman/README.Debian first. -MTA='Postfix' -POSTFIX_STYLE_VIRTUAL_DOMAINS = [{virtual_domains}] -#------------------------------------------------------------- -# Uncomment if you want to filter mail with SpamAssassin. For -# more information please visit this website: -# http://www.jamesh.id.au/articles/mailman-spamassassin/ -# GLOBAL_PIPELINE.insert(1, 'SpamAssassin') - -POSTFIX_MAP_CMD = '/etc/mailman/virtual_to_transport.sh' - -# Note - if you're looking for something that is imported from mm_cfg, but you -# didn't find it above, it's probably in /usr/lib/mailman/Mailman/Defaults.py. \ No newline at end of file diff --git a/install/tpl/mysql_clientdb.conf.master b/install/tpl/mysql_clientdb.conf.master index e6eba12615e75403810f554a365c0a19d2c4384d..c205d7142874e279074eecf5502f9b2fd3d86ee2 100644 --- a/install/tpl/mysql_clientdb.conf.master +++ b/install/tpl/mysql_clientdb.conf.master @@ -3,5 +3,6 @@ $clientdb_host = '{hostname}'; $clientdb_user = '{username}'; $clientdb_password = '{password}'; +$clientdb_port = '{port}'; ?> \ No newline at end of file diff --git a/install/tpl/nginx_apps.vhost.master b/install/tpl/nginx_apps.vhost.master deleted file mode 100644 index 701f3defb1db35963a2c7a04f7b3fe097f8b968b..0000000000000000000000000000000000000000 --- a/install/tpl/nginx_apps.vhost.master +++ /dev/null @@ -1,211 +0,0 @@ -server { - listen {apps_vhost_port}; - listen [::]:{apps_vhost_port} ipv6only=on; - ssl {ssl_on}; - {ssl_comment}ssl_protocols TLSv1 TLSv1.1 TLSv1.2; - {ssl_comment}ssl_certificate /usr/local/ispconfig/interface/ssl/ispserver.crt; - {ssl_comment}ssl_certificate_key /usr/local/ispconfig/interface/ssl/ispserver.key; - - # redirect to https if accessed with http - {ssl_comment}error_page 497 https://$host:{vhost_port}$request_uri; - - server_name {apps_vhost_servername}; - - root {apps_vhost_dir}; - - client_max_body_size 100M; - - location / { - index index.php index.html; - } - - # serve static files directly - location ~* ^.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt)$ { - access_log off; - } - - location ~ \.php$ { - try_files $uri =404; - fastcgi_param QUERY_STRING $query_string; - fastcgi_param REQUEST_METHOD $request_method; - fastcgi_param CONTENT_TYPE $content_type; - fastcgi_param CONTENT_LENGTH $content_length; - - fastcgi_param SCRIPT_FILENAME $request_filename; - fastcgi_param SCRIPT_NAME $fastcgi_script_name; - fastcgi_param REQUEST_URI $request_uri; - fastcgi_param DOCUMENT_URI $document_uri; - fastcgi_param DOCUMENT_ROOT $document_root; - fastcgi_param SERVER_PROTOCOL $server_protocol; - - fastcgi_param GATEWAY_INTERFACE CGI/1.1; - fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; - fastcgi_param HTTP_PROXY ""; - - fastcgi_param REMOTE_ADDR $remote_addr; - fastcgi_param REMOTE_PORT $remote_port; - fastcgi_param SERVER_ADDR $server_addr; - fastcgi_param SERVER_PORT $server_port; - fastcgi_param SERVER_NAME $server_name; - - fastcgi_param HTTPS $https; - - # PHP only, required if PHP was built with --enable-force-cgi-redirect - fastcgi_param REDIRECT_STATUS 200; - fastcgi_pass unix:{fpm_socket}; - fastcgi_index index.php; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - #fastcgi_param PATH_INFO $fastcgi_script_name; - fastcgi_buffer_size 128k; - fastcgi_buffers 256 4k; - fastcgi_busy_buffers_size 256k; - fastcgi_temp_file_write_size 256k; - } - - location ~ /\. { - deny all; - } - - location /phpmyadmin { - root /usr/share/; - index index.php index.html index.htm; - location ~ ^/phpmyadmin/(.+\.php)$ { - try_files $uri =404; - root /usr/share/; - fastcgi_param QUERY_STRING $query_string; - fastcgi_param REQUEST_METHOD $request_method; - fastcgi_param CONTENT_TYPE $content_type; - fastcgi_param CONTENT_LENGTH $content_length; - - fastcgi_param SCRIPT_FILENAME $request_filename; - fastcgi_param SCRIPT_NAME $fastcgi_script_name; - fastcgi_param REQUEST_URI $request_uri; - fastcgi_param DOCUMENT_URI $document_uri; - fastcgi_param DOCUMENT_ROOT $document_root; - fastcgi_param SERVER_PROTOCOL $server_protocol; - - fastcgi_param GATEWAY_INTERFACE CGI/1.1; - fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; - - fastcgi_param REMOTE_ADDR $remote_addr; - fastcgi_param REMOTE_PORT $remote_port; - fastcgi_param SERVER_ADDR $server_addr; - fastcgi_param SERVER_PORT $server_port; - fastcgi_param SERVER_NAME $server_name; - - fastcgi_param HTTPS $https; - - # PHP only, required if PHP was built with --enable-force-cgi-redirect - fastcgi_param REDIRECT_STATUS 200; - # To access phpMyAdmin, the default user (like www-data on Debian/Devuan/Ubuntu) must be used - {use_tcp}fastcgi_pass 127.0.0.1:9000; - {use_socket}fastcgi_pass unix:/var/run/php5-fpm.sock; - fastcgi_index index.php; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - fastcgi_buffer_size 128k; - fastcgi_buffers 256 4k; - fastcgi_busy_buffers_size 256k; - fastcgi_temp_file_write_size 256k; - fastcgi_read_timeout 1200; - } - location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { - root /usr/share/; - } - } - location /phpMyAdmin { - rewrite ^/* /phpmyadmin last; - } - - location /squirrelmail { - root /usr/share/; - index index.php index.html index.htm; - location ~ ^/squirrelmail/(.+\.php)$ { - try_files $uri =404; - root /usr/share/; - fastcgi_param QUERY_STRING $query_string; - fastcgi_param REQUEST_METHOD $request_method; - fastcgi_param CONTENT_TYPE $content_type; - fastcgi_param CONTENT_LENGTH $content_length; - - fastcgi_param SCRIPT_FILENAME $request_filename; - fastcgi_param SCRIPT_NAME $fastcgi_script_name; - fastcgi_param REQUEST_URI $request_uri; - fastcgi_param DOCUMENT_URI $document_uri; - fastcgi_param DOCUMENT_ROOT $document_root; - fastcgi_param SERVER_PROTOCOL $server_protocol; - - fastcgi_param GATEWAY_INTERFACE CGI/1.1; - fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; - - fastcgi_param REMOTE_ADDR $remote_addr; - fastcgi_param REMOTE_PORT $remote_port; - fastcgi_param SERVER_ADDR $server_addr; - fastcgi_param SERVER_PORT $server_port; - fastcgi_param SERVER_NAME $server_name; - - fastcgi_param HTTPS $https; - - # PHP only, required if PHP was built with --enable-force-cgi-redirect - fastcgi_param REDIRECT_STATUS 200; - # To access SquirrelMail, the default user (like www-data on Debian/Devuan/Ubuntu) must be used - {use_tcp}fastcgi_pass 127.0.0.1:9000; - {use_socket}fastcgi_pass unix:/var/run/php5-fpm.sock; - fastcgi_index index.php; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - fastcgi_buffer_size 128k; - fastcgi_buffers 256 4k; - fastcgi_busy_buffers_size 256k; - fastcgi_temp_file_write_size 256k; - } - location ~* ^/squirrelmail/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { - root /usr/share/; - } - } - location /webmail { - rewrite ^/* /squirrelmail last; - } - - location /cgi-bin/mailman { - root /usr/lib/; - fastcgi_split_path_info (^/cgi-bin/mailman/[^/]*)(.*)$; - fastcgi_param QUERY_STRING $query_string; - fastcgi_param REQUEST_METHOD $request_method; - fastcgi_param CONTENT_TYPE $content_type; - fastcgi_param CONTENT_LENGTH $content_length; - - fastcgi_param SCRIPT_FILENAME $request_filename; - fastcgi_param SCRIPT_NAME $fastcgi_script_name; - fastcgi_param REQUEST_URI $request_uri; - fastcgi_param DOCUMENT_URI $document_uri; - fastcgi_param DOCUMENT_ROOT $document_root; - fastcgi_param SERVER_PROTOCOL $server_protocol; - - fastcgi_param GATEWAY_INTERFACE CGI/1.1; - fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; - - fastcgi_param REMOTE_ADDR $remote_addr; - fastcgi_param REMOTE_PORT $remote_port; - fastcgi_param SERVER_ADDR $server_addr; - fastcgi_param SERVER_PORT $server_port; - fastcgi_param SERVER_NAME $server_name; - - fastcgi_param HTTPS $https; - - # PHP only, required if PHP was built with --enable-force-cgi-redirect - fastcgi_param REDIRECT_STATUS 200; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - fastcgi_param PATH_INFO $fastcgi_path_info; - fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; - fastcgi_intercept_errors on; - fastcgi_pass unix:{cgi_socket}; - } - - location /images/mailman { - alias /usr/share/images/mailman; - } - - location /pipermail { - alias /var/lib/mailman/archives/public; - autoindex on; - } -} diff --git a/install/tpl/nginx_apps.vhost.master b/install/tpl/nginx_apps.vhost.master new file mode 120000 index 0000000000000000000000000000000000000000..e59b73601552c4bb8638c961fce1640a6c5ecc0f --- /dev/null +++ b/install/tpl/nginx_apps.vhost.master @@ -0,0 +1 @@ +../../server/conf/nginx_apps.vhost.master \ No newline at end of file diff --git a/install/tpl/opensuse_postfix.conf.master b/install/tpl/opensuse_postfix.conf.master index 4192f988b5213775cc7b47a99b70f3add21946cc..4ed16e3ddfef5be14ea6553f39613bb5db53674f 100644 --- a/install/tpl/opensuse_postfix.conf.master +++ b/install/tpl/opensuse_postfix.conf.master @@ -1,7 +1,7 @@ -alias_maps = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases -alias_database = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases +alias_maps = hash:/etc/aliases +alias_database = hash:/etc/aliases virtual_alias_domains = -virtual_alias_maps = hash:/etc/mailman/virtual-mailman, proxy:mysql:{config_dir}/mysql-virtual_forwardings.cf, proxy:mysql:{config_dir}/mysql-virtual_email2email.cf +virtual_alias_maps = proxy:mysql:{config_dir}/mysql-virtual_forwardings.cf, proxy:mysql:{config_dir}/mysql-virtual_email2email.cf virtual_mailbox_domains = proxy:mysql:{config_dir}/mysql-virtual_domains.cf virtual_mailbox_maps = proxy:mysql:{config_dir}/mysql-virtual_mailboxes.cf virtual_mailbox_base = {vmail_mailbox_base} @@ -18,7 +18,7 @@ smtpd_use_tls = yes smtpd_tls_security_level = may smtpd_tls_cert_file = {config_dir}/smtpd.cert smtpd_tls_key_file = {config_dir}/smtpd.key -transport_maps = hash:/var/lib/mailman/data/transport-mailman, proxy:mysql:{config_dir}/mysql-virtual_transports.cf +transport_maps = proxy:mysql:{config_dir}/mysql-virtual_transports.cf relay_domains = mysql:{config_dir}/mysql-virtual_relaydomains.cf relay_recipient_maps = mysql:{config_dir}/mysql-virtual_relayrecipientmaps.cf smtpd_sender_login_maps = proxy:mysql:{config_dir}/mysql-virtual_sender_login_maps.cf diff --git a/install/tpl/rspamd_antivirus.conf.master b/install/tpl/rspamd_antivirus.conf.master new file mode 100644 index 0000000000000000000000000000000000000000..f88d81ac7ce94c881087b93e0d08bc2f1849f429 --- /dev/null +++ b/install/tpl/rspamd_antivirus.conf.master @@ -0,0 +1,30 @@ +clamav { + # If set force this action if any virus is found (default unset: no action is forced) + #action = "reject"; + # if `true` only messages with non-image attachments will be checked (default true) + scan_mime_parts = true; + # If `max_size` is set, messages > n bytes in size are not scanned + #max_size = 20000000; + # symbol to add (add it to metric if you want non-zero weight) + symbol = "CLAM_VIRUS"; + # type of scanner: "clamav", "fprot", "sophos" or "savapi" + type = "clamav"; + # For "savapi" you must also specify the following variable + #product_id = 12345; + # You can enable logging for clean messages + #log_clean = true; + # servers to query (if port is unspecified, scanner-specific default is used) + # can be specified multiple times to pool servers + # can be set to a path to a unix socket + # Enable this in local.d/antivirus.conf + #servers = "127.0.0.1:3310"; + servers = "/var/run/clamav/clamd.ctl"; + # if `patterns` is specified virus name will be matched against provided regexes and the related + # symbol will be yielded if a match is found. If no match is found, default symbol is yielded. + patterns { + # symbol_name = "pattern"; + JUST_EICAR = "^Eicar-Test-Signature$"; + } + # `whitelist` points to a map of IP addresses. Mail from these addresses is not scanned. + whitelist = "/etc/rspamd/antivirus.wl"; +} \ No newline at end of file diff --git a/install/tpl/rspamd_classifier-bayes.conf.master b/install/tpl/rspamd_classifier-bayes.conf.master new file mode 100644 index 0000000000000000000000000000000000000000..1688d57e217673cdfa50ff36c31f4beb782aae70 --- /dev/null +++ b/install/tpl/rspamd_classifier-bayes.conf.master @@ -0,0 +1,3 @@ +autolearn = [-0.01, 5.00]; +per_user = true; +per_language = true; \ No newline at end of file diff --git a/install/tpl/rspamd_dkim_signing.conf.master b/install/tpl/rspamd_dkim_signing.conf.master new file mode 100644 index 0000000000000000000000000000000000000000..0e55a7ead24c371004df6bb4bad5c620a0cca295 --- /dev/null +++ b/install/tpl/rspamd_dkim_signing.conf.master @@ -0,0 +1,2 @@ +path = "/$domain.private"; +selector = "default"; \ No newline at end of file diff --git a/install/tpl/rspamd_greylist.conf.master b/install/tpl/rspamd_greylist.conf.master new file mode 100644 index 0000000000000000000000000000000000000000..74ea715a22cc6fa76671fd47a3f1bf89cfe92d49 --- /dev/null +++ b/install/tpl/rspamd_greylist.conf.master @@ -0,0 +1 @@ +servers = "127.0.0.1:6379"; \ No newline at end of file diff --git a/install/tpl/rspamd_groups.conf.master b/install/tpl/rspamd_groups.conf.master new file mode 100644 index 0000000000000000000000000000000000000000..62a986533abb66fe28203358f0d6ef5854f9e0e6 --- /dev/null +++ b/install/tpl/rspamd_groups.conf.master @@ -0,0 +1,4 @@ +group "antivirus" { + .include(try=true; priority=1; duplicate=merge) "$LOCAL_CONFDIR/local.d/antivirus_group.conf" + .include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/antivirus_group.conf" +} diff --git a/install/tpl/rspamd_milter_headers.conf.master b/install/tpl/rspamd_milter_headers.conf.master new file mode 100644 index 0000000000000000000000000000000000000000..d399bbf4ecc37e39ff900260a4884335767e9957 --- /dev/null +++ b/install/tpl/rspamd_milter_headers.conf.master @@ -0,0 +1,2 @@ +use = ["x-spamd-bar", "x-spam-level", "authentication-results"]; +authenticated_headers = ["authentication-results"]; \ No newline at end of file diff --git a/install/tpl/rspamd_mx_check.conf.master b/install/tpl/rspamd_mx_check.conf.master new file mode 100644 index 0000000000000000000000000000000000000000..0a628f9c8382ee1f0def03883c91b91d7701e625 --- /dev/null +++ b/install/tpl/rspamd_mx_check.conf.master @@ -0,0 +1,9 @@ +enabled = true; +servers = "localhost"; +key_prefix = "rmx"; +symbol_bad_mx = "MX_INVALID"; +symbol_no_mx = "MX_MISSING"; +symbol_good_mx = "MX_GOOD"; +expire = 86400; +expire_novalid = 7200; +greylist_invalid = false; \ No newline at end of file diff --git a/install/tpl/rspamd_neural.conf.master b/install/tpl/rspamd_neural.conf.master new file mode 100644 index 0000000000000000000000000000000000000000..64b0fa8716211b2b57f0276881fb2bb076d77587 --- /dev/null +++ b/install/tpl/rspamd_neural.conf.master @@ -0,0 +1,31 @@ +servers = 127.0.0.1:6379; +enabled = true; + +rules { + "LONG" { + train { + max_trains = 5000; + max_usages = 200; + max_iterations = 25; + learning_rate = 0.01, + spam_score = 8; + ham_score = -2; + } + symbol_spam = "NEURAL_SPAM_LONG"; + symbol_ham = "NEURAL_HAM_LONG"; + ann_expire = 100d; + } + "SHORT" { + train { + max_trains = 100; + max_usages = 2; + max_iterations = 25; + learning_rate = 0.01, + spam_score = 8; + ham_score = -2; + } + symbol_spam = "NEURAL_SPAM_SHORT"; + symbol_ham = "NEURAL_HAM_SHORT"; + ann_expire = 1d; + } +} \ No newline at end of file diff --git a/install/tpl/rspamd_neural_group.conf.master b/install/tpl/rspamd_neural_group.conf.master new file mode 100644 index 0000000000000000000000000000000000000000..c4f59c52e5c794ae3ab0cfede7f4a06705acf89d --- /dev/null +++ b/install/tpl/rspamd_neural_group.conf.master @@ -0,0 +1,18 @@ +symbols = { + "NEURAL_SPAM_LONG" { + weight = 3.0; # sample weight + description = "Neural network spam (long)"; + } + "NEURAL_HAM_LONG" { + weight = -3.0; # sample weight + description = "Neural network ham (long)"; + } + "NEURAL_SPAM_SHORT" { + weight = 2.0; # sample weight + description = "Neural network spam (short)"; + } + "NEURAL_HAM_SHORT" { + weight = -1.0; # sample weight + description = "Neural network ham (short)"; + } +} diff --git a/install/tpl/rspamd_options.inc.master b/install/tpl/rspamd_options.inc.master new file mode 100644 index 0000000000000000000000000000000000000000..69e40365b7dc653b046b6e3cb3ff0539936a816e --- /dev/null +++ b/install/tpl/rspamd_options.inc.master @@ -0,0 +1,5 @@ +local_addrs = "127.0.0.0/8, ::1"; + +dns { + nameserver = ["127.0.0.1:53:10"]; +} diff --git a/install/tpl/rspamd_override_rbl.conf.master b/install/tpl/rspamd_override_rbl.conf.master new file mode 100644 index 0000000000000000000000000000000000000000..310e722832376f6e049fc2e1ac4c4179a3c3259e --- /dev/null +++ b/install/tpl/rspamd_override_rbl.conf.master @@ -0,0 +1,53 @@ +# RBL +symbols = { + "RBL_SENDERSCORE" { + weight = 4.0; + description = "From address is listed in senderscore.com BL"; + } + "RBL_SPAMHAUS_SBL" { + weight = 2.0; + description = "From address is listed in zen sbl"; + } + "RBL_SPAMHAUS_CSS" { + weight = 2.0; + description = "From address is listed in zen css"; + } + "RBL_SPAMHAUS_XBL" { + weight = 4.0; + description = "From address is listed in zen xbl"; + } + "RBL_SPAMHAUS_XBL_ANY" { + weight = 4.0; + description = "From or receive address is listed in zen xbl (any list)"; + } + "RBL_SPAMHAUS_PBL" { + weight = 2.0; + description = "From address is listed in zen pbl (ISP list)"; + } + "RBL_SPAMHAUS_DROP" { + weight = 7.0; + description = "From address is listed in zen drop bl"; + } + "RECEIVED_SPAMHAUS_XBL" { + weight = 3.0; + description = "Received address is listed in zen xbl"; + one_shot = true; + } + "RBL_MAILSPIKE_WORST" { + weight = 2.0; + description = "From address is listed in RBL - worst possible reputation"; + } + "RBL_MAILSPIKE_VERYBAD" { + weight = 1.5; + description = "From address is listed in RBL - very bad reputation"; + } + "RBL_MAILSPIKE_BAD" { + weight = 1.0; + description = "From address is listed in RBL - bad reputation"; + } + "RBL_SEM" { + weight = 1.0; + description = "Address is listed in Spameatingmonkey RBL"; + } + # /RBL +} diff --git a/install/tpl/rspamd_override_surbl.conf.master b/install/tpl/rspamd_override_surbl.conf.master new file mode 100644 index 0000000000000000000000000000000000000000..30676a46fde75e4e4d21bf3e5cc1e6aabc4e749d --- /dev/null +++ b/install/tpl/rspamd_override_surbl.conf.master @@ -0,0 +1,108 @@ +symbols = { + # SURBL + "PH_SURBL_MULTI" { + weight = 5.5; + description = "SURBL: Phishing sites"; + } + "MW_SURBL_MULTI" { + weight = 5.5; + description = "SURBL: Malware sites"; + } + "ABUSE_SURBL" { + weight = 5.5; + description = "SURBL: ABUSE"; + } + "CRACKED_SURBL" { + weight = 4.0; + description = "SURBL: cracked site"; + } + "RAMBLER_URIBL" { + weight = 4.5; + description = "Rambler uribl"; + one_shot = true; + } + "RAMBLER_EMAILBL" { + weight = 9.5; + description = "Rambler emailbl"; + one_shot = true; + } + "MSBL_EBL" { + weight = 7.5; + description = "MSBL emailbl"; + one_shot = true; + } + "SEM_URIBL" { + weight = 3.5; + description = "Spameatingmonkey uribl"; + } + "SEM_URIBL_FRESH15" { + weight = 3.0; + description = "Spameatingmonkey uribl. Domains registered in the last 15 days (.AERO,.BIZ,.COM,.INFO,.NAME,.NET,.PRO,.SK,.TEL,.US)"; + } + "DBL" { + weight = 0.0; + description = "DBL unknown result"; + } + "DBL_SPAM" { + weight = 6.5; + description = "DBL uribl spam"; + } + "DBL_PHISH" { + weight = 6.5; + description = "DBL uribl phishing"; + } + "DBL_MALWARE" { + weight = 6.5; + description = "DBL uribl malware"; + } + "DBL_BOTNET" { + weight = 5.5; + description = "DBL uribl botnet C&C domain"; + } + "DBL_ABUSE" { + weight = 6.5; + description = "DBL uribl abused legit spam"; + } + "DBL_ABUSE_REDIR" { + weight = 1.5; + description = "DBL uribl abused spammed redirector domain"; + } + "DBL_ABUSE_PHISH" { + weight = 7.5; + description = "DBL uribl abused legit phish"; + } + "DBL_ABUSE_MALWARE" { + weight = 7.5; + description = "DBL uribl abused legit malware"; + } + "DBL_ABUSE_BOTNET" { + weight = 5.5; + description = "DBL uribl abused legit botnet C&C"; + } + "URIBL_BLACK" { + weight = 7.5; + description = "uribl.com black url"; + } + "URIBL_RED" { + weight = 3.5; + description = "uribl.com red url"; + } + "URIBL_GREY" { + weight = 1.5; + description = "uribl.com grey url"; + one_shot = true; + } + "URIBL_SBL" { + weight = 6.5; + description = "Spamhaus SBL URIBL"; + } + "URIBL_SBL_CSS" { + weight = 6.5; + description = "Spamhaus SBL CSS URIBL"; + } + "RBL_SARBL_BAD" { + weight = 2.5; + description = "A domain listed in the mail is blacklisted in SARBL"; + } + # /SURBL +} diff --git a/install/tpl/rspamd_redis.conf.master b/install/tpl/rspamd_redis.conf.master new file mode 100644 index 0000000000000000000000000000000000000000..b908af9f5ebe0e23293797e234eb9dd455838a01 --- /dev/null +++ b/install/tpl/rspamd_redis.conf.master @@ -0,0 +1 @@ +servers = "127.0.0.1"; \ No newline at end of file diff --git a/install/tpl/rspamd_symbols_antivirus.conf.master b/install/tpl/rspamd_symbols_antivirus.conf.master new file mode 100644 index 0000000000000000000000000000000000000000..8c2d93d89eeacf816ad870f5bab97a7d406cc143 --- /dev/null +++ b/install/tpl/rspamd_symbols_antivirus.conf.master @@ -0,0 +1,15 @@ +subject = "***SPAM*** %s"; +symbols = { + "CLAM_VIRUS" { + weight = 50; + description = "Clamav has found a virus."; + } + "JUST_EICAR" { + weight = 50; + description = "Clamav has found a virus."; + } + "R_DUMMY" { + weight = 0.0; + description = "Dummy symbol"; + } +} \ No newline at end of file diff --git a/install/tpl/rspamd_users.conf.master b/install/tpl/rspamd_users.conf.master new file mode 100644 index 0000000000000000000000000000000000000000..bf7ad2830032d33573c6b2a51672072b230eb4d1 --- /dev/null +++ b/install/tpl/rspamd_users.conf.master @@ -0,0 +1,43 @@ +settings { + authenticated { + priority = 10; + authenticated = yes; + #apply "default" { groups_disabled = ["rbl", "spf"]; } + apply "default" { + symbols_enabled = []; + symbols_disabled = []; + groups_enabled = []; + groups_disabled = []; + } + } + whitelist { + priority = 10; + rcpt = "postmaster"; + rcpt = "hostmaster"; + rcpt = "abuse"; + want_spam = yes; + } + whitelist-ip { + priority = 10; + + ip = ""; + + + want_spam = yes; + } +# whitelist-timmehosting { +# priority = 20; +# from = "@xxx"; +# from = "@xxx"; +# want_spam = yes; +# } + whitelist-ca { + priority = 20; + from = "@comodo.com"; + from = "@geotrust.com"; + from = "@geotrusteurope.com"; + want_spam = yes; + } + .include(try=true; glob=true) "$LOCAL_CONFDIR/local.d/users/*.conf" + .include(try=true; priority=1,duplicate=merge) "$LOCAL_CONFDIR/local.d/users.local.conf" +} diff --git a/install/tpl/rspamd_wblist.inc.conf.master b/install/tpl/rspamd_wblist.inc.conf.master new file mode 100644 index 0000000000000000000000000000000000000000..fc06127eae69ed43309f050983c90a5c12bdc9f0 --- /dev/null +++ b/install/tpl/rspamd_wblist.inc.conf.master @@ -0,0 +1,18 @@ +spamfilter_wblist- { + priority = ; + from = ""; + rcpt = ""; + + want_spam = yes; + + apply "default" { + R_DUMMY = 999.0; + actions { + reject = 0.2; + add_header = 0.1; + greylist = 0.1; + rewrite_subject = 0.1; + } + } + +} \ No newline at end of file diff --git a/install/tpl/rspamd_worker-controller.inc.master b/install/tpl/rspamd_worker-controller.inc.master new file mode 120000 index 0000000000000000000000000000000000000000..dae19323690f604babdb0682108b49f420476fb7 --- /dev/null +++ b/install/tpl/rspamd_worker-controller.inc.master @@ -0,0 +1 @@ +../../server/conf/rspamd_worker-controller.inc.master \ No newline at end of file diff --git a/install/tpl/sasl_smtpd.conf.master b/install/tpl/sasl_smtpd.conf.master deleted file mode 100644 index 72371270099bcd02d82de2ebf8d0424248eca438..0000000000000000000000000000000000000000 --- a/install/tpl/sasl_smtpd.conf.master +++ /dev/null @@ -1,9 +0,0 @@ -pwcheck_method: saslauthd -mech_list: plain login -allow_plaintext: true -auxprop_plugin: mysql -sql_hostnames: {mysql_server_ip} -sql_user: {mysql_server_ispconfig_user} -sql_passwd: {mysql_server_ispconfig_password} -sql_database: {mysql_server_database} -sql_select: select password from mail_user where (login = '%u' or email = '%u@%r') and postfix = 'y' and disablesmtp = 'n' \ No newline at end of file diff --git a/install/tpl/sasl_smtpd2.conf.master b/install/tpl/sasl_smtpd2.conf.master deleted file mode 100644 index 5fafe3670ccf3cd5adf17ae3575b75124c4d4a93..0000000000000000000000000000000000000000 --- a/install/tpl/sasl_smtpd2.conf.master +++ /dev/null @@ -1,10 +0,0 @@ -pwcheck_method: saslauthd -mech_list: plain login -allow_plaintext: true -auxprop_plugin: sql -sql_engine: mysql -sql_hostnames: {mysql_server_ip} -sql_user: {mysql_server_ispconfig_user} -sql_passwd: {mysql_server_ispconfig_password} -sql_database: {mysql_server_database} -sql_select: select password from mail_user where (login = '%u' or email = '%u@%r') and postfix = 'y' and disablesmtp = 'n' diff --git a/install/tpl/server.ini.master b/install/tpl/server.ini.master index b6a8b8b42cfdee1f02047708f9cc7dc90d256d92..996c388f2813279e7dfed84335c23b0f011e67c5 100644 --- a/install/tpl/server.ini.master +++ b/install/tpl/server.ini.master @@ -38,8 +38,8 @@ homedir_path=/var/vmail maildir_format=maildir dkim_path=/var/lib/amavis/dkim dkim_strength=1024 -pop3_imap_daemon=courier -mail_filter_syntax=maildrop +content_filter=rspamd +rspamd_password= mailuser_uid=5000 mailuser_gid=5000 mailuser_name=vmail @@ -57,7 +57,6 @@ overquota_notify_client=y overquota_notify_freq=7 overquota_notify_onok=n sendmail_path=/usr/sbin/sendmail -mailinglist_manager=mlmmj [getmail] getmail_config_dir=/etc/getmail @@ -134,12 +133,11 @@ fastcgi_phpini_path=/etc/php5/cgi/ fastcgi_children=8 fastcgi_max_requests=5000 fastcgi_bin=/usr/bin/php-cgi -fastcgi_config_syntax=2 [jailkit] jailkit_chroot_home=/home/[username] jailkit_chroot_app_sections=basicshell editors extendedshell netutils ssh sftp scp groups jk_lsh -jailkit_chroot_app_programs=/usr/bin/groups /usr/bin/id /usr/bin/dircolors /usr/bin/lesspipe /usr/bin/basename /usr/bin/dirname /usr/bin/nano /usr/bin/pico /usr/bin/mysql /usr/bin/mysqldump /usr/bin/git /usr/bin/git-receive-pack /usr/bin/git-upload-pack /usr/bin/unzip /usr/bin/zip /bin/tar /bin/rm /usr/bin/patch /usr/bin/which /usr/lib/x86_64-linux-gnu/libmemcached.so.11 /usr/lib/x86_64-linux-gnu/libmemcachedutil.so.2 /usr/lib/x86_64-linux-gnu/libMagickWand-6.Q16.so.2 /opt/php-5.6.8/bin/php /opt/php-5.6.8/include /opt/php-5.6.8/lib +jailkit_chroot_app_programs=/usr/bin/groups /usr/bin/id /usr/bin/dircolors /usr/bin/lesspipe /usr/bin/basename /usr/bin/dirname /usr/bin/nano /usr/bin/pico /usr/bin/mysql /usr/bin/mysqldump /usr/bin/git /usr/bin/git-receive-pack /usr/bin/git-upload-pack /usr/bin/unzip /usr/bin/zip /bin/tar /bin/rm /usr/bin/patch /usr/bin/which /usr/lib/x86_64-linux-gnu/libmemcached.so.11 /usr/lib/x86_64-linux-gnu/libmemcachedutil.so.2 /usr/lib/x86_64-linux-gnu/libMagickWand-6.Q16.so.2 /usr/bin/rsync /usr/bin/jpegoptim /usr/bin/optipng /usr/share/ca-certificates/ /etc/ssl/certs/ /opt/th-php-libs/ /etc/ld.so.conf.d/ /bin/bzip2 /usr/local/bin/composer /usr/lib/ssl /usr/bin/env /usr/bin/xargs jailkit_chroot_cron_programs=/usr/bin/php /usr/bin/perl /usr/share/perl /usr/share/php [vlogger] @@ -155,14 +153,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..3a51546f04cf0250ab006fa6263bf2aa3a248681 100644 --- a/install/update.php +++ b/install/update.php @@ -98,7 +98,7 @@ if(is_dir('/root/ispconfig') || is_dir('/home/admispconfig')) { die('This software cannot be installed on a server wich runs ISPConfig 2.x.'); } -// Patch is required to reapir latest amavis versions +// Patch is required to repair latest amavis versions if(is_installed('amavisd-new') && !is_installed('patch')) die('The patch command is missing. Install patch command and start update again.'); //** Get distribution identifier @@ -109,6 +109,7 @@ $conf_old = $conf; unset($conf); if($dist['id'] == '') die('Linux distribution or version not recognized.'); +if(!$dist['supported']) die('This distribution is not supported.'); //** Include the autoinstaller configuration (for non-interactive setups) error_reporting(E_ALL ^ E_NOTICE); @@ -141,11 +142,18 @@ if(isset($cmd_opt['autoinstall']) && is_file($cmd_opt['autoinstall'])) { define('AUTOINSTALL', false); } + //** Include the distribution-specific installer class library and configuration if(is_file('dist/lib/'.$dist['baseid'].'.lib.php')) include_once 'dist/lib/'.$dist['baseid'].'.lib.php'; include_once 'dist/lib/'.$dist['id'].'.lib.php'; include_once 'dist/conf/'.$dist['confid'].'.conf.php'; +$inst = new installer(); +if (!$inst->get_php_version()) die('ISPConfig requieres PHP '.$inst->min_php."\n"); +$inst->is_update = true; + +$inst->raiseEvent('set_dist_config', $dist); + //** tRNG dependencies $conf['tRNG']=''; @@ -186,10 +194,6 @@ if(!$conf['mysql']['ip'] = gethostbyname($conf['mysql']['host'])) die('Unable to $conf['server_id'] = intval($conf_old["server_id"]); $conf['ispconfig_log_priority'] = $conf_old["log_priority"]; -$inst = new installer(); -if (!$inst->get_php_version()) die('ISPConfig requieres PHP '.$inst->min_php."\n"); -$inst->is_update = true; - echo "This application will update ISPConfig 3 on your server.\n\n"; //* Make a backup before we start the update @@ -298,7 +302,9 @@ checkDbHealth(); /* * dump the new Database and reconfigure the server.ini */ +$inst->raiseEvent('updateDbAndIni::before'); updateDbAndIni(); +$inst->raiseEvent('updateDbAndIni::after'); //** read server config from db into $conf['server_config'] $tmp = $inst->db->queryOneRecord("SELECT config FROM ?? WHERE server_id = ?", $conf["mysql"]["database"] . '.server', $conf['server_id']); @@ -320,22 +326,24 @@ if($reconfigure_master_database_rights_answer == 'yes') { //} //** Detect the installed applications +$inst->raiseEvent('find_installed_apps::before'); $inst->find_installed_apps(); +$inst->raiseEvent('find_installed_apps::after'); //** 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']); +$inst->raiseEvent('check_service_config_state::before'); +if ($conf['mysql']['master_slave_setup'] == 'y') $current_svc_config = $inst->dbmaster->queryOneRecord("SELECT mail_server,web_server,dns_server,firewall_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,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); +$inst->raiseEvent('check_service_config_state::after'); //** 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']}', 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']); @@ -365,34 +373,10 @@ if($reconfigure_services_answer == 'yes' || $reconfigure_services_answer == 'sel //* Configure dovecot swriteln('Configuring Dovecot'); $inst->configure_dovecot(); - } elseif ($conf['courier']['installed'] == true) { - //** Configure saslauthd - swriteln('Configuring SASL'); - $inst->configure_saslauthd(); - - //** Configure PAM - swriteln('Configuring PAM'); - $inst->configure_pam(); - - //* Configure courier - swriteln('Configuring Courier'); - $inst->configure_courier(); } } - //** Configure mailman - if($conf['mailman']['installed'] == true && $inst->reconfigure_app('Mailman', $reconfigure_services_answer)) { - swriteln('Configuring Mailman'); - $inst->configure_mailman('update'); - } - - //* Configure mlmmj - if($conf['mlmmj']['installed'] == true && $inst->reconfigure_app('Mlmmj', $reconfigure_services_answer)) { - swriteln('Configuring Mlmmj'); - $inst->configure_mlmmj(/*update*/); - } - //** Configure Spamasassin if($inst->reconfigure_app('Spamassassin', $reconfigure_services_answer)) { swriteln('Configuring Spamassassin'); @@ -405,6 +389,12 @@ if($reconfigure_services_answer == 'yes' || $reconfigure_services_answer == 'sel $inst->configure_amavis(); } + //** Configure Rspamd + if($conf['rspamd']['installed'] == true && $inst->reconfigure_app('Rspamd', $reconfigure_services_answer)) { + swriteln('Configuring Rspamd'); + $inst->configure_rspamd(); + } + //** Configure Getmail if ($inst->reconfigure_app('Getmail', $reconfigure_services_answer)) { swriteln('Configuring Getmail'); @@ -465,17 +455,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 @@ -524,7 +503,9 @@ if ($inst->install_ispconfig_interface) { } } +$inst->raiseEvent('install_ispconfig::before'); $inst->install_ispconfig(); +$inst->raiseEvent('install_ispconfig::after'); // Cleanup $inst->cleanup_ispconfig(); @@ -542,18 +523,10 @@ if($reconfigure_services_answer == 'yes') { if($conf['mysql']['installed'] == true && $conf['mysql']['init_script'] != '') system($inst->getinitcommand($conf['mysql']['init_script'], 'restart').' >/dev/null 2>&1'); if($conf['services']['mail']) { if($conf['postfix']['installed'] == true && $conf['postfix']['init_script'] != '') system($inst->getinitcommand($conf['postfix']['init_script'], 'restart')); - if($conf['saslauthd']['installed'] == true && $conf['saslauthd']['init_script'] != '') system($inst->getinitcommand($conf['saslauthd']['init_script'], 'restart')); if($conf['amavis']['installed'] == true && $conf['amavis']['init_script'] != '') system($inst->getinitcommand($conf['amavis']['init_script'], 'restart')); + if($conf['rspamd']['installed'] == true && $conf['rspamd']['init_script'] != '') system($inst->getinitcommand($conf['rspamd']['init_script'], 'restart')); if($conf['clamav']['installed'] == true && $conf['clamav']['init_script'] != '') system($inst->getinitcommand($conf['clamav']['init_script'], 'restart')); - if($conf['courier']['installed'] == true){ - if($conf['courier']['courier-authdaemon'] != '') system($inst->getinitcommand($conf['courier']['courier-authdaemon'], 'restart')); - if($conf['courier']['courier-imap'] != '') system($inst->getinitcommand($conf['courier']['courier-imap'], 'restart')); - if($conf['courier']['courier-imap-ssl'] != '') system($inst->getinitcommand($conf['courier']['courier-imap-ssl'], 'restart')); - if($conf['courier']['courier-pop'] != '') system($inst->getinitcommand($conf['courier']['courier-pop'], 'restart')); - if($conf['courier']['courier-pop-ssl'] != '') system($inst->getinitcommand($conf['courier']['courier-pop-ssl'], 'restart')); - } if($conf['dovecot']['installed'] == true && $conf['dovecot']['init_script'] != '') system($inst->getinitcommand($conf['dovecot']['init_script'], 'restart')); - if($conf['mailman']['installed'] == true && $conf['mailman']['init_script'] != '') system('nohup '.$inst->getinitcommand($conf['mailman']['init_script'], 'restart').' >/dev/null 2>&1 &'); } if($conf['services']['web'] || $inst->install_ispconfig_interface) { if($conf['webserver']['server_type'] == 'apache' && $conf['apache']['init_script'] != '') system($inst->getinitcommand($conf['apache']['init_script'], 'restart')); @@ -570,11 +543,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..dc3e9e837932041e60022e2828d660782e7a20b0 100644 --- a/interface/lib/classes/custom_datasource.inc.php +++ b/interface/lib/classes/custom_datasource.inc.php @@ -136,12 +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; case 'mail_servers': $field = 'mail_server'; break; @@ -154,9 +148,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/db_mysql.inc.php b/interface/lib/classes/db_mysql.inc.php index b03ad55676ddb3c30cf01c4e12eed534865d8585..c4764cb5558539bed8e990b4418798ef24833d77 100644 --- a/interface/lib/classes/db_mysql.inc.php +++ b/interface/lib/classes/db_mysql.inc.php @@ -719,8 +719,8 @@ class db if($action == 'INSERT') $action = 'i'; if($action == 'UPDATE') $action = 'u'; if($action == 'DELETE') $action = 'd'; - $sql = "INSERT INTO sys_datalog (dbtable,dbidx,server_id,action,tstamp,user,data) VALUES (?, ?, ?, ?, ?, ?, ?)"; - $app->db->query($sql, $db_table, $dbidx, $server_id, $action, time(), $username, $diffstr); + $sql = "INSERT INTO sys_datalog (dbtable,dbidx,server_id,action,tstamp,user,data,session_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?)"; + $app->db->query($sql, $db_table, $dbidx, $server_id, $action, time(), $username, $diffstr, session_id()); } return true; @@ -759,6 +759,9 @@ class db $old_rec = array(); $index_value = $this->insertID(); + if(!$index_value && isset($insert_data[$index_field])) { + $index_value = $insert_data[$index_field]; + } $new_rec = $this->queryOneRecord("SELECT * FROM ?? WHERE ?? = ?", $tablename, $index_field, $index_value); $this->datalogSave($tablename, 'INSERT', $index_field, $index_value, $old_rec, $new_rec); diff --git a/interface/lib/classes/finediff.inc.php b/interface/lib/classes/finediff.inc.php new file mode 100644 index 0000000000000000000000000000000000000000..43b542f3629ec5ce14741267a0cdf991865bd193 --- /dev/null +++ b/interface/lib/classes/finediff.inc.php @@ -0,0 +1,752 @@ +copy->insert +* command (swap) for when the inserted segment is exactly the same +* as the deleted one, and with only a copy operation in between. +* TODO: How often this case occurs? Is it worth it? Can only +* be done as a postprocessing method (->optimize()?) +*/ +abstract class FineDiffOp { + abstract public function getFromLen(); + abstract public function getToLen(); + abstract public function getOpcode(); + } + +class FineDiffDeleteOp extends FineDiffOp { + public function __construct($len) { + $this->fromLen = $len; + } + public function getFromLen() { + return $this->fromLen; + } + public function getToLen() { + return 0; + } + public function getOpcode() { + if ( $this->fromLen === 1 ) { + return 'd'; + } + return "d{$this->fromLen}"; + } + } + +class FineDiffInsertOp extends FineDiffOp { + public function __construct($text) { + $this->text = $text; + } + public function getFromLen() { + return 0; + } + public function getToLen() { + return strlen($this->text); + } + public function getText() { + return $this->text; + } + public function getOpcode() { + $to_len = strlen($this->text); + if ( $to_len === 1 ) { + return "i:{$this->text}"; + } + return "i{$to_len}:{$this->text}"; + } + } + +class FineDiffReplaceOp extends FineDiffOp { + public function __construct($fromLen, $text) { + $this->fromLen = $fromLen; + $this->text = $text; + } + public function getFromLen() { + return $this->fromLen; + } + public function getToLen() { + return strlen($this->text); + } + public function getText() { + return $this->text; + } + public function getOpcode() { + if ( $this->fromLen === 1 ) { + $del_opcode = 'd'; + } + else { + $del_opcode = "d{$this->fromLen}"; + } + $to_len = strlen($this->text); + if ( $to_len === 1 ) { + return "{$del_opcode}i:{$this->text}"; + } + return "{$del_opcode}i{$to_len}:{$this->text}"; + } + } + +class FineDiffCopyOp extends FineDiffOp { + public function __construct($len) { + $this->len = $len; + } + public function getFromLen() { + return $this->len; + } + public function getToLen() { + return $this->len; + } + public function getOpcode() { + if ( $this->len === 1 ) { + return 'c'; + } + return "c{$this->len}"; + } + public function increase($size) { + return $this->len += $size; + } + } + +/** +* FineDiff ops +* +* Collection of ops +*/ +class FineDiffOps { + public function appendOpcode($opcode, $from, $from_offset, $from_len) { + if ( $opcode === 'c' ) { + $edits[] = new FineDiffCopyOp($from_len); + } + else if ( $opcode === 'd' ) { + $edits[] = new FineDiffDeleteOp($from_len); + } + else /* if ( $opcode === 'i' ) */ { + $edits[] = new FineDiffInsertOp(substr($from, $from_offset, $from_len)); + } + } + public $edits = array(); + } + +/** +* FineDiff class +* +* TODO: Document +* +*/ +class FineDiff { + + /**------------------------------------------------------------------------ + * + * Public section + * + */ + + /** + * Constructor + * ... + * The $granularityStack allows FineDiff to be configurable so that + * a particular stack tailored to the specific content of a document can + * be passed. + */ + public function __construct($from_text = '', $to_text = '', $granularityStack = null) { + // setup stack for generic text documents by default + $this->granularityStack = $granularityStack ? $granularityStack : FineDiff::$characterGranularity; + $this->edits = array(); + $this->from_text = $from_text; + $this->doDiff($from_text, $to_text); + } + + public function getOps() { + return $this->edits; + } + + public function getOpcodes() { + $opcodes = array(); + foreach ( $this->edits as $edit ) { + $opcodes[] = $edit->getOpcode(); + } + return implode('', $opcodes); + } + + public function renderDiffToHTML() { + $in_offset = 0; + ob_start(); + foreach ( $this->edits as $edit ) { + $n = $edit->getFromLen(); + if ( $edit instanceof FineDiffCopyOp ) { + FineDiff::renderDiffToHTMLFromOpcode('c', $this->from_text, $in_offset, $n); + } + else if ( $edit instanceof FineDiffDeleteOp ) { + FineDiff::renderDiffToHTMLFromOpcode('d', $this->from_text, $in_offset, $n); + } + else if ( $edit instanceof FineDiffInsertOp ) { + FineDiff::renderDiffToHTMLFromOpcode('i', $edit->getText(), 0, $edit->getToLen()); + } + else /* if ( $edit instanceof FineDiffReplaceOp ) */ { + FineDiff::renderDiffToHTMLFromOpcode('d', $this->from_text, $in_offset, $n); + FineDiff::renderDiffToHTMLFromOpcode('i', $edit->getText(), 0, $edit->getToLen()); + } + $in_offset += $n; + } + return ob_get_clean(); + } + + /**------------------------------------------------------------------------ + * Return an opcodes string describing the diff between a "From" and a + * "To" string + */ + public static function getDiffOpcodes($from, $to, $granularities = null) { + $diff = new FineDiff($from, $to, $granularities); + return $diff->getOpcodes(); + } + + /**------------------------------------------------------------------------ + * Return an iterable collection of diff ops from an opcodes string + */ + public static function getDiffOpsFromOpcodes($opcodes) { + $diffops = new FineDiffOps(); + FineDiff::renderFromOpcodes(null, $opcodes, array($diffops,'appendOpcode')); + return $diffops->edits; + } + + /**------------------------------------------------------------------------ + * Re-create the "To" string from the "From" string and an "Opcodes" string + */ + public static function renderToTextFromOpcodes($from, $opcodes) { + ob_start(); + FineDiff::renderFromOpcodes($from, $opcodes, array('FineDiff','renderToTextFromOpcode')); + return ob_get_clean(); + } + + /**------------------------------------------------------------------------ + * Render the diff to an HTML string -- UTF8 unsafe + */ + public static function renderDiffToHTMLFromOpcodes($from, $opcodes) { + ob_start(); + FineDiff::renderFromOpcodes($from, $opcodes, array('FineDiff','renderDiffToHTMLFromOpcode')); + return ob_get_clean(); + } + + /**------------------------------------------------------------------------ + * Render the diff to an HTML string -- UTF8 safe + */ + public static function renderUTF8DiffToHTMLFromOpcodes($from, $opcodes) { + ob_start(); + FineDiff::renderUTF8FromOpcode($from, $opcodes, array('FineDiff','renderDiffToHTMLFromOpcode')); + return ob_get_clean(); + } + + /**------------------------------------------------------------------------ + * Generic opcodes parser, user must supply callback for handling + * single opcode + */ + public static function renderFromOpcodes($from, $opcodes, $callback) { + if ( !is_callable($callback) ) { + return; + } + $opcodes_len = strlen($opcodes); + $from_offset = $opcodes_offset = 0; + while ( $opcodes_offset < $opcodes_len ) { + $opcode = substr($opcodes, $opcodes_offset, 1); + $opcodes_offset++; + $n = intval(substr($opcodes, $opcodes_offset)); + if ( $n ) { + $opcodes_offset += strlen(strval($n)); + } + else { + $n = 1; + } + if ( $opcode === 'c' ) { // copy n characters from source + call_user_func($callback, 'c', $from, $from_offset, $n, ''); + $from_offset += $n; + } + else if ( $opcode === 'd' ) { // delete n characters from source + call_user_func($callback, 'd', $from, $from_offset, $n, ''); + $from_offset += $n; + } + else /* if ( $opcode === 'i' ) */ { // insert n characters from opcodes + call_user_func($callback, 'i', $opcodes, $opcodes_offset + 1, $n); + $opcodes_offset += 1 + $n; + } + } + } + + /**------------------------------------------------------------------------ + * Generic opcodes parser, user must supply callback for handling + * single opcode + */ + private static function renderUTF8FromOpcode($from, $opcodes, $callback) { + if ( !is_callable($callback) ) { + return; + } + $from_len = strlen($from); + $opcodes_len = strlen($opcodes); + $from_offset = $opcodes_offset = 0; + $last_to_chars = ''; + while ( $opcodes_offset < $opcodes_len ) { + $opcode = substr($opcodes, $opcodes_offset, 1); + $opcodes_offset++; + $n = intval(substr($opcodes, $opcodes_offset)); + if ( $n ) { + $opcodes_offset += strlen(strval($n)); + } + else { + $n = 1; + } + if ( $opcode === 'c' || $opcode === 'd' ) { + $beg = $from_offset; + $end = $from_offset + $n; + while ( $beg > 0 && (ord($from[$beg]) & 0xC0) === 0x80 ) { $beg--; } + while ( $end < $from_len && (ord($from[$end]) & 0xC0) === 0x80 ) { $end++; } + if ( $opcode === 'c' ) { // copy n characters from source + call_user_func($callback, 'c', $from, $beg, $end - $beg, ''); + $last_to_chars = substr($from, $beg, $end - $beg); + } + else /* if ( $opcode === 'd' ) */ { // delete n characters from source + call_user_func($callback, 'd', $from, $beg, $end - $beg, ''); + } + $from_offset += $n; + } + else /* if ( $opcode === 'i' ) */ { // insert n characters from opcodes + $opcodes_offset += 1; + if ( strlen($last_to_chars) > 0 && (ord($opcodes[$opcodes_offset]) & 0xC0) === 0x80 ) { + $beg = strlen($last_to_chars) - 1; + while ( $beg > 0 && (ord($last_to_chars[$beg]) & 0xC0) === 0x80 ) { $beg--; } + $prefix = substr($last_to_chars, $beg); + } else { + $prefix = ''; + } + $end = $from_offset; + while ( $end < $from_len && (ord($from[$end]) & 0xC0) === 0x80 ) { $end++; } + $toInsert = $prefix . substr($opcodes, $opcodes_offset, $n) . substr($from, $end, $end - $from_offset); + call_user_func($callback, 'i', $toInsert, 0, strlen($toInsert)); + $opcodes_offset += $n; + $last_to_chars = $toInsert; + } + } + } + + /** + * Stock granularity stacks and delimiters + */ + + const paragraphDelimiters = "\n\r"; + public static $paragraphGranularity = array( + FineDiff::paragraphDelimiters + ); + const sentenceDelimiters = ".\n\r"; + public static $sentenceGranularity = array( + FineDiff::paragraphDelimiters, + FineDiff::sentenceDelimiters + ); + const wordDelimiters = " \t.\n\r"; + public static $wordGranularity = array( + FineDiff::paragraphDelimiters, + FineDiff::sentenceDelimiters, + FineDiff::wordDelimiters + ); + const characterDelimiters = ""; + public static $characterGranularity = array( + FineDiff::paragraphDelimiters, + FineDiff::sentenceDelimiters, + FineDiff::wordDelimiters, + FineDiff::characterDelimiters + ); + + public static $textStack = array( + ".", + " \t.\n\r", + "" + ); + + /**------------------------------------------------------------------------ + * + * Private section + * + */ + + /** + * Entry point to compute the diff. + */ + private function doDiff($from_text, $to_text) { + $this->last_edit = false; + $this->stackpointer = 0; + $this->from_text = $from_text; + $this->from_offset = 0; + // can't diff without at least one granularity specifier + if ( empty($this->granularityStack) ) { + return; + } + $this->_processGranularity($from_text, $to_text); + } + + /** + * This is the recursive function which is responsible for + * handling/increasing granularity. + * + * Incrementally increasing the granularity is key to compute the + * overall diff in a very efficient way. + */ + private function _processGranularity($from_segment, $to_segment) { + $delimiters = $this->granularityStack[$this->stackpointer++]; + $has_next_stage = $this->stackpointer < count($this->granularityStack); + foreach ( FineDiff::doFragmentDiff($from_segment, $to_segment, $delimiters) as $fragment_edit ) { + // increase granularity + if ( $fragment_edit instanceof FineDiffReplaceOp && $has_next_stage ) { + $this->_processGranularity( + substr($this->from_text, $this->from_offset, $fragment_edit->getFromLen()), + $fragment_edit->getText() + ); + } + // fuse copy ops whenever possible + else if ( $fragment_edit instanceof FineDiffCopyOp && $this->last_edit instanceof FineDiffCopyOp ) { + $this->edits[count($this->edits)-1]->increase($fragment_edit->getFromLen()); + $this->from_offset += $fragment_edit->getFromLen(); + } + else { + /* $fragment_edit instanceof FineDiffCopyOp */ + /* $fragment_edit instanceof FineDiffDeleteOp */ + /* $fragment_edit instanceof FineDiffInsertOp */ + $this->edits[] = $this->last_edit = $fragment_edit; + $this->from_offset += $fragment_edit->getFromLen(); + } + } + $this->stackpointer--; + } + + /** + * This is the core algorithm which actually perform the diff itself, + * fragmenting the strings as per specified delimiters. + * + * This function is naturally recursive, however for performance purpose + * a local job queue is used instead of outright recursivity. + */ + private static function doFragmentDiff($from_text, $to_text, $delimiters) { + // Empty delimiter means character-level diffing. + // In such case, use code path optimized for character-level + // diffing. + if ( empty($delimiters) ) { + return FineDiff::doCharDiff($from_text, $to_text); + } + + $result = array(); + + // fragment-level diffing + $from_text_len = strlen($from_text); + $to_text_len = strlen($to_text); + $from_fragments = FineDiff::extractFragments($from_text, $delimiters); + $to_fragments = FineDiff::extractFragments($to_text, $delimiters); + + $jobs = array(array(0, $from_text_len, 0, $to_text_len)); + + $cached_array_keys = array(); + + while ( $job = array_pop($jobs) ) { + + // get the segments which must be diff'ed + list($from_segment_start, $from_segment_end, $to_segment_start, $to_segment_end) = $job; + + // catch easy cases first + $from_segment_length = $from_segment_end - $from_segment_start; + $to_segment_length = $to_segment_end - $to_segment_start; + if ( !$from_segment_length || !$to_segment_length ) { + if ( $from_segment_length ) { + $result[$from_segment_start * 4] = new FineDiffDeleteOp($from_segment_length); + } + else if ( $to_segment_length ) { + $result[$from_segment_start * 4 + 1] = new FineDiffInsertOp(substr($to_text, $to_segment_start, $to_segment_length)); + } + continue; + } + + // find longest copy operation for the current segments + $best_copy_length = 0; + + $from_base_fragment_index = $from_segment_start; + + $cached_array_keys_for_current_segment = array(); + + while ( $from_base_fragment_index < $from_segment_end ) { + $from_base_fragment = $from_fragments[$from_base_fragment_index]; + $from_base_fragment_length = strlen($from_base_fragment); + // performance boost: cache array keys + if ( !isset($cached_array_keys_for_current_segment[$from_base_fragment]) ) { + if ( !isset($cached_array_keys[$from_base_fragment]) ) { + $to_all_fragment_indices = $cached_array_keys[$from_base_fragment] = array_keys($to_fragments, $from_base_fragment, true); + } + else { + $to_all_fragment_indices = $cached_array_keys[$from_base_fragment]; + } + // get only indices which falls within current segment + if ( $to_segment_start > 0 || $to_segment_end < $to_text_len ) { + $to_fragment_indices = array(); + foreach ( $to_all_fragment_indices as $to_fragment_index ) { + if ( $to_fragment_index < $to_segment_start ) { continue; } + if ( $to_fragment_index >= $to_segment_end ) { break; } + $to_fragment_indices[] = $to_fragment_index; + } + $cached_array_keys_for_current_segment[$from_base_fragment] = $to_fragment_indices; + } + else { + $to_fragment_indices = $to_all_fragment_indices; + } + } + else { + $to_fragment_indices = $cached_array_keys_for_current_segment[$from_base_fragment]; + } + // iterate through collected indices + foreach ( $to_fragment_indices as $to_base_fragment_index ) { + $fragment_index_offset = $from_base_fragment_length; + // iterate until no more match + for (;;) { + $fragment_from_index = $from_base_fragment_index + $fragment_index_offset; + if ( $fragment_from_index >= $from_segment_end ) { + break; + } + $fragment_to_index = $to_base_fragment_index + $fragment_index_offset; + if ( $fragment_to_index >= $to_segment_end ) { + break; + } + if ( $from_fragments[$fragment_from_index] !== $to_fragments[$fragment_to_index] ) { + break; + } + $fragment_length = strlen($from_fragments[$fragment_from_index]); + $fragment_index_offset += $fragment_length; + } + if ( $fragment_index_offset > $best_copy_length ) { + $best_copy_length = $fragment_index_offset; + $best_from_start = $from_base_fragment_index; + $best_to_start = $to_base_fragment_index; + } + } + $from_base_fragment_index += strlen($from_base_fragment); + // If match is larger than half segment size, no point trying to find better + // TODO: Really? + if ( $best_copy_length >= $from_segment_length / 2) { + break; + } + // no point to keep looking if what is left is less than + // current best match + if ( $from_base_fragment_index + $best_copy_length >= $from_segment_end ) { + break; + } + } + + if ( $best_copy_length ) { + $jobs[] = array($from_segment_start, $best_from_start, $to_segment_start, $best_to_start); + $result[$best_from_start * 4 + 2] = new FineDiffCopyOp($best_copy_length); + $jobs[] = array($best_from_start + $best_copy_length, $from_segment_end, $best_to_start + $best_copy_length, $to_segment_end); + } + else { + $result[$from_segment_start * 4 ] = new FineDiffReplaceOp($from_segment_length, substr($to_text, $to_segment_start, $to_segment_length)); + } + } + + ksort($result, SORT_NUMERIC); + return array_values($result); + } + + /** + * Perform a character-level diff. + * + * The algorithm is quite similar to doFragmentDiff(), except that + * the code path is optimized for character-level diff -- strpos() is + * used to find out the longest common subequence of characters. + * + * We try to find a match using the longest possible subsequence, which + * is at most the length of the shortest of the two strings, then incrementally + * reduce the size until a match is found. + * + * I still need to study more the performance of this function. It + * appears that for long strings, the generic doFragmentDiff() is more + * performant. For word-sized strings, doCharDiff() is somewhat more + * performant. + */ + private static function doCharDiff($from_text, $to_text) { + $result = array(); + $jobs = array(array(0, strlen($from_text), 0, strlen($to_text))); + while ( $job = array_pop($jobs) ) { + // get the segments which must be diff'ed + list($from_segment_start, $from_segment_end, $to_segment_start, $to_segment_end) = $job; + $from_segment_len = $from_segment_end - $from_segment_start; + $to_segment_len = $to_segment_end - $to_segment_start; + + // catch easy cases first + if ( !$from_segment_len || !$to_segment_len ) { + if ( $from_segment_len ) { + $result[$from_segment_start * 4 + 0] = new FineDiffDeleteOp($from_segment_len); + } + else if ( $to_segment_len ) { + $result[$from_segment_start * 4 + 1] = new FineDiffInsertOp(substr($to_text, $to_segment_start, $to_segment_len)); + } + continue; + } + if ( $from_segment_len >= $to_segment_len ) { + $copy_len = $to_segment_len; + while ( $copy_len ) { + $to_copy_start = $to_segment_start; + $to_copy_start_max = $to_segment_end - $copy_len; + while ( $to_copy_start <= $to_copy_start_max ) { + $from_copy_start = strpos(substr($from_text, $from_segment_start, $from_segment_len), substr($to_text, $to_copy_start, $copy_len)); + if ( $from_copy_start !== false ) { + $from_copy_start += $from_segment_start; + break 2; + } + $to_copy_start++; + } + $copy_len--; + } + } + else { + $copy_len = $from_segment_len; + while ( $copy_len ) { + $from_copy_start = $from_segment_start; + $from_copy_start_max = $from_segment_end - $copy_len; + while ( $from_copy_start <= $from_copy_start_max ) { + $to_copy_start = strpos(substr($to_text, $to_segment_start, $to_segment_len), substr($from_text, $from_copy_start, $copy_len)); + if ( $to_copy_start !== false ) { + $to_copy_start += $to_segment_start; + break 2; + } + $from_copy_start++; + } + $copy_len--; + } + } + // match found + if ( $copy_len ) { + $jobs[] = array($from_segment_start, $from_copy_start, $to_segment_start, $to_copy_start); + $result[$from_copy_start * 4 + 2] = new FineDiffCopyOp($copy_len); + $jobs[] = array($from_copy_start + $copy_len, $from_segment_end, $to_copy_start + $copy_len, $to_segment_end); + } + // no match, so delete all, insert all + else { + $result[$from_segment_start * 4] = new FineDiffReplaceOp($from_segment_len, substr($to_text, $to_segment_start, $to_segment_len)); + } + } + ksort($result, SORT_NUMERIC); + return array_values($result); + } + + /** + * Efficiently fragment the text into an array according to + * specified delimiters. + * No delimiters means fragment into single character. + * The array indices are the offset of the fragments into + * the input string. + * A sentinel empty fragment is always added at the end. + * Careful: No check is performed as to the validity of the + * delimiters. + */ + private static function extractFragments($text, $delimiters) { + // special case: split into characters + if ( empty($delimiters) ) { + $chars = str_split($text, 1); + $chars[strlen($text)] = ''; + return $chars; + } + $fragments = array(); + $start = $end = 0; + for (;;) { + $end += strcspn($text, $delimiters, $end); + $end += strspn($text, $delimiters, $end); + if ( $end === $start ) { + break; + } + $fragments[$start] = substr($text, $start, $end - $start); + $start = $end; + } + $fragments[$start] = ''; + return $fragments; + } + + /** + * Stock opcode renderers + */ + private static function renderToTextFromOpcode($opcode, $from, $from_offset, $from_len) { + if ( $opcode === 'c' || $opcode === 'i' ) { + echo substr($from, $from_offset, $from_len); + } + } + + private static function renderDiffToHTMLFromOpcode($opcode, $from, $from_offset, $from_len) { + if ( $opcode === 'c' ) { + echo htmlspecialchars(substr($from, $from_offset, $from_len)); + } + else if ( $opcode === 'd' ) { + $deletion = substr($from, $from_offset, $from_len); + if ( strcspn($deletion, " \n\r") === 0 ) { + $deletion = str_replace(array("\n","\r"), array('\n','\r'), $deletion); + } + echo '', htmlspecialchars($deletion), ''; + } + else /* if ( $opcode === 'i' ) */ { + echo '', htmlspecialchars(substr($from, $from_offset, $from_len)), ''; + } + } + } + diff --git a/interface/lib/classes/functions.inc.php b/interface/lib/classes/functions.inc.php index a86057a0647c0544849b97e6d6107c3d33663943..25e8b4aa222fd74da940780865aba9ac4734b39a 100644 --- a/interface/lib/classes/functions.inc.php +++ b/interface/lib/classes/functions.inc.php @@ -232,12 +232,6 @@ class functions { } } - $results = $app->db->queryAllRecords("SELECT ip_address AS ip FROM openvz_ip"); - if(!empty($results) && is_array($results)){ - foreach($results as $result){ - if(preg_match($regex, $result['ip'])) $ips[] = $result['ip']; - } - } $results = $groupid != 1 ? $app->db->queryAllRecords("SELECT rr.data AS server_ip, rr.name as server_name, soa.origin as domain FROM dns_rr as rr, dns_soa as soa WHERE (rr.type = 'A' OR rr.type = 'AAAA') AND soa.id = rr.zone AND rr.sys_groupid = ?", $groupid) : $results = $app->db->queryAllRecords("SELECT rr.data AS server_ip, rr.name as server_name, soa.origin as domain FROM dns_rr as rr, dns_soa as soa WHERE (rr.type = 'A' OR rr.type = 'AAAA') AND soa.id = rr.zone"); if(!empty($results) && is_array($results)){ @@ -259,6 +253,12 @@ class functions { } } } + + $tmp_ips = $app->plugin->raiseEvent('get_server_ips', 0, true); + if(is_array($tmp_ips) && !empty($tmp_ips)) { + $ips = array_merge($ips, $tmp_ips); + } + $results = $groupid != 1 ? $app->db->queryAllRecords("SELECT database_name as name,remote_ips as ip FROM web_database WHERE remote_ips != '' AND sys_groupid = ?", $groupid) : $results = $app->db->queryAllRecords("SELECT database_name as name,remote_ips as ip FROM web_database WHERE remote_ips != ''"); diff --git a/interface/lib/classes/ispcmail.inc.php b/interface/lib/classes/ispcmail.inc.php index b818e1e44a6732db717bee6560001a6ebba9ef35..209cb5bd4369f3a60cc8363d4cb55da63ff7b54c 100644 --- a/interface/lib/classes/ispcmail.inc.php +++ b/interface/lib/classes/ispcmail.inc.php @@ -744,32 +744,22 @@ class ispcmail { } if($this->use_smtp == true) { - if(!$this->_logged_in || !$this->_smtp_conn) { - $result = $this->_smtp_login(); - if(!$result) return false; - } $bcc_cc_sent = false; foreach($recipients as $recipname => $recip) { - if($this->_sent_mails >= $this->smtp_max_mails) { - // close connection to smtp and reconnect - $this->_sent_mails = 0; - $this->_smtp_close(); - $result = $this->_smtp_login(); - if(!$result) return false; - } - $this->_sent_mails += 1; + // Build mail headers, content etc. + + $m_recipients = array(); + $m_mail_content = ''; $recipname = trim(str_replace('"', '', $recipname)); $recip = $this->_encodeHeader($recip, $this->mail_charset); $recipname = $this->_encodeHeader($recipname, $this->mail_charset); //Email From - fputs($this->_smtp_conn, 'MAIL FROM: <' . $this->_mail_sender . '>' . $this->_crlf); - $response = fgets($this->_smtp_conn, 515); + $m_from = $this->_mail_sender; //Email To - fputs($this->_smtp_conn, 'RCPT TO: <' . $recip . '>' . $this->_crlf); - $response = fgets($this->_smtp_conn, 515); + $m_recipients[] = $recip; if($bcc_cc_sent == false) { $add_recips = array(); @@ -777,17 +767,12 @@ class ispcmail { if($this->getHeader('Bcc') != '') $add_recips = array_merge($add_recips, $this->_extract_names($this->getHeader('Bcc'))); foreach($add_recips as $add_recip) { if(!$add_recip['mail']) continue; - fputs($this->_smtp_conn, 'RCPT TO: <' . $this->_encodeHeader($add_recip['mail'], $this->mail_charset) . '>' . $this->_crlf); - $response = fgets($this->_smtp_conn, 515); + $m_recipients[] = $this->_encodeHeader($add_recip['mail'], $this->mail_charset); } unset($add_recips); $bcc_cc_sent = true; } - //The Email - fputs($this->_smtp_conn, 'DATA' . $this->_crlf); - $response = fgets($this->_smtp_conn, 515); - //Construct Headers if($recipname && !is_numeric($recipname)) $this->setHeader('To', $recipname . ' <' . $recip . '>'); else $this->setHeader('To', $recip); @@ -797,10 +782,32 @@ class ispcmail { if($this->getHeader('Cc') != '') $mail_content .= 'Cc: ' . $this->_encodeHeader($this->getHeader('Cc'), $this->mail_charset) . $this->_crlf; $mail_content .= implode($this->_crlf, $headers) . $this->_crlf . ($this->_is_signed == false ? $this->_crlf : '') . $this->body; - fputs($this->_smtp_conn, $mail_content . $this->_crlf . '.' . $this->_crlf); - $response = fgets($this->_smtp_conn, 515); + $m_mail_content = $mail_content; + + // Attempt SMTP login: + + if(!$this->_logged_in || !$this->_smtp_conn) { + $result = $this->_smtp_login(); + } + + if($this->_sent_mails >= $this->smtp_max_mails) { + // close connection to smtp and reconnect + $this->_sent_mails = 0; + $this->_smtp_close(); + $result = $this->_smtp_login(); + } + $this->_sent_mails += 1; + + // Send mail or queue it + + if ($result) { + $this->send_smtp($m_from, $m_recipients, $m_mail_content); + } else { + $this->add_to_queue($m_from, $m_recipients, $m_mail_content); + } + + // hopefully message was correctly sent or queued now - // hopefully message was correctly sent now $result = true; } } else { @@ -828,7 +835,87 @@ class ispcmail { return $result; } + /** + * Send all mails in queue (usually called from cron) + */ + public function send_queue() { + global $app; + + $mails = $app->db->queryAllRecords('SELECT * FROM sys_mailqueue'); + + if (is_array($mails)) { + foreach ($mails as $mail) { + // Open SMTP connections if not open: + + if(!$this->_logged_in || !$this->_smtp_conn) { + $result = $this->_smtp_login(); + } + + if($this->_sent_mails >= $this->smtp_max_mails) { + // close connection to smtp and reconnect + $this->_sent_mails = 0; + $this->_smtp_close(); + $result = $this->_smtp_login(); + } + $this->_sent_mails += 1; + + if (!$result) { + return false; + } + + // Send mail: + + $id = $mail['id']; + $from = $mail['from_address']; + $recipients = explode("\n", $mail['recipients']); + $mail_content = $mail['mail_content']; + + $this->send_smtp($from, $recipients, $mail_content); + + // Delete from queue: + + $app->db->query('DELETE FROM sys_mailqueue WHERE id = ?', $id); + } + } + } + + /** + * Send mail via SMTP + */ + private function send_smtp($from, $recipients, $mail_content) { + // from: + + fputs($this->_smtp_conn, 'MAIL FROM: <' . $from . '>' . $this->_crlf); + $response = fgets($this->_smtp_conn, 515); + + // recipients (To, Cc or Bcc): + + foreach ($recipients as $recipient) { + fputs($this->_smtp_conn, 'RCPT TO: <' . $recipient . '>' . $this->_crlf); + $response = fgets($this->_smtp_conn, 515); + } + + // mail content: + fputs($this->_smtp_conn, 'DATA' . $this->_crlf); + $response = fgets($this->_smtp_conn, 515); + + fputs($this->_smtp_conn, $mail_content . $this->_crlf . '.' . $this->_crlf); + $response = fgets($this->_smtp_conn, 515); + + // hopefully message was correctly sent now + $result = true; + + return $result; + } + + /** + * Add mail to queue for sending later + */ + private function add_to_queue($from, $recipients, $mail_content) { + global $app; + $app->db->query('INSERT INTO `sys_mailqueue` (`from_address`, `recipients`, `mail_content`) VALUES (?,?,?)', $from, implode("\n", $recipients), $mail_content); + } /** * Close mail connections diff --git a/interface/lib/classes/json_handler.inc.php b/interface/lib/classes/json_handler.inc.php index de8dd5ba0dd254053821ae910f3a868ba943597f..edc57132b70ba7de24c6353b47f6ecefcb85e6ab 100644 --- a/interface/lib/classes/json_handler.inc.php +++ b/interface/lib/classes/json_handler.inc.php @@ -115,11 +115,17 @@ class ISPConfigJSONHandler { try { $this->_return_json('ok', '', call_user_func_array(array($this->classes[$class_name], $method), $params)); - } catch(SoapFault $e) { + } catch(ISPConfigRemoteException $e) { $this->_return_json('remote_fault', $e->getMessage()); } } } -?> +if(!class_exists('ISPConfigRemoteException')) { + class ISPConfigRemoteException extends Exception { + public function __construct($code = '', $message = '') { + parent::__construct($message . ' (' . $code . ')', 0); + } + } +} \ No newline at end of file diff --git a/interface/lib/classes/listform.inc.php b/interface/lib/classes/listform.inc.php index 4b92daa73c2cba5cc8b7ec01ee170a452e20a3c8..665f2e457b6ab4b6e3b68cc9f256f788b0f906fc 100644 --- a/interface/lib/classes/listform.inc.php +++ b/interface/lib/classes/listform.inc.php @@ -66,6 +66,70 @@ class listform { $this->wordbook = $wb; + $module = (isset($_SESSION['s']['module']['name']) ? $_SESSION['s']['module']['name'] : ''); + + // load wordbook/lang files from addons + if($module == '') { + $lng_path = 'lib/lang.d'; + } else { + $lng_path = '../' . $module . '/lib/lang.d'; + } + if(($dir = opendir($lng_path))) { + $fallback_files = array(); + $use_files = array(); + while(false !== ($cur = readdir($dir))) { + $lng_file = $lng_path . '/' . $cur; + if(is_file($lng_file) && substr($cur, -strlen('.'.$app->listform->listDef["name"].".lng")) === '.'.$app->listform->listDef["name"].".lng") { + if(substr($cur, 0, 3) === 'en_') { + $fallback_files[] = $cur; + } elseif(substr($cur, 0, 3) === $app->functions->check_language($_SESSION["s"]["language"]) . '_') { + $use_files[] = $cur; + } + } + } + closedir($dir); + + foreach($fallback_files as $cur) { + $cur_lng = $app->functions->check_language($_SESSION["s"]["language"]) . '_' . substr($cur, 3); + if(in_array($cur_lng, $use_files, true) == false) { + $use_files[] = $cur; + } + } + unset($fallback_files); + + reset($use_files); + foreach($use_files as $cur) { + $lng_file = $lng_path . '/' . $cur; + + include $lng_file; + if(isset($wb) && is_array($wb)) { + $this->wordbook = $app->functions->array_merge($this->wordbook, $wb); + } + } + unset($use_files); + } + + + if($module) { + // load list files from addons + $listform_path = '../' . $module . '/lib/form.d'; + if(($dir = opendir($listform_path))) { + $items = null; + while(false !== ($cur = readdir($dir))) { + $listform_file = $listform_path . '/' . $cur; + if(is_file($listform_file) && substr($cur, -strlen('.'.$app->listform->listDef["name"].".list.php")) === '.'.$app->listform->listDef["name"].".list.php") { + unset($items); // just in case someone does not create a new array in the list file + include($listform_file); + if(isset($items) && is_array($items) && !empty($items)) { + $this->listDef['item'] = array_merge($this->listDef['item'], $items); + } + } + } + closedir($dir); + } + } + + return true; } diff --git a/interface/lib/classes/plugin.inc.php b/interface/lib/classes/plugin.inc.php index 8a8ac20012976866518a72b4f6bb8685c5e142e5..a01b2588cf7d69ab330b796a4f29419595d61ffe 100644 --- a/interface/lib/classes/plugin.inc.php +++ b/interface/lib/classes/plugin.inc.php @@ -124,17 +124,35 @@ class plugin { $tmp_event = $sub_events[2]; if($this->debug) $app->log("Called Event '$tmp_event'", LOGLEVEL_DEBUG); $tmpresult = $this->callPluginEvent($tmp_event, $data, $return_data); - if($return_data == true && $tmpresult) $result .= $tmpresult; + if($return_data == true && $tmpresult) { + if(is_array($tmpresult) && (!$result || is_array($result))) { + $result = array_merge($result, $tmpresult); + } elseif(!is_array($tmpresult)) { + $result .= $tmpresult; + } + } $tmp_event = $sub_events[0].':'.$sub_events[2]; if($this->debug) $app->log("Called Event '$tmp_event'", LOGLEVEL_DEBUG); $tmpresult = $this->callPluginEvent($tmp_event, $data, $return_data); - if($return_data == true && $tmpresult) $result .= $tmpresult; + if($return_data == true && $tmpresult) { + if(is_array($tmpresult) && (!$result || is_array($result))) { + $result = array_merge($result, $tmpresult); + } elseif(!is_array($tmpresult)) { + $result .= $tmpresult; + } + } $tmp_event = $sub_events[0].':'.$sub_events[1].':'.$sub_events[2]; if($this->debug) $app->log("Called Event '$tmp_event'", LOGLEVEL_DEBUG); $tmpresult = $this->callPluginEvent($tmp_event, $data, $return_data); - if($return_data == true && $tmpresult) $result .= $tmpresult; + if($return_data == true && $tmpresult) { + if(is_array($tmpresult) && (!$result || is_array($result))) { + $result = array_merge($result, $tmpresult); + } elseif(!is_array($tmpresult)) { + $result .= $tmpresult; + } + } /*$sub_events = array_reverse($sub_events); $tmp_event = ''; @@ -147,7 +165,13 @@ class plugin { } else { if($this->debug) $app->log("Called Event '$sub_events[0]'", LOGLEVEL_DEBUG); $tmpresult = $this->callPluginEvent($sub_events[0], $data, $return_data); - if($return_data == true && $tmpresult) $result .= $tmpresult; + if($return_data == true && $tmpresult) { + if(is_array($tmpresult) && (!$result || is_array($result))) { + $result = array_merge($result, $tmpresult); + } elseif(!is_array($tmpresult)) { + $result .= $tmpresult; + } + } } } @@ -187,7 +211,13 @@ class plugin { // call_user_method($function_name,$app->loaded_plugins[$plugin_name],$event_name,$data); $tmpresult = call_user_func(array($app->loaded_plugins[$plugin_name], $function_name), $event_name, $data); - if($return_data == true && $tmpresult) $result .= $tmpresult; + if($return_data == true && $tmpresult) { + if(is_array($tmpresult) && (!$result || is_array($result))) { + $result = array_merge($result, $tmpresult); + } elseif(!is_array($tmpresult)) { + $result .= $tmpresult; + } + } } } diff --git a/interface/lib/classes/remote.d/admin.inc.php b/interface/lib/classes/remote.d/admin.inc.php index 8b0c4730e80a0d4e0587baacc6772a227198a750..497f9a65541259b52371938ea648fbee4b567ced 100644 --- a/interface/lib/classes/remote.d/admin.inc.php +++ b/interface/lib/classes/remote.d/admin.inc.php @@ -52,7 +52,7 @@ class remoting_admin extends remoting { global $app; if(!$this->checkPerm($session_id, 'admin_record_permissions')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -62,7 +62,7 @@ class remoting_admin extends remoting { // check if userid is valid $check = $app->db->queryOneRecord('SELECT userid FROM sys_user WHERE userid = ?', $app->functions->intval($value)); if(!$check || !$check['userid']) { - throw new SoapFault('invalid parameters', $value . ' is no valid sys_userid.'); + throw new ISPConfigRemoteException('invalid parameters', $value . ' is no valid sys_userid.'); return false; } $permissions[$key] = $app->functions->intval($value); @@ -71,7 +71,7 @@ class remoting_admin extends remoting { // check if groupid is valid $check = $app->db->queryOneRecord('SELECT groupid FROM sys_group WHERE groupid = ?', $app->functions->intval($value)); if(!$check || !$check['groupid']) { - throw new SoapFault('invalid parameters', $value . ' is no valid sys_groupid.'); + throw new ISPConfigRemoteException('invalid parameters', $value . ' is no valid sys_groupid.'); return false; } $permissions[$key] = $app->functions->intval($value); @@ -81,7 +81,7 @@ class remoting_admin extends remoting { // check if permissions are valid $value = strtolower($value); if(!preg_match('/^[riud]+$/', $value)) { - throw new SoapFault('invalid parameters', $value . ' is no valid permission string.'); + throw new ISPConfigRemoteException('invalid parameters', $value . ' is no valid permission string.'); return false; } @@ -95,7 +95,7 @@ class remoting_admin extends remoting { break; default: - throw new SoapFault('invalid parameters', 'Only sys_userid, sys_groupid, sys_perm_user and sys_perm_group parameters can be changed with this function.'); + throw new ISPConfigRemoteException('invalid parameters', 'Only sys_userid, sys_groupid, sys_perm_user and sys_perm_group parameters can be changed with this function.'); break; } } @@ -113,7 +113,7 @@ class remoting_admin extends remoting { public function system_config_set($session_id, $section, $key, $value) { global $app; if(!$this->checkPerm($session_id, 'system_config_set')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if ($section != '' && $key != '') { @@ -123,7 +123,7 @@ class remoting_admin extends remoting { $system_config_str = $app->ini_parser->get_ini_string($system_config_array); return $app->db->datalogUpdate('sys_ini', array("config" => $system_config_str), 'sysini_id', 1); } else { - throw new SoapFault('invalid_function_parameter', 'Invalid function parameter.'); + throw new ISPConfigRemoteException('invalid_function_parameter', 'Invalid function parameter.'); return false; } } @@ -138,7 +138,7 @@ class remoting_admin extends remoting { public function system_config_get($session_id, $section, $key) { global $app; if(!$this->checkPerm($session_id, 'system_config_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if ($section != '') { @@ -152,7 +152,7 @@ class remoting_admin extends remoting { else return false; } } else { - throw new SoapFault('invalid_function_parameter', 'Invalid function parameter.'); + throw new ISPConfigRemoteException('invalid_function_parameter', 'Invalid function parameter.'); return false; } } @@ -165,13 +165,13 @@ class remoting_admin extends remoting { global $app; if(!$this->checkPerm($session_id, 'config_value_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } // validate fields if($group == '' || $name == '') { - throw new SoapFault('field_empty_error', 'Group and name parameter may not be empty.'); + throw new ISPConfigRemoteException('field_empty_error', 'Group and name parameter may not be empty.'); return false; } @@ -184,18 +184,18 @@ class remoting_admin extends remoting { global $app; if(!$this->checkPerm($session_id, 'config_value_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } // validate fields if($group == '' || $name == '' || $value == '') { - throw new SoapFault('field_empty_error', 'Group, name, and value parameter may not be empty.'); + throw new ISPConfigRemoteException('field_empty_error', 'Group, name, and value parameter may not be empty.'); return false; } if(is_array($app->db->queryOneRecord('SELECT * FROM sys_config WHERE `group` = ? AND `name` = ?', $group, $name))) { - throw new SoapFault('record_unique_error', 'Group plus name field combination is not unique.'); + throw new ISPConfigRemoteException('record_unique_error', 'Group plus name field combination is not unique.'); return false; } @@ -208,18 +208,18 @@ class remoting_admin extends remoting { global $app; if(!$this->checkPerm($session_id, 'config_value_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } // validate fields if($group == '' || $name == '' || $value == '') { - throw new SoapFault('field_empty_error', 'Group, name, and value parameter may not be empty.'); + throw new ISPConfigRemoteException('field_empty_error', 'Group, name, and value parameter may not be empty.'); return false; } if(!is_array($app->db->queryOneRecord('SELECT * FROM sys_config WHERE `group` = ? AND `name` = ?', $group, $name))) { - throw new SoapFault('record_nonexist_error', 'There is no record with this group plus name field combination.'); + throw new ISPConfigRemoteException('record_nonexist_error', 'There is no record with this group plus name field combination.'); return false; } @@ -232,13 +232,13 @@ class remoting_admin extends remoting { global $app; if(!$this->checkPerm($session_id, 'config_value_replace')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } // validate fields if($group == '' || $name == '' || $value == '') { - throw new SoapFault('field_empty_error', 'Group, name, and value parameter may not be empty.'); + throw new ISPConfigRemoteException('field_empty_error', 'Group, name, and value parameter may not be empty.'); return false; } @@ -255,18 +255,18 @@ class remoting_admin extends remoting { global $app; if(!$this->checkPerm($session_id, 'config_value_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } // validate fields if($group == '' || $name == '') { - throw new SoapFault('field_empty_error', 'Group and name parameter may not be empty.'); + throw new ISPConfigRemoteException('field_empty_error', 'Group and name parameter may not be empty.'); return false; } if(!is_array($app->db->queryOneRecord('SELECT * FROM sys_config WHERE `group` = ? AND `name` = ?', $group, $name))) { - throw new SoapFault('record_nonexist_error', 'There is no record with this group plus name field combination.'); + throw new ISPConfigRemoteException('record_nonexist_error', 'There is no record with this group plus name field combination.'); return false; } diff --git a/interface/lib/classes/remote.d/aps.inc.php b/interface/lib/classes/remote.d/aps.inc.php index 50dda4825577555eac85e0ca56891b866db1352f..2e1770be42a1ece22d64bccfa976dd9b5286453c 100644 --- a/interface/lib/classes/remote.d/aps.inc.php +++ b/interface/lib/classes/remote.d/aps.inc.php @@ -40,7 +40,7 @@ class remoting_aps extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_aps_update_package_list')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -60,7 +60,7 @@ class remoting_aps extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_aps_available_packages_list')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -82,7 +82,7 @@ class remoting_aps extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_aps_get_package_details')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -98,14 +98,14 @@ class remoting_aps extends remoting { // Make sure an integer ID is given if (!isset($primary_id) || !$gui->isValidPackageID($primary_id, true)) {// always adminflag - throw new SoapFault('package_error', 'The given Package ID is not valid.'); + throw new ISPConfigRemoteException('package_error', 'The given Package ID is not valid.'); return false; } // Get package details $details = $gui->getPackageDetails($primary_id); if (isset($details['error'])) { - throw new SoapFault('package_error', $details['error']); + throw new ISPConfigRemoteException('package_error', $details['error']); return false; } @@ -121,7 +121,7 @@ class remoting_aps extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_aps_get_package_file')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -137,14 +137,14 @@ class remoting_aps extends remoting { // Make sure an integer ID is given if (!isset($primary_id) || !$gui->isValidPackageID($primary_id, true)) {// always adminflag - throw new SoapFault('package_error', 'The given Package ID is not valid.'); + throw new ISPConfigRemoteException('package_error', 'The given Package ID is not valid.'); return false; } // Get package details $details = $gui->getPackageDetails($primary_id); if (isset($details['error'])) { - throw new SoapFault('package_error', $details['error']); + throw new ISPConfigRemoteException('package_error', $details['error']); return false; } @@ -155,7 +155,7 @@ class remoting_aps extends remoting { foreach ($details['Screenshots'] as $screen) { if (basename($screen['ScreenPath']) == $filename) { $found = true; break; } } if (!$found) { - throw new SoapFault('package_error', 'File not found in package.'); + throw new ISPConfigRemoteException('package_error', 'File not found in package.'); return false; } @@ -167,7 +167,7 @@ class remoting_aps extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_aps_get_package_details')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -183,14 +183,14 @@ class remoting_aps extends remoting { // Make sure an integer ID is given if (!isset($primary_id) || !$gui->isValidPackageID($primary_id, true)) {// always adminflag - throw new SoapFault('package_error', 'The given Package ID is not valid.'); + throw new ISPConfigRemoteException('package_error', 'The given Package ID is not valid.'); return false; } // Get package settings $settings = $gui->getPackageSettings($primary_id); if (isset($settings['error'])) { - throw new SoapFault('package_error', $settings['error']); + throw new ISPConfigRemoteException('package_error', $settings['error']); return false; } @@ -205,7 +205,7 @@ class remoting_aps extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_aps_change_package_status')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -215,12 +215,12 @@ class remoting_aps extends remoting { // Make sure an integer ID is given if (!isset($primary_id) || !$gui->isValidPackageID($primary_id, true)) {// always adminflag - throw new SoapFault('package_error', 'The given Package ID is not valid.'); + throw new ISPConfigRemoteException('package_error', 'The given Package ID is not valid.'); return false; } if(!isset($params['package_status']) || (($params['package_status'] != PACKAGE_ENABLED) && ($params['package_status'] != PACKAGE_LOCKED))) { - throw new SoapFault('package_error', 'Wrong new status: '.$params['package_status']); + throw new ISPConfigRemoteException('package_error', 'Wrong new status: '.$params['package_status']); return false; } @@ -235,7 +235,7 @@ class remoting_aps extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_aps_install_package')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -251,25 +251,25 @@ class remoting_aps extends remoting { // Make sure an integer ID is given if (!isset($primary_id) || !$gui->isValidPackageID($primary_id, true)) {// always adminflag - throw new SoapFault('package_error', 'The given Package ID is not valid.'); + throw new ISPConfigRemoteException('package_error', 'The given Package ID is not valid.'); return false; } // Get package details $details = $gui->getPackageDetails($primary_id); if (isset($details['error'])) { - throw new SoapFault('package_error', $details['error']); + throw new ISPConfigRemoteException('package_error', $details['error']); return false; } $settings = $gui->getPackageSettings($primary_id); if (isset($settings['error'])) { - throw new SoapFault('package_error', $settings['error']); + throw new ISPConfigRemoteException('package_error', $settings['error']); return false; } // Check given Site/VHostDomain if (!isset($params['main_domain'])) { - throw new SoapFault('invalid parameters', 'No valid domain given.'); + throw new ISPConfigRemoteException('invalid parameters', 'No valid domain given.'); return false; } @@ -284,7 +284,7 @@ class remoting_aps extends remoting { } if (!$domain) { - throw new SoapFault('invalid parameters', 'No valid domain given.'); + throw new ISPConfigRemoteException('invalid parameters', 'No valid domain given.'); return false; } @@ -295,7 +295,7 @@ class remoting_aps extends remoting { return $gui->createPackageInstance($result['input'], $primary_id); } - throw new SoapFault('invalid parameters', implode('
', $result['error'])); + throw new ISPConfigRemoteException('invalid parameters', implode('
', $result['error'])); return false; } @@ -304,7 +304,7 @@ class remoting_aps extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_aps_instance_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -318,7 +318,7 @@ class remoting_aps extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_aps_instance_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -332,7 +332,7 @@ class remoting_aps extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_aps_instance_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -344,7 +344,7 @@ class remoting_aps extends remoting { $result = $app->db->queryOneRecord($sql, $primary_id); if (!$result) { - throw new SoapFault('instance_error', 'No valid instance id given.'); + throw new ISPConfigRemoteException('instance_error', 'No valid instance id given.'); return false; } diff --git a/interface/lib/classes/remote.d/client.inc.php b/interface/lib/classes/remote.d/client.inc.php index 5c47c26c76bfad0579331d9549a2b8f7dadc8590..2d068a137ef2952d70a42e8f346118ca1a7ed9c7 100644 --- a/interface/lib/classes/remote.d/client.inc.php +++ b/interface/lib/classes/remote.d/client.inc.php @@ -53,7 +53,7 @@ class remoting_client extends remoting { global $app; if(!$this->checkPerm($session_id, 'client_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -98,7 +98,7 @@ class remoting_client extends remoting { { global $app; if(!$this->checkPerm($session_id, 'client_get_id')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -108,7 +108,7 @@ class remoting_client extends remoting { if(isset($rec['client_id'])) { return $app->functions->intval($rec['client_id']); } else { - throw new SoapFault('no_client_found', 'There is no sysuser account for this client ID.'); + throw new ISPConfigRemoteException('no_client_found', 'There is no sysuser account for this client ID.'); return false; } @@ -119,7 +119,7 @@ class remoting_client extends remoting { global $app; if(!$this->checkPerm($session_id, 'client_get_emailcontact')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -130,7 +130,7 @@ class remoting_client extends remoting { if(is_array($rec)) { return $rec; } else { - throw new SoapFault('no_client_found', 'There is no client with this client ID.'); + throw new ISPConfigRemoteException('no_client_found', 'There is no client with this client ID.'); return false; } } @@ -139,7 +139,7 @@ class remoting_client extends remoting { { global $app; if(!$this->checkPerm($session_id, 'client_get_id')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -149,7 +149,7 @@ class remoting_client extends remoting { if(isset($rec['groupid'])) { return $app->functions->intval($rec['groupid']); } else { - throw new SoapFault('no_group_found', 'There is no group for this client ID.'); + throw new ISPConfigRemoteException('no_group_found', 'There is no group for this client ID.'); return false; } @@ -162,7 +162,7 @@ class remoting_client extends remoting { if (!$this->checkPerm($session_id, 'client_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if(!isset($params['parent_client_id']) || $params['parent_client_id'] == 0) $params['parent_client_id'] = $reseller_id; @@ -174,7 +174,7 @@ class remoting_client extends remoting { // Selected client is not a reseller. REMOVING PARENT_CLIENT_ID!!! $params['parent_client_id'] = 0; } elseif(isset($params['limit_client']) && $params['limit_client'] != 0) { - throw new SoapFault('Invalid reseller', 'Reseller cannot be client of another reseller.'); + throw new ISPConfigRemoteException('Invalid reseller', 'Reseller cannot be client of another reseller.'); return false; } } @@ -191,7 +191,7 @@ class remoting_client extends remoting { if (!$this->checkPerm($session_id, 'client_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -208,12 +208,12 @@ class remoting_client extends remoting { // check if this one is reseller $check = $app->db->queryOneRecord('SELECT `limit_client` FROM `client` WHERE `client_id` = ?', intval($params['parent_client_id'])); if($check['limit_client'] == 0) { - throw new SoapFault('Invalid reseller', 'Selected client is not a reseller.'); + throw new ISPConfigRemoteException('Invalid reseller', 'Selected client is not a reseller.'); return false; } if(isset($params['limit_client']) && $params['limit_client'] != 0) { - throw new SoapFault('Invalid reseller', 'Reseller cannot be client of another reseller.'); + throw new ISPConfigRemoteException('Invalid reseller', 'Reseller cannot be client of another reseller.'); return false; } } @@ -251,7 +251,7 @@ class remoting_client extends remoting { global $app; if(!$this->checkPerm($session_id, 'client_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -259,7 +259,7 @@ class remoting_client extends remoting { $sql = "SELECT * FROM `client_template_assigned` WHERE `client_id` = ?"; return $app->db->queryOneRecord($sql, $client_id); } else { - throw new SoapFault('The ID must be an integer.'); + throw new ISPConfigRemoteException('The ID must be an integer.'); return array(); } } @@ -289,7 +289,7 @@ class remoting_client extends remoting { global $app; if(!$this->checkPerm($session_id, 'client_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -297,13 +297,13 @@ class remoting_client extends remoting { // check if client exists $check = $app->db->queryOneRecord('SELECT `client_id` FROM `client` WHERE `client_id` = ?', $client_id); if(!$check) { - throw new SoapFault('Invalid client'); + throw new ISPConfigRemoteException('Invalid client'); return false; } // check if template exists $check = $app->db->queryOneRecord('SELECT `template_id` FROM `client_template` WHERE `template_id` = ?', $template_id); if(!$check) { - throw new SoapFault('Invalid template'); + throw new ISPConfigRemoteException('Invalid template'); return false; } @@ -318,7 +318,7 @@ class remoting_client extends remoting { return $insert_id; } else { - throw new SoapFault('The IDs must be of type integer.'); + throw new ISPConfigRemoteException('The IDs must be of type integer.'); return false; } } @@ -327,7 +327,7 @@ class remoting_client extends remoting { global $app; if(!$this->checkPerm($session_id, 'client_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -335,13 +335,13 @@ class remoting_client extends remoting { // check if client exists $check = $app->db->queryOneRecord('SELECT `client_id` FROM `client` WHERE `client_id` = ?', $client_id); if(!$check) { - throw new SoapFault('Invalid client'); + throw new ISPConfigRemoteException('Invalid client'); return false; } // check if template exists $check = $app->db->queryOneRecord('SELECT `assigned_template_id` FROM `client_template_assigned` WHERE `client_id` = ? AND `client_template_id` = ?', $client_id, $assigned_template_id); if(!$check) { - throw new SoapFault('Invalid template'); + throw new ISPConfigRemoteException('Invalid template'); return false; } @@ -356,7 +356,7 @@ class remoting_client extends remoting { return $affected_rows; } else { - throw new SoapFault('The IDs must be of type integer.'); + throw new ISPConfigRemoteException('The IDs must be of type integer.'); return false; } } @@ -367,7 +367,7 @@ class remoting_client extends remoting { if (!$this->checkPerm($session_id, 'client_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../client/form/client.tform.php', $client_id); @@ -384,7 +384,7 @@ class remoting_client extends remoting { global $app, $conf; if(!$this->checkPerm($session_id, 'client_delete_everything')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -404,7 +404,7 @@ class remoting_client extends remoting { $app->db->query("DELETE FROM sys_user WHERE client_id = ?", $client_id); //* Delete all records (sub-clients, mail, web, etc....) of this client. - $tables = 'cron,dns_rr,dns_soa,dns_slave,ftp_user,mail_access,mail_content_filter,mail_domain,mail_forwarding,mail_get,mail_user,mail_user_filter,shell_user,spamfilter_users,support_message,web_database,web_database_user,web_domain,web_traffic,domain,mail_mailinglist,client'; + $tables = 'cron,dns_rr,dns_soa,dns_slave,ftp_user,mail_access,mail_content_filter,mail_domain,mail_forwarding,mail_get,mail_user,mail_user_filter,shell_user,spamfilter_users,support_message,web_database,web_database_user,web_domain,web_traffic,domain,client'; $tables_array = explode(',', $tables); $client_group_id = $app->functions->intval($client_group['groupid']); if($client_group_id > 1) { @@ -440,7 +440,7 @@ class remoting_client extends remoting { } if (!$this->checkPerm($session_id, 'client_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../client/form/client.tform.php', $client_id); @@ -460,14 +460,14 @@ class remoting_client extends remoting { public function client_get_by_username($session_id, $username) { global $app; if(!$this->checkPerm($session_id, 'client_get_by_username')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $rec = $app->db->queryOneRecord("SELECT * FROM sys_user WHERE username = ?", $username); if (isset($rec)) { return $rec; } else { - throw new SoapFault('no_client_found', 'There is no user account for this user name.'); + throw new ISPConfigRemoteException('no_client_found', 'There is no user account for this user name.'); return false; } } @@ -475,12 +475,12 @@ class remoting_client extends remoting { public function client_get_by_customer_no($session_id, $customer_no) { global $app; if(!$this->checkPerm($session_id, 'client_get_by_customer_no')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $customer_no = trim($customer_no); if($customer_no == '') { - throw new SoapFault('permission_denied', 'There was no customer number specified.'); + throw new ISPConfigRemoteException('permission_denied', 'There was no customer number specified.'); return false; } $customer_no = $app->db->quote($customer_no); @@ -488,7 +488,7 @@ class remoting_client extends remoting { if (isset($rec)) { return $rec; } else { - throw new SoapFault('no_client_found', 'There is no user account for this customer number.'); + throw new ISPConfigRemoteException('no_client_found', 'There is no user account for this customer number.'); return false; } } @@ -501,7 +501,7 @@ class remoting_client extends remoting { public function client_get_all($session_id) { global $app; if(!$this->checkPerm($session_id, 'client_get_all')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $result = $app->db->queryAllRecords("SELECT client_id FROM client WHERE 1"); @@ -529,7 +529,7 @@ class remoting_client extends remoting { $app->uses('auth'); if(!$this->checkPerm($session_id, 'client_change_password')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -542,7 +542,7 @@ class remoting_client extends remoting { $app->db->query($sql, $new_password, $client_id); return true; } else { - throw new SoapFault('no_client_found', 'There is no user account for this client_id'); + throw new ISPConfigRemoteException('no_client_found', 'There is no user account for this client_id'); return false; } } @@ -555,7 +555,7 @@ class remoting_client extends remoting { public function client_templates_get_all($session_id) { global $app; if(!$this->checkPerm($session_id, 'client_templates_get_all')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $sql = "SELECT * FROM client_template"; @@ -568,17 +568,17 @@ class remoting_client extends remoting { //* Check permissions if(!$this->checkPerm($session_id, 'client_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } //* Check username and password if(!preg_match("/^[\w\.\-\_\@]{1,128}$/", $username)) { - throw new SoapFault('user_regex_error', 'Username contains invalid characters.'); + throw new ISPConfigRemoteException('user_regex_error', 'Username contains invalid characters.'); return false; } if(!preg_match("/^.{1,64}$/i", $password)) { - throw new SoapFault('password_length_error', 'Invalid password length or no password provided.'); + throw new ISPConfigRemoteException('password_length_error', 'Invalid password length or no password provided.'); return false; } @@ -588,7 +588,7 @@ class remoting_client extends remoting { //* too many failedlogins if($alreadyfailed['times'] > 5) { - throw new SoapFault('error_user_too_many_logins', 'Too many failed logins.'); + throw new ISPConfigRemoteException('error_user_too_many_logins', 'Too many failed logins.'); return false; } @@ -659,7 +659,7 @@ class remoting_client extends remoting { 'language' => $user['language'], 'country' => 'de'); } else { - throw new SoapFault('login_failed', 'Login failed.'); + throw new ISPConfigRemoteException('login_failed', 'Login failed.'); } } diff --git a/interface/lib/classes/remote.d/dns.inc.php b/interface/lib/classes/remote.d/dns.inc.php index f7b0d139747eb4217056a417e3f1e98e72cf4d82..4bd518ed1626ffaa2372fb045359d28f24ac8e82 100644 --- a/interface/lib/classes/remote.d/dns.inc.php +++ b/interface/lib/classes/remote.d/dns.inc.php @@ -46,7 +46,7 @@ class remoting_dns extends remoting { { global $app, $conf; if(!$this->checkPerm($session_id, 'dns_templatezone_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -180,7 +180,7 @@ class remoting_dns extends remoting { return $dns_soa_id; exit; } else { - throw new SoapFault('permission_denied', $error); + throw new ISPConfigRemoteException('permission_denied', $error); } } @@ -191,7 +191,7 @@ class remoting_dns extends remoting { global $app; if(!$this->checkPerm($session_id, 'dns_zone_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -203,7 +203,7 @@ class remoting_dns extends remoting { public function dns_slave_add($session_id, $client_id, $params) { if(!$this->checkPerm($session_id, 'dns_zone_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } return $this->insertQuery('../dns/form/dns_slave.tform.php', $client_id, $params); @@ -213,7 +213,7 @@ class remoting_dns extends remoting { public function dns_slave_update($session_id, $client_id, $primary_id, $params) { if(!$this->checkPerm($session_id, 'dns_zone_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->updateQuery('../dns/form/dns_slave.tform.php', $client_id, $primary_id, $params); @@ -224,7 +224,7 @@ class remoting_dns extends remoting { public function dns_slave_delete($session_id, $primary_id) { if(!$this->checkPerm($session_id, 'dns_zone_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } return $this->deleteQuery('../dns/form/dns_slave.tform.php', $primary_id); @@ -236,12 +236,12 @@ class remoting_dns extends remoting { global $app; if(!$this->checkPerm($session_id, 'dns_zone_get_id')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if(!preg_match('/^([a-z0-9][a-z0-9\-]+[a-z0-9]|[a-z0-9]{2})(\.[a-z]{2,63})+$/i', $origin)){ - throw new SoapFault('no_domain_found', 'Invalid domain name.'); + throw new ISPConfigRemoteException('no_domain_found', 'Invalid domain name.'); return false; } @@ -249,7 +249,7 @@ class remoting_dns extends remoting { if(isset($rec['id'])) { return $app->functions->intval($rec['id']); } else { - throw new SoapFault('no_domain_found', 'There is no domain ID with informed domain name.'); + throw new ISPConfigRemoteException('no_domain_found', 'There is no domain ID with informed domain name.'); return false; } } @@ -258,7 +258,7 @@ class remoting_dns extends remoting { public function dns_zone_add($session_id, $client_id, $params) { if(!$this->checkPerm($session_id, 'dns_zone_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } return $this->insertQuery('../dns/form/dns_soa.tform.php', $client_id, $params); @@ -268,7 +268,7 @@ class remoting_dns extends remoting { public function dns_zone_update($session_id, $client_id, $primary_id, $params) { if(!$this->checkPerm($session_id, 'dns_zone_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->updateQuery('../dns/form/dns_soa.tform.php', $client_id, $primary_id, $params); @@ -279,7 +279,7 @@ class remoting_dns extends remoting { public function dns_zone_delete($session_id, $primary_id) { if(!$this->checkPerm($session_id, 'dns_zone_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../dns/form/dns_soa.tform.php', $primary_id); @@ -294,7 +294,7 @@ class remoting_dns extends remoting { global $app; if(!$this->checkPerm($session_id, 'dns_aaaa_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -306,7 +306,7 @@ class remoting_dns extends remoting { public function dns_aaaa_add($session_id, $client_id, $params, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_aaaa_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if($update_serial) $this->increase_serial($session_id, $client_id, $params); @@ -317,7 +317,7 @@ class remoting_dns extends remoting { public function dns_aaaa_update($session_id, $client_id, $primary_id, $params, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_aaaa_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->updateQuery('../dns/form/dns_aaaa.tform.php', $client_id, $primary_id, $params); @@ -329,7 +329,7 @@ class remoting_dns extends remoting { public function dns_aaaa_delete($session_id, $primary_id, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_aaaa_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../dns/form/dns_aaaa.tform.php', $primary_id); @@ -345,7 +345,7 @@ class remoting_dns extends remoting { global $app; if(!$this->checkPerm($session_id, 'dns_a_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -357,7 +357,7 @@ class remoting_dns extends remoting { public function dns_a_add($session_id, $client_id, $params, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_a_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if($update_serial) $this->increase_serial($session_id, $client_id, $params); @@ -368,7 +368,7 @@ class remoting_dns extends remoting { public function dns_a_update($session_id, $client_id, $primary_id, $params, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_a_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if($update_serial) $this->increase_serial($session_id, $client_id, $params); @@ -380,7 +380,7 @@ class remoting_dns extends remoting { public function dns_a_delete($session_id, $primary_id, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_a_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../dns/form/dns_a.tform.php', $primary_id); @@ -396,7 +396,7 @@ class remoting_dns extends remoting { global $app; if(!$this->checkPerm($session_id, 'dns_alias_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -408,7 +408,7 @@ class remoting_dns extends remoting { public function dns_alias_add($session_id, $client_id, $params, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_alias_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if($update_serial) $this->increase_serial($session_id, $client_id, $params); @@ -419,7 +419,7 @@ class remoting_dns extends remoting { public function dns_alias_update($session_id, $client_id, $primary_id, $params, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_alias_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if($update_serial) $this->increase_serial($session_id, $client_id, $params); @@ -431,7 +431,7 @@ class remoting_dns extends remoting { public function dns_alias_delete($session_id, $primary_id, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_alias_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../dns/form/dns_alias.tform.php', $primary_id); @@ -447,7 +447,7 @@ class remoting_dns extends remoting { global $app; if(!$this->checkPerm($session_id, 'dns_cname_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -459,7 +459,7 @@ class remoting_dns extends remoting { public function dns_cname_add($session_id, $client_id, $params, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_cname_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if($update_serial) $this->increase_serial($session_id, $client_id, $params); @@ -470,7 +470,7 @@ class remoting_dns extends remoting { public function dns_cname_update($session_id, $client_id, $primary_id, $params, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_cname_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if($update_serial) $this->increase_serial($session_id, $client_id, $params); @@ -482,7 +482,7 @@ class remoting_dns extends remoting { public function dns_cname_delete($session_id, $primary_id, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_cname_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../dns/form/dns_cname.tform.php', $primary_id); @@ -498,7 +498,7 @@ class remoting_dns extends remoting { global $app; if(!$this->checkPerm($session_id, 'dns_hinfo_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -510,7 +510,7 @@ class remoting_dns extends remoting { public function dns_hinfo_add($session_id, $client_id, $params, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_hinfo_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if($update_serial) $this->increase_serial($session_id, $client_id, $params); @@ -521,7 +521,7 @@ class remoting_dns extends remoting { public function dns_hinfo_update($session_id, $client_id, $primary_id, $params, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_hinfo_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if($update_serial) $this->increase_serial($session_id, $client_id, $params); @@ -533,7 +533,7 @@ class remoting_dns extends remoting { public function dns_hinfo_delete($session_id, $primary_id, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_hinfo_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../dns/form/dns_hinfo.tform.php', $primary_id); @@ -549,7 +549,7 @@ class remoting_dns extends remoting { global $app; if(!$this->checkPerm($session_id, 'dns_mx_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -561,7 +561,7 @@ class remoting_dns extends remoting { public function dns_mx_add($session_id, $client_id, $params, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_mx_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if($update_serial) $this->increase_serial($session_id, $client_id, $params); @@ -572,7 +572,7 @@ class remoting_dns extends remoting { public function dns_mx_update($session_id, $client_id, $primary_id, $params, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_mx_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if($update_serial) $this->increase_serial($session_id, $client_id, $params); @@ -584,7 +584,7 @@ class remoting_dns extends remoting { public function dns_mx_delete($session_id, $primary_id, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_mx_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../dns/form/dns_mx.tform.php', $primary_id); @@ -600,7 +600,7 @@ class remoting_dns extends remoting { global $app; if(!$this->checkPerm($session_id, 'dns_ns_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -612,7 +612,7 @@ class remoting_dns extends remoting { public function dns_ns_add($session_id, $client_id, $params, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_ns_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if($update_serial) $this->increase_serial($session_id, $client_id, $params); @@ -623,7 +623,7 @@ class remoting_dns extends remoting { public function dns_ns_update($session_id, $client_id, $primary_id, $params, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_ns_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if($update_serial) $this->increase_serial($session_id, $client_id, $params); @@ -635,7 +635,7 @@ class remoting_dns extends remoting { public function dns_ns_delete($session_id, $primary_id, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_ns_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../dns/form/dns_ns.tform.php', $primary_id); @@ -651,7 +651,7 @@ class remoting_dns extends remoting { global $app; if(!$this->checkPerm($session_id, 'dns_ptr_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -663,7 +663,7 @@ class remoting_dns extends remoting { public function dns_ptr_add($session_id, $client_id, $params, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_ptr_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if($update_serial) $this->increase_serial($session_id, $client_id, $params); @@ -674,7 +674,7 @@ class remoting_dns extends remoting { public function dns_ptr_update($session_id, $client_id, $primary_id, $params, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_ptr_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if($update_serial) $this->increase_serial($session_id, $client_id, $params); @@ -686,7 +686,7 @@ class remoting_dns extends remoting { public function dns_ptr_delete($session_id, $primary_id, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_ptr_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../dns/form/dns_ptr.tform.php', $primary_id); @@ -702,7 +702,7 @@ class remoting_dns extends remoting { global $app; if(!$this->checkPerm($session_id, 'dns_rp_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -714,7 +714,7 @@ class remoting_dns extends remoting { public function dns_rp_add($session_id, $client_id, $params, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_rp_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if($update_serial) $this->increase_serial($session_id, $client_id, $params); @@ -725,7 +725,7 @@ class remoting_dns extends remoting { public function dns_rp_update($session_id, $client_id, $primary_id, $params, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_rp_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if($update_serial) $this->increase_serial($session_id, $client_id, $params); @@ -737,7 +737,7 @@ class remoting_dns extends remoting { public function dns_rp_delete($session_id, $primary_id, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_rp_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../dns/form/dns_rp.tform.php', $primary_id); @@ -753,7 +753,7 @@ class remoting_dns extends remoting { global $app; if(!$this->checkPerm($session_id, 'dns_srv_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -765,7 +765,7 @@ class remoting_dns extends remoting { public function dns_srv_add($session_id, $client_id, $params, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_srv_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if($update_serial) $this->increase_serial($session_id, $client_id, $params); @@ -776,7 +776,7 @@ class remoting_dns extends remoting { public function dns_srv_update($session_id, $client_id, $primary_id, $params, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_srv_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if($update_serial) $this->increase_serial($session_id, $client_id, $params); @@ -788,7 +788,7 @@ class remoting_dns extends remoting { public function dns_srv_delete($session_id, $primary_id, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_srv_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../dns/form/dns_srv.tform.php', $primary_id); @@ -804,7 +804,7 @@ class remoting_dns extends remoting { global $app; if(!$this->checkPerm($session_id, 'dns_txt_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -816,7 +816,7 @@ class remoting_dns extends remoting { public function dns_txt_add($session_id, $client_id, $params, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_txt_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if($update_serial) $this->increase_serial($session_id, $client_id, $params); @@ -827,7 +827,7 @@ class remoting_dns extends remoting { public function dns_txt_update($session_id, $client_id, $primary_id, $params, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_txt_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if($update_serial) $this->increase_serial($session_id, $client_id, $params); @@ -839,7 +839,7 @@ class remoting_dns extends remoting { public function dns_txt_delete($session_id, $primary_id, $update_serial=false) { if(!$this->checkPerm($session_id, 'dns_txt_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../dns/form/dns_txt.tform.php', $primary_id); @@ -856,7 +856,7 @@ class remoting_dns extends remoting { public function dns_zone_get_by_user($session_id, $client_id, $server_id) { global $app; if(!$this->checkPerm($session_id, 'dns_zone_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if (!empty($client_id) && !empty($server_id)) { @@ -880,7 +880,7 @@ class remoting_dns extends remoting { public function dns_rr_get_all_by_zone($session_id, $zone_id) { global $app; if(!$this->checkPerm($session_id, 'dns_zone_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $sql = "SELECT * FROM dns_rr WHERE zone = ?"; @@ -898,7 +898,7 @@ class remoting_dns extends remoting { public function dns_zone_set_status($session_id, $primary_id, $status) { global $app; if(!$this->checkPerm($session_id, 'dns_zone_set_status')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if(in_array($status, array('active', 'inactive'))) { @@ -912,7 +912,7 @@ class remoting_dns extends remoting { $result = $app->db->affectedRows(); return $result; } else { - throw new SoapFault('status_undefined', 'The status is not available'); + throw new ISPConfigRemoteException('status_undefined', 'The status is not available'); return false; } } diff --git a/interface/lib/classes/remote.d/domains.inc.php b/interface/lib/classes/remote.d/domains.inc.php index 33830335d8989990cd1c4f4613ab290679763184..5bc70cf4a56e6a5606ec76d52c2f6dfbd6c4a46f 100644 --- a/interface/lib/classes/remote.d/domains.inc.php +++ b/interface/lib/classes/remote.d/domains.inc.php @@ -47,7 +47,7 @@ class remoting_domains extends remoting { global $app; if(!$this->checkPerm($session_id, 'domains_domain_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -59,7 +59,7 @@ class remoting_domains extends remoting { public function domains_domain_add($session_id, $client_id, $params) { if(!$this->checkPerm($session_id, 'domains_domain_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } return $this->insertQuery('../client/form/domain.tform.php', $client_id, $params); @@ -69,7 +69,7 @@ class remoting_domains extends remoting { public function domains_domain_delete($session_id, $primary_id) { if(!$this->checkPerm($session_id, 'domains_domain_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../client/form/domain.tform.php', $primary_id); @@ -82,7 +82,7 @@ class remoting_domains extends remoting { { global $app; if(!$this->checkPerm($session_id, 'domains_get_all_by_user')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $group_id = $app->functions->intval($group_id); diff --git a/interface/lib/classes/remote.d/mail.inc.php b/interface/lib/classes/remote.d/mail.inc.php index 0a1f890b968742df8dd3874a66bc3393c79d59c9..decd45a7c842e319b1d7b1d1787d6519039a61b6 100644 --- a/interface/lib/classes/remote.d/mail.inc.php +++ b/interface/lib/classes/remote.d/mail.inc.php @@ -45,7 +45,7 @@ class remoting_mail extends remoting { global $app; if(!$this->checkPerm($session_id, 'mail_domain_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -57,7 +57,7 @@ class remoting_mail extends remoting { public function mail_domain_add($session_id, $client_id, $params) { if(!$this->checkPerm($session_id, 'mail_domain_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $primary_id = $this->insertQuery('../mail/form/mail_domain.tform.php', $client_id, $params); @@ -68,7 +68,7 @@ class remoting_mail extends remoting { public function mail_domain_update($session_id, $client_id, $primary_id, $params) { if(!$this->checkPerm($session_id, 'mail_domain_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->updateQuery('../mail/form/mail_domain.tform.php', $client_id, $primary_id, $params); @@ -79,7 +79,7 @@ class remoting_mail extends remoting { public function mail_domain_delete($session_id, $primary_id) { if(!$this->checkPerm($session_id, 'mail_domain_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../mail/form/mail_domain.tform.php', $primary_id); @@ -92,7 +92,7 @@ class remoting_mail extends remoting { global $app; if(!$this->checkPerm($session_id, 'mail_aliasdomain_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -105,7 +105,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_aliasdomain_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->insertQuery('../mail/form/mail_aliasdomain.tform.php', $client_id, $params); @@ -117,7 +117,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_aliasdomain_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->updateQuery('../mail/form/mail_aliasdomain.tform.php', $client_id, $primary_id, $params); @@ -128,67 +128,20 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_aliasdomain_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../mail/form/mail_aliasdomain.tform.php', $primary_id); return $affected_rows; } - //* Get mail mailinglist details - public function mail_mailinglist_get($session_id, $primary_id) - { - global $app; - - if(!$this->checkPerm($session_id, 'mail_mailinglist_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/mail_mailinglist.tform.php'); - return $app->remoting_lib->getDataRecord($primary_id); - } - - //* Add a mail mailinglist - public function mail_mailinglist_add($session_id, $client_id, $params) - { - if(!$this->checkPerm($session_id, 'mail_mailinglist_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $primary_id = $this->insertQuery('../mail/form/mail_mailinglist.tform.php', $client_id, $params); - return $primary_id; - } - - //* Update a mail mailinglist - public function mail_mailinglist_update($session_id, $client_id, $primary_id, $params) - { - if(!$this->checkPerm($session_id, 'mail_mailinglist_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->updateQuery('../mail/form/mail_mailinglist.tform.php', $client_id, $primary_id, $params); - return $affected_rows; - } - - //* Delete a mail mailinglist - public function mail_mailinglist_delete($session_id, $primary_id) - { - if(!$this->checkPerm($session_id, 'mail_mailinglist_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->deleteQuery('../mail/form/mail_mailinglist.tform.php', $primary_id); - return $affected_rows; - } - //* Get mail user details public function mail_user_get($session_id, $primary_id) { global $app; if(!$this->checkPerm($session_id, 'mail_user_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -202,7 +155,7 @@ class remoting_mail extends remoting { global $app; if (!$this->checkPerm($session_id, 'mail_user_add')){ - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -210,7 +163,7 @@ class remoting_mail extends remoting { $email_parts = explode('@', $params['email']); $tmp = $app->db->queryOneRecord("SELECT domain FROM mail_domain WHERE domain = ?", $email_parts[1]); if($tmp['domain'] != $email_parts[1]) { - throw new SoapFault('mail_domain_does_not_exist', 'Mail domain - '.$email_parts[1].' - does not exist.'); + throw new ISPConfigRemoteException('mail_domain_does_not_exist', 'Mail domain - '.$email_parts[1].' - does not exist.'); return false; } @@ -230,7 +183,7 @@ class remoting_mail extends remoting { if (!$this->checkPerm($session_id, 'mail_user_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -238,7 +191,7 @@ class remoting_mail extends remoting { $email_parts = explode('@', $params['email']); $tmp = $app->db->queryOneRecord("SELECT domain FROM mail_domain WHERE domain = ?", $email_parts[1]); if($tmp['domain'] != $email_parts[1]) { - throw new SoapFault('mail_domain_does_not_exist', 'Mail domain - '.$email_parts[1].' - does not exist.'); + throw new ISPConfigRemoteException('mail_domain_does_not_exist', 'Mail domain - '.$email_parts[1].' - does not exist.'); return false; } @@ -252,7 +205,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_user_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../mail/form/mail_user.tform.php', $primary_id); @@ -265,7 +218,7 @@ class remoting_mail extends remoting { global $app; if(!$this->checkPerm($session_id, 'mail_user_filter_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -277,7 +230,7 @@ class remoting_mail extends remoting { { global $app; if (!$this->checkPerm($session_id, 'mail_user_filter_add')){ - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->insertQuery('../mail/form/mail_user_filter.tform.php', $client_id, $params, 'mail:mail_user_filter:on_after_insert'); @@ -290,7 +243,7 @@ class remoting_mail extends remoting { global $app; if (!$this->checkPerm($session_id, 'mail_user_filter_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->updateQuery('../mail/form/mail_user_filter.tform.php', $client_id, $primary_id, $params, 'mail:mail_user_filter:on_after_update'); @@ -303,7 +256,7 @@ class remoting_mail extends remoting { global $app; if (!$this->checkPerm($session_id, 'mail_user_filter_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../mail/form/mail_user_filter.tform.php', $primary_id, 'mail:mail_user_filter:on_after_delete'); @@ -311,13 +264,13 @@ class remoting_mail extends remoting { return $affected_rows; } - // Mail backup list function by Dominik Mller, 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; if(!$this->checkPerm($session_id, 'mail_user_backup')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -334,13 +287,13 @@ class remoting_mail extends remoting { return $result; } - // Mail backup restore/download functions by Dominik Mller, 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; if(!$this->checkPerm($session_id, 'mail_user_backup')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -354,19 +307,19 @@ class remoting_mail extends remoting { //* Basic validation of variables if ($server_id <= 0) { - throw new SoapFault('invalid_backup_id', "Invalid or non existant backup_id $primary_id"); + throw new ISPConfigRemoteException('invalid_backup_id', "Invalid or non existant backup_id $primary_id"); return false; } if (/*$action_type != 'backup_download_mail' and*/ $action_type != 'backup_restore_mail' and $action_type != 'backup_delete_mail') { - throw new SoapFault('invalid_action', "Invalid action_type $action_type"); + throw new ISPConfigRemoteException('invalid_action', "Invalid action_type $action_type"); return false; } //* Validate instance $instance_record = $app->db->queryOneRecord("SELECT * FROM `sys_remoteaction` WHERE `action_param`=? and `action_type`=? and `action_state`='pending'", $primary_id, $action_type); if ($instance_record['action_id'] >= 1) { - throw new SoapFault('duplicate_action', "There is already a pending $action_type action"); + throw new ISPConfigRemoteException('duplicate_action', "There is already a pending $action_type action"); return false; } @@ -384,7 +337,7 @@ class remoting_mail extends remoting { global $app; if(!$this->checkPerm($session_id, 'mail_alias_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -399,14 +352,14 @@ class remoting_mail extends remoting { if (!$this->checkPerm($session_id, 'mail_alias_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } //* Check if there is no active mailbox with this address $tmp = $app->db->queryOneRecord("SELECT count(mailuser_id) as number FROM mail_user WHERE postfix = 'y' AND email = ?", $params["source"]); if($tmp['number'] > 0) { - throw new SoapFault('duplicate', 'There is already a mailbox with this email address.'); + throw new ISPConfigRemoteException('duplicate', 'There is already a mailbox with this email address.'); } unset($tmp); @@ -421,14 +374,14 @@ class remoting_mail extends remoting { if (!$this->checkPerm($session_id, 'mail_alias_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } //* Check if there is no active mailbox with this address $tmp = $app->db->queryOneRecord("SELECT count(mailuser_id) as number FROM mail_user WHERE postfix = 'y' AND email = ?", $params["source"]); if($tmp['number'] > 0) { - throw new SoapFault('duplicate', 'There is already a mailbox with this email address.'); + throw new ISPConfigRemoteException('duplicate', 'There is already a mailbox with this email address.'); } unset($tmp); @@ -440,7 +393,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_alias_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../mail/form/mail_alias.tform.php', $primary_id); @@ -453,7 +406,7 @@ class remoting_mail extends remoting { global $app; if(!$this->checkPerm($session_id, 'mail_forward_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -466,7 +419,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_forward_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->insertQuery('../mail/form/mail_forward.tform.php', $client_id, $params); @@ -478,7 +431,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_forward_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->updateQuery('../mail/form/mail_forward.tform.php', $client_id, $primary_id, $params); @@ -490,7 +443,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_forward_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../mail/form/mail_forward.tform.php', $primary_id); @@ -503,7 +456,7 @@ class remoting_mail extends remoting { global $app; if(!$this->checkPerm($session_id, 'mail_catchall_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -516,7 +469,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_catchall_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->insertQuery('../mail/form/mail_domain_catchall.tform.php', $client_id, $params); @@ -527,7 +480,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_catchall_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->updateQuery('../mail/form/mail_domain_catchall.tform.php', $client_id, $primary_id, $params); @@ -538,7 +491,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_catchall_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../mail/form/mail_domain_catchall.tform.php', $primary_id); @@ -551,7 +504,7 @@ class remoting_mail extends remoting { global $app; if(!$this->checkPerm($session_id, 'mail_transport_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -564,7 +517,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_transport_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->insertQuery('../mail/form/mail_transport.tform.php', $client_id, $params); @@ -576,7 +529,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_transport_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->updateQuery('../mail/form/mail_transport.tform.php', $client_id, $primary_id, $params); @@ -588,7 +541,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_transport_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../mail/form/mail_transport.tform.php', $primary_id); @@ -601,7 +554,7 @@ class remoting_mail extends remoting { global $app; if(!$this->checkPerm($session_id, 'mail_relay_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -615,7 +568,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_relay_add')) { - throw new SoapFault('permission_denied','You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied','You do not have the permissions to access this function.'); return false; } $affected_rows = $this->insertQuery('../mail/form/mail_relay_recipient.tform.php', $client_id, $params); @@ -627,7 +580,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_relay_update')) { - throw new SoapFault('permission_denied','You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied','You do not have the permissions to access this function.'); return false; } $affected_rows = $this->updateQuery('../mail/form/mail_relay_recipient.tform.php', $client_id, $primary_id, $params); @@ -639,7 +592,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_relay_delete')) { - throw new SoapFault('permission_denied','You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied','You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../mail/form/mail_relay_recipient.tform.php', $primary_id); @@ -652,7 +605,7 @@ class remoting_mail extends remoting { global $app; if(!$this->checkPerm($session_id, 'mail_spamfilter_whitelist_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -665,7 +618,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_spamfilter_whitelist_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->insertQuery('../mail/form/spamfilter_whitelist.tform.php', $client_id, $params); @@ -677,7 +630,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_spamfilter_whitelist_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->updateQuery('../mail/form/spamfilter_whitelist.tform.php', $client_id, $primary_id, $params); @@ -689,7 +642,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_spamfilter_whitelist_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../mail/form/spamfilter_whitelist.tform.php', $primary_id); @@ -702,7 +655,7 @@ class remoting_mail extends remoting { global $app; if(!$this->checkPerm($session_id, 'mail_spamfilter_blacklist_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -715,7 +668,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_spamfilter_blacklist_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->insertQuery('../mail/form/spamfilter_blacklist.tform.php', $client_id, $params); @@ -727,7 +680,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_spamfilter_blacklist_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->updateQuery('../mail/form/spamfilter_blacklist.tform.php', $client_id, $primary_id, $params); @@ -739,7 +692,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_spamfilter_blacklist_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../mail/form/spamfilter_blacklist.tform.php', $primary_id); @@ -752,7 +705,7 @@ class remoting_mail extends remoting { global $app; if(!$this->checkPerm($session_id, 'mail_spamfilter_user_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -765,7 +718,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_spamfilter_user_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->insertQuery('../mail/form/spamfilter_users.tform.php', $client_id, $params); @@ -777,7 +730,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_spamfilter_user_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->updateQuery('../mail/form/spamfilter_users.tform.php', $client_id, $primary_id, $params); @@ -789,7 +742,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_spamfilter_user_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../mail/form/spamfilter_users.tform.php', $primary_id); @@ -802,7 +755,7 @@ class remoting_mail extends remoting { global $app; if(!$this->checkPerm($session_id, 'mail_policy_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -815,7 +768,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_policy_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->insertQuery('../mail/form/spamfilter_policy.tform.php', $client_id, $params); @@ -827,7 +780,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_policy_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->updateQuery('../mail/form/spamfilter_policy.tform.php', $client_id, $primary_id, $params); @@ -839,7 +792,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_policy_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../mail/form/spamfilter_policy.tform.php', $primary_id); @@ -852,7 +805,7 @@ class remoting_mail extends remoting { global $app; if(!$this->checkPerm($session_id, 'mail_fetchmail_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -865,7 +818,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_fetchmail_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->insertQuery('../mail/form/mail_get.tform.php', $client_id, $params); @@ -877,7 +830,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_fetchmail_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->updateQuery('../mail/form/mail_get.tform.php', $client_id, $primary_id, $params); @@ -889,7 +842,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_fetchmail_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../mail/form/mail_get.tform.php', $primary_id); @@ -902,7 +855,7 @@ class remoting_mail extends remoting { global $app; if(!$this->checkPerm($session_id, 'mail_whitelist_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -915,7 +868,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_whitelist_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->insertQuery('../mail/form/mail_whitelist.tform.php', $client_id, $params); @@ -927,7 +880,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_whitelist_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->updateQuery('../mail/form/mail_whitelist.tform.php', $client_id, $primary_id, $params); @@ -939,7 +892,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_whitelist_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../mail/form/mail_whitelist.tform.php', $primary_id); @@ -952,7 +905,7 @@ class remoting_mail extends remoting { global $app; if(!$this->checkPerm($session_id, 'mail_blacklist_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -965,7 +918,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_blacklist_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->insertQuery('../mail/form/mail_blacklist.tform.php', $client_id, $params); @@ -977,7 +930,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_blacklist_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->updateQuery('../mail/form/mail_blacklist.tform.php', $client_id, $primary_id, $params); @@ -989,7 +942,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_blacklist_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../mail/form/mail_blacklist.tform.php', $primary_id); @@ -1002,7 +955,7 @@ class remoting_mail extends remoting { global $app; if(!$this->checkPerm($session_id, 'mail_filter_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -1015,7 +968,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_filter_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->insertQuery('../mail/form/mail_content_filter.tform.php', $client_id, $params); @@ -1027,7 +980,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_filter_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->updateQuery('../mail/form/mail_content_filter.tform.php', $client_id, $primary_id, $params); @@ -1039,7 +992,7 @@ class remoting_mail extends remoting { { if (!$this->checkPerm($session_id, 'mail_filter_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../mail/form/mail_content_filter.tform.php', $primary_id); @@ -1058,7 +1011,7 @@ class remoting_mail extends remoting { public function mail_domain_get_by_domain($session_id, $domain) { global $app; if(!$this->checkPerm($session_id, 'mail_domain_get_by_domain')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if (!empty($domain)) { @@ -1072,7 +1025,7 @@ class remoting_mail extends remoting { public function mail_domain_set_status($session_id, $primary_id, $status) { global $app; if(!$this->checkPerm($session_id, 'mail_domain_set_status')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if(in_array($status, array('active', 'inactive'))) { @@ -1086,7 +1039,7 @@ class remoting_mail extends remoting { $result = $app->db->affectedRows(); return $result; } else { - throw new SoapFault('status_undefined', 'The status is not available'); + throw new ISPConfigRemoteException('status_undefined', 'The status is not available'); return false; } } @@ -1098,179 +1051,12 @@ class remoting_mail extends remoting { $app->uses('quota_lib'); if(!$this->checkPerm($session_id, 'mailquota_get_by_user')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } 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/monitor.inc.php b/interface/lib/classes/remote.d/monitor.inc.php index d3689b94caaa0e40ea65b3b906950ab114f9688f..9d207f0796b4df020c658f18dbb81e378300c720 100644 --- a/interface/lib/classes/remote.d/monitor.inc.php +++ b/interface/lib/classes/remote.d/monitor.inc.php @@ -38,7 +38,7 @@ class remoting_monitor extends remoting { global $app; if(!$this->checkPerm($session_id, 'monitor_jobqueue_count')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } diff --git a/interface/lib/classes/remote.d/openvz.inc.php b/interface/lib/classes/remote.d/openvz.inc.php deleted file mode 100644 index a4ef38ad792003aaaf9e28fe293a1fbc0fd0f974..0000000000000000000000000000000000000000 --- a/interface/lib/classes/remote.d/openvz.inc.php +++ /dev/null @@ -1,480 +0,0 @@ - - -*/ - -class remoting_openvz extends remoting { - //* Functions for virtual machine management - - //* Get OpenVZ OStemplate details - public function openvz_ostemplate_get($session_id, $ostemplate_id) - { - global $app; - - if(!$this->checkPerm($session_id, 'vm_openvz')) { - 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('../vm/form/openvz_ostemplate.tform.php'); - return $app->remoting_lib->getDataRecord($ostemplate_id); - } - - //* Add a openvz ostemplate record - public function openvz_ostemplate_add($session_id, $client_id, $params) - { - if(!$this->checkPerm($session_id, 'vm_openvz')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - return $this->insertQuery('../vm/form/openvz_ostemplate.tform.php', $client_id, $params); - } - - //* Update openvz ostemplate record - public function openvz_ostemplate_update($session_id, $client_id, $ostemplate_id, $params) - { - if(!$this->checkPerm($session_id, 'vm_openvz')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->updateQuery('../vm/form/openvz_ostemplate.tform.php', $client_id, $ostemplate_id, $params); - return $affected_rows; - } - - //* Delete openvz ostemplate record - public function openvz_ostemplate_delete($session_id, $ostemplate_id) - { - if(!$this->checkPerm($session_id, 'vm_openvz')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->deleteQuery('../vm/form/openvz_ostemplate.tform.php', $ostemplate_id); - return $affected_rows; - } - - //* Get OpenVZ template details - public function openvz_template_get($session_id, $template_id) - { - global $app; - - if(!$this->checkPerm($session_id, 'vm_openvz')) { - 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('../vm/form/openvz_template.tform.php'); - return $app->remoting_lib->getDataRecord($template_id); - } - - //* Add a openvz template record - public function openvz_template_add($session_id, $client_id, $params) - { - if(!$this->checkPerm($session_id, 'vm_openvz')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - return $this->insertQuery('../vm/form/openvz_template.tform.php', $client_id, $params); - } - - //* Update openvz template record - public function openvz_template_update($session_id, $client_id, $template_id, $params) - { - if(!$this->checkPerm($session_id, 'vm_openvz')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->updateQuery('../vm/form/openvz_template.tform.php', $client_id, $template_id, $params); - return $affected_rows; - } - - //* Delete openvz template record - public function openvz_template_delete($session_id, $template_id) - { - if(!$this->checkPerm($session_id, 'vm_openvz')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->deleteQuery('../vm/form/openvz_template.tform.php', $template_id); - return $affected_rows; - } - - //* Get OpenVZ ip details - public function openvz_ip_get($session_id, $ip_id) - { - global $app; - - if(!$this->checkPerm($session_id, 'vm_openvz')) { - 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('../vm/form/openvz_ip.tform.php'); - return $app->remoting_lib->getDataRecord($ip_id); - } - - //* Get OpenVZ a free IP address - public function openvz_get_free_ip($session_id, $server_id = 0) - { - global $app; - - if(!$this->checkPerm($session_id, 'vm_openvz')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $server_id = $app->functions->intval($server_id); - - if($server_id > 0) { - $tmp = $app->db->queryOneRecord("SELECT ip_address_id, server_id, ip_address FROM openvz_ip WHERE reserved = 'n' AND vm_id = 0 AND server_id = ? LIMIT 0,1", $server_id); - } else { - $tmp = $app->db->queryOneRecord("SELECT ip_address_id, server_id, ip_address FROM openvz_ip WHERE reserved = 'n' AND vm_id = 0 LIMIT 0,1"); - } - - if(count($tmp) > 0) { - return $tmp; - } else { - throw new SoapFault('no_free_ip', 'There is no free IP available.'); - } - } - - //* Add a openvz ip record - public function openvz_ip_add($session_id, $client_id, $params) - { - if(!$this->checkPerm($session_id, 'vm_openvz')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - return $this->insertQuery('../vm/form/openvz_ip.tform.php', $client_id, $params); - } - - //* Update openvz ip record - public function openvz_ip_update($session_id, $client_id, $ip_id, $params) - { - if(!$this->checkPerm($session_id, 'vm_openvz')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->updateQuery('../vm/form/openvz_ip.tform.php', $client_id, $ip_id, $params); - return $affected_rows; - } - - //* Delete openvz ip record - public function openvz_ip_delete($session_id, $ip_id) - { - if(!$this->checkPerm($session_id, 'vm_openvz')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->deleteQuery('../vm/form/openvz_ip.tform.php', $ip_id); - return $affected_rows; - } - - //* Get OpenVZ vm details - public function openvz_vm_get($session_id, $vm_id) - { - global $app; - - if(!$this->checkPerm($session_id, 'vm_openvz')) { - 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('../vm/form/openvz_vm.tform.php'); - return $app->remoting_lib->getDataRecord($vm_id); - } - - //* Get OpenVZ list - public function openvz_vm_get_by_client($session_id, $client_id) - { - global $app; - - if(!$this->checkPerm($session_id, 'vm_openvz')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - - if (!empty($client_id)) { - $client_id = $app->functions->intval($client_id); - $tmp = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ?", $client_id); - $sql = "SELECT * FROM openvz_vm WHERE sys_groupid = ?"; - $result = $app->db->queryAllRecords($sql, $tmp['groupid']); - return $result; - } - return false; - } - - //* Add a openvz vm record - public function openvz_vm_add($session_id, $client_id, $params) - { - if(!$this->checkPerm($session_id, 'vm_openvz')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - return $this->insertQuery('../vm/form/openvz_vm.tform.php', $client_id, $params); - } - - //* Add a openvz vm record from template - public function openvz_vm_add_from_template($session_id, $client_id, $ostemplate_id, $template_id, $override_params = array()) - { - global $app; - - if(!$this->checkPerm($session_id, 'vm_openvz')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - - - $template_id = $app->functions->intval($template_id); - $ostemplate_id = $app->functions->intval($ostemplate_id); - - //* Verify parameters - if($template_id == 0) { - throw new SoapFault('template_id_error', 'Template ID must be > 0.'); - return false; - } - if($ostemplate_id == 0) { - throw new SoapFault('ostemplate_id_error', 'OSTemplate ID must be > 0.'); - return false; - } - - // Verify if template and ostemplate exist - $tmp = $app->db->queryOneRecord("SELECT template_id FROM openvz_template WHERE template_id = ?", $template_id); - if(!is_array($tmp)) { - throw new SoapFault('template_id_error', 'Template does not exist.'); - return false; - } - $tmp = $app->db->queryOneRecord("SELECT ostemplate_id FROM openvz_ostemplate WHERE ostemplate_id = ?", $ostemplate_id); - if(!is_array($tmp)) { - throw new SoapFault('ostemplate_id_error', 'OSTemplate does not exist.'); - return false; - } - - //* Get the template - $vtpl = $app->db->queryOneRecord("SELECT * FROM openvz_template WHERE template_id = ?", $template_id); - - //* Get the IP address and server_id - if($override_params['server_id'] > 0) { - $vmip = $app->db->queryOneRecord("SELECT ip_address_id, server_id, ip_address FROM openvz_ip WHERE reserved = 'n' AND vm_id = 0 AND server_id = ? LIMIT 0,1", $override_params['server_id']); - } else { - $vmip = $app->db->queryOneRecord("SELECT ip_address_id, server_id, ip_address FROM openvz_ip WHERE reserved = 'n' AND vm_id = 0 LIMIT 0,1"); - } - if(!is_array($vmip)) { - throw new SoapFault('vm_ip_error', 'Unable to get a free VM IP.'); - return false; - } - - //* Build the $params array - $params = array(); - $params['server_id'] = $vmip['server_id']; - $params['ostemplate_id'] = $ostemplate_id; - $params['template_id'] = $template_id; - $params['ip_address'] = $vmip['ip_address']; - $params['hostname'] = (isset($override_params['hostname']))?$override_params['hostname']:$vtpl['hostname']; - $params['vm_password'] = (isset($override_params['vm_password']))?$override_params['vm_password']:$app->auth->get_random_password(10); - $params['start_boot'] = (isset($override_params['start_boot']))?$override_params['start_boot']:'y'; - $params['active'] = (isset($override_params['active']))?$override_params['active']:'y'; - $params['active_until_date'] = (isset($override_params['active_until_date']))?$override_params['active_until_date']:null; - $params['description'] = (isset($override_params['description']))?$override_params['description']:''; - - //* The next params get filled with pseudo values, as the get replaced - //* by the openvz event plugin anyway with values from the template - $params['veid'] = 1; - $params['diskspace'] = 1; - $params['ram'] = 1; - $params['ram_burst'] = 1; - $params['cpu_units'] = 1; - $params['cpu_num'] = 1; - $params['cpu_limit'] = 1; - $params['io_priority'] = 1; - $params['nameserver'] = '8.8.8.8 8.8.4.4'; - $params['create_dns'] = 'n'; - $params['capability'] = ''; - - return $this->insertQuery('../vm/form/openvz_vm.tform.php', $client_id, $params, 'vm:openvz_vm:on_after_insert'); - } - - //* Update openvz vm record - public function openvz_vm_update($session_id, $client_id, $vm_id, $params) - { - if(!$this->checkPerm($session_id, 'vm_openvz')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->updateQuery('../vm/form/openvz_vm.tform.php', $client_id, $vm_id, $params, 'vm:openvz_vm:on_after_update'); - return $affected_rows; - } - - //* Delete openvz vm record - public function openvz_vm_delete($session_id, $vm_id) - { - if(!$this->checkPerm($session_id, 'vm_openvz')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->deleteQuery('../vm/form/openvz_vm.tform.php', $vm_id, 'vm:openvz_vm:on_after_delete'); - return $affected_rows; - } - - //* Start VM - public function openvz_vm_start($session_id, $vm_id) - { - global $app; - - if(!$this->checkPerm($session_id, 'vm_openvz')) { - 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('../vm/form/openvz_vm.tform.php'); - $vm = $app->remoting_lib->getDataRecord($vm_id); - - if(!is_array($vm)) { - throw new SoapFault('action_pending', 'No VM with this ID available.'); - return false; - } - - if($vm['active'] == 'n') { - throw new SoapFault('action_pending', 'VM is not in active state.'); - return false; - } - - $action = 'openvz_start_vm'; - - $tmp = $app->db->queryOneRecord("SELECT count(action_id) as actions FROM sys_remoteaction - WHERE server_id = ? - AND action_type = ? - AND action_param = ? - AND action_state = 'pending'", $vm['server_id'], $action, $vm['veid']); - - if($tmp['actions'] > 0) { - throw new SoapFault('action_pending', 'There is already a action pending for this VM.'); - return false; - } else { - $sql = "INSERT INTO sys_remoteaction (server_id, tstamp, action_type, action_param, action_state, response) " . - "VALUES (?, ?, ?, ?, 'pending', '')"; - $app->db->query($sql, (int)$vm['server_id'], time(), $action, $vm['veid']); - } - } - - //* Stop VM - public function openvz_vm_stop($session_id, $vm_id) - { - global $app; - - if(!$this->checkPerm($session_id, 'vm_openvz')) { - 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('../vm/form/openvz_vm.tform.php'); - $vm = $app->remoting_lib->getDataRecord($vm_id); - - if(!is_array($vm)) { - throw new SoapFault('action_pending', 'No VM with this ID available.'); - return false; - } - - if($vm['active'] == 'n') { - throw new SoapFault('action_pending', 'VM is not in active state.'); - return false; - } - - $action = 'openvz_stop_vm'; - - $tmp = $app->db->queryOneRecord("SELECT count(action_id) as actions FROM sys_remoteaction - WHERE server_id = ? - AND action_type = ? - AND action_param = ? - AND action_state = 'pending'", $vm['server_id'], $action, $vm['veid']); - - if($tmp['actions'] > 0) { - throw new SoapFault('action_pending', 'There is already a action pending for this VM.'); - return false; - } else { - $sql = "INSERT INTO sys_remoteaction (server_id, tstamp, action_type, action_param, action_state, response) " . - "VALUES (?, ?, ?, ?, 'pending', '')"; - $app->db->query($sql, (int)$vm['server_id'], time(), $action, $vm['veid']); - } - } - - //* Restart VM - public function openvz_vm_restart($session_id, $vm_id) - { - global $app; - - if(!$this->checkPerm($session_id, 'vm_openvz')) { - 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('../vm/form/openvz_vm.tform.php'); - $vm = $app->remoting_lib->getDataRecord($vm_id); - - if(!is_array($vm)) { - throw new SoapFault('action_pending', 'No VM with this ID available.'); - return false; - } - - if($vm['active'] == 'n') { - throw new SoapFault('action_pending', 'VM is not in active state.'); - return false; - } - - $action = 'openvz_restart_vm'; - - $tmp = $app->db->queryOneRecord("SELECT count(action_id) as actions FROM sys_remoteaction - WHERE server_id = ? - AND action_type = ? - AND action_param = ? - AND action_state = 'pending'", $vm['server_id'], $action, $vm['veid']); - - if($tmp['actions'] > 0) { - throw new SoapFault('action_pending', 'There is already a action pending for this VM.'); - return false; - } else { - $sql = "INSERT INTO sys_remoteaction (server_id, tstamp, action_type, action_param, action_state, response) " . - "VALUES (?, ?, ?, ?, 'pending', '')"; - $app->db->query($sql, (int)$vm['server_id'], time(), $action, $vm['veid']); - } - } - -} - -?> diff --git a/interface/lib/classes/remote.d/server.inc.php b/interface/lib/classes/remote.d/server.inc.php index 4e8179d06e7ec26a25de00ca50000ab01f634ef6..261acd84838c502870668f5b2a8876d2a7c45814 100644 --- a/interface/lib/classes/remote.d/server.inc.php +++ b/interface/lib/classes/remote.d/server.inc.php @@ -52,7 +52,7 @@ class remoting_server extends remoting { { global $app; if(!$this->checkPerm($session_id, 'server_get_serverid_by_ip')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $sql = "SELECT server_id FROM server_ip WHERE ip_address = ?"; @@ -66,7 +66,7 @@ class remoting_server extends remoting { global $app; if(!$this->checkPerm($session_id, 'server_ip_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -78,7 +78,7 @@ class remoting_server extends remoting { public function server_ip_add($session_id, $client_id, $params) { if(!$this->checkPerm($session_id, 'server_ip_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } return $this->insertQuery('../admin/form/server_ip.tform.php', $client_id, $params); @@ -88,7 +88,7 @@ class remoting_server extends remoting { public function server_ip_update($session_id, $client_id, $ip_id, $params) { if(!$this->checkPerm($session_id, 'server_ip_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->updateQuery('../admin/form/server_ip.tform.php', $client_id, $ip_id, $params); @@ -99,7 +99,7 @@ class remoting_server extends remoting { public function server_ip_delete($session_id, $ip_id) { if(!$this->checkPerm($session_id, 'server_ip_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../admin/form/server_ip.tform.php', $ip_id); @@ -118,7 +118,7 @@ class remoting_server extends remoting { public function server_get($session_id, $server_id = null, $section ='') { global $app; if(!$this->checkPerm($session_id, 'server_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if (!empty($session_id)) { @@ -155,7 +155,7 @@ class remoting_server extends remoting { public function server_config_set($session_id, $server_id, $section, $key, $value) { global $app; if(!$this->checkPerm($session_id, 'server_config_set')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if (!empty($server_id) && $server_id > 0 && $section != '' && $key != '') { @@ -165,7 +165,7 @@ class remoting_server extends remoting { $server_config_str = $app->ini_parser->get_ini_string($server_config_array); return $app->db->datalogUpdate('server', array("config" => $server_config_str), 'server_id', $server_id); } else { - throw new SoapFault('invalid_function_parameter', 'Invalid function parameter.'); + throw new ISPConfigRemoteException('invalid_function_parameter', 'Invalid function parameter.'); return false; } } @@ -180,7 +180,7 @@ class remoting_server extends remoting { { global $app; if(!$this->checkPerm($session_id, 'server_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if (!empty($session_id)) { @@ -202,8 +202,7 @@ class remoting_server extends remoting { { global $app; if(!$this->checkPerm($session_id, 'server_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); - return false; + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); } if (!empty($session_id) && !empty($server_name)) { $sql = "SELECT server_id FROM server WHERE server_name = ?"; @@ -224,13 +223,23 @@ class remoting_server extends remoting { { global $app; if(!$this->checkPerm($session_id, 'server_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); - return false; + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); } 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 * FROM server WHERE server_id = ?"; $all = $app->db->queryOneRecord($sql, $server_id); - return $all; + if(empty($all)) return false; + + $func = array(); + foreach($all as $key => $value) { + if($key === 'mirror_server_id' || substr($key, -7) === '_server') { + if($value == 0 || $value == 1) { + $func[$key] = $value; + } + } + } + + return $func; } else { return false; } @@ -240,8 +249,7 @@ class remoting_server extends remoting { { global $app; if(!$this->checkPerm($session_id, 'server_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); - return false; + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); } if (!empty($session_id)) { if($server_id == 0) $ispc_app_version = array('ispc_app_version' => ISPC_APP_VERSION); @@ -261,7 +269,7 @@ class remoting_server extends remoting { { global $app; if(!$this->checkPerm($session_id, 'server_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); } if (!empty($session_id) && !empty($server_id) && !empty($php)) { $php_versions = array(); diff --git a/interface/lib/classes/remote.d/sites.inc.php b/interface/lib/classes/remote.d/sites.inc.php index a2f15d6f9d4f73c5bcd67c21ca407c20dfde052c..b8ca4c2035247fd17c0ebf1538711f8103feea68 100644 --- a/interface/lib/classes/remote.d/sites.inc.php +++ b/interface/lib/classes/remote.d/sites.inc.php @@ -47,7 +47,7 @@ class remoting_sites extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_cron_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -59,7 +59,7 @@ class remoting_sites extends remoting { public function sites_cron_add($session_id, $client_id, $params) { if(!$this->checkPerm($session_id, 'sites_cron_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } return $this->insertQuery('../sites/form/cron.tform.php', $client_id, $params); @@ -69,7 +69,7 @@ class remoting_sites extends remoting { public function sites_cron_update($session_id, $client_id, $cron_id, $params) { if(!$this->checkPerm($session_id, 'sites_cron_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->updateQuery('../sites/form/cron.tform.php', $client_id, $cron_id, $params); @@ -80,7 +80,7 @@ class remoting_sites extends remoting { public function sites_cron_delete($session_id, $cron_id) { if(!$this->checkPerm($session_id, 'sites_cron_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../sites/form/cron.tform.php', $cron_id); @@ -95,7 +95,7 @@ class remoting_sites extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_database_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -110,14 +110,14 @@ class remoting_sites extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_database_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } //* Check for duplicates $tmp = $app->db->queryOneRecord("SELECT count(database_id) as dbnum FROM web_database WHERE database_name = ? AND server_id = ?", $params['database_name'], $params["server_id"]); if($tmp['dbnum'] > 0) { - throw new SoapFault('database_name_error_unique', 'There is already a database with that name on the same server.'); + throw new ISPConfigRemoteException('database_name_error_unique', 'There is already a database with that name on the same server.'); return false; } @@ -151,7 +151,7 @@ class remoting_sites extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_database_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -183,7 +183,7 @@ class remoting_sites extends remoting { { global $app; if(!$this->checkPerm($session_id, 'sites_database_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -202,7 +202,7 @@ class remoting_sites extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_database_user_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -214,7 +214,7 @@ class remoting_sites extends remoting { public function sites_database_user_add($session_id, $client_id, $params) { if(!$this->checkPerm($session_id, 'sites_database_user_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -227,7 +227,7 @@ class remoting_sites extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_database_user_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -257,7 +257,7 @@ class remoting_sites extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_database_user_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -285,7 +285,7 @@ class remoting_sites extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_ftp_user_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -297,7 +297,7 @@ class remoting_sites extends remoting { public function sites_ftp_user_add($session_id, $client_id, $params) { if(!$this->checkPerm($session_id, 'sites_ftp_user_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } return $this->insertQuery('../sites/form/ftp_user.tform.php', $client_id, $params); @@ -307,7 +307,7 @@ class remoting_sites extends remoting { public function sites_ftp_user_update($session_id, $client_id, $primary_id, $params) { if(!$this->checkPerm($session_id, 'sites_ftp_user_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->updateQuery('../sites/form/ftp_user.tform.php', $client_id, $primary_id, $params); @@ -318,7 +318,7 @@ class remoting_sites extends remoting { public function sites_ftp_user_delete($session_id, $primary_id) { if(!$this->checkPerm($session_id, 'sites_ftp_user_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../sites/form/ftp_user.tform.php', $primary_id); @@ -331,7 +331,7 @@ class remoting_sites extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_ftp_user_server_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -353,7 +353,7 @@ class remoting_sites extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_shell_user_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -365,7 +365,7 @@ class remoting_sites extends remoting { public function sites_shell_user_add($session_id, $client_id, $params) { if(!$this->checkPerm($session_id, 'sites_shell_user_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } return $this->insertQuery('../sites/form/shell_user.tform.php', $client_id, $params); @@ -375,7 +375,7 @@ class remoting_sites extends remoting { public function sites_shell_user_update($session_id, $client_id, $primary_id, $params) { if(!$this->checkPerm($session_id, 'sites_shell_user_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->updateQuery('../sites/form/shell_user.tform.php', $client_id, $primary_id, $params); @@ -386,7 +386,7 @@ class remoting_sites extends remoting { public function sites_shell_user_delete($session_id, $primary_id) { if(!$this->checkPerm($session_id, 'sites_shell_user_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../sites/form/shell_user.tform.php', $primary_id); @@ -401,7 +401,7 @@ class remoting_sites extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_web_domain_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -414,7 +414,7 @@ class remoting_sites extends remoting { { global $app; if(!$this->checkPerm($session_id, 'sites_web_domain_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -445,7 +445,7 @@ class remoting_sites extends remoting { public function sites_web_domain_update($session_id, $client_id, $primary_id, $params) { if(!$this->checkPerm($session_id, 'sites_web_domain_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -465,7 +465,7 @@ class remoting_sites extends remoting { public function sites_web_domain_delete($session_id, $primary_id) { if(!$this->checkPerm($session_id, 'sites_web_domain_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../sites/form/web_vhost_domain.tform.php', $primary_id); @@ -480,7 +480,7 @@ class remoting_sites extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_web_aliasdomain_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -493,7 +493,7 @@ class remoting_sites extends remoting { { global $app; if(!$this->checkPerm($session_id, 'sites_web_aliasdomain_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -517,7 +517,7 @@ class remoting_sites extends remoting { public function sites_web_vhost_aliasdomain_update($session_id, $client_id, $primary_id, $params) { if(!$this->checkPerm($session_id, 'sites_web_aliasdomain_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -537,7 +537,7 @@ class remoting_sites extends remoting { public function sites_web_vhost_aliasdomain_delete($session_id, $primary_id) { if(!$this->checkPerm($session_id, 'sites_web_aliasdomain_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../sites/form/web_vhost_domain.tform.php', $primary_id); @@ -552,7 +552,7 @@ class remoting_sites extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_web_subdomain_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -565,7 +565,7 @@ class remoting_sites extends remoting { { global $app; if(!$this->checkPerm($session_id, 'sites_web_subdomain_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -589,7 +589,7 @@ class remoting_sites extends remoting { public function sites_web_vhost_subdomain_update($session_id, $client_id, $primary_id, $params) { if(!$this->checkPerm($session_id, 'sites_web_subdomain_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -609,7 +609,7 @@ class remoting_sites extends remoting { public function sites_web_vhost_subdomain_delete($session_id, $primary_id) { if(!$this->checkPerm($session_id, 'sites_web_subdomain_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../sites/form/web_vhost_domain.tform.php', $primary_id); @@ -624,7 +624,7 @@ class remoting_sites extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_web_aliasdomain_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -636,7 +636,7 @@ class remoting_sites extends remoting { public function sites_web_aliasdomain_add($session_id, $client_id, $params) { if(!$this->checkPerm($session_id, 'sites_web_aliasdomain_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } return $this->insertQuery('../sites/form/web_childdomain.tform.php', $client_id, $params); @@ -646,7 +646,7 @@ class remoting_sites extends remoting { public function sites_web_aliasdomain_update($session_id, $client_id, $primary_id, $params) { if(!$this->checkPerm($session_id, 'sites_web_aliasdomain_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->updateQuery('../sites/form/web_childdomain.tform.php', $client_id, $primary_id, $params); @@ -657,7 +657,7 @@ class remoting_sites extends remoting { public function sites_web_aliasdomain_delete($session_id, $primary_id) { if(!$this->checkPerm($session_id, 'sites_web_aliasdomain_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../sites/form/web_childdomain.tform.php', $primary_id); @@ -672,7 +672,7 @@ class remoting_sites extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_web_subdomain_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -684,7 +684,7 @@ class remoting_sites extends remoting { public function sites_web_subdomain_add($session_id, $client_id, $params) { if(!$this->checkPerm($session_id, 'sites_web_subdomain_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } return $this->insertQuery('../sites/form/web_childdomain.tform.php', $client_id, $params); @@ -694,7 +694,7 @@ class remoting_sites extends remoting { public function sites_web_subdomain_update($session_id, $client_id, $primary_id, $params) { if(!$this->checkPerm($session_id, 'sites_web_subdomain_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->updateQuery('../sites/form/web_childdomain.tform.php', $client_id, $primary_id, $params); @@ -705,7 +705,7 @@ class remoting_sites extends remoting { public function sites_web_subdomain_delete($session_id, $primary_id) { if(!$this->checkPerm($session_id, 'sites_web_subdomain_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../sites/form/web_childdomain.tform.php', $primary_id); @@ -720,7 +720,7 @@ class remoting_sites extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_web_folder_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -732,7 +732,7 @@ class remoting_sites extends remoting { public function sites_web_folder_add($session_id, $client_id, $params) { if(!$this->checkPerm($session_id, 'sites_web_folder_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } return $this->insertQuery('../sites/form/web_folder.tform.php', $client_id, $params); @@ -742,7 +742,7 @@ class remoting_sites extends remoting { public function sites_web_folder_update($session_id, $client_id, $primary_id, $params) { if(!$this->checkPerm($session_id, 'sites_web_folder_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->updateQuery('../sites/form/web_folder.tform.php', $client_id, $primary_id, $params); @@ -754,7 +754,7 @@ class remoting_sites extends remoting { { global $app; if(!$this->checkPerm($session_id, 'sites_web_folder_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -778,7 +778,7 @@ class remoting_sites extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_web_folder_user_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); @@ -790,7 +790,7 @@ class remoting_sites extends remoting { public function sites_web_folder_user_add($session_id, $client_id, $params) { if(!$this->checkPerm($session_id, 'sites_web_folder_user_add')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } return $this->insertQuery('../sites/form/web_folder_user.tform.php', $client_id, $params); @@ -800,7 +800,7 @@ class remoting_sites extends remoting { public function sites_web_folder_user_update($session_id, $client_id, $primary_id, $params) { if(!$this->checkPerm($session_id, 'sites_web_folder_user_update')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->updateQuery('../sites/form/web_folder_user.tform.php', $client_id, $primary_id, $params); @@ -811,7 +811,7 @@ class remoting_sites extends remoting { public function sites_web_folder_user_delete($session_id, $primary_id) { if(!$this->checkPerm($session_id, 'sites_web_folder_user_delete')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $affected_rows = $this->deleteQuery('../sites/form/web_folder_user.tform.php', $primary_id); @@ -831,7 +831,7 @@ class remoting_sites extends remoting { public function client_get_sites_by_user($session_id, $sys_userid, $sys_groupid) { global $app; if(!$this->checkPerm($session_id, 'client_get_sites_by_user')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $sys_userid = $app->functions->intval($sys_userid); @@ -846,7 +846,7 @@ class remoting_sites extends remoting { if(isset($result)) { return $result; } else { - throw new SoapFault('no_client_found', 'There is no site for this user'); + throw new ISPConfigRemoteException('no_client_found', 'There is no site for this user'); return false; } } @@ -864,7 +864,7 @@ class remoting_sites extends remoting { public function sites_web_domain_set_status($session_id, $primary_id, $status) { global $app; if(!$this->checkPerm($session_id, 'sites_web_domain_set_status')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if(in_array($status, array('active', 'inactive'))) { @@ -880,7 +880,7 @@ class remoting_sites extends remoting { $affected_rows = $this->updateQuery('../sites/form/web_vhost_domain.tform.php', 0, $primary_id, $params); return $affected_rows; } else { - throw new SoapFault('status_undefined', 'The status is not available'); + throw new ISPConfigRemoteException('status_undefined', 'The status is not available'); return false; } } @@ -893,7 +893,7 @@ class remoting_sites extends remoting { { global $app; if(!$this->checkPerm($session_id, 'sites_database_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } $client_id = $app->functions->intval($client_id); @@ -908,7 +908,7 @@ class remoting_sites extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_web_domain_backup')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -922,7 +922,7 @@ class remoting_sites extends remoting { global $app; if(!$this->checkPerm($session_id, 'sites_web_domain_backup')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -936,19 +936,19 @@ class remoting_sites extends remoting { //* Basic validation of variables if ($server_id <= 0) { - throw new SoapFault('invalid_backup_id', "Invalid or non existant backup_id $primary_id"); + throw new ISPConfigRemoteException('invalid_backup_id', "Invalid or non existant backup_id $primary_id"); return false; } if ($action_type != 'backup_download' and $action_type != 'backup_restore' and $action_type != 'backup_delete') { - throw new SoapFault('invalid_action', "Invalid action_type $action_type"); + throw new ISPConfigRemoteException('invalid_action', "Invalid action_type $action_type"); return false; } //* Validate instance $instance_record = $app->db->queryOneRecord("SELECT * FROM `sys_remoteaction` WHERE `action_param`= ? and `action_type`= ? and `action_state`= ?", $primary_id, $action_type, 'pending'); if ($instance_record['action_id'] >= 1) { - throw new SoapFault('duplicate_action', "There is already a pending $action_type action"); + throw new ISPConfigRemoteException('duplicate_action', "There is already a pending $action_type action"); return false; } @@ -967,7 +967,7 @@ class remoting_sites extends remoting { $app->uses('quota_lib'); if(!$this->checkPerm($session_id, 'quota_get_by_user')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } @@ -980,7 +980,7 @@ class remoting_sites extends remoting { $app->uses('quota_lib'); if(!$this->checkPerm($session_id, 'trafficquota_get_by_user')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if ($client_id != null) @@ -995,7 +995,7 @@ class remoting_sites extends remoting { $app->uses('quota_lib'); if(!$this->checkPerm($session_id, 'trafficquota_get_by_user')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if ($client_id != null) @@ -1010,7 +1010,7 @@ class remoting_sites extends remoting { $app->uses('quota_lib'); if(!$this->checkPerm($session_id, 'databasequota_get_by_user')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } diff --git a/interface/lib/classes/remoting.inc.php b/interface/lib/classes/remoting.inc.php index 8522ebc6fd802cd07ebd32936b5359de22d27ad8..0ca262e597c8498e14a8f7e31e6d39ff4c326bfb 100644 --- a/interface/lib/classes/remoting.inc.php +++ b/interface/lib/classes/remoting.inc.php @@ -206,7 +206,7 @@ class remoting { fwrite($authlog_handle, $authlog ."\n"); fclose($authlog_handle); - throw new SoapFault($error['faultcode'], $error['faultstring']); + throw new ISPConfigRemoteException($error['faultcode'], $error['faultstring']); return false; } else { // User login right, so attempts can be deleted @@ -231,7 +231,7 @@ class remoting { global $app; if(empty($session_id)) { - throw new SoapFault('session_id_empty', 'The SessionID is empty.'); + throw new ISPConfigRemoteException('session_id_empty', 'The SessionID is empty.'); return false; } @@ -265,14 +265,14 @@ class remoting { //* Stop on error while preparing the sql query if($app->remoting_lib->errorMessage != '') { - throw new SoapFault('data_processing_error', $app->remoting_lib->errorMessage); + throw new ISPConfigRemoteException('data_processing_error', $app->remoting_lib->errorMessage); return false; } //* Execute the SQL query $app->db->query($sql); if($app->db->errorMessage != '') { - throw new SoapFault('database_error', $app->db->errorMessage . ' '.$sql); + throw new ISPConfigRemoteException('database_error', $app->db->errorMessage . ' '.$sql); return false; } if ( isset($params['_primary_id'] )) @@ -283,7 +283,7 @@ class remoting { //* Stop on error while executing the sql query if($app->remoting_lib->errorMessage != '') { - throw new SoapFault('data_processing_error', $app->remoting_lib->errorMessage); + throw new ISPConfigRemoteException('data_processing_error', $app->remoting_lib->errorMessage); return false; } @@ -294,7 +294,7 @@ class remoting { /* if($app->db->errorMessage != '') { - throw new SoapFault('database_error', $app->db->errorMessage . ' '.$sql); + throw new ISPConfigRemoteException('database_error', $app->db->errorMessage . ' '.$sql); return false; } */ @@ -345,7 +345,7 @@ class remoting { //* Get the SQL query $sql = $app->remoting_lib->getSQL($params, 'INSERT', 0); if($app->remoting_lib->errorMessage != '') { - throw new SoapFault('data_processing_error', $app->remoting_lib->errorMessage); + throw new ISPConfigRemoteException('data_processing_error', $app->remoting_lib->errorMessage); return false; } $app->log('Executed insertQueryPrepare', LOGLEVEL_DEBUG); @@ -361,7 +361,7 @@ class remoting { $app->db->query($sql); if($app->db->errorMessage != '') { - throw new SoapFault('database_error', $app->db->errorMessage . ' '.$sql); + throw new ISPConfigRemoteException('database_error', $app->db->errorMessage . ' '.$sql); return false; } @@ -421,9 +421,9 @@ class remoting { //* Get the SQL query $sql = $app->remoting_lib->getSQL($params, 'UPDATE', $primary_id); - // throw new SoapFault('debug', $sql); + // throw new ISPConfigRemoteException('debug', $sql); if($app->remoting_lib->errorMessage != '') { - throw new SoapFault('data_processing_error', $app->remoting_lib->errorMessage); + throw new ISPConfigRemoteException('data_processing_error', $app->remoting_lib->errorMessage); return false; } @@ -446,7 +446,7 @@ class remoting { $app->db->query($sql); if($app->db->errorMessage != '') { - throw new SoapFault('database_error', $app->db->errorMessage . ' '.$sql); + throw new ISPConfigRemoteException('database_error', $app->db->errorMessage . ' '.$sql); return false; } @@ -492,7 +492,7 @@ class remoting { $affected_rows = $app->db->affectedRows(); if($app->db->errorMessage != '') { - throw new SoapFault('database_error', $app->db->errorMessage . ' '.$sql); + throw new ISPConfigRemoteException('database_error', $app->db->errorMessage . ' '.$sql); return false; } @@ -543,7 +543,7 @@ class remoting { global $app; if(empty($session_id)) { - throw new SoapFault('session_id_empty', 'The SessionID is empty.'); + throw new ISPConfigRemoteException('session_id_empty', 'The SessionID is empty.'); return false; } @@ -552,7 +552,7 @@ class remoting { if($session['remote_userid'] > 0) { return $session; } else { - throw new SoapFault('session_does_not_exist', 'The Session is expired or does not exist.'); + throw new ISPConfigRemoteException('session_does_not_exist', 'The Session is expired or does not exist.'); return false; } } @@ -560,7 +560,7 @@ class remoting { public function server_get($session_id, $server_id = null, $section ='') { global $app; if(!$this->checkPerm($session_id, 'server_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if (!empty($session_id)) { @@ -594,7 +594,7 @@ class remoting { { global $app; if(!$this->checkPerm($session_id, 'server_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } if (!empty($session_id)) { @@ -617,7 +617,7 @@ class remoting { public function get_function_list($session_id) { if(!$this->checkPerm($session_id, 'get_function_list')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + throw new ISPConfigRemoteException('permission_denied', 'You do not have the permissions to access this function.'); return false; } return $this->_methods; diff --git a/interface/lib/classes/remoting_lib.inc.php b/interface/lib/classes/remoting_lib.inc.php index a5a5d0c31c49c647f33d5a0eca3310133820e05c..6fd5d2f3d97ded866b3a2bd000c29d1906b8014e 100644 --- a/interface/lib/classes/remoting_lib.inc.php +++ b/interface/lib/classes/remoting_lib.inc.php @@ -238,7 +238,7 @@ class remoting_lib extends tform_base { $sql = "SELECT * FROM ??"; return $app->db->queryAllRecords($sql, $this->formDef['db_table']); } else { - throw new SoapFault('invalid_id', 'The ID has to be > 0 or -1.'); + throw new ISPConfigRemoteException('invalid_id', 'The ID has to be > 0 or -1.'); return array(); } } elseif (@is_array($primary_id) || @is_object($primary_id)) { diff --git a/interface/lib/classes/rest_handler.inc.php b/interface/lib/classes/rest_handler.inc.php index ceaa7c63be32fc95198769c0398a6f46cc1e4b31..ebca73c40ecc683104e52bbedec668d318b46d74 100644 --- a/interface/lib/classes/rest_handler.inc.php +++ b/interface/lib/classes/rest_handler.inc.php @@ -173,11 +173,17 @@ class ISPConfigRESTHandler { try { $this->_return_json($return_code, call_user_func_array(array($this->classes[$class_name], $method), $params)); - } catch(SoapFault $e) { + } catch(ISPConfigRemoteException $e) { $this->_return_error(500, 'REQUEST ERROR', $e->getMessage()); } } } -?> +if(!class_exists('ISPConfigRemoteException')) { + class ISPConfigRemoteException extends Exception { + public function __construct($code = '', $message = '') { + parent::__construct($message . ' (' . $code . ')', 0); + } + } +} \ No newline at end of file diff --git a/interface/lib/classes/searchform.inc.php b/interface/lib/classes/searchform.inc.php deleted file mode 100644 index 0a290c1d699bcae630af474c76190d92f5ec1d42..0000000000000000000000000000000000000000 --- a/interface/lib/classes/searchform.inc.php +++ /dev/null @@ -1,349 +0,0 @@ -listDef = $liste; - $this->module = $module; - - //* Fill datasources - foreach($this->listDef['item'] as $key => $field) { - if(is_array($field['datasource'])) { - $this->listDef['item'][$key]['value'] = $this->getDatasourceData($field); - } - } - return true; - } - - /** - * Get the key => value array of a form filed from a datasource definitiom - * - * @param field = array with field definition - * @param record = Dataset as array - * @return key => value array for the value field of a form - */ - - - public function getDatasourceData($field) - { - global $app; - $values = array(); - - if($field['datasource']['type'] == 'SQL') { - //* Preparing SQL string. We will replace some common placeholders - $querystring = $field['datasource']['querystring']; - $querystring = str_replace('{USERID}', $_SESSION['s']['user']['userid'], $querystring); - $querystring = str_replace('{GROUPID}', $_SESSION['s']['user']['default_group'], $querystring); - $querystring = str_replace('{GROUPS}', $_SESSION['s']['user']['groups'], $querystring); - $table_idx = $this->formDef['db_table_idx']; - //$querystring = str_replace('{RECORDID}',$record[$table_idx],$querystring); - $app->uses('tform'); - $querystring = str_replace('{AUTHSQL}', $app->tform->getAuthSQL('r'), $querystring); - - //* Getting the records - $tmp_records = $app->db->queryAllRecords($querystring); - if($app->db->errorMessage != ''){ - die($app->db->errorMessage); - } - if(is_array($tmp_records)) { - $key_field = $field['datasource']['keyfield']; - $value_field = $field['datasource']['valuefield']; - foreach($tmp_records as $tmp_rec) { - $values[$tmp_rec[$key_field]] = $tmp_rec[$value_field]; - } - } - } - if($field['datasource']['type'] == 'CUSTOM') { - //* Calls a custom class to validate this record - if($field['datasource']['class'] != '' and $field['datasource']['function'] != '') { - $datasource_class = $field['datasource']['class']; - $datasource_function = $field['datasource']['function']; - $app->uses($datasource_class); - $record = array(); - $values = $app->$datasource_class->$datasource_function($field, $record); - }else{ - $this->errorMessage .= "Custom datasource class or function is empty
\r\n"; - } - } - return $values; - } - - public function getSearchSQL($sql_where = '') - { - global $db; - - //* Config vars - $list_name = $this->listDef['name']; - $search_prefix = $this->listDef['search_prefix']; - - //* store retrieval query - foreach($this->listDef['item'] as $i) { - $field = $i['field']; - - //* TODO ? hat sich die suche ge�ndert - has itself search ? - $ki = $search_prefix.$field; - if(isset($_REQUEST) and $_REQUEST[$ki] != $_SESSION['search'][$list_name][$ki]){ - $this->searchChanged = 1; - } - - //* suchfield in session store. - if(isset($_REQUEST[$ki])){ - $_SESSION['search'][$list_name][$ki] = $_REQUEST[$ki]; - } - - if($i['formtype'] == 'SELECT'){ - if(is_array($i['value'])) { - $out = ''; - foreach($i['value'] as $k => $v) { - $selected = ($k == $_SESSION['search'][$list_name][$ki] && $_SESSION['search'][$list_name][$ki] != '') ? ' SELECTED' : ''; - $out .= "\r\n"; - } - } - $this->searchValues[$ki] = $out; - }else{ - $this->searchValues[$ki] = $_SESSION['search'][$list_name][$ki]; - } - } - - //* store variables in object. $this->searchValues = $_SESSION["search"][$list_name]; - foreach($this->listDef['item'] as $i) { - $field = $i['field']; - //if($_REQUEST[$search_prefix.$field] != '') $sql_where .= " $field ".$i["op"]." '".$i["prefix"].$_REQUEST[$search_prefix.$field].$i["suffix"]."' and"; - if($_SESSION['search'][$list_name][$ki] != ''){ - $sql_where .= " $field ".$i['op']." '".$i['prefix'].$_SESSION['search'][$list_name][$ki].$i['suffix']."' and"; - } - } - return ($sql_where != '') ? substr($sql_where, 0, -3) : '1'; - } - - public function getPagingSQL($sql_where = '1') { - global $app, $conf; - - $list_name = $this->listDef['name']; - $search_prefix = $this->listDef['search_prefix']; - $records_per_page = $this->listDef['records_per_page']; - $table = $this->listDef['table']; - - //* set page to seror id session not set - if($_SESSION['search'][$list_name]['page'] == '') $_SESSION['search'][$list_name]['page'] = 0; - - //* Set page size to request if set - if(isset($_REQUEST['page'])) $_SESSION['search'][$list_name]['page'] = $_REQUEST['page']; - - //* TODO PAGE to 0 set, if look for themselves ge?ndert. = page auf 0 setzen, wenn suche sich ge�ndert hat. - if($this->searchChanged == 1) $_SESSION['search'][$list_name]['page'] = 0; - - $sql_von = $_SESSION['search'][$list_name]['page'] * $records_per_page; - $record_count = $app->db->queryOneRecord("SELECT count(*) AS anzahl FROM ?? WHERE $sql_where", $table); - $pages = $app->functions->intval(($record_count['anzahl'] - 1) / $records_per_page); - - $vars['list_file'] = $this->listDef['file']; - $vars['page'] = $_SESSION['search'][$list_name]['page']; - $vars['last_page'] = $_SESSION['search'][$list_name]['page'] - 1; - $vars['next_page'] = $_SESSION['search'][$list_name]['page'] + 1; - $vars['pages'] = $pages; - $vars['max_pages'] = $pages + 1; - $vars['records_gesamt'] = $record_count['anzahl']; - $vars['page_params'] = $this->listDef['page_params']; - - if($_SESSION['search'][$list_name]['page'] > 0) $vars['show_page_back'] = 1; - if($_SESSION['search'][$list_name]['page'] <= $vars['pages'] - 1) $vars['show_page_next'] = 1; - - $this->pagingValues = $vars; - $this->pagingHTML = $this->getPagingHTML($vars); - - return "LIMIT $sql_von, $records_per_page"; - } - - public function getPagingHTML($vars) { - global $app; - $page_params = $vars['page_params']; - $list_file = $vars['list_file']; - $content = '   '; - if($vars['show_page_back'] == 1){ - $content .= ' '; - } - $content .= ' '.$app->lng('Page').' '.$vars['next_page'].' '.$app->lng('of').' '.$vars['max_pages'].' '; - if($vars['show_page_next'] == 1){ - $content .= '   '; - } else{ - $content .= ' '; - } - $content .= ' '; - return $content; - } - - public function getPagingHTMLasTXT($vars) - { - global $app; - $page_params = $vars['page_params']; - $list_file = $vars['list_file']; - $content = '[|<< ]'; - if($vars['show_page_back'] == 1){ - $content .= '[<< '.$app->lng('Back').'] '; - } - $content .= ' '.$app->lng('Page').' '.$vars['next_page'].' '.$app->lng('of').' '.$vars['max_pages'].' '; - if($vars['show_page_next'] == 1){ - $content .= '['.$app->lng('Next').' >>] '; - } - $content .= '[ >>|]'; - return $content; - } - - public function getSortSQL() - { - $sort_field = $this->listDef['sort_field']; - $sort_direction = $this->listDef['sort_direction']; - return ($sort_field != '' && $sort_direction != '') ? "ORDER BY $sort_field $sort_direction" : ''; - } - - public function saveSearchSettings($searchresult_name) - { - global $app, $conf; - - $list_name = $this->listDef['name']; - $settings = $_SESSION['search'][$list_name]; - unset($settings['page']); - $data = serialize($settings); - - $userid = $_SESSION['s']['user']['userid']; - $groupid = $_SESSION['s']['user']['default_group']; - $sys_perm_user = 'riud'; - $sys_perm_group = 'r'; - $sys_perm_other = ''; - $module = $_SESSION['s']['module']['name']; - $searchform = $this->listDef['name']; - $title = $searchresult_name; - - $sql = 'INSERT INTO `searchform` ( ' - .'`sys_userid` , `sys_groupid` , `sys_perm_user` , `sys_perm_group` , `sys_perm_other` , `module` , `searchform` , `title` , `data` ' - .')VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)'; - $app->db->query($sql, $userid, $groupid, $sys_perm_user, $sys_perm_group, $sys_perm_other, $module, $searchform, $title, $data); - } - - public function decode($record) - { - global $app; - if(is_array($record)) { - foreach($this->listDef['item'] as $field) { - $key = $field['field']; - switch ($field['datatype']) - { - case 'DATE': - if($val > 0) { - $record[$key] = date($this->dateformat, $record[$key]); - } - break; - - case 'INTEGER': - $record[$key] = $app->functions->intval($record[$key]); - break; - - case 'DOUBLE': - $record[$key] = $record[$key]; - break; - - case 'CURRENCY': - $record[$key] = number_format($record[$key], 2, ',', ''); - break; - - - case 'VARCHAR': - case 'TEXT': - default: - $record[$key] = stripslashes($record[$key]); - break; - } - } - } - return $record; - } - - /* TODO: check for double quoting mysql value */ - public function encode($record) - { - global $app; - if(is_array($record)) { - foreach($this->listDef['item'] as $field) { - $key = $field['field']; - switch ($field['datatype']) - { - case 'VARCHAR': - case 'TEXT': - if(!is_array($record[$key])) { - $record[$key] = $app->db->quote($record[$key]); - } else { - $record[$key] = implode($this->tableDef[$key]['separator'], $record[$key]); - } - break; - - case 'DATE': - if($record[$key] > 0) { - list($tag, $monat, $jahr) = explode('.', $record[$key]); - $record[$key] = mktime(0, 0, 0, $monat, $tag, $jahr); - } - break; - - case 'INTEGER': - $record[$key] = $app->functions->intval($record[$key]); - break; - - case 'DOUBLE': - $record[$key] = $app->db->quote($record[$key]); - break; - - case 'CURRENCY': - $record[$key] = str_replace(',', '.', $record[$key]); - break; - } - } - } - return $record; - } - -} - -?> diff --git a/interface/lib/classes/searchform_actions.inc.php b/interface/lib/classes/searchform_actions.inc.php deleted file mode 100644 index c4372982c0ae5fbd0a7d94683b57d9dd1e96a538..0000000000000000000000000000000000000000 --- a/interface/lib/classes/searchform_actions.inc.php +++ /dev/null @@ -1,202 +0,0 @@ -tpl)) $app->uses('tpl'); - if(!is_object($app->searchform)) $app->uses('searchform'); - if(!is_object($app->tform)) $app->uses('tform'); - - // Load list definition - $app->searchform->loadListDef($list_def_file); - - // Delete the search form contents, if requested - if($_REQUEST["empty_searchfields"] == 'yes') { - $list_name = $app->searchform->listDef["name"]; - unset($_SESSION["search"][$list_name]); - } - - // Save the search for later usage - if($_REQUEST["btn_submit_search_save"] && $_REQUEST["search_save_as"] != '') { - $app->searchform->saveSearchSettings($_REQUEST["search_save_as"]); - } - - // Set th returnto value for forms - $_SESSION["s"]["form"]["return_to_url"] = $app->searchform->listDef["file"]; - - if(!is_file('templates/'.$app->searchform->listDef["name"].'_search.htm')) { - $app->uses('searchform_tpl_generator'); - $app->searchform_tpl_generator->buildHTML($app->searchform->listDef); - } - - $app->tpl->newTemplate("searchpage.tpl.htm"); - $app->tpl->setInclude('content_tpl', 'templates/'.$app->searchform->listDef["name"].'_search.htm'); - - // Getting Datasets from DB - $records = $app->db->queryAllRecords($this->getQueryString()); - - - $this->DataRowColor = "#FFFFFF"; - if(is_array($records)) { - $this->idx_key = $app->searchform->listDef["table_idx"]; - foreach($records as $rec) { - $records_new[] = $this->prepareDataRow($rec); - } - } - - $app->tpl->setLoop('records', $records_new); - - //print_r($records_new); - - $this->onShow(); - - - } - - function prepareDataRow($rec) { - global $app; - - $rec = $app->searchform->decode($rec); - - // Alternating datarow colors - $this->DataRowColor = ($this->DataRowColor == "#FFFFFF")?"#EEEEEE":"#FFFFFF"; - $rec["bgcolor"] = $this->DataRowColor; - - // substitute value for select fields - foreach($app->searchform->listDef["item"] as $field) { - $key = $field["field"]; - if($field['formtype'] == "SELECT") { - if($rec[$key] == 'y' or $rec[$key] == 'n') { - // Set a additional image variable for bolean fields - $rec['_'.$key.'_'] = ($rec[$key] == 'y')?'list_icon_true.png':'list_icon_false.png'; - } - // substitute value for select field - $rec[$key] = $field['value'][$rec[$key]]; - } - } - - // The variable "id" contains always the index variable - $rec["id"] = $rec[$this->idx_key]; - - return $rec; - } - - function getQueryString() { - global $app; - - // Generate the search sql - if($app->searchform->listDef["auth"] != 'no') { - if($_SESSION["s"]["user"]["typ"] == "admin") { - $sql_where = ""; - } else { - $sql_where = $app->tform->getAuthSQL('r')." and"; - } - } - - if($this->SQLExtWhere != '') { - $sql_where .= " ".$this->SQLExtWhere." and"; - } - - $sql_where = $app->searchform->getSearchSQL($sql_where); - $app->tpl->setVar($app->searchform->searchValues); - - $order_by_sql = $this->SQLOrderBy; - - // Generate SQL for paging - $limit_sql = $app->searchform->getPagingSQL($sql_where); - $app->tpl->setVar("paging", $app->searchform->pagingHTML); - - return "SELECT * FROM ".$app->searchform->listDef["table"]." WHERE $sql_where $order_by_sql $limit_sql"; - - } - - - function onShow() { - global $app; - - // Language File setzen - $lng_file = ISPC_WEB_PATH.'/lang/lib/lang/'.$app->functions->check_language($_SESSION['s']['language']).'_list.lng'; - if(!file_exists($lng_file)) $lng_file = ISPC_WEB_PATH.'/lang/lib/lang/en_'.'_list.lng'; - include $lng_file; - $lng_file = "lib/lang/".$app->functions->check_language($_SESSION["s"]["language"])."_".$app->searchform->listDef['name']."_search.lng"; - if(!file_exists($lng_file)) $lng_file = 'lib/lang/en_'.$app->searchform->listDef['name']."_search.lng"; - include $lng_file; - $app->tpl->setVar($wb); - $app->tpl->setVar("form_action", $app->searchform->listDef["file"]); - - // Parse the templates and send output to the browser - $this->onShowEnd(); - } - - function onShowEnd() { - global $app; - - if(count($_REQUEST) > 0) { - $app->tpl->setVar('searchresult_visible', 1); - if($_REQUEST['searchresult_visible'] == 'no') $app->tpl->setVar('searchresult_visible', 0); - - if($_REQUEST['searchform_visible'] == 'yes') { - $app->tpl->setVar('searchform_visible', 1); - } else { - $app->tpl->setVar('searchform_visible', 0); - } - } else { - $app->tpl->setVar('searchform_visible', 1); - if($_REQUEST['searchform_visible'] == 'no') $app->tpl->setVar('searchform_visible', 0); - - if($_REQUEST['searchresult_visible'] == 'yes') { - $app->tpl->setVar('searchresult_visible', 1); - } else { - $app->tpl->setVar('searchresult_visible', 0); - } - } - - // make columns visible - $visible_columns = explode(",", $app->searchform->listDef['default_columns']); - foreach($visible_columns as $col) { - $app->tpl->setVar($col.'_visible', 1); - } - - $app->tpl_defaults(); - $app->tpl->pparse(); - } - -} - -?> diff --git a/interface/lib/classes/searchform_tpl_generator.inc.php b/interface/lib/classes/searchform_tpl_generator.inc.php deleted file mode 100644 index 81e2f4ef1a6ee42c0b948c64742b958faf1a4007..0000000000000000000000000000000000000000 --- a/interface/lib/classes/searchform_tpl_generator.inc.php +++ /dev/null @@ -1,136 +0,0 @@ - -

- -'; - - $lang["list_head_txt"] = $listDef["name"]; - foreach($listDef["item"] as $field) { - $key = $field["field"]; - - if($field["formtype"] == 'SELECT') { - $html .= " - - - - "; - } else { - $html .= " - - - - "; - } - } - - $html .= ' - - - -
:
:
-
- -

-[Neue Suche] -[Suchkriterien ändern] -Suche speichern unter: -

- - -'; - - $lang["list_head_txt"] = $listDef["name"]; - foreach($listDef["item"] as $field) { - $key = $field["field"]; - $html .= ""; - $html .= " \r\n"; - $html .= ""; - $lang[$key."_txt"] = $key; - } - - $html .= ' - - - -'; - - foreach($listDef["item"] as $field) { - $key = $field["field"]; - $html .= ""; - $html .= " \r\n"; - $html .= ""; - } - - $html .= " - - -"; - $html .= ' -
 
{tmpl_var name=\"".$key."\"}[{tmpl_var name='delete_txt'}]
- - - -
-
-'; - - if($module == '') { - $filename = 'templates/'.$listDef["name"].'_search.htm'; - } else { - $filename = '../'.$module.'/templates/'.$listDef["name"].'_search.htm'; - } - - - // speichere Template - if (!$handle = fopen($filename, 'w')) { - print "Cannot open file ($filename)"; - exit; - } - - if (!fwrite($handle, $html)) { - print "Cannot write to file ($filename)"; - exit; - } - fclose($handle); - - } - -} - -?> diff --git a/interface/lib/classes/soap_handler.inc.php b/interface/lib/classes/soap_handler.inc.php index 704e21b20ba282fc45d661dd2d1b78c66981e0ba..31221bcfe5a67c6db616ceecb780bc13535cfe18 100644 --- a/interface/lib/classes/soap_handler.inc.php +++ b/interface/lib/classes/soap_handler.inc.php @@ -71,25 +71,31 @@ class ISPConfigSoapHandler { public function __call($method, $params) { if(array_key_exists($method, $this->methods) == false) { - throw new SoapFault('invalid_method', 'Method ' . $method . ' does not exist'); + throw new ISPConfigRemoteException('invalid_method', 'Method ' . $method . ' does not exist'); } $class_name = $this->methods[$method]; if(array_key_exists($class_name, $this->classes) == false) { - throw new SoapFault('invalid_class', 'Class ' . $class_name . ' does not exist'); + throw new ISPConfigRemoteException('invalid_class', 'Class ' . $class_name . ' does not exist'); } if(method_exists($this->classes[$class_name], $method) == false) { - throw new SoapFault('invalid_method', 'Method ' . $method . ' does not exist in the class it was expected (' . $class_name . ')'); + throw new ISPConfigRemoteException('invalid_method', 'Method ' . $method . ' does not exist in the class it was expected (' . $class_name . ')'); } try { return call_user_func_array(array($this->classes[$class_name], $method), $params); - } catch(SoapFault $e) { + } catch(ISPConfigRemoteException $e) { throw $e; } } } -?> +if(!class_exists('ISPConfigRemoteException')) { + class ISPConfigRemoteException extends SoapFault { + public function __construct($code = '', $message = '') { + parent::__construct($code, $message); + } + } +} diff --git a/interface/lib/classes/system.inc.php b/interface/lib/classes/system.inc.php index cef9424a75d61203e57060fb8aee39eb85a14435..7107228278d969c6218b39c44376f41e89e2d3c9 100644 --- a/interface/lib/classes/system.inc.php +++ b/interface/lib/classes/system.inc.php @@ -41,7 +41,7 @@ class system { // simple query cache if($this->client_service===null) - $this->client_service = $app->db->queryOneRecord("SELECT client.* FROM sys_user, client WHERE sys_user.userid = ? AND sys_user.client_id = client.client_id", $userid); + $this->client_service = $app->db->queryOneRecord("SELECT client.* FROM sys_user, client WHERE sys_user.userid = ? AND sys_user.client_id = client.client_id", $userid); // isn't service if(!$this->client_service) return false; diff --git a/interface/lib/classes/tform_base.inc.php b/interface/lib/classes/tform_base.inc.php index 3b82b48376a9f111e767633b63fae0874290431c..0b8a73858b293759058d1872a3a2b31ee3b5f4f8 100644 --- a/interface/lib/classes/tform_base.inc.php +++ b/interface/lib/classes/tform_base.inc.php @@ -155,6 +155,66 @@ class tform_base { $this->wordbook = $wb; + // load wordbook/lang files from addons + if($module == '') { + $lng_path = 'lib/lang.d'; + } else { + $lng_path = '../' . $module . '/lib/lang.d'; + } + if(($dir = opendir($lng_path))) { + $fallback_files = array(); + $use_files = array(); + while(false !== ($cur = readdir($dir))) { + $lng_file = $lng_path . '/' . $cur; + if(is_file($lng_file) && substr($cur, -strlen('.'.$this->formDef["name"].".lng")) === '.'.$this->formDef["name"].".lng") { + if(substr($cur, 0, 3) === 'en_') { + $fallback_files[] = $cur; + } elseif(substr($cur, 0, 3) === $app->functions->check_language($_SESSION["s"]["language"]) . '_') { + $use_files[] = $cur; + } + } + } + closedir($dir); + + foreach($fallback_files as $cur) { + $cur_lng = $app->functions->check_language($_SESSION["s"]["language"]) . '_' . substr($cur, 3); + if(in_array($cur_lng, $use_files, true) == false) { + $use_files[] = $cur; + } + } + unset($fallback_files); + + reset($use_files); + foreach($use_files as $cur) { + $lng_file = $lng_path . '/' . $cur; + + include $lng_file; + if(isset($wb) && is_array($wb)) { + $this->wordbook = $app->functions->array_merge($this->wordbook, $wb); + } + } + unset($use_files); + } + + if($module != '') { + // load tform files from addons + $tform_path = '../' . $module . '/lib/form.d'; + if(($dir = opendir($tform_path))) { + $tabs = null; + while(false !== ($cur = readdir($dir))) { + $tform_file = $tform_path . '/' . $cur; + if(is_file($tform_file) && substr($cur, -strlen('.'.$this->formDef["name"].".tform.php")) === '.'.$this->formDef["name"].".tform.php") { + unset($tabs); // just in case someone does not create a new array in the tform file + include($tform_file); + if(isset($tabs) && is_array($tabs) && !empty($tabs)) { + $this->tform['tabs'] = array_replace_recursive($this->tform['tabs'], $tabs); + } + } + } + closedir($dir); + } + } + $app->plugin->raiseEvent($_SESSION['s']['module']['name'].':'.$app->tform->formDef['name'] . ':on_after_formdef', $this); $this->dateformat = $app->lng('conf_format_dateshort'); diff --git a/interface/lib/classes/tools_monitor.inc.php b/interface/lib/classes/tools_monitor.inc.php index ce3ffca1eba13e81ab2565eb6665fb0e4da31201..1bb96f1699554c30b28e06b02f8c26dde7d676c4 100644 --- a/interface/lib/classes/tools_monitor.inc.php +++ b/interface/lib/classes/tools_monitor.inc.php @@ -504,39 +504,6 @@ class tools_monitor { return $html; } - function showMongoDB() { - global $app; - - /* fetch the Data from the DB */ - $record = $app->db->queryOneRecord("SELECT data, state FROM monitor_data WHERE type = 'log_mongodb' and server_id = ? ORDER BY created DESC", $_SESSION['monitor']['server_id']); - - if(isset($record['data'])) { - $html = - '
-
'; - - /* - * First, we have to detect, if there is any monitoring-data. - * If not (because mongodb is not installed) show this. - */ - $data = unserialize($record['data']); - if ($data == '') { - $html .= '

'. - 'MongoDB is not installed on this server.
' . - '

'; - } - else { - $html .= nl2br($data); - } - $html .= '
'; - - } else { - $html = '

There is no data available at the moment.

'; - } - - return $html; - } - function showIPTables() { global $app; $record = $app->db->queryOneRecord("SELECT data, state FROM monitor_data WHERE type = 'iptables_rules' and server_id = ? ORDER BY created DESC", $_SESSION['monitor']['server_id']); diff --git a/interface/lib/classes/validate_client.inc.php b/interface/lib/classes/validate_client.inc.php index 4652e2a07b1ddc65f5776a4538ec34d4ab382db4..20050d8cb5d77e94bc2a5b0cdbf4004d6fab9da4 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)) @@ -196,7 +193,7 @@ class validate_client { } */ - } catch(SoapFault $e) { + } catch(ISPConfigRemoteException $e) { //echo 'Error, see message: '.$e->faultstring; switch ($e->faultstring) { case 'INVALID_INPUT': @@ -215,7 +212,7 @@ class validate_client { break; } } - } catch(SoapFault $e){ + } catch(ISPConfigRemoteException $e){ // Connection to host not possible, europe.eu down? // this shouldn't be the user's fault, so we return no error } diff --git a/interface/lib/classes/validate_openvz.inc.php b/interface/lib/classes/validate_openvz.inc.php deleted file mode 100644 index 4aa1a709c7f28d9267cb734b9bd0ca51f3c968bf..0000000000000000000000000000000000000000 --- a/interface/lib/classes/validate_openvz.inc.php +++ /dev/null @@ -1,66 +0,0 @@ -tform->wordbook[$errmsg])) { - return $app->tform->wordbook[$errmsg].$additional."
\r\n"; - } else { - return $errmsg."
".$additional."
\r\n"; - } - } - - function check_custom($field_name, $field_value, $validator) { - $template = file('../vm/templates/openvz.conf.tpl', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); - $custom_array = explode("\n", $field_value); - $used_parameters = array(); - foreach ($template as $line) { - $line = trim ($line); - if (preg_match('/^[^#].*=\".*\"/', $line)) { - $line = explode('=', $line, 2); - $used_parameters[] = $line[0]; - } - } - foreach ($custom_array as $check) { - $check = trim(strtoupper($check)); - $check = explode('=', trim($check), 2); - $check = trim($check[0]); - if (in_array($check, $used_parameters)) { - return $this->get_error($validator['errmsg'], $check); - } - } - } - -} diff --git a/interface/lib/config.inc.php b/interface/lib/config.inc.php index 3c534f3f2144ec3e1d2af0b45b77f0b33fbf9d74..e5789ace37c8a3a95b1cfa994985684f163824cc 100644 --- a/interface/lib/config.inc.php +++ b/interface/lib/config.inc.php @@ -45,7 +45,7 @@ $revision = str_replace(array('Revision:', '$', ' '), '', $svn_revision); //** Application define('ISPC_APP_TITLE', 'ISPConfig'); -define('ISPC_APP_VERSION', '3.1dev'); +define('ISPC_APP_VERSION', '3.2.0dev'); define('DEVSYSTEM', 0); diff --git a/interface/lib/plugins/mail_mail_domain_plugin.inc.php b/interface/lib/plugins/mail_mail_domain_plugin.inc.php index e72c4aa06b2d8ce82fce9e895db40aba5f331a20..f90c6f961742aa99d8481278aa5f4cddb716be7e 100644 --- a/interface/lib/plugins/mail_mail_domain_plugin.inc.php +++ b/interface/lib/plugins/mail_mail_domain_plugin.inc.php @@ -88,14 +88,6 @@ class mail_mail_domain_plugin { } } - //* Update the mailinglist - $mailing_lists = $app->db->queryAllRecords("SELECT mailinglist_id FROM mail_mailinglist WHERE domain = ?", $page_form->oldDataRecord['domain']); - if(is_array($mailing_lists)) { - foreach($mailing_lists as $rec) { - $app->db->datalogUpdate('mail_mailinglist', array("sys_userid" => $client_user_id, "sys_groupid" => $sys_groupid), 'mailinglist_id', $rec['mailinglist_id']); - } - } - //* Update the mailget records $mail_gets = $app->db->queryAllRecords("SELECT mailget_id, destination FROM mail_get WHERE destination LIKE ?", "%@" . $page_form->oldDataRecord['domain']); if(is_array($mail_gets)) { diff --git a/interface/lib/plugins/mail_user_filter_plugin.inc.php b/interface/lib/plugins/mail_user_filter_plugin.inc.php index a4e973973e66629deca2949698168b4acf559801..b2d1c18ced8125e08a066945881e1d5dc05ac9fd 100644 --- a/interface/lib/plugins/mail_user_filter_plugin.inc.php +++ b/interface/lib/plugins/mail_user_filter_plugin.inc.php @@ -125,154 +125,84 @@ class mail_user_filter_plugin { $mailuser_rec = $app->db->queryOneRecord("SELECT server_id FROM mail_user WHERE mailuser_id = ?", $page_form->dataRecord["mailuser_id"]); $mail_config = $app->getconf->get_server_config($app->functions->intval($mailuser_rec["server_id"]), 'mail'); - if($mail_config['mail_filter_syntax'] == 'sieve') { - - // ####################################################### - // Filter in Sieve Syntax - // ####################################################### - - $content = ''; - $content .= '### BEGIN FILTER_ID:'.$page_form->id."\n"; - - //$content .= 'require ["fileinto", "regex", "vacation"];'."\n"; - - if($page_form->dataRecord["op"] == 'domain') { - $content .= 'if address :domain :is "'.strtolower($page_form->dataRecord["source"]).'" "'.$page_form->dataRecord["searchterm"].'" {'."\n"; - } elseif ($page_form->dataRecord["op"] == 'localpart') { - $content .= 'if address :localpart :is "'.strtolower($page_form->dataRecord["source"]).'" "'.$page_form->dataRecord["searchterm"].'" {'."\n"; - } elseif ($page_form->dataRecord["source"] == 'Size') { - if(substr(trim($page_form->dataRecord["searchterm"]),-1) == 'k' || substr(trim($page_form->dataRecord["searchterm"]),-1) == 'K') { - $unit = 'k'; - } else { - $unit = 'm'; - } - $content .= 'if size :over '.intval($page_form->dataRecord["searchterm"]).$unit.' {'."\n"; - } else { - if($page_form->dataRecord["source"] == 'Detail') { - $content .= 'if envelope :detail :regex "to" ["'; - } else { - if($page_form->dataRecord["source"] == 'Header') { - $parts = explode(':',trim($page_form->dataRecord["searchterm"])); - $page_form->dataRecord["source"] = trim($parts[0]); - unset($parts[0]); - $page_form->dataRecord["searchterm"] = trim(implode(':',$parts)); - unset($parts); - } - - $content .= 'if header :regex ["'.strtolower($page_form->dataRecord["source"]).'"] ["'; - } - - $searchterm = preg_quote($page_form->dataRecord["searchterm"]); - $searchterm = str_replace( - array( - '"', - '\\[', - '\\]' - ), - array( - '\\"', - '\\\\[', - '\\\\]' - ), $searchterm); - - if($page_form->dataRecord["op"] == 'contains') { - $content .= ".*".$searchterm; - } elseif ($page_form->dataRecord["op"] == 'is') { - $content .= "^".$searchterm."$"; - } elseif ($page_form->dataRecord["op"] == 'begins') { - $content .= "^".$searchterm.""; - } elseif ($page_form->dataRecord["op"] == 'ends') { - $content .= ".*".$searchterm."$"; - } - - $content .= '"] {'."\n"; - } - - if($page_form->dataRecord["action"] == 'move') { - $content .= ' fileinto "'.$page_form->dataRecord["target"].'";' . "\n stop;\n"; - } elseif ($page_form->dataRecord["action"] == 'keep') { - $content .= " keep;\n"; - } elseif ($page_form->dataRecord["action"] == 'stop') { - $content .= " stop;\n"; - } elseif ($page_form->dataRecord["action"] == 'reject') { - $content .= ' reject "'.$page_form->dataRecord["target"].'"; stop;\n\n'; - } elseif ($page_form->dataRecord["action"] == 'read') { - $content .= ' setflag "\\\\Seen";\n stop;\n'; + // ####################################################### + // Filter in Sieve Syntax + // ####################################################### + + $content = ''; + $content .= '### BEGIN FILTER_ID:'.$page_form->id."\n"; + + //$content .= 'require ["fileinto", "regex", "vacation"];'."\n"; + + if($page_form->dataRecord["op"] == 'domain') { + $content .= 'if address :domain :is "'.strtolower($page_form->dataRecord["source"]).'" "'.$page_form->dataRecord["searchterm"].'" {'."\n"; + } elseif ($page_form->dataRecord["op"] == 'localpart') { + $content .= 'if address :localpart :is "'.strtolower($page_form->dataRecord["source"]).'" "'.$page_form->dataRecord["searchterm"].'" {'."\n"; + } elseif ($page_form->dataRecord["source"] == 'Size') { + if(substr(trim($page_form->dataRecord["searchterm"]),-1) == 'k' || substr(trim($page_form->dataRecord["searchterm"]),-1) == 'K') { + $unit = 'k'; } else { - $content .= " discard;\n stop;\n"; + $unit = 'm'; } - - $content .= "}\n"; - - $content .= '### END FILTER_ID:'.$page_form->id."\n"; - + $content .= 'if size :over '.intval($page_form->dataRecord["searchterm"]).$unit.' {'."\n"; } else { + if($page_form->dataRecord["source"] == 'Detail') { + $content .= 'if envelope :detail :regex "to" ["'; + } else { + if($page_form->dataRecord["source"] == 'Header') { + $parts = explode(':',trim($page_form->dataRecord["searchterm"])); + $page_form->dataRecord["source"] = trim($parts[0]); + unset($parts[0]); + $page_form->dataRecord["searchterm"] = trim(implode(':',$parts)); + unset($parts); + } - // ####################################################### - // Filter in Maildrop Syntax - // ####################################################### - $content = ''; - $content .= '### BEGIN FILTER_ID:'.$page_form->id."\n"; - - $TargetNoQuotes = $page_form->dataRecord["target"]; - $TargetQuotes = "\"$TargetNoQuotes\""; - - $TestChDirNoQuotes = '$DEFAULT/.'.$TargetNoQuotes; - $TestChDirQuotes = "\"$TestChDirNoQuotes\""; - - $MailDirMakeNoQuotes = $TargetQuotes.' $DEFAULT'; - - $EchoTargetFinal = $TargetNoQuotes; - - - if($page_form->dataRecord["action"] == 'move') { - - $content .= " -`test -e ".$TestChDirQuotes." && exit 1 || exit 0` -if ( ".'$RETURNCODE'." != 1 ) -{ - `maildirmake -f $MailDirMakeNoQuotes` - `chmod -R 0700 ".$TestChDirQuotes."` - `echo \"INBOX.$EchoTargetFinal\" >> ".'$DEFAULT'."/courierimapsubscribed` -} -"; + $content .= 'if header :regex ["'.strtolower($page_form->dataRecord["source"]).'"] ["'; } - $content .= "if (/^".$page_form->dataRecord["source"].": "; - $searchterm = preg_quote($page_form->dataRecord["searchterm"]); + $searchterm = str_replace( + array( + '"', + '\\[', + '\\]' + ), + array( + '\\"', + '\\\\[', + '\\\\]' + ), $searchterm); if($page_form->dataRecord["op"] == 'contains') { - $content .= ".*".$searchterm."/:h)\n"; + $content .= ".*".$searchterm; } elseif ($page_form->dataRecord["op"] == 'is') { - $content .= $searchterm."$/:h)\n"; + $content .= "^".$searchterm."$"; } elseif ($page_form->dataRecord["op"] == 'begins') { - $content .= $searchterm."/:h)\n"; + $content .= "^".$searchterm.""; } elseif ($page_form->dataRecord["op"] == 'ends') { - $content .= ".*".$searchterm."$/:h)\n"; - } - - $content .= "{\n"; - $content .= "exception {\n"; - - if($page_form->dataRecord["action"] == 'move') { - $content .= 'ID' . "$page_form->id" . 'EndFolder = "$DEFAULT/.' . $page_form->dataRecord['target'] . '/"' . "\n"; - $content .= "xfilter \"/usr/bin/formail -A \\\"X-User-Mail-Filter-ID"."$page_form->id".": Yes\\\"\"" . "\n"; - $content .= "to ". '$ID' . "$page_form->id" . 'EndFolder' . "\n"; - } elseif ($page_form->dataRecord["action"] == 'read') { - $content .= ''; // mark as read currently not supported for Maildrop - } else { - $content .= "to /dev/null\n"; + $content .= ".*".$searchterm."$"; } - $content .= "}\n"; - $content .= "}\n"; + $content .= '"] {'."\n"; + } - //} + if($page_form->dataRecord["action"] == 'move') { + $content .= ' fileinto "'.$page_form->dataRecord["target"].'";' . "\n stop;\n"; + } elseif ($page_form->dataRecord["action"] == 'keep') { + $content .= " keep;\n"; + } elseif ($page_form->dataRecord["action"] == 'stop') { + $content .= " stop;\n"; + } elseif ($page_form->dataRecord["action"] == 'reject') { + $content .= ' reject "'.$page_form->dataRecord["target"].'"; stop;\n\n'; + } elseif ($page_form->dataRecord["action"] == 'read') { + $content .= ' setflag "\\\\Seen";\n stop;\n'; + } else { + $content .= " discard;\n stop;\n"; + } - $content .= '### END FILTER_ID:'.$page_form->id."\n"; + $content .= "}\n"; - } + $content .= '### END FILTER_ID:'.$page_form->id."\n"; return $content; } diff --git a/interface/lib/plugins/vm_openvz_plugin.inc.php b/interface/lib/plugins/vm_openvz_plugin.inc.php deleted file mode 100644 index 281fae4a1f62f69d48a0fc91cae3fdba05db2f7a..0000000000000000000000000000000000000000 --- a/interface/lib/plugins/vm_openvz_plugin.inc.php +++ /dev/null @@ -1,298 +0,0 @@ -plugin->registerEvent('vm:openvz_vm:on_after_insert', 'vm_openvz_plugin', 'openvz_vm_insert'); - $app->plugin->registerEvent('vm:openvz_vm:on_after_update', 'vm_openvz_plugin', 'openvz_vm_update'); - $app->plugin->registerEvent('vm:openvz_vm:on_after_delete', 'vm_openvz_plugin', 'openvz_vm_delete'); - } - - /* - Function that gets called after a new vm was inserted - */ - function openvz_vm_insert($event_name, $page_form) { - global $app, $conf; - - $this->id = $app->functions->intval($page_form->id); - $this->dataRecord = $page_form->dataRecord; - $this->oldDataRecord = $page_form->oldDataRecord; - - // make sure that the record belongs to the clinet 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 openvz_vm SET sys_groupid = ? WHERE vm_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 openvz_vm SET sys_groupid = ? WHERE vm_id = ?", $client_group_id, $this->id); - } - - // Set the VEID - $tmp = $app->db->queryOneRecord('SELECT MAX(veid) + 1 as newveid FROM openvz_vm'); - $veid = ($tmp['newveid'] > 100)?$tmp['newveid']:101; - $app->db->query("UPDATE openvz_vm SET veid = ? WHERE vm_id = ?", $veid, $this->id); - unset($tmp); - - // Apply template values to the advanced tab settings - $this->applyTemplate(); - - // Set the IP address - $app->db->query("UPDATE openvz_ip SET vm_id = ? WHERE ip_address = ?", $this->id, $this->dataRecord['ip_address']); - - // Set additional IPs - if (isset($this->dataRecord['additional_ip'])) { - $app->db->query("UPDATE openvz_ip SET vm_id = 0, additional = 'n' WHERE vm_id = ? AND additional='y'", $this->id); - foreach ($this->dataRecord['additional_ip'] as $idx => $rec) { - $app->db->query("UPDATE openvz_ip SET vm_id = ?, additional = 'y' WHERE ip_address = ?", $this->id, $rec); - } - } - - // Create the OpenVZ config file and store it in config field - $this->makeOpenVZConfig(); - - // Create the DNS record - $this->createDNS(); - - } - - /* - Function that gets called after a vm was updated - */ - function openvz_vm_update($event_name, $page_form) { - global $app, $conf; - - $this->id = $app->functions->intval($page_form->id); - $this->dataRecord = $page_form->dataRecord; - $this->oldDataRecord = $page_form->oldDataRecord; - - // make sure that the record belongs to the clinet group and not the admin group when a 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 openvz_vm SET sys_groupid = ? WHERE vm_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 openvz_vm SET sys_groupid = ? WHERE vm_id = ?", $client_group_id, $this->id); - } - - if(isset($this->dataRecord["ostemplate_id"]) && $this->oldDataRecord["ostemplate_id"] != $this->dataRecord["ostemplate_id"]) { - $this->applyTemplate(); - } - - // Set the IP address - if(isset($this->dataRecord['ip_address'])) { - $app->db->query("UPDATE openvz_ip SET vm_id = 0 WHERE vm_id = ? AND additional='n'", $this->id); - $app->db->query("UPDATE openvz_ip SET vm_id = ?, additional = 'n' WHERE ip_address = ?", $this->id, $this->dataRecord['ip_address']); - } - - // Set additional IPs - if (isset($this->dataRecord['additional_ip'])) { - $app->db->query("UPDATE openvz_ip SET vm_id = 0, additional = 'n' WHERE (vm_id = ? AND additional='y')", $this->id); - foreach ($this->dataRecord['additional_ip'] as $idx => $rec) { - $app->db->query("UPDATE openvz_ip SET vm_id = ?, additional = 'y' WHERE ip_address = ?", $this->id, $rec); - } - } - - // Create the OpenVZ config file and store it in config field - $this->makeOpenVZConfig(); - - // Create the DNS record - if((isset($this->dataRecord['hostname']) && $this->dataRecord['hostname'] != $this->oldDataRecord['hostname']) - or (isset($this->dataRecord['create_dns']) && $this->dataRecord['create_dns'] != $this->oldDataRecord['create_dns'])) { - $this->createDNS(); - } - - } - - function openvz_vm_delete($event_name, $page_form) { - global $app, $conf; - - //* Free the IP address - $tmp_rec = $app->db->queryAllRecords("SELECT ip_address_id FROM openvz_ip WHERE vm_id = ?", $page_form->id); - foreach ($tmp_rec as $tmp) { - $app->db->datalogUpdate('openvz_ip', array('vm_id' => 0), 'ip_address_id', $tmp['ip_address_id']); - } - } - - private function applyTemplate() { - global $app, $conf; - - $tpl = $app->db->queryOneRecord("SELECT * FROM openvz_template WHERE template_id = ?", $this->dataRecord["template_id"]); - - $sql = "UPDATE openvz_vm SET "; - $sql .= "diskspace = ?, "; - $sql .= "ram = ?, "; - $sql .= "ram_burst = ?, "; - $sql .= "cpu_units = ?, "; - $sql .= "cpu_num = ?, "; - $sql .= "cpu_limit = ?, "; - $sql .= "io_priority = ?, "; - $sql .= "nameserver = ?, "; - $sql .= "create_dns = ?, "; - $sql .= "capability = ?, "; - $sql .= "features = ?, "; - $sql .= "iptables = ? "; - $sql .= "custom = ? "; - $sql .= "WHERE vm_id = ?"; - $app->db->query($sql, $tpl['diskspace'], $tpl['ram'], $tpl['ram_burst'], $tpl['cpu_units'], $tpl['cpu_num'], $tpl['cpu_limit'], $tpl['io_priority'], $tpl['nameserver'], $tpl['create_dns'], $tpl['capability'], $tpl['features'], $tpl['iptables'], $tpl['custom'], $this->id); - - } - - private function makeOpenVZConfig() { - global $app, $conf; - - $vm = $app->db->queryOneRecord("SELECT * FROM openvz_vm WHERE vm_id = ?",$app->functions->intval($this->id)); - $vm_template = $app->db->queryOneRecord("SELECT * FROM openvz_template WHERE template_id = ?",$app->functions->intval($vm['template_id'])); - $burst_ram = $vm['ram_burst']*256; - $guar_ram = $vm['ram']*256; - - $app->load('tpl'); - $tpl = new tpl(); - $tpl->newTemplate('../vm/templates/openvz.conf.tpl'); - - $onboot = ($vm['start_boot'] == 'y')?'yes':'no'; - $tpl->setVar('onboot', $onboot); - - $tpl->setVar('bootorder', $vm['bootorder']); - $tpl->setVar('kmemsize', $vm_template['kmemsize']); - $tpl->setVar('lockedpages', $vm_template['lockedpages']); - $tpl->setVar('privvmpages', $burst_ram.':'.$burst_ram*1.0625); - $tpl->setVar('shmpages', $guar_ram.':'.$guar_ram); - $tpl->setVar('numproc', $vm_template['numproc']); - $tpl->setVar('physpages', $vm_template['physpages']); - $tpl->setVar('vmguarpages', $guar_ram.':unlimited'); - $tpl->setVar('oomguarpages', $guar_ram.':'.$guar_ram); - $tpl->setVar('numtcpsock', $vm_template['numtcpsock']); - $tpl->setVar('numflock', $vm_template['numflock']); - $tpl->setVar('numpty', $vm_template['numpty']); - $tpl->setVar('numsiginfo', $vm_template['numsiginfo']); - $tpl->setVar('tcpsndbuf', $vm_template['tcpsndbuf']); - $tpl->setVar('tcprcvbuf', $vm_template['tcprcvbuf']); - $tpl->setVar('othersockbuf', $vm_template['othersockbuf']); - $tpl->setVar('dgramrcvbuf', $vm_template['dgramrcvbuf']); - $tpl->setVar('numothersock', $vm_template['numothersock']); - $tpl->setVar('dcachesize', $vm_template['dcachesize']); - $tpl->setVar('numfile', $vm_template['numfile']); - $tpl->setVar('avnumproc', $vm_template['avnumproc']); - $tpl->setVar('numiptent', $vm_template['numiptent']); - $tpl->setVar('swappages', $vm_template['swappages']); - - $diskspace = $vm['diskspace']*1048576; - $diskinodes = $vm['diskspace']*524288; - - $tpl->setVar('diskspace', $diskspace.":".$diskspace); - $tpl->setVar('diskinodes', $diskinodes.":".$diskinodes); - $tpl->setVar('io_priority', $vm['io_priority']); - - $tpl->setVar('cpu_num', $vm['cpu_num']); - $tpl->setVar('cpu_units', $vm['cpu_units']); - $tpl->setVar('cpu_limit', $vm['cpu_limit']); - - $hostname = str_replace('{VEID}', $vm['veid'], $vm['hostname']); - - $tpl->setVar('hostname', $hostname); - - $additional_ips = $app->db->queryAllRecords("SELECT * FROM openvz_ip WHERE vm_id = ?",$this->id); - if (isset($additional_ips)) { - $vm['ip_address']=''; - foreach ($additional_ips as $ip) { - $vm['ip_address'] .= " ".$ip['ip_address']; - } - $vm['ip_address'] = substr($vm['ip_address'],1); - } - $tpl->setVar('ip_address', $vm['ip_address']); - - $tpl->setVar('ip_address', $vm['ip_address']); - $tpl->setVar('nameserver', $vm['nameserver']); - $tpl->setVar('capability', $vm['capability']); - $tpl->setVar('features', $vm['features']); - $tpl->setVar('iptables', $vm['iptables']); - - $tpl->setVar('custom', $vm['custom']); - - $tmp = $app->db->queryOneRecord("SELECT template_file FROM openvz_ostemplate WHERE ostemplate_id = ?", $app->functions->intval($vm['ostemplate_id'])); - $tpl->setVar('ostemplate', $tmp['template_file']); - unset($tmp); - - $openvz_config = $tpl->grab(); - $app->db->query("UPDATE openvz_vm SET config = ? WHERE vm_id = ?", $openvz_config, $app->functions->intval($this->id)); - - unset($tpl); - - } - - private function createDNS() { - global $app, $conf; - - $vm = $app->db->queryOneRecord("SELECT * FROM openvz_vm WHERE vm_id = ?", $app->functions->intval($this->id)); - - if($vm['create_dns'] != 'y') return; - - $full_hostname = str_replace('{VEID}', $vm['veid'], $vm['hostname']); - $hostname_parts = explode('.', $full_hostname); - $hostname = $hostname_parts[0]; - unset($hostname_parts[0]); - $zone = implode('.', $hostname_parts); - unset($hostname_parts); - - // Find the dns zone - $zone_rec = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE origin = ?", $zone); - $rr_rec = $app->db->queryOneRecord("SELECT * FROM dns_rr WHERE zone = ? AND name = ?", $zone_rec['id'], $hostname); - - if($zone_rec['id'] > 0) { - $ip_address = $vm['ip_address']; - $sys_userid = $app->functions->intval($zone_rec['sys_userid']); - $sys_groupid = $app->functions->intval($zone_rec['sys_groupid']); - $server_id = $app->functions->intval($zone_rec['server_id']); - $dns_soa_id = $app->functions->intval($zone_rec['id']); - - if($rr_rec['id'] > 0) { - $app->uses('validate_dns'); - $app->db->datalogUpdate('dns_rr', array("data" => $ip_address), 'id', $app->functions->intval($rr_rec['id'])); - $serial = $app->validate_dns->increase_serial($zone_rec['serial']); - $app->db->datalogUpdate('dns_soa', array("serial" => $serial), 'id', $app->functions->intval($zone_rec['id'])); - } else { - $insert_data = array( - "sys_userid" => $sys_userid, - "sys_groupid" => $sys_groupid, - "sys_perm_user" => 'riud', - "sys_perm_group" => 'riud', - "sys_perm_other" => '', - "server_id" => $server_id, - "zone" => $dns_soa_id, - "name" => $hostname, - "type" => @(preg_match("/^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/", $ip_address))?'A':'AAAA', - "data" => $ip_address, - "aux" => '0', - "ttl" => '3600', - "active" => 'Y' - ); - $dns_rr_id = $app->db->datalogInsert('dns_rr', $insert_data, 'id'); - } - - } - } - -} diff --git a/interface/lib/server_conf.master b/interface/lib/server_conf.master index 8fd54d9926967b1b3ec5b9759808e7262079439d..7e705935e6829e3327dd3d784a3779ffa1468f0f 100644 --- a/interface/lib/server_conf.master +++ b/interface/lib/server_conf.master @@ -21,6 +21,3 @@ module=generic [file] module=generic - -[vserver] -module=generic \ No newline at end of file diff --git a/interface/web/admin/form/server.tform.php b/interface/web/admin/form/server.tform.php index 95dca6c33b5cb552b29692b3c0f27f2e76924024..e28e3e34d85ef085e763c7d864c4be4d7d2797c8 100644 --- a/interface/web/admin/form/server.tform.php +++ b/interface/web/admin/form/server.tform.php @@ -102,18 +102,6 @@ $form["tabs"]['services'] = array ( 'default' => '0', 'value' => array(0 => 0, 1 => 1) ), - 'vserver_server' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'CHECKBOX', - '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..6bbfd79856814348053e26b2250b9988095547b7 100644 --- a/interface/web/admin/form/server_config.tform.php +++ b/interface/web/admin/form/server_config.tform.php @@ -331,7 +331,12 @@ $form["tabs"]['server'] = array( ), 'value' => '', 'width' => '40', - 'maxlength' => '255' + 'maxlength' => '255', + 'filters' => array( 0 => array( + 'event' => 'SAVE', + 'type' => 'TRIM' + ), + ) ), 'monit_user' => array( 'datatype' => 'VARCHAR', @@ -345,7 +350,12 @@ $form["tabs"]['server'] = array( 'default' => '', 'value' => '', 'width' => '40', - 'maxlength' => '255' + 'maxlength' => '255', + 'filters' => array( 0 => array( + 'event' => 'SAVE', + 'type' => 'TRIM' + ), + ) ), 'monit_password' => array( 'datatype' => 'VARCHAR', @@ -353,7 +363,12 @@ $form["tabs"]['server'] = array( 'default' => '', 'value' => '', 'width' => '40', - 'maxlength' => '255' + 'maxlength' => '255', + 'filters' => array( 0 => array( + 'event' => 'SAVE', + 'type' => 'TRIM' + ), + ) ), 'munin_url' => array( 'datatype' => 'VARCHAR', @@ -365,7 +380,12 @@ $form["tabs"]['server'] = array( ), 'value' => '', 'width' => '40', - 'maxlength' => '255' + 'maxlength' => '255', + 'filters' => array( 0 => array( + 'event' => 'SAVE', + 'type' => 'TRIM' + ), + ) ), 'munin_user' => array( 'datatype' => 'VARCHAR', @@ -379,7 +399,12 @@ $form["tabs"]['server'] = array( 'default' => '', 'value' => '', 'width' => '40', - 'maxlength' => '255' + 'maxlength' => '255', + 'filters' => array( 0 => array( + 'event' => 'SAVE', + 'type' => 'TRIM' + ), + ) ), 'munin_password' => array( 'datatype' => 'VARCHAR', @@ -387,7 +412,12 @@ $form["tabs"]['server'] = array( 'default' => '', 'value' => '', 'width' => '40', - 'maxlength' => '255' + 'maxlength' => '255', + 'filters' => array( 0 => array( + 'event' => 'SAVE', + 'type' => 'TRIM' + ), + ) ), 'nagios_url' => array( 'datatype' => 'VARCHAR', @@ -399,7 +429,12 @@ $form["tabs"]['server'] = array( ), 'value' => '', 'width' => '40', - 'maxlength' => '255' + 'maxlength' => '255', + 'filters' => array( 0 => array( + 'event' => 'SAVE', + 'type' => 'TRIM' + ), + ) ), 'nagios_user' => array( 'datatype' => 'VARCHAR', @@ -407,7 +442,12 @@ $form["tabs"]['server'] = array( 'default' => '', 'value' => '', 'width' => '40', - 'maxlength' => '255' + 'maxlength' => '255', + 'filters' => array( 0 => array( + 'event' => 'SAVE', + 'type' => 'TRIM' + ), + ) ), 'nagios_password' => array( 'datatype' => 'VARCHAR', @@ -415,7 +455,12 @@ $form["tabs"]['server'] = array( 'default' => '', 'value' => '', 'width' => '40', - 'maxlength' => '255' + 'maxlength' => '255', + 'filters' => array( 0 => array( + 'event' => 'SAVE', + 'type' => 'TRIM' + ), + ) ), 'monitor_system_updates' => array( 'datatype' => 'VARCHAR', @@ -494,6 +539,23 @@ $form["tabs"]['mail'] = array( 'width' => '40', 'maxlength' => '255' ), + 'content_filter' => array( + 'datatype' => 'VARCHAR', + 'formtype' => 'SELECT', + 'default' => 'rspamd', + 'value' => array('amavisd' => 'Amavisd', 'rspamd' => 'Rspamd') + ), + 'rspamd_password' => array( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'width' => '40', + 'maxlength' => '255', + 'filters' => array( 0 => array( 'event' => 'SAVE', + 'type' => 'TRIM'), + ), + ), 'dkim_path' => array( 'datatype' => 'VARCHAR', 'formtype' => 'TEXT', @@ -523,18 +585,6 @@ $form["tabs"]['mail'] = array( 'maxlength' => '255' ), - 'pop3_imap_daemon' => array( - 'datatype' => 'VARCHAR', - 'formtype' => 'SELECT', - 'default' => '20', - 'value' => array('courier' => 'Courier', 'dovecot' => 'Dovecot') - ), - 'mail_filter_syntax' => array( - 'datatype' => 'VARCHAR', - 'formtype' => 'SELECT', - 'default' => '20', - 'value' => array('maildrop' => 'Maildrop', 'sieve' => 'Sieve') - ), 'mailuser_uid' => array( 'datatype' => 'INTEGER', 'formtype' => 'TEXT', @@ -703,12 +753,6 @@ $form["tabs"]['mail'] = array( 'default' => 'n', 'value' => array(0 => 'n', 1 => 'y') ), - 'mailinglist_manager' => array( - 'datatype' => 'VARCHAR', - 'formtype' => 'SELECT', - 'default' => '20', - 'value' => array('mlmmj' => 'Mlmmj', 'mailman' => 'Mailman') - ), //################################# // ENDE Datatable fields //################################# @@ -1602,15 +1646,7 @@ $form["tabs"]['fastcgi'] = array( 'value' => '', 'width' => '40', 'maxlength' => '255' - ), - 'fastcgi_config_syntax' => array( - 'datatype' => 'INTEGER', - 'formtype' => 'SELECT', - 'default' => '2', - 'value' => array('1' => 'Old (apache 2.0)', '2' => 'New (apache 2.2)'), - 'width' => '40', - 'maxlength' => '255' - ), + ) //################################# // ENDE Datatable fields //################################# @@ -1618,104 +1654,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, @@ -1753,13 +1691,13 @@ $form["tabs"]['jailkit'] = array( 'maxlength' => '1000' ), 'jailkit_chroot_app_programs' => array( - 'datatype' => 'VARCHAR', + 'datatype' => 'TEXT', 'formtype' => 'TEXT', 'default' => '', 'validators' => array( 0 => array('type' => 'NOTEMPTY', 'errmsg' => 'jailkit_chroot_app_programs_error_empty'), 1 => array ( 'type' => 'REGEX', - 'regex' => '/^[a-zA-Z0-9\*\.\-\_\/\ ]{1,}$/', + 'regex' => '/^[a-zA-Z0-9\*\.\-\_\/\ \r\n]{1,}$/', 'errmsg'=> 'jailkit_chroot_app_programs_error_regex'), ), 'value' => '', @@ -1956,12 +1894,6 @@ $form["tabs"]['rescue'] = array( 'default' => 'n', 'value' => array(0 => 'n', 1 => 'y') ), - 'do_not_try_rescue_mongodb' => array( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOX', - 'default' => 'n', - 'value' => array(0 => 'n', 1 => 'y') - ), 'do_not_try_rescue_mysql' => array( 'datatype' => 'VARCHAR', 'formtype' => 'CHECKBOX', @@ -1979,4 +1911,10 @@ $form["tabs"]['rescue'] = array( //################################# ) ); -?> + +$mail_config = $app->getconf->get_server_config($conf['server_id'], 'mail'); +if(!isset($mail_config['rspamd_available']) || $mail_config['rspamd_available'] != 'y') { + $form['tabs']['mail']['fields']['content_filter']['default'] = 'amavisd'; + unset($form['tabs']['mail']['fields']['content_filter']['value']['rspamd']); + unset($form['tabs']['mail']['fields']['rspamd_password']); +} \ No newline at end of file diff --git a/interface/web/admin/form/system_config.tform.php b/interface/web/admin/form/system_config.tform.php index ea1ce1aaf773bc0cabb0e179c337e72a26af45ad..31a9b6bccff53fb04cd48ea6878d9d1e1c88475a 100644 --- a/interface/web/admin/form/system_config.tform.php +++ b/interface/web/admin/form/system_config.tform.php @@ -269,24 +269,6 @@ $form["tabs"]['mail'] = array ( 'width' => '30', 'maxlength' => '255' ), - 'mailmailinglist_link' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOX', - 'default' => 'n', - 'value' => array(0 => 'n', 1 => 'y') - ), - 'mailmailinglist_url' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'REGEX', - 'regex' => '/^[0-9a-zA-Z\:\/\-\.]{0,255}$/', - 'errmsg'=> 'mailinglist_url_error_regex'), - ), - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), 'admin_mail' => array ( 'datatype' => 'VARCHAR', 'filters' => array( 0 => array( 'event' => 'SAVE', diff --git a/interface/web/admin/lib/lang/de_server_config.lng b/interface/web/admin/lib/lang/de_server_config.lng index e3ac6988871a5612049edec159b0795325853602..f05d36b6cedcb5f35099ead6572780e6527fd508 100644 --- a/interface/web/admin/lib/lang/de_server_config.lng +++ b/interface/web/admin/lib/lang/de_server_config.lng @@ -299,4 +299,7 @@ $wb['log_retention_txt'] = 'Log retention (days)'; $wb['log_retention_error_ispositive'] = 'Log retention must be a number > 0'; $wb['php_default_name_txt'] = 'Beschreibung Standard PHP'; $wb['php_default_name_error_empty'] = 'Beschreibung Standard PHP ist leer.'; -?> +$wb['content_filter_txt'] = 'Content-Filter'; +$wb['rspamd_url_txt'] = 'Rspamd-URL'; +$wb['rspamd_user_txt'] = 'Rspamd-Benutzer'; +$wb['rspamd_password_txt'] = 'Rspamd-Passwort'; \ No newline at end of file diff --git a/interface/web/admin/lib/lang/en_server_config.lng b/interface/web/admin/lib/lang/en_server_config.lng index 7a960e552a3e2df861d67ac2de26079fe9929913..ce9d6e428f00eafdc55c07a433b42308b42797a2 100644 --- a/interface/web/admin/lib/lang/en_server_config.lng +++ b/interface/web/admin/lib/lang/en_server_config.lng @@ -301,4 +301,8 @@ $wb['log_retention_txt'] = 'Log retention (days)'; $wb['log_retention_error_ispositive'] = 'Log retention must be a number > 0'; $wb['php_default_name_txt'] = 'Description Default PHP-Version'; $wb['php_default_name_error_empty'] = 'Description Default PHP-Version must not be empty'; -?> +$wb['content_filter_txt'] = 'Content Filter'; +$wb['rspamd_url_txt'] = 'Rspamd URL'; +$wb['rspamd_user_txt'] = 'Rspamd User'; +$wb['rspamd_password_txt'] = 'Rspamd Password'; + diff --git a/interface/web/admin/list/server.list.php b/interface/web/admin/list/server.list.php index 58779eec9c6a1e84c9c175b78fc3824969b71c42..ee8f590021a14e2876605323be3e3b3afb7c72a8 100644 --- a/interface/web/admin/list/server.list.php +++ b/interface/web/admin/list/server.list.php @@ -100,23 +100,3 @@ $liste['item'][] = array( 'field' => 'db_server', 'suffix' => '%', 'width' => '', 'value' => array('1' => $app->lng('yes_txt'), '0' => $app->lng('no_txt'))); - -$liste['item'][] = array( 'field' => 'vserver_server', - 'datatype' => 'VARCHAR', - 'formtype' => 'SELECT', - 'op' => 'like', - 'prefix' => '%', - 'suffix' => '%', - '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/server_config_edit.php b/interface/web/admin/server_config_edit.php index e446bf3adde88b8b46ddef61e7f6f6df90916108..add6c84930dc2d6f922952d8254101fff0f4b664 100644 --- a/interface/web/admin/server_config_edit.php +++ b/interface/web/admin/server_config_edit.php @@ -52,6 +52,21 @@ $app->load('tform_actions'); class page_action extends tform_actions { + function onShow() { + global $app, $conf; + + // get the config + $app->uses('getconf'); + $web_config = $app->getconf->get_server_config($conf['server_id'], 'web'); + + if($web_config['server_type'] == 'nginx'){ + unset($app->tform->formDef["tabs"]["fastcgi"]); + unset($app->tform->formDef["tabs"]["vlogger"]); + } + + parent::onShow(); + } + function onShowEdit() { global $app, $conf; @@ -64,11 +79,19 @@ class page_action extends tform_actions { $server_id = $this->id; $this->dataRecord = $app->getconf->get_server_config($server_id, $section); + + $this->dataRecord['jailkit_chroot_app_programs'] = str_replace(' ', "\r\n", $this->dataRecord['jailkit_chroot_app_programs']); + + if($section == 'mail'){ + $server_config = $app->getconf->get_server_config($server_id, 'server'); + $rspamd_url = 'https://'.$server_config['hostname'].':8081/rspamd/'; + } } $record = $app->tform->getHTML($this->dataRecord, $this->active_tab, 'EDIT'); $record['id'] = $this->id; + if(isset($rspamd_url)) $record['rspamd_url'] = $rspamd_url; $app->tpl->setVar($record); } @@ -101,6 +124,20 @@ class page_action extends tform_actions { } } + if(isset($this->dataRecord['jailkit_chroot_app_programs'])) { + $app->uses('file'); + $jailkit_chroot_app_programs = $this->dataRecord['jailkit_chroot_app_programs']; + $jailkit_chroot_app_programs = $app->file->unix_nl($jailkit_chroot_app_programs); + $jailkit_chroot_app_programs = explode("\n", $jailkit_chroot_app_programs); + $jailkit_chroot_app_programs = array_unique($jailkit_chroot_app_programs); + foreach ($jailkit_chroot_app_programs as $key => $value) { + if (trim($value)=='') { + unset($jailkit_chroot_app_programs[$key]); + } + } + $this->dataRecord['jailkit_chroot_app_programs'] = implode(' ', $jailkit_chroot_app_programs); + } + if($app->tform->errorMessage == '') { $server_config_array[$section] = $app->tform->encode($this->dataRecord, $section); $server_config_str = $app->ini_parser->get_ini_string($server_config_array); @@ -112,6 +149,49 @@ class page_action extends tform_actions { } } + function onAfterUpdate() { + global $app; + + if(isset($this->dataRecord['content_filter'])){ + $app->uses('ini_parser'); + $old_config = $app->ini_parser->parse_ini_string(stripslashes($this->oldDataRecord['config'])); + if($this->dataRecord['content_filter'] == 'rspamd' && $old_config['mail']['content_filter'] != $this->dataRecord['content_filter']){ + + $spamfilter_users = $app->db->queryAllRecords("SELECT * FROM spamfilter_users WHERE server_id = ?", intval($this->id)); + if(is_array($spamfilter_users) && !empty($spamfilter_users)){ + foreach($spamfilter_users as $spamfilter_user){ + $app->db->datalogUpdate('spamfilter_users', $spamfilter_user, 'id', $spamfilter_user["id"], true); + } + } + + $spamfilter_wblists = $app->db->queryAllRecords("SELECT * FROM spamfilter_wblist WHERE server_id = ?", intval($this->id)); + if(is_array($spamfilter_wblists) && !empty($spamfilter_wblists)){ + foreach($spamfilter_wblists as $spamfilter_wblist){ + $app->db->datalogUpdate('spamfilter_wblist', $spamfilter_wblist, 'wblist_id', $spamfilter_wblist["wblist_id"], true); + } + } + + $mail_users = $app->db->queryAllRecords("SELECT * FROM mail_user WHERE server_id = ? AND (autoresponder = 'y' OR move_junk = 'y')", intval($this->id)); + if(is_array($mail_users) && !empty($mail_users)){ + foreach($mail_users as $mail_user){ + if($mail_user['autoresponder'] == 'y'){ + $mail_user['autoresponder'] = 'n'; + $app->db->datalogUpdate('mail_user', $mail_user, 'mailuser_id', $mail_user["mailuser_id"], true); + $mail_user['autoresponder'] = 'y'; + $app->db->datalogUpdate('mail_user', $mail_user, 'mailuser_id', $mail_user["mailuser_id"], true); + } else { + $mail_user['move_junk'] = 'n'; + $app->db->datalogUpdate('mail_user', $mail_user, 'mailuser_id', $mail_user["mailuser_id"], true); + $mail_user['move_junk'] = 'y'; + $app->db->datalogUpdate('mail_user', $mail_user, 'mailuser_id', $mail_user["mailuser_id"], true); + } + + } + } + } + } + } + } $app->tform_actions = new page_action; diff --git a/interface/web/admin/templates/server_config_fastcgi_edit.htm b/interface/web/admin/templates/server_config_fastcgi_edit.htm index c36b482e725b69399afc657065c3b0ade563ca02..db476a091c4fc687df9e01dd86c6ffcaa5b4135e 100644 --- a/interface/web/admin/templates/server_config_fastcgi_edit.htm +++ b/interface/web/admin/templates/server_config_fastcgi_edit.htm @@ -26,12 +26,6 @@
-
- -
-
diff --git a/interface/web/admin/templates/server_config_jailkit_edit.htm b/interface/web/admin/templates/server_config_jailkit_edit.htm index b7a749147654c6fab6105400cafb7ec691d980c8..47416797a02d6ba4af45069bccf42f5d0ad8924e 100644 --- a/interface/web/admin/templates/server_config_jailkit_edit.htm +++ b/interface/web/admin/templates/server_config_jailkit_edit.htm @@ -13,7 +13,7 @@
-
+
@@ -24,4 +24,4 @@
-
+ \ No newline at end of file diff --git a/interface/web/admin/templates/server_config_mail_edit.htm b/interface/web/admin/templates/server_config_mail_edit.htm index 1e01dc760be7c5f74d2714f9cd202ce1fc1ba64e..0cbef290216079dfaa379ac2bece98e3d5ad0577 100644 --- a/interface/web/admin/templates/server_config_mail_edit.htm +++ b/interface/web/admin/templates/server_config_mail_edit.htm @@ -32,18 +32,20 @@ {tmpl_var name='dkim_strength'} -
- -
+ {tmpl_var name='content_filter'}
-
- -
+
+ +
+
+ +
+
@@ -117,12 +119,6 @@ {tmpl_var name='overquota_notify_onok'}
-
- -
-
@@ -131,3 +127,24 @@ + + diff --git a/interface/web/admin/templates/server_config_rescue_edit.htm b/interface/web/admin/templates/server_config_rescue_edit.htm index df8aa97c0714ce4e5ac94a73e978c8a2e71d1f03..855ca877ee2586122c00d508298d33a221eadf49 100644 --- a/interface/web/admin/templates/server_config_rescue_edit.htm +++ b/interface/web/admin/templates/server_config_rescue_edit.htm @@ -17,14 +17,6 @@ {tmpl_var name='do_not_try_rescue_httpd'} -
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_use_ipv6'} -
-
-
- -
- -
-
- -
- -
- -
-
- -
- -
-
-
-

{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..cfcc2fb8b2829a65c98b23c0940675ac1e39b019 100644 --- a/interface/web/admin/templates/server_edit_services.htm +++ b/interface/web/admin/templates/server_edit_services.htm @@ -4,7 +4,7 @@

- + {tmpl_hook name="begin_form"}
@@ -38,19 +38,9 @@ {tmpl_var name='db_server'}
-
- -
- {tmpl_var name='vserver_server'} -
-
-
- -
- {tmpl_var name='xmpp_server'} -
-
- + {tmpl_hook name="field_db_server"} + {tmpl_hook name="end_service_fields"} +
- + {tmpl_hook name="end_form"} diff --git a/interface/web/admin/templates/server_list.htm b/interface/web/admin/templates/server_list.htm index 1152909320f758d7e9fbe086296a4c1e7255c46b..25c18c01f0ac226da2ed356bfe310f8def146270 100644 --- a/interface/web/admin/templates/server_list.htm +++ b/interface/web/admin/templates/server_list.htm @@ -15,8 +15,7 @@ - - + {tmpl_hook name="end_table_headers"} {tmpl_var name='search_limit'} @@ -26,11 +25,10 @@ - - + {tmpl_hook name="end_table_filters"} - + "} @@ -42,8 +40,7 @@ {tmpl_var name="dns_server"} {tmpl_var name="file_server"} {tmpl_var name="db_server"} - {tmpl_var name="vserver_server"} - {tmpl_var name="xmpp_server"} + {tmpl_hook name="end_table_columns"} diff --git a/interface/web/admin/templates/system_config_mail_edit.htm b/interface/web/admin/templates/system_config_mail_edit.htm index e29c5f44282d004e28ff5989c5b471025789d588..ae5fbc4d0a4681f743311fc169f77dd11fdd9359 100644 --- a/interface/web/admin/templates/system_config_mail_edit.htm +++ b/interface/web/admin/templates/system_config_mail_edit.htm @@ -45,15 +45,6 @@
 {tmpl_var name='webmail_url_note_txt'} [SERVERNAME]
-
- -
- {tmpl_var name='mailmailinglist_link'} -
-
-
- -
diff --git a/interface/web/client/client_del.php b/interface/web/client/client_del.php index 2bddd02a0750294de606cb335e7710987c585f15..58ee7cf093d4b89165c1d7690c61aa50de5658c3 100644 --- a/interface/web/client/client_del.php +++ b/interface/web/client/client_del.php @@ -128,7 +128,7 @@ class page_action extends tform_actions { $app->db->query("DELETE FROM sys_user WHERE client_id = ?", $client_id); // Delete all records (sub-clients, mail, web, etc....) of this client. - $tables = 'cron,client,dns_rr,dns_soa,dns_slave,ftp_user,mail_access,mail_content_filter,mail_domain,mail_forwarding,mail_get,mail_user,mail_user_filter,shell_user,spamfilter_users,support_message,web_database,web_database_user,web_domain,web_folder,web_folder_user,domain,mail_mailinglist,spamfilter_wblist'; + $tables = 'cron,client,dns_rr,dns_soa,dns_slave,ftp_user,mail_access,mail_content_filter,mail_domain,mail_forwarding,mail_get,mail_user,mail_user_filter,shell_user,spamfilter_users,support_message,web_database,web_database_user,web_domain,web_folder,web_folder_user,domain,spamfilter_wblist'; $tables_array = explode(',', $tables); $client_group_id = $app->functions->intval($client_group['groupid']); if($client_group_id > 1) { diff --git a/interface/web/client/client_edit.php b/interface/web/client/client_edit.php index 8577a1b32d94a5c1e27de0c622495d3f0b4ca2be..0d06a42fe2956554eeb93d299c8784bd3c6d55b5 100644 --- a/interface/web/client/client_edit.php +++ b/interface/web/client/client_edit.php @@ -438,7 +438,6 @@ class page_action extends tform_actions { 'mail_user_smtp' => 'mailuser_id', 'mail_forwarding' => 'forwarding_id', 'mail_get' => 'mailget_id', - 'openvz_vm' => 'vm_id', 'shell_user' => 'shell_user_id', 'webdav_user' => 'webdav_user_id', 'web_database' => 'database_id', @@ -446,6 +445,11 @@ class page_action extends tform_actions { 'web_folder' => 'web_folder_id', 'web_folder_user' => 'web_folder_user_id' ); + + $addons_disable = $app->plugin->raiseEvent('client::get_lockable_data', $this->id, true); + if(is_array($addons_disable) && !empty($addons_disable)) { + $to_disable = array_merge($to_disable, $addons_disable); + } $udata = $app->db->queryOneRecord('SELECT `userid` FROM `sys_user` WHERE `client_id` = ?', $this->id); $gdata = $app->db->queryOneRecord('SELECT `groupid` FROM `sys_group` WHERE `client_id` = ?', $this->id); diff --git a/interface/web/client/form/client.tform.php b/interface/web/client/form/client.tform.php index 09db5c1ff660c9b06bbc2b25b308b23a18d19dc5..b272fcbe264ad6d9befd0840c7ef93eea3038683 100644 --- a/interface/web/client/form/client.tform.php +++ b/interface/web/client/form/client.tform.php @@ -784,20 +784,6 @@ $form["tabs"]['limits'] = array ( 'rows' => '', 'cols' => '' ), - 'limit_mailmailinglist' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_mailmailinglist_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), 'limit_mailforward' => array ( 'datatype' => 'INTEGER', 'formtype' => 'TEXT', @@ -924,118 +910,7 @@ $form["tabs"]['limits'] = array ( 'rows' => '', 'cols' => '' ), - 'default_xmppserver' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'SELECT', - 'default' => '1', - 'datasource' => array ( 'type' => 'CUSTOM', - 'class'=> 'custom_datasource', - 'function'=> 'client_servers' - ), - 'value' => '', - 'name' => 'default_xmppserver' - ), - 'xmpp_servers' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'MULTIPLE', - 'separator' => ',', - 'default' => '1', - 'datasource' => array ( 'type' => 'CUSTOM', - 'class'=> 'custom_datasource', - 'function'=> 'client_servers' - ), - 'validators' => array ( - 0 => array ( 'type' => 'CUSTOM', - 'class' => 'validate_client', - 'function' => 'check_used_servers', - 'errmsg'=> 'xmpp_servers_used'), - ), - 'value' => '', - 'name' => 'xmpp_servers' - ), - 'limit_xmpp_domain' => array( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_xmpp_domain_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_xmpp_user' => array( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_xmpp_user_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_xmpp_muc' => array( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOX', - 'default' => 'n', - 'value' => array(0 => 'n', 1 => 'y') - ), - 'limit_xmpp_anon' => array( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOX', - 'default' => 'n', - 'value' => array(0 => 'n', 1 => 'y') - ), - 'limit_xmpp_vjud' => array( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOX', - 'default' => 'n', - 'value' => array(0 => 'n', 1 => 'y') - ), - 'limit_xmpp_proxy' => array( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOX', - 'default' => 'n', - 'value' => array(0 => 'n', 1 => 'y') - ), - 'limit_xmpp_status' => array( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOX', - 'default' => 'n', - 'value' => array(0 => 'n', 1 => 'y') - ), - 'limit_xmpp_webpresence' => array( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOX', - 'default' => 'n', - 'value' => array(0 => 'n', 1 => 'y') - ), - 'limit_xmpp_http_upload' => array( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOX', - 'default' => 'n', - 'value' => array(0 => 'n', 1 => 'y') - ), - 'limit_xmpp_pastebin' => array( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOX', - 'default' => 'n', - 'value' => array(0 => 'n', 1 => 'y') - ), - 'limit_xmpp_httparchive' => array( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOX', - 'default' => 'n', - 'value' => array(0 => 'n', 1 => 'y') - ), - 'default_webserver' => array ( + 'default_webserver' => array ( 'datatype' => 'INTEGER', 'formtype' => 'SELECT', 'default' => '1', @@ -1468,31 +1343,6 @@ $form["tabs"]['limits'] = array ( 'rows' => '', 'cols' => '' ), - 'limit_openvz_vm' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_openvz_vm_error_notint'), - ), - 'default' => '0', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_openvz_vm_template_id' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'SELECT', - 'default' => '', - 'datasource' => array ( 'type' => 'SQL', - 'querystring' => 'SELECT template_id,template_name FROM openvz_template WHERE 1 ORDER BY template_name', - 'keyfield'=> 'template_id', - 'valuefield'=> 'template_name' - ), - 'value' => array(0 => ' ') - ), 'limit_aps' => array ( 'datatype' => 'INTEGER', 'formtype' => 'TEXT', diff --git a/interface/web/client/form/client_template.tform.php b/interface/web/client/form/client_template.tform.php index 2196ad4d0f7eb3474eca7e81308558a0523d4d57..b6dc1b202a970f9e9b4e019688667645c0745c11 100644 --- a/interface/web/client/form/client_template.tform.php +++ b/interface/web/client/form/client_template.tform.php @@ -200,20 +200,6 @@ $form["tabs"]['limits'] = array ( 'rows' => '', 'cols' => '' ), - 'limit_mailmailinglist' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_mailmailinglist_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), 'limit_mailforward' => array ( 'datatype' => 'INTEGER', 'formtype' => 'TEXT', @@ -339,118 +325,8 @@ $form["tabs"]['limits'] = array ( 'maxlength' => '10', 'rows' => '', 'cols' => '' - ),/* - 'default_xmppserver' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'SELECT', - 'default' => '1', - 'datasource' => array ( 'type' => 'CUSTOM', - 'class'=> 'custom_datasource', - 'function'=> 'client_servers' - ), - 'value' => '', - 'name' => 'default_xmppserver' - ),*/ - 'xmpp_servers' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'MULTIPLE', - 'separator' => ',', - 'default' => '1', - 'datasource' => array ( 'type' => 'CUSTOM', - 'class'=> 'custom_datasource', - 'function'=> 'client_servers' - ), - 'validators' => array ( - 0 => array ( 'type' => 'CUSTOM', - 'class' => 'validate_client', - 'function' => 'check_used_servers', - 'errmsg'=> 'xmpp_servers_used'), - ), - 'value' => '', - 'name' => 'xmpp_servers' - ), - 'limit_xmpp_domain' => array( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_xmpp_domain_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_xmpp_user' => array( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_xmpp_user_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_xmpp_muc' => array( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOX', - 'default' => 'n', - 'value' => array(0 => 'n', 1 => 'y') - ), - 'limit_xmpp_anon' => array( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOX', - 'default' => 'n', - 'value' => array(0 => 'n', 1 => 'y') - ), - 'limit_xmpp_vjud' => array( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOX', - 'default' => 'n', - 'value' => array(0 => 'n', 1 => 'y') - ), - 'limit_xmpp_proxy' => array( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOX', - 'default' => 'n', - 'value' => array(0 => 'n', 1 => 'y') - ), - 'limit_xmpp_status' => array( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOX', - 'default' => 'n', - 'value' => array(0 => 'n', 1 => 'y') - ), - 'limit_xmpp_webpresence' => array( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOX', - 'default' => 'n', - 'value' => array(0 => 'n', 1 => 'y') - ), - 'limit_xmpp_http_upload' => array( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOX', - 'default' => 'n', - 'value' => array(0 => 'n', 1 => 'y') - ), - 'limit_xmpp_pastebin' => array( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOX', - 'default' => 'n', - 'value' => array(0 => 'n', 1 => 'y') - ), - 'limit_xmpp_httparchive' => array( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOX', - 'default' => 'n', - 'value' => array(0 => 'n', 1 => 'y') - ),/* + ), + /* 'default_webserver' => array ( 'datatype' => 'INTEGER', 'formtype' => 'SELECT', @@ -872,31 +748,6 @@ $form["tabs"]['limits'] = array ( 'rows' => '', 'cols' => '' ), - 'limit_openvz_vm' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_openvz_vm_error_notint'), - ), - 'default' => '0', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_openvz_vm_template_id' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'SELECT', - 'default' => '', - 'datasource' => array ( 'type' => 'SQL', - 'querystring' => 'SELECT template_id,template_name FROM openvz_template WHERE 1 ORDER BY template_name', - 'keyfield'=> 'template_id', - 'valuefield'=> 'template_name' - ), - 'value' => array(0 => ' ') - ), 'limit_aps' => array ( 'datatype' => 'INTEGER', 'formtype' => 'TEXT', diff --git a/interface/web/client/form/reseller.tform.php b/interface/web/client/form/reseller.tform.php index d5c22e206b84054c93106d1a06c205d6b2c94710..53acfd602e872ca0448949cc34cbba275e658ccc 100644 --- a/interface/web/client/form/reseller.tform.php +++ b/interface/web/client/form/reseller.tform.php @@ -740,20 +740,6 @@ $form["tabs"]['limits'] = array ( 'rows' => '', 'cols' => '' ), - 'limit_mailmailinglist' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_mailmailinglist_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), 'limit_mailbox' => array ( 'datatype' => 'INTEGER', 'formtype' => 'TEXT', @@ -922,118 +908,7 @@ $form["tabs"]['limits'] = array ( 'rows' => '', 'cols' => '' ), - 'default_xmppserver' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'SELECT', - 'default' => '1', - 'datasource' => array ( 'type' => 'CUSTOM', - 'class'=> 'custom_datasource', - 'function'=> 'client_servers' - ), - 'value' => '', - 'name' => 'default_xmppserver' - ), - 'xmpp_servers' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'MULTIPLE', - 'separator' => ',', - 'default' => '1', - 'datasource' => array ( 'type' => 'CUSTOM', - 'class'=> 'custom_datasource', - 'function'=> 'client_servers' - ), - 'validators' => array ( - 0 => array ( 'type' => 'CUSTOM', - 'class' => 'validate_client', - 'function' => 'check_used_servers', - 'errmsg'=> 'xmpp_servers_used'), - ), - 'value' => '', - 'name' => 'xmpp_servers' - ), - 'limit_xmpp_domain' => array( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_xmpp_domain_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_xmpp_user' => array( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_xmpp_user_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_xmpp_muc' => array( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOX', - 'default' => 'n', - 'value' => array(0 => 'n', 1 => 'y') - ), - 'limit_xmpp_anon' => array( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOX', - 'default' => 'n', - 'value' => array(0 => 'n', 1 => 'y') - ), - 'limit_xmpp_vjud' => array( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOX', - 'default' => 'n', - 'value' => array(0 => 'n', 1 => 'y') - ), - 'limit_xmpp_proxy' => array( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOX', - 'default' => 'n', - 'value' => array(0 => 'n', 1 => 'y') - ), - 'limit_xmpp_status' => array( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOX', - 'default' => 'n', - 'value' => array(0 => 'n', 1 => 'y') - ), - 'limit_xmpp_webpresence' => array( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOX', - 'default' => 'n', - 'value' => array(0 => 'n', 1 => 'y') - ), - 'limit_xmpp_http_upload' => array( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOX', - 'default' => 'n', - 'value' => array(0 => 'n', 1 => 'y') - ), - 'limit_xmpp_pastebin' => array( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOX', - 'default' => 'n', - 'value' => array(0 => 'n', 1 => 'y') - ), - 'limit_xmpp_httparchive' => array( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOX', - 'default' => 'n', - 'value' => array(0 => 'n', 1 => 'y') - ), - 'default_webserver' => array ( + 'default_webserver' => array ( 'datatype' => 'INTEGER', 'formtype' => 'SELECT', 'default' => '1', @@ -1467,31 +1342,6 @@ $form["tabs"]['limits'] = array ( 'rows' => '', 'cols' => '' ), - 'limit_openvz_vm' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_openvz_vm_error_notint'), - ), - 'default' => '0', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_openvz_vm_template_id' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'SELECT', - 'default' => '', - 'datasource' => array ( 'type' => 'SQL', - 'querystring' => 'SELECT template_id,template_name FROM openvz_template WHERE 1 ORDER BY template_name', - 'keyfield'=> 'template_id', - 'valuefield'=> 'template_name' - ), - 'value' => array(0 => ' ') - ), 'limit_aps' => array ( 'datatype' => 'INTEGER', 'formtype' => 'TEXT', diff --git a/interface/web/client/templates/client_edit_limits.htm b/interface/web/client/templates/client_edit_limits.htm index 83ba88d12dbac2f0fd06cdbbd6dc7b6284eeb136..16cd1fc201a043ccda0b77a503ad2046fafc2aea 100644 --- a/interface/web/client/templates/client_edit_limits.htm +++ b/interface/web/client/templates/client_edit_limits.htm @@ -207,9 +207,6 @@
-
- -
@@ -242,91 +239,7 @@ -
- -
-
-
- -
-
-
- -
-
- -
- -
- -
- {tmpl_var name='limit_xmpp_muc'} -
-
-
- -
- {tmpl_var name='limit_xmpp_pastebin'} -
-
-
- -
- {tmpl_var name='limit_xmpp_httparchive'} -
-
-
- -
- {tmpl_var name='limit_xmpp_anon'} -
-
-
- -
- {tmpl_var name='limit_xmpp_vjud'} -
-
-
- -
- {tmpl_var name='limit_xmpp_proxy'} -
-
-
- -
- {tmpl_var name='limit_xmpp_status'} -
-
-
- -
- {tmpl_var name='limit_xmpp_webpresence'} -
-
-
- -
- {tmpl_var name='limit_xmpp_http_upload'} -
-
-
-
-
+
-
- -
-
-
- -
-
- -
-
-
-
-
+ {tmpl_hook name="end_form"} diff --git a/interface/web/client/templates/client_template_edit_limits.htm b/interface/web/client/templates/client_template_edit_limits.htm index 4e10891c97a9a505d8d9d2a56e32159f122d086d..abaf65aad71bdd6c96dbc3e3ffff4ea3dba12199 100644 --- a/interface/web/client/templates/client_template_edit_limits.htm +++ b/interface/web/client/templates/client_template_edit_limits.htm @@ -165,9 +165,6 @@
-
- -
@@ -200,91 +197,6 @@ -
- -
-
-
- -
-
-
- -
-
- -
- -
- -
- {tmpl_var name='limit_xmpp_muc'} -
-
-
- -
- {tmpl_var name='limit_xmpp_pastebin'} -
-
-
- -
- {tmpl_var name='limit_xmpp_httparchive'} -
-
-
- -
- {tmpl_var name='limit_xmpp_anon'} -
-
-
- -
- {tmpl_var name='limit_xmpp_vjud'} -
-
-
- -
- {tmpl_var name='limit_xmpp_proxy'} -
-
-
- -
- {tmpl_var name='limit_xmpp_status'} -
-
-
- -
- {tmpl_var name='limit_xmpp_webpresence'} -
-
-
- -
- {tmpl_var name='limit_xmpp_http_upload'} -
-
-
-
-
-
- -
-
-
- -
-
- -
-
-
-
-
+ {tmpl_hook name="end_form"}
diff --git a/interface/web/client/templates/reseller_edit_limits.htm b/interface/web/client/templates/reseller_edit_limits.htm index 87691e3d2ef2f7a02ff129c5fc232007f380a7db..539b7d5e4107204e1490f134e37123e1b834d706 100644 --- a/interface/web/client/templates/reseller_edit_limits.htm +++ b/interface/web/client/templates/reseller_edit_limits.htm @@ -209,9 +209,6 @@
-
- -
@@ -244,91 +241,7 @@
-
- -
-
-
- -
-
-
- -
-
- -
- -
- -
- {tmpl_var name='limit_xmpp_muc'} -
-
-
- -
- {tmpl_var name='limit_xmpp_pastebin'} -
-
-
- -
- {tmpl_var name='limit_xmpp_httparchive'} -
-
-
- -
- {tmpl_var name='limit_xmpp_anon'} -
-
-
- -
- {tmpl_var name='limit_xmpp_vjud'} -
-
-
- -
- {tmpl_var name='limit_xmpp_proxy'} -
-
-
- -
- {tmpl_var name='limit_xmpp_status'} -
-
-
- -
- {tmpl_var name='limit_xmpp_webpresence'} -
-
-
- -
- {tmpl_var name='limit_xmpp_http_upload'} -
-
-
-
-
+
-
- -
-
-
- -
-
- -
-
-
-
-
+ {tmpl_hook name="end_form"}
diff --git a/interface/web/mail/templates/spamfilter_policy_list.htm b/interface/web/mail/templates/spamfilter_policy_list.htm index da1183d75f9af0dcbf526e0ac68cb400c33d6942..84b1a04403cacd0586936c5221057d7be94bfdb5 100644 --- a/interface/web/mail/templates/spamfilter_policy_list.htm +++ b/interface/web/mail/templates/spamfilter_policy_list.htm @@ -19,16 +19,20 @@ + + {tmpl_var name='search_limit'} + + @@ -40,8 +44,10 @@ {tmpl_var name="policy_name"} {tmpl_var name="virus_lover"} {tmpl_var name="spam_lover"} + {tmpl_var name="banned_files_lover"} {tmpl_var name="bad_header_lover"} + @@ -49,17 +55,17 @@ - {tmpl_var name='globalsearch_noresults_text_txt'} + {tmpl_var name='globalsearch_noresults_text_txt'} - +
- \ No newline at end of file + diff --git a/interface/web/mail/templates/spamfilter_taglevel_edit.htm b/interface/web/mail/templates/spamfilter_taglevel_edit.htm index ba92662ba6f1b96a138dc0afcfc43136eac68cf3..73fd4e6ac42bd2b049427c0f45352edeb90dab8e 100644 --- a/interface/web/mail/templates/spamfilter_taglevel_edit.htm +++ b/interface/web/mail/templates/spamfilter_taglevel_edit.htm @@ -4,7 +4,7 @@

- +
@@ -32,6 +32,33 @@
+
+ +
+ +
+ {tmpl_var name='rspamd_greylisting'} +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
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 @@ - -

- - - - -
- - -
- - - -
-
-
- -
- -
-
-
- - - - -
- - -
- - - -
-
-
-
-
- - - -
- -
-
-
-
- -
- - -
- -
readonly="readonly"/>
-
- - - - - - - -
- -
- -
-
- -
- -
-
-
- -
-
-
- -
- -
-
- - -
- -
- {tmpl_var name='active'} -
-
- - - -
- - -
- 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 @@ - -

- - - -
- -
- {tmpl_var name='use_anon_host'} -
-
-
-
- -
- {tmpl_var name='use_pubsub'} -
-
- -
- -
- {tmpl_var name='use_vjud'} -
-
-
- -
-
-
- -
- -
- {tmpl_var name='use_proxy'} -
-
-
- -
- -
- {tmpl_var name='use_status_host'} -
-
-
- - -
- -
- {tmpl_var name='use_webpresence'} - {tmpl_var name='xmpp_daemon'} -
-
-
- - -
- -
- {tmpl_var name='use_http_upload'} -
-
-
- - - - - -
- - -
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 @@ - -

- - - -
- -
- {tmpl_var name='use_muc_host'} -
-
- -
-
- -
- -
-
- -
- -
-
-
-
- -
-
-
- - -
- -
- {tmpl_var name='use_pastebin'} -
-
-
-
- -
- -
-
-
- -
- -
-
-
-
- - -
- -
- {tmpl_var name='use_http_archive'} -
-
-
-
- -
- {tmpl_var name='http_archive_show_join'} -
-
-
- -
- {tmpl_var name='http_archive_show_status'} -
-
-
-
- -
- - - - -
- - -
- 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"}

- - - - - - -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{tmpl_var name='search_limit'}
- -
{tmpl_var name="active"}{tmpl_var name="server_id"}{tmpl_var name="domain"} - -
{tmpl_var name='globalsearch_noresults_text_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 @@ - -

-
- -
-
- - @ -
- -
-
-
-
-
- -
-
- - - - -
-
-
-
- -
-
-   -
-
-
- -
-
-
- - -
-
-
- -
- {tmpl_var name='active'} -
-
- - - - -
- - -
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"}

- - - - - - -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{tmpl_var name='search_limit'}
- -
{tmpl_var name="jid"}{tmpl_var name="is_domain_admin"}{tmpl_var name="is_muc_admin"} - -
{tmpl_var name='globalsearch_noresults_text_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/interface/web/vm/openvz_vm_list.php b/interface/web/monitor/dataloghistory_list.php similarity index 87% rename from interface/web/vm/openvz_vm_list.php rename to interface/web/monitor/dataloghistory_list.php index c1ea907c1017f3ed55528ed2619d7246d60dbccb..cab8da8a3671454d32c6598bde1a74e5a1e512b5 100644 --- a/interface/web/vm/openvz_vm_list.php +++ b/interface/web/monitor/dataloghistory_list.php @@ -1,7 +1,7 @@ auth->check_module_permissions('vm'); +$app->auth->check_module_permissions('monitor'); $app->uses('listform_actions'); -// $app->listform_actions->SQLOrderBy = 'ORDER BY company_name, contact_name, client_id'; -//$app->listform_actions->SQLExtWhere = ""; +$app->listform_actions->SQLOrderBy = "ORDER BY sys_datalog.tstamp DESC, sys_datalog.datalog_id DESC"; + $app->listform_actions->onLoad(); diff --git a/interface/web/vm/openvz_template_edit.php b/interface/web/monitor/dataloghistory_undo.php similarity index 50% rename from interface/web/vm/openvz_template_edit.php rename to interface/web/monitor/dataloghistory_undo.php index c9c24006c3f3e20429756f29e88365565d618d4d..455f8c9d0dd8dc83cae5a9fe48fb6e59a8ca188e 100644 --- a/interface/web/vm/openvz_template_edit.php +++ b/interface/web/monitor/dataloghistory_undo.php @@ -1,6 +1,7 @@ auth->check_module_permissions('monitor'); -$tform_def_file = "form/openvz_template.tform.php"; +// Loading the template +$app->uses('tpl'); +$app->tpl->newTemplate("form.tpl.htm"); +$app->tpl->setInclude('content_tpl', 'templates/dataloghistory_undo.htm'); -/****************************************** -* End Form configuration -******************************************/ +require('lib/lang/'.$_SESSION['s']['language'].'_dataloghistory_undo.lng'); +$app->tpl->setvar($wb); -require_once '../../lib/config.inc.php'; -require_once '../../lib/app.inc.php'; +$id = intval($_GET['id']); -//* Check permissions for module -$app->auth->check_module_permissions('vm'); -if($_SESSION["s"]["user"]["typ"] != 'admin') die('permission denied'); +$record = $app->db->queryOneRecord('SELECT * FROM sys_datalog WHERE datalog_id = ?', $id); -// Loading classes -$app->uses('tpl,tform'); -$app->load('tform_actions'); +$dbidx = explode(':', $record['dbidx']); -class page_action extends tform_actions { +$old_record = $app->db->queryOneRecord('SELECT * FROM ?? WHERE ??=?', $record['dbtable'], $dbidx[0], $dbidx[1]); - function onAfterInsert() { - global $app, $conf; +if($record['action'] === 'u') { + if (is_array($old_record)) { + if(!$data = unserialize(stripslashes($record['data']))) { + $data = unserialize($record['data']); + } - $this->onAfterUpdate(); - } + $new_record = $data['old']; - function onAfterUpdate() { - global $app, $conf; + $app->db->datalogUpdate($record['dbtable'], $new_record, $dbidx[0], $dbidx[1]); - $guar_ram = $app->functions->intval($this->dataRecord['ram']*256); - $burst_ram = $app->functions->intval($this->dataRecord['ram_burst']*256); - $sql = "UPDATE openvz_template SET shmpages = ?,vmguarpages = ?, oomguarpages = ?,privvmpages = ? WHERE template_id = ?"; - $app->db->query($sql, $guar_ram . ':' . $guar_ram, $guar_ram . ':unlimited', $guar_ram . ':' . $guar_ram, $burst_ram . ':' . $burst_ram*1.0625, $this->id); + $app->tpl->setVar('success', true); + } else { + $app->tpl->setVar('success', false); } +} elseif($record['action'] === 'd') { + if(is_array($old_record)) { + $app->tpl->setVar('success', false); + $app->tpl->setVar('error_txt', $wb['error_undelete_txt']); + } else { + if(!$data = unserialize(stripslashes($record['data']))) { + $data = unserialize($record['data']); + } + + $new_record = $data['old']; + /* TODO: maybe check some data, e. g. server_id -> server still there?, sys_groupid -> sys_group/sys_user still there? */ + $app->db->datalogInsert($record['dbtable'], $new_record, $dbidx[0]); + + $app->tpl->setVar('success', true); + } } -$page = new page_action; -$page->onLoad(); +$app->tpl_defaults(); +$app->tpl->pparse(); ?> diff --git a/interface/web/monitor/dataloghistory_view.php b/interface/web/monitor/dataloghistory_view.php new file mode 100644 index 0000000000000000000000000000000000000000..2b5ea1e0323c4dbe135baaacaef6f26a7ed1ef54 --- /dev/null +++ b/interface/web/monitor/dataloghistory_view.php @@ -0,0 +1,131 @@ +auth->check_module_permissions('monitor'); + +$app->load('finediff'); + +// Loading the template +$app->uses('tpl'); +$app->tpl->newTemplate("form.tpl.htm"); +$app->tpl->setInclude('content_tpl', 'templates/dataloghistory_view.htm'); + +$app->load_language_file('web/monitor/lib/lang/'.$_SESSION['s']['language'].'_dataloghistory_view.lng'); +require('lib/lang/'.$_SESSION['s']['language'].'_dataloghistory_view.lng'); +$app->tpl->setvar($wb); + +$id = intval($_GET['id']); + +$record = $app->db->queryOneRecord('SELECT * FROM sys_datalog WHERE datalog_id = ?', $id); + +$out['id'] = $id; + +$out['timestamp'] = date($app->lng('conf_format_datetime'), $record['tstamp']); +$out['table'] = $record['dbtable']; + +$out['action_char'] = $record['action']; +$out['action_name'] = $app->lng($record['action']); + +$out['session_id'] = $record['session_id']; + +if(!$data = unserialize(stripslashes($record['data']))) { + $data = unserialize($record['data']); +} + +switch ($record['action']) { + case 'i': + $inserts = array(); + foreach ($data['new'] as $key=>$value) { + $inserts[] = array( + 'key' => $key, + 'value' => nl2br($value), + ); + } + $app->tpl->setLoop('inserts', $inserts); + break; + case 'u': + $updates = array(); + foreach ($data['new'] as $key=>$value) { + if ($value != $data['old'][$key]) { + $old = $data['old'][$key]; + $new = $value; + $changes = show_diff_if_needed($old, $new); + $updates[] = array( + 'key' => $key, + 'is_diff' => $changes['is_diff'], + 'old' => nl2br($changes['old']), + 'new' => nl2br($changes['new']), + 'diff' => nl2br($changes['diff']), + ); + } + } + if (count($updates) > 0) { + $app->tpl->setLoop('updates', $updates); + } else { + $out['no_changes'] = true; + } + break; + case 'd': + $deletes = array(); + foreach ($data['old'] as $key=>$value) { + $deletes[] = array( + 'key' => $key, + 'value' => nl2br($value), + ); + } + $app->tpl->setLoop('deletes', $deletes); + break; +} + +$app->tpl->setVar($out); +$app->tpl->setVar('can_undo', ($out['action_char'] === 'u' || $out['action_char'] === 'd')); + +$app->tpl_defaults(); +$app->tpl->pparse(); + +function show_diff_if_needed($old, $new) { + global $app; + + $diff_min_lines = 6; + + if (substr_count($old, "\n") >= $diff_min_lines || substr_count($new, "\n") >= $diff_min_lines) { + $opcodes = FineDiff::getDiffOpcodes($old, $new); + $html = FineDiff::renderUTF8DiffToHTMLFromOpcodes($old, $opcodes); + return array('is_diff'=>true, 'old'=>'', 'new'=>'', 'diff'=>$html); + } else { + return array('is_diff'=>false, 'old'=>$old, 'new'=>$new, 'diff'=>''); + } +} + +?> diff --git a/interface/web/monitor/lib/lang/de.lng b/interface/web/monitor/lib/lang/de.lng index 8e70741ef97864b85b05417f6a966bbaf328c741..33998b5ed8127a185f6311ee5c670b8fbdc5ef06 100644 --- a/interface/web/monitor/lib/lang/de.lng +++ b/interface/web/monitor/lib/lang/de.lng @@ -40,6 +40,7 @@ $wb['Show Clamav-Log'] = 'ClamAV Protokoll anzeigen'; $wb['Show ISPConfig-Log'] = 'ISPConfig Protokoll anzeigen'; $wb['Show RKHunter-Log'] = 'RKHunter Protokoll anzeigen'; $wb['Show Jobqueue'] = 'Jobwarteschlange anzeigen'; +$wb['Show Data Log History'] = 'Datalog-History anzeigen'; $wb['Show ISPC Cron-Log'] = 'Cron Protokoll anzeigen'; $wb['no_data_updates_txt'] = 'Derzeit stehen keine Daten über Updates zur Verfügung. Bitte später erneut überprüfen.'; $wb['no_data_raid_txt'] = 'Derzeit stehen keine Daten über RAID zur Verfügung. Bitte später erneut überprüfen.'; diff --git a/interface/web/monitor/lib/lang/de_dataloghistory_list.lng b/interface/web/monitor/lib/lang/de_dataloghistory_list.lng new file mode 100644 index 0000000000000000000000000000000000000000..2c2b6c9fc2d41c11f5d37d11d691140229718b7a --- /dev/null +++ b/interface/web/monitor/lib/lang/de_dataloghistory_list.lng @@ -0,0 +1,8 @@ + diff --git a/interface/web/monitor/lib/lang/de_dataloghistory_undo.lng b/interface/web/monitor/lib/lang/de_dataloghistory_undo.lng new file mode 100644 index 0000000000000000000000000000000000000000..9bae987d50ac7cc5356db635a5eb71660f01a85d --- /dev/null +++ b/interface/web/monitor/lib/lang/de_dataloghistory_undo.lng @@ -0,0 +1,7 @@ + diff --git a/interface/web/monitor/lib/lang/de_dataloghistory_view.lng b/interface/web/monitor/lib/lang/de_dataloghistory_view.lng new file mode 100644 index 0000000000000000000000000000000000000000..81123a69c0676d5163b68be44f347557bbd1086e --- /dev/null +++ b/interface/web/monitor/lib/lang/de_dataloghistory_view.lng @@ -0,0 +1,26 @@ + diff --git a/interface/web/monitor/lib/lang/en.lng b/interface/web/monitor/lib/lang/en.lng index 3721f692e735f35911c42873525b18bdf8d8dbba..baa0252ceac6e4fcf357c65a7f8b66e647daf687 100644 --- a/interface/web/monitor/lib/lang/en.lng +++ b/interface/web/monitor/lib/lang/en.lng @@ -46,6 +46,7 @@ $wb['Show Clamav-Log'] = 'Show Clamav-Log'; $wb['Show ISPConfig-Log'] = 'Show ISPConfig-Log'; $wb['Show RKHunter-Log'] = 'Show RKHunter-Log'; $wb['Show Jobqueue'] = 'Show Jobqueue'; +$wb['Show Data Log History'] = 'Show Data Log History'; $wb['Show fail2ban-Log'] = 'Show fail2ban-Log'; $wb['Show MongoDB-Log'] = 'Show MongoDB-Log'; $wb['Show IPTables'] = 'Show IPTables'; diff --git a/interface/web/monitor/lib/lang/en_dataloghistory_list.lng b/interface/web/monitor/lib/lang/en_dataloghistory_list.lng new file mode 100644 index 0000000000000000000000000000000000000000..9f9afd6347ba4443cc46796810fb1c4a24106ccf --- /dev/null +++ b/interface/web/monitor/lib/lang/en_dataloghistory_list.lng @@ -0,0 +1,8 @@ + diff --git a/interface/web/monitor/lib/lang/en_dataloghistory_undo.lng b/interface/web/monitor/lib/lang/en_dataloghistory_undo.lng new file mode 100644 index 0000000000000000000000000000000000000000..0e040a3e77d48b89a779f7c7d3fb4198df0fe02e --- /dev/null +++ b/interface/web/monitor/lib/lang/en_dataloghistory_undo.lng @@ -0,0 +1,7 @@ + diff --git a/interface/web/monitor/lib/lang/en_dataloghistory_view.lng b/interface/web/monitor/lib/lang/en_dataloghistory_view.lng new file mode 100644 index 0000000000000000000000000000000000000000..df9ddd286f46e816e06132e7465929ab8dd87229 --- /dev/null +++ b/interface/web/monitor/lib/lang/en_dataloghistory_view.lng @@ -0,0 +1,26 @@ + diff --git a/interface/web/monitor/lib/module.conf.php b/interface/web/monitor/lib/module.conf.php index 5b35053dc6f7dcda21daa7109eb470f64864697f..0bba401ade6d17eb57e522e598ad7df40e75c94d 100644 --- a/interface/web/monitor/lib/module.conf.php +++ b/interface/web/monitor/lib/module.conf.php @@ -26,6 +26,11 @@ $items[] = array( 'title' => 'Show Jobqueue', 'link' => 'monitor/datalog_list.php', 'html_id' => 'jobqueue'); +$items[] = array( 'title' => 'Show Data Log History', + 'target' => 'content', + 'link' => 'monitor/dataloghistory_list.php', + 'html_id' => 'dataloghistory'); + $module["nav"][] = array( 'title' => 'System State (All Servers)', 'open' => 1, 'items' => $items); @@ -201,12 +206,6 @@ $items[] = array( 'title' => "Show fail2ban-Log", 'link' => 'monitor/show_data.php?type=fail2ban', 'html_id' => 'fai2ban'); -/* -$items[] = array( 'title' => "Show MongoDB-Log", - 'target' => 'content', - 'link' => 'monitor/show_data.php?type=mongodb', - 'html_id' => 'mongodb'); -*/ $items[] = array( 'title' => "Show IPTables", 'target' => 'content', 'link' => 'monitor/show_data.php?type=iptables', diff --git a/interface/web/monitor/list/dataloghistory.list.php b/interface/web/monitor/list/dataloghistory.list.php new file mode 100644 index 0000000000000000000000000000000000000000..1757125e8d2b33690f4bf7522513ca5c0eb3c653 --- /dev/null +++ b/interface/web/monitor/list/dataloghistory.list.php @@ -0,0 +1,91 @@ + "tstamp", + 'datatype' => "DATETIME", + 'formtype' => "TEXT", + 'op' => "like", + 'prefix' => "", + 'suffix' => "", + 'width' => "", + 'value' => ""); + + +$liste['item'][] = array( 'field' => 'server_id', + 'datatype' => 'INTEGER', + 'formtype' => 'SELECT', + 'op' => '=', + 'prefix' => '', + 'suffix' => '', + 'datasource' => array ( 'type' => 'SQL', + 'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name', + 'keyfield'=> 'server_id', + 'valuefield'=> 'server_name' + ), + 'width' => '', + 'value' => ''); + +$liste["item"][] = array( 'field' => "action", + 'datatype' => "VARCHAR", + 'formtype' => "SELECT", + 'op' => "=", + 'prefix' => "", + 'suffix' => "", + 'width' => "", + 'value' => array('i' => "Insert", 'u' => "Update", 'd' => "Delete")); + + +$liste["item"][] = array( 'field' => "dbtable", + 'datatype' => "VARCHAR", + 'formtype' => "TEXT", + 'op' => "like", + 'prefix' => "%", + 'suffix' => "%", + 'width' => "", + 'value' => ""); + + +?> diff --git a/interface/web/monitor/show_data.php b/interface/web/monitor/show_data.php index 80f246ee2dcec04b6a255c1c5d9bec58adbd5420..9a5cafea446446b3eb25cdbc549a9aecfbad23cf 100644 --- a/interface/web/monitor/show_data.php +++ b/interface/web/monitor/show_data.php @@ -138,15 +138,6 @@ case 'fail2ban': $description = ''; $add_padding = true; break; -/* -case 'mongodb': - $template = 'templates/show_data.htm'; - $output .= $app->tools_monitor->showMongoDB(); - $time = $app->tools_monitor->getDataTime('log_mongodb'); - $title = $app->lng("monitor_title_mongodb_txt") . ' (' . $monTransSrv . ' : ' . $_SESSION['monitor']['server_name'] . ')'; - $description = ''; - break; -*/ case 'iptables': $template = 'templates/show_data.htm'; $output .= $app->tools_monitor->showIPTables(); diff --git a/interface/web/mail/templates/xmpp_domain_admin_list.htm b/interface/web/monitor/templates/dataloghistory_list.htm similarity index 54% rename from interface/web/mail/templates/xmpp_domain_admin_list.htm rename to interface/web/monitor/templates/dataloghistory_list.htm index ccda2d503263caa1a1dc00f61294b6bfa61c8b3d..0cd3c4f4d27f52fa40977b3e00b80bf0c65cfbb4 100644 --- a/interface/web/mail/templates/xmpp_domain_admin_list.htm +++ b/interface/web/monitor/templates/dataloghistory_list.htm @@ -1,46 +1,40 @@ + + +

-

{tmpl_var name="toolsarea_head_txt"}

- - - - - -

- - + - + + - - + - + + - - - - - + + + + + @@ -57,4 +51,4 @@
{tmpl_var name='search_limit'}
  - +
{tmpl_var name="active"}{tmpl_var name="sys_groupid"}{tmpl_var name="server_id"}{tmpl_var name="domain"} - - {tmpl_var name="tstamp"}{tmpl_var name="server_id"}{tmpl_var name="action"}{tmpl_var name="dbtable"}
- \ No newline at end of file + diff --git a/interface/web/monitor/templates/dataloghistory_undo.htm b/interface/web/monitor/templates/dataloghistory_undo.htm new file mode 100644 index 0000000000000000000000000000000000000000..997231a885ad3fb3e412658fabdd5ce7a62712de --- /dev/null +++ b/interface/web/monitor/templates/dataloghistory_undo.htm @@ -0,0 +1,17 @@ + + + + + + + + + + +
+
+ +
+
diff --git a/interface/web/monitor/templates/dataloghistory_view.htm b/interface/web/monitor/templates/dataloghistory_view.htm new file mode 100644 index 0000000000000000000000000000000000000000..4ba82bbf052a8aa7375d780a7b1c440c7cd2a8e0 --- /dev/null +++ b/interface/web/monitor/templates/dataloghistory_view.htm @@ -0,0 +1,124 @@ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +

+
+ +

+
+ +

+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+
( / )
+
+
+
+ +
+
+ + {tmpl_var name='undo_txt'} + + +
+
diff --git a/interface/web/nav.php b/interface/web/nav.php index 1091276b86153638719e3c248bb10dfca91d85ff..bb79cc63bdc05e8cdb089e4896d3fa0b394fbc16 100644 --- a/interface/web/nav.php +++ b/interface/web/nav.php @@ -53,6 +53,7 @@ if(isset($_GET['nav']) && $_GET['nav'] == 'top') { $modules = array_merge(array('dashboard'), $modules); } */ + $module = null; if(is_array($modules)) { foreach($modules as $mt) { if(is_file($mt.'/lib/module.conf.php')) { @@ -69,12 +70,11 @@ if(isset($_GET['nav']) && $_GET['nav'] == 'top') { $web_servers = $app->db->queryOneRecord("SELECT COUNT(*) as cnt FROM server WHERE web_server = 1 AND active = 1"); if($web_servers['cnt'] == 0) continue; } - if($mt == 'vm'){ - $vm_servers = $app->db->queryOneRecord("SELECT COUNT(*) AS cnt FROM server WHERE vserver_server = 1 AND active = 1"); - if($vm_servers['cnt'] == 0) continue; - } + unset($module); include_once $mt.'/lib/module.conf.php'; + if(!isset($module)) continue; // allow module files to be skipped if they define no module data + $language = $app->functions->check_language((isset($_SESSION['s']['user']['language']))?$_SESSION['s']['user']['language']:$conf['language']); $app->load_language_file('web/'.$mt.'/lib/'.$language.'.lng'); $active = ($module['name'] == $_SESSION['s']['module']['name']) ? 1 : 0; diff --git a/interface/web/sites/database_user_edit.php b/interface/web/sites/database_user_edit.php index 07fa1315f062960e5f214aefdaa3eebb19f8837b..6d18893e71d70a60b1789bdacee911ec33c8bf44 100644 --- a/interface/web/sites/database_user_edit.php +++ b/interface/web/sites/database_user_edit.php @@ -168,14 +168,6 @@ class page_action extends tform_actions { $this->dataRecord['database_user'] = substr($dbuser_prefix . $this->dataRecord['database_user'], 0, 16); } - /* prepare password for MongoDB */ - // TODO: this still doens't work as when only the username changes we have no database_password. - // taking the one from oldData doesn't work as it's encrypted...shit! -/* - $this->dataRecord['database_password_mongo'] = $this->dataRecord['database_user'].":mongo:".$this->dataRecord['database_password']; - - $this->dataRecord['server_id'] = 0; // we need this on all servers -*/ parent::onBeforeUpdate(); } @@ -211,9 +203,6 @@ class page_action extends tform_actions { $this->dataRecord['server_id'] = 0; // we need this on all servers - /* prepare password for MongoDB */ -// $this->dataRecord['database_password_mongo'] = $this->dataRecord['database_user'].":mongo:".$this->dataRecord['database_password']; - parent::onBeforeInsert(); } diff --git a/interface/web/sites/form/database.tform.php b/interface/web/sites/form/database.tform.php index 40085478397bd7b0a7ca8733f5f1b4014d5fe853..32d06945019618d9abc64ea8a1a182f83cb7ae53 100644 --- a/interface/web/sites/form/database.tform.php +++ b/interface/web/sites/form/database.tform.php @@ -90,7 +90,6 @@ $form["tabs"]['database'] = array ( 'formtype' => 'SELECT', 'default' => 'mysql', 'value' => array( - /*'mongo' => 'MongoDB',*/ 'mysql' => 'MySQL' ) ), diff --git a/interface/web/sites/form/database_user.tform.php b/interface/web/sites/form/database_user.tform.php index 09d2c32b2c3e94ca714fd8e574bb09df3ebb0563..6fc02dbe19348bdb9fd2f54fa87d8a2b4c43c3fa 100644 --- a/interface/web/sites/form/database_user.tform.php +++ b/interface/web/sites/form/database_user.tform.php @@ -115,15 +115,7 @@ $form["tabs"]['database_user'] = array ( 'value' => '', 'width' => '30', 'maxlength' => '255' - ), - 'database_password_mongo' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'PASSWORD', - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), + ) //################################# // ENDE Datatable fields //################################# diff --git a/interface/web/sites/form/web_vhost_domain.tform.php b/interface/web/sites/form/web_vhost_domain.tform.php index ad1d4ff55b650e5cc830a000958b2c0de4125c9b..84de25dee5ef19499c47e459168c5420d8d40e04 100644 --- a/interface/web/sites/form/web_vhost_domain.tform.php +++ b/interface/web/sites/form/web_vhost_domain.tform.php @@ -970,6 +970,12 @@ if($_SESSION["s"]["user"]["typ"] == 'admin' 'value' => '', 'width' => '4', 'maxlength' => '4' + ), + 'jailkit_jkupdate_cron' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'CHECKBOX', + 'default' => 'y', + 'value' => array(0 => 'n', 1 => 'y') ) //################################# // ENDE Datatable fields diff --git a/interface/web/sites/lib/lang/de_web_vhost_domain.lng b/interface/web/sites/lib/lang/de_web_vhost_domain.lng index ecfb1994cd4c19303c80b9e61592a349394fd7b0..f401e0f4c1947b7234f2e6fca9e4b5c4f9411986 100644 --- a/interface/web/sites/lib/lang/de_web_vhost_domain.lng +++ b/interface/web/sites/lib/lang/de_web_vhost_domain.lng @@ -155,4 +155,5 @@ $wb['error_server_change_not_possible'] = 'Der Server kann nicht geändert werde $wb['enable_pagespeed_txt'] = 'Enable PageSpeed'; $wb['log_retention_txt'] = 'Log-Dateien Aufbewahrungszeit'; $wb['log_retention_error_regex'] = 'Aufbewahrungszeit in Tagen (Erlaubte Werte: min. 0 - max. 9999)'; -?> +$wb['jailkit_jkupdate_cron_txt'] = 'Automatisches Jailkit-Update'; +$wb['ttip_jailkit_jkupdate_cron_txt'] = 'Wenn diese Website mind. einen Jailkit-SSH-Benutzer hat, wird das Jailkit durch einen täglichen Cron Job aktuell gehalten.'; \ No newline at end of file diff --git a/interface/web/sites/lib/lang/en_web_vhost_domain.lng b/interface/web/sites/lib/lang/en_web_vhost_domain.lng index 17d47ed4646d28f8a43c4e3a4fa7222d777903a6..7a99f632d8194584338b82056507a6b274ad4bd2 100644 --- a/interface/web/sites/lib/lang/en_web_vhost_domain.lng +++ b/interface/web/sites/lib/lang/en_web_vhost_domain.lng @@ -161,4 +161,5 @@ $wb['error_domain_change_forbidden'] = 'The domain name cannot be changed. Pleas $wb['error_server_change_not_possible'] = 'The server cannot be changed.'; $wb['log_retention_txt'] = 'Logfiles retention time'; $wb['log_retention_error_regex'] = 'Retention time in days (allowed values: min. 0 - max. 9999)'; -?> +$wb['jailkit_jkupdate_cron_txt'] = 'Automatic Jailkit update'; +$wb['ttip_jailkit_jkupdate_cron_txt'] = 'If this site has at least one Jailkit SSH user, the jailkit will be kept up to date through a daily cron job.'; \ No newline at end of file diff --git a/interface/web/sites/list/database.list.php b/interface/web/sites/list/database.list.php index 25e1b8de7f3811e6ef3a7bc51a1d459c445b572e..9684b2ac8272241fb420d3a13dd29e7e1992d9f9 100644 --- a/interface/web/sites/list/database.list.php +++ b/interface/web/sites/list/database.list.php @@ -78,7 +78,6 @@ $liste["item"][] = array( 'field' => "type", 'suffix' => "", 'width' => "", 'value' => array( - 'mongo' => "MongoDB", 'mysql' => "MySQL" ) ); diff --git a/interface/web/sites/templates/web_vhost_domain_advanced.htm b/interface/web/sites/templates/web_vhost_domain_advanced.htm index 322748257b9ce85d989101de4925fe866c061dc1..7ecfe9608dd4adf47b93f70dc729286ceb4fa76d 100644 --- a/interface/web/sites/templates/web_vhost_domain_advanced.htm +++ b/interface/web/sites/templates/web_vhost_domain_advanced.htm @@ -101,6 +101,12 @@ {tmpl_var name="available_php_directive_snippets_txt"}

 {tmpl_var name="php_directive_snippets_txt"} +
+ +
+ {tmpl_var name='jailkit_jkupdate_cron'} +
+
diff --git a/interface/web/themes/default/assets/stylesheets/bootstrap.min.css b/interface/web/themes/default/assets/stylesheets/bootstrap.min.css index 4af8905e5b8a97dee4470a7d15ebbf0ad2a22a7d..e351b378aac550b368b318e6f5ac2bedf2f0c00a 100644 --- a/interface/web/themes/default/assets/stylesheets/bootstrap.min.css +++ b/interface/web/themes/default/assets/stylesheets/bootstrap.min.css @@ -2,4 +2,4 @@ * Bootstrap v3.3.0 (http://getbootstrap.com) * Copyright 2011-2014 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - *//*! normalize.css v3.0.2 | MIT License | git.io/normalize */html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{margin:.67em 0;font-size:2em}mark{color:#000;background:#ff0}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{height:0;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{margin:0;font:inherit;color:inherit}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}input{line-height:normal}input[type=checkbox],input[type=radio]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{padding:.35em .625em .75em;margin:0 2px;border:1px solid silver}legend{padding:0;border:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-spacing:0;border-collapse:collapse}td,th{padding:0}/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */@media print{*,:before,:after{color:#000!important;text-shadow:none!important;background:transparent!important;-webkit-box-shadow:none!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="#"]:after,a[href^="javascript:"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100%!important}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}select{background:#fff!important}.navbar{display:none}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered th,.table-bordered td{border:1px solid #ddd!important}}@font-face{font-family:'Glyphicons Halflings';src:url(../fonts/glyphicons-halflings-regular.eot);src:url(../fonts/glyphicons-halflings-regular.eot?#iefix) format('embedded-opentype'),url(../fonts/glyphicons-halflings-regular.woff) format('woff'),url(../fonts/glyphicons-halflings-regular.ttf) format('truetype'),url(../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format('svg')}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-asterisk:before{content:"\2a"}.glyphicon-plus:before{content:"\2b"}.glyphicon-euro:before,.glyphicon-eur:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-lock:before{content:"\e033"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-bookmark:before{content:"\e044"}.glyphicon-print:before{content:"\e045"}.glyphicon-camera:before{content:"\e046"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-fire:before{content:"\e104"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-calendar:before{content:"\e109"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-bell:before{content:"\e123"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-wrench:before{content:"\e136"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-briefcase:before{content:"\e139"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-paperclip:before{content:"\e142"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-pushpin:before{content:"\e146"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:before{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.glyphicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:before,:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:10px;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.42857143;color:#333;background-color:#fff}input,button,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#428bca;text-decoration:none}a:hover,a:focus{color:#2a6496;text-decoration:underline}a:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.img-responsive,.thumbnail>img,.thumbnail a>img,.carousel-inner>.item>img,.carousel-inner>.item>a>img{display:block;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{display:inline-block;max-width:100%;height:auto;padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6{font-family:inherit;font-weight:500;line-height:1.1;color:inherit}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small,.h1 small,.h2 small,.h3 small,.h4 small,.h5 small,.h6 small,h1 .small,h2 .small,h3 .small,h4 .small,h5 .small,h6 .small,.h1 .small,.h2 .small,.h3 .small,.h4 .small,.h5 .small,.h6 .small{font-weight:400;line-height:1;color:#777}h1,.h1,h2,.h2,h3,.h3{margin-top:20px;margin-bottom:10px}h1 small,.h1 small,h2 small,.h2 small,h3 small,.h3 small,h1 .small,.h1 .small,h2 .small,.h2 .small,h3 .small,.h3 .small{font-size:65%}h4,.h4,h5,.h5,h6,.h6{margin-top:10px;margin-bottom:10px}h4 small,.h4 small,h5 small,.h5 small,h6 small,.h6 small,h4 .small,.h4 .small,h5 .small,.h5 .small,h6 .small,.h6 .small{font-size:75%}h1,.h1{font-size:36px}h2,.h2{font-size:30px}h3,.h3{font-size:24px}h4,.h4{font-size:18px}h5,.h5{font-size:14px}h6,.h6{font-size:12px}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:16px;font-weight:300;line-height:1.4}@media (min-width:768px){.lead{font-size:21px}}small,.small{font-size:85%}mark,.mark{padding:.2em;background-color:#fcf8e3}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-nowrap{white-space:nowrap}.text-lowercase{text-transform:lowercase}.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.text-muted{color:#777}.text-primary{color:#428bca}a.text-primary:hover{color:#3071a9}.text-success{color:#3c763d}a.text-success:hover{color:#2b542c}.text-info{color:#31708f}a.text-info:hover{color:#245269}.text-warning{color:#8a6d3b}a.text-warning:hover{color:#66512c}.text-danger{color:#a94442}a.text-danger:hover{color:#843534}.bg-primary{color:#fff;background-color:#428bca}a.bg-primary:hover{background-color:#3071a9}.bg-success{background-color:#dff0d8}a.bg-success:hover{background-color:#c1e2b3}.bg-info{background-color:#d9edf7}a.bg-info:hover{background-color:#afd9ee}.bg-warning{background-color:#fcf8e3}a.bg-warning:hover{background-color:#f7ecb5}.bg-danger{background-color:#f2dede}a.bg-danger:hover{background-color:#e4b9b9}.page-header{padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}ul,ol{margin-top:0;margin-bottom:10px}ul ul,ol ul,ul ol,ol ol{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;margin-left:-5px;list-style:none}.list-inline>li{display:inline-block;padding-right:5px;padding-left:5px}dl{margin-top:0;margin-bottom:20px}dt,dd{line-height:1.42857143}dt{font-weight:700}dd{margin-left:0}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}}abbr[title],abbr[data-original-title]{cursor:help;border-bottom:1px dotted #777}.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}blockquote p:last-child,blockquote ul:last-child,blockquote ol:last-child{margin-bottom:0}blockquote footer,blockquote small,blockquote .small{display:block;font-size:80%;line-height:1.42857143;color:#777}blockquote footer:before,blockquote small:before,blockquote .small:before{content:'\2014 \00A0'}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;text-align:right;border-right:5px solid #eee;border-left:0}.blockquote-reverse footer:before,blockquote.pull-right footer:before,.blockquote-reverse small:before,blockquote.pull-right small:before,.blockquote-reverse .small:before,blockquote.pull-right .small:before{content:''}.blockquote-reverse footer:after,blockquote.pull-right footer:after,.blockquote-reverse small:after,blockquote.pull-right small:after,.blockquote-reverse .small:after,blockquote.pull-right .small:after{content:'\00A0 \2014'}address{margin-bottom:20px;font-style:normal;line-height:1.42857143}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;border-radius:4px}kbd{padding:2px 4px;font-size:90%;color:#fff;background-color:#333;border-radius:3px;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.25);box-shadow:inset 0 -1px 0 rgba(0,0,0,.25)}kbd kbd{padding:0;font-size:100%;font-weight:700;-webkit-box-shadow:none;box-shadow:none}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.42857143;color:#333;word-break:break-all;word-wrap:break-word;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.row{margin-right:-15px;margin-left:-15px}.col-xs-1,.col-sm-1,.col-md-1,.col-lg-1,.col-xs-2,.col-sm-2,.col-md-2,.col-lg-2,.col-xs-3,.col-sm-3,.col-md-3,.col-lg-3,.col-xs-4,.col-sm-4,.col-md-4,.col-lg-4,.col-xs-5,.col-sm-5,.col-md-5,.col-lg-5,.col-xs-6,.col-sm-6,.col-md-6,.col-lg-6,.col-xs-7,.col-sm-7,.col-md-7,.col-lg-7,.col-xs-8,.col-sm-8,.col-md-8,.col-lg-8,.col-xs-9,.col-sm-9,.col-md-9,.col-lg-9,.col-xs-10,.col-sm-10,.col-md-10,.col-lg-10,.col-xs-11,.col-sm-11,.col-md-11,.col-lg-11,.col-xs-12,.col-sm-12,.col-md-12,.col-lg-12{position:relative;min-height:1px;padding-right:15px;padding-left:15px}.col-xs-1,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-10,.col-xs-11,.col-xs-12{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:auto}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:auto}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0}@media (min-width:768px){.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:auto}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:auto}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0}}@media (min-width:992px){.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:auto}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:auto}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0}}@media (min-width:1200px){.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11,.col-lg-12{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:auto}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:auto}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0}}table{background-color:transparent}caption{padding-top:8px;padding-bottom:8px;color:#777;text-align:left}th{text-align:left}.table{width:100%;max-width:100%;margin-bottom:20px}.table>thead>tr>th,.table>tbody>tr>th,.table>tfoot>tr>th,.table>thead>tr>td,.table>tbody>tr>td,.table>tfoot>tr>td{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>th,.table>caption+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>td,.table>thead:first-child>tr:first-child>td{border-top:0}.table>tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed>thead>tr>th,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>tbody>tr>td,.table-condensed>tfoot>tr>td{padding:5px}.table-bordered{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>tbody>tr>td,.table-bordered>tfoot>tr>td{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>thead>tr>td{border-bottom-width:2px}.table-striped>tbody>tr:nth-child(odd){background-color:#f9f9f9}.table-hover>tbody>tr:hover{background-color:#f5f5f5}table col[class*=col-]{position:static;display:table-column;float:none}table td[class*=col-],table th[class*=col-]{position:static;display:table-cell;float:none}.table>thead>tr>td.active,.table>tbody>tr>td.active,.table>tfoot>tr>td.active,.table>thead>tr>th.active,.table>tbody>tr>th.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>tbody>tr.active>td,.table>tfoot>tr.active>td,.table>thead>tr.active>th,.table>tbody>tr.active>th,.table>tfoot>tr.active>th{background-color:#f5f5f5}.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover,.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr.active:hover>th{background-color:#e8e8e8}.table>thead>tr>td.success,.table>tbody>tr>td.success,.table>tfoot>tr>td.success,.table>thead>tr>th.success,.table>tbody>tr>th.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>tbody>tr.success>td,.table>tfoot>tr.success>td,.table>thead>tr.success>th,.table>tbody>tr.success>th,.table>tfoot>tr.success>th{background-color:#dff0d8}.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover,.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr.success:hover>th{background-color:#d0e9c6}.table>thead>tr>td.info,.table>tbody>tr>td.info,.table>tfoot>tr>td.info,.table>thead>tr>th.info,.table>tbody>tr>th.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>tbody>tr.info>td,.table>tfoot>tr.info>td,.table>thead>tr.info>th,.table>tbody>tr.info>th,.table>tfoot>tr.info>th{background-color:#d9edf7}.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover,.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr.info:hover>th{background-color:#c4e3f3}.table>thead>tr>td.warning,.table>tbody>tr>td.warning,.table>tfoot>tr>td.warning,.table>thead>tr>th.warning,.table>tbody>tr>th.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>tbody>tr.warning>td,.table>tfoot>tr.warning>td,.table>thead>tr.warning>th,.table>tbody>tr.warning>th,.table>tfoot>tr.warning>th{background-color:#fcf8e3}.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover,.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr.warning:hover>th{background-color:#faf2cc}.table>thead>tr>td.danger,.table>tbody>tr>td.danger,.table>tfoot>tr>td.danger,.table>thead>tr>th.danger,.table>tbody>tr>th.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>tbody>tr.danger>td,.table>tfoot>tr.danger>td,.table>thead>tr.danger>th,.table>tbody>tr.danger>th,.table>tfoot>tr.danger>th{background-color:#f2dede}.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover,.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr.danger:hover>th{background-color:#ebcccc}.table-responsive{min-height:.01%;overflow-x:auto}@media screen and (max-width:767px){.table-responsive{width:100%;margin-bottom:15px;overflow-y:hidden;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ddd}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>thead>tr>th,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tfoot>tr>td{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>thead>tr>th:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.table-responsive>.table-bordered>thead>tr>th:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>th,.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>td{border-bottom:0}}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:inherit;color:#333;border:0;border-bottom:1px solid #e5e5e5}label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:700}input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type=radio],input[type=checkbox]{margin:4px 0 0;margin-top:1px \9;line-height:normal}input[type=file]{display:block}input[type=range]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type=file]:focus,input[type=radio]:focus,input[type=checkbox]:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}output{display:block;padding-top:7px;font-size:14px;line-height:1.42857143;color:#555}.form-control{display:block;width:100%;height:34px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.form-control::-moz-placeholder{color:#999;opacity:1}.form-control:-ms-input-placeholder{color:#999}.form-control::-webkit-input-placeholder{color:#999}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{cursor:not-allowed;background-color:#eee;opacity:1}textarea.form-control{height:auto}input[type=search]{-webkit-appearance:none}input[type=date],input[type=time],input[type=datetime-local],input[type=month]{line-height:34px;line-height:1.42857143 \0}input[type=date].input-sm,input[type=time].input-sm,input[type=datetime-local].input-sm,input[type=month].input-sm{line-height:30px;line-height:1.5 \0}input[type=date].input-lg,input[type=time].input-lg,input[type=datetime-local].input-lg,input[type=month].input-lg{line-height:46px;line-height:1.33 \0}_:-ms-fullscreen,:root input[type=date],_:-ms-fullscreen,:root input[type=time],_:-ms-fullscreen,:root input[type=datetime-local],_:-ms-fullscreen,:root input[type=month]{line-height:1.42857143}_:-ms-fullscreen.input-sm,:root input[type=date].input-sm,_:-ms-fullscreen.input-sm,:root input[type=time].input-sm,_:-ms-fullscreen.input-sm,:root input[type=datetime-local].input-sm,_:-ms-fullscreen.input-sm,:root input[type=month].input-sm{line-height:1.5}_:-ms-fullscreen.input-lg,:root input[type=date].input-lg,_:-ms-fullscreen.input-lg,:root input[type=time].input-lg,_:-ms-fullscreen.input-lg,:root input[type=datetime-local].input-lg,_:-ms-fullscreen.input-lg,:root input[type=month].input-lg{line-height:1.33}.form-group{margin-bottom:15px}.radio,.checkbox{position:relative;display:block;margin-top:10px;margin-bottom:10px}.radio label,.checkbox label{min-height:20px;padding-left:20px;margin-bottom:0;font-weight:400;cursor:pointer}.radio input[type=radio],.radio-inline input[type=radio],.checkbox input[type=checkbox],.checkbox-inline input[type=checkbox]{position:absolute;margin-top:4px \9;margin-left:-20px}.radio+.radio,.checkbox+.checkbox{margin-top:-5px}.radio-inline,.checkbox-inline{display:inline-block;padding-left:20px;margin-bottom:0;font-weight:400;vertical-align:middle;cursor:pointer}.radio-inline+.radio-inline,.checkbox-inline+.checkbox-inline{margin-top:0;margin-left:10px}input[type=radio][disabled],input[type=checkbox][disabled],input[type=radio].disabled,input[type=checkbox].disabled,fieldset[disabled] input[type=radio],fieldset[disabled] input[type=checkbox]{cursor:not-allowed}.radio-inline.disabled,.checkbox-inline.disabled,fieldset[disabled] .radio-inline,fieldset[disabled] .checkbox-inline{cursor:not-allowed}.radio.disabled label,.checkbox.disabled label,fieldset[disabled] .radio label,fieldset[disabled] .checkbox label{cursor:not-allowed}.form-control-static{padding-top:7px;padding-bottom:7px;margin-bottom:0}.form-control-static.input-lg,.form-control-static.input-sm{padding-right:0;padding-left:0}.input-sm,.form-group-sm .form-control{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-sm,select.form-group-sm .form-control{height:30px;line-height:30px}textarea.input-sm,textarea.form-group-sm .form-control,select[multiple].input-sm,select[multiple].form-group-sm .form-control{height:auto}.input-lg,.form-group-lg .form-control{height:46px;padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}select.input-lg,select.form-group-lg .form-control{height:46px;line-height:46px}textarea.input-lg,textarea.form-group-lg .form-control,select[multiple].input-lg,select[multiple].form-group-lg .form-control{height:auto}.has-feedback{position:relative}.has-feedback .form-control{padding-right:42.5px}.form-control-feedback{position:absolute;top:0;right:0;z-index:2;display:block;width:34px;height:34px;line-height:34px;text-align:center;pointer-events:none}.input-lg+.form-control-feedback{width:46px;height:46px;line-height:46px}.input-sm+.form-control-feedback{width:30px;height:30px;line-height:30px}.has-success .help-block,.has-success .control-label,.has-success .radio,.has-success .checkbox,.has-success .radio-inline,.has-success .checkbox-inline,.has-success.radio label,.has-success.checkbox label,.has-success.radio-inline label,.has-success.checkbox-inline label{color:#3c763d}.has-success .form-control{border-color:#3c763d;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-success .form-control:focus{border-color:#2b542c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168}.has-success .input-group-addon{color:#3c763d;background-color:#dff0d8;border-color:#3c763d}.has-success .form-control-feedback{color:#3c763d}.has-warning .help-block,.has-warning .control-label,.has-warning .radio,.has-warning .checkbox,.has-warning .radio-inline,.has-warning .checkbox-inline,.has-warning.radio label,.has-warning.checkbox label,.has-warning.radio-inline label,.has-warning.checkbox-inline label{color:#8a6d3b}.has-warning .form-control{border-color:#8a6d3b;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-warning .form-control:focus{border-color:#66512c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b}.has-warning .input-group-addon{color:#8a6d3b;background-color:#fcf8e3;border-color:#8a6d3b}.has-warning .form-control-feedback{color:#8a6d3b}.has-error .help-block,.has-error .control-label,.has-error .radio,.has-error .checkbox,.has-error .radio-inline,.has-error .checkbox-inline,.has-error.radio label,.has-error.checkbox label,.has-error.radio-inline label,.has-error.checkbox-inline label{color:#a94442}.has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483}.has-error .input-group-addon{color:#a94442;background-color:#f2dede;border-color:#a94442}.has-error .form-control-feedback{color:#a94442}.has-feedback label~.form-control-feedback{top:25px}.has-feedback label.sr-only~.form-control-feedback{top:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#737373}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-static{display:inline-block}.form-inline .input-group{display:inline-table;vertical-align:middle}.form-inline .input-group .input-group-addon,.form-inline .input-group .input-group-btn,.form-inline .input-group .form-control{width:auto}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .radio,.form-inline .checkbox{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.form-inline .radio label,.form-inline .checkbox label{padding-left:0}.form-inline .radio input[type=radio],.form-inline .checkbox input[type=checkbox]{position:relative;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .radio,.form-horizontal .checkbox,.form-horizontal .radio-inline,.form-horizontal .checkbox-inline{padding-top:7px;margin-top:0;margin-bottom:0}.form-horizontal .radio,.form-horizontal .checkbox{min-height:27px}.form-horizontal .form-group{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.form-horizontal .control-label{padding-top:7px;margin-bottom:0;text-align:right}}.form-horizontal .has-feedback .form-control-feedback{right:15px}@media (min-width:768px){.form-horizontal .form-group-lg .control-label{padding-top:14.3px}}@media (min-width:768px){.form-horizontal .form-group-sm .control-label{padding-top:6px}}.btn{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:4px}.btn:focus,.btn:active:focus,.btn.active:focus,.btn.focus,.btn:active.focus,.btn.active.focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn:hover,.btn:focus,.btn.focus{color:#333;text-decoration:none}.btn:active,.btn.active{background-image:none;outline:0;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{pointer-events:none;cursor:not-allowed;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none;opacity:.65}.btn-default{color:#333;background-color:#fff;border-color:#ccc}.btn-default:hover,.btn-default:focus,.btn-default.focus,.btn-default:active,.btn-default.active,.open>.dropdown-toggle.btn-default{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default:active,.btn-default.active,.open>.dropdown-toggle.btn-default{background-image:none}.btn-default.disabled,.btn-default[disabled],fieldset[disabled] .btn-default,.btn-default.disabled:hover,.btn-default[disabled]:hover,fieldset[disabled] .btn-default:hover,.btn-default.disabled:focus,.btn-default[disabled]:focus,fieldset[disabled] .btn-default:focus,.btn-default.disabled.focus,.btn-default[disabled].focus,fieldset[disabled] .btn-default.focus,.btn-default.disabled:active,.btn-default[disabled]:active,fieldset[disabled] .btn-default:active,.btn-default.disabled.active,.btn-default[disabled].active,fieldset[disabled] .btn-default.active{background-color:#fff;border-color:#ccc}.btn-default .badge{color:#fff;background-color:#333}.btn-primary{color:#fff;background-color:#428bca;border-color:#357ebd}.btn-primary:hover,.btn-primary:focus,.btn-primary.focus,.btn-primary:active,.btn-primary.active,.open>.dropdown-toggle.btn-primary{color:#fff;background-color:#3071a9;border-color:#285e8e}.btn-primary:active,.btn-primary.active,.open>.dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled,.btn-primary[disabled],fieldset[disabled] .btn-primary,.btn-primary.disabled:hover,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary:hover,.btn-primary.disabled:focus,.btn-primary[disabled]:focus,fieldset[disabled] .btn-primary:focus,.btn-primary.disabled.focus,.btn-primary[disabled].focus,fieldset[disabled] .btn-primary.focus,.btn-primary.disabled:active,.btn-primary[disabled]:active,fieldset[disabled] .btn-primary:active,.btn-primary.disabled.active,.btn-primary[disabled].active,fieldset[disabled] .btn-primary.active{background-color:#428bca;border-color:#357ebd}.btn-primary .badge{color:#428bca;background-color:#fff}.btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.btn-success:hover,.btn-success:focus,.btn-success.focus,.btn-success:active,.btn-success.active,.open>.dropdown-toggle.btn-success{color:#fff;background-color:#449d44;border-color:#398439}.btn-success:active,.btn-success.active,.open>.dropdown-toggle.btn-success{background-image:none}.btn-success.disabled,.btn-success[disabled],fieldset[disabled] .btn-success,.btn-success.disabled:hover,.btn-success[disabled]:hover,fieldset[disabled] .btn-success:hover,.btn-success.disabled:focus,.btn-success[disabled]:focus,fieldset[disabled] .btn-success:focus,.btn-success.disabled.focus,.btn-success[disabled].focus,fieldset[disabled] .btn-success.focus,.btn-success.disabled:active,.btn-success[disabled]:active,fieldset[disabled] .btn-success:active,.btn-success.disabled.active,.btn-success[disabled].active,fieldset[disabled] .btn-success.active{background-color:#5cb85c;border-color:#4cae4c}.btn-success .badge{color:#5cb85c;background-color:#fff}.btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.btn-info:hover,.btn-info:focus,.btn-info.focus,.btn-info:active,.btn-info.active,.open>.dropdown-toggle.btn-info{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info:active,.btn-info.active,.open>.dropdown-toggle.btn-info{background-image:none}.btn-info.disabled,.btn-info[disabled],fieldset[disabled] .btn-info,.btn-info.disabled:hover,.btn-info[disabled]:hover,fieldset[disabled] .btn-info:hover,.btn-info.disabled:focus,.btn-info[disabled]:focus,fieldset[disabled] .btn-info:focus,.btn-info.disabled.focus,.btn-info[disabled].focus,fieldset[disabled] .btn-info.focus,.btn-info.disabled:active,.btn-info[disabled]:active,fieldset[disabled] .btn-info:active,.btn-info.disabled.active,.btn-info[disabled].active,fieldset[disabled] .btn-info.active{background-color:#5bc0de;border-color:#46b8da}.btn-info .badge{color:#5bc0de;background-color:#fff}.btn-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.btn-warning:hover,.btn-warning:focus,.btn-warning.focus,.btn-warning:active,.btn-warning.active,.open>.dropdown-toggle.btn-warning{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning:active,.btn-warning.active,.open>.dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled,.btn-warning[disabled],fieldset[disabled] .btn-warning,.btn-warning.disabled:hover,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning:hover,.btn-warning.disabled:focus,.btn-warning[disabled]:focus,fieldset[disabled] .btn-warning:focus,.btn-warning.disabled.focus,.btn-warning[disabled].focus,fieldset[disabled] .btn-warning.focus,.btn-warning.disabled:active,.btn-warning[disabled]:active,fieldset[disabled] .btn-warning:active,.btn-warning.disabled.active,.btn-warning[disabled].active,fieldset[disabled] .btn-warning.active{background-color:#f0ad4e;border-color:#eea236}.btn-warning .badge{color:#f0ad4e;background-color:#fff}.btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.btn-danger:hover,.btn-danger:focus,.btn-danger.focus,.btn-danger:active,.btn-danger.active,.open>.dropdown-toggle.btn-danger{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger:active,.btn-danger.active,.open>.dropdown-toggle.btn-danger{background-image:none}.btn-danger.disabled,.btn-danger[disabled],fieldset[disabled] .btn-danger,.btn-danger.disabled:hover,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger:hover,.btn-danger.disabled:focus,.btn-danger[disabled]:focus,fieldset[disabled] .btn-danger:focus,.btn-danger.disabled.focus,.btn-danger[disabled].focus,fieldset[disabled] .btn-danger.focus,.btn-danger.disabled:active,.btn-danger[disabled]:active,fieldset[disabled] .btn-danger:active,.btn-danger.disabled.active,.btn-danger[disabled].active,fieldset[disabled] .btn-danger.active{background-color:#d9534f;border-color:#d43f3a}.btn-danger .badge{color:#d9534f;background-color:#fff}.btn-link{font-weight:400;color:#428bca;border-radius:0}.btn-link,.btn-link:active,.btn-link.active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:hover,.btn-link:focus,.btn-link:active{border-color:transparent}.btn-link:hover,.btn-link:focus{color:#2a6496;text-decoration:underline;background-color:transparent}.btn-link[disabled]:hover,fieldset[disabled] .btn-link:hover,.btn-link[disabled]:focus,fieldset[disabled] .btn-link:focus{color:#777;text-decoration:none}.btn-lg,.btn-group-lg>.btn{padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}.btn-sm,.btn-group-sm>.btn{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-xs,.btn-group-xs>.btn{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:5px}input[type=submit].btn-block,input[type=reset].btn-block,input[type=button].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none;visibility:hidden}.collapse.in{display:block;visibility:visible}tr.collapse.in{display:table-row}tbody.collapse.in{display:table-row-group}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition-timing-function:ease;-o-transition-timing-function:ease;transition-timing-function:ease;-webkit-transition-duration:.35s;-o-transition-duration:.35s;transition-duration:.35s;-webkit-transition-property:height,visibility;-o-transition-property:height,visibility;transition-property:height,visibility}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px solid;border-right:4px solid transparent;border-left:4px solid transparent}.dropdown{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;font-size:14px;text-align:left;list-style:none;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175)}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus{color:#262626;text-decoration:none;background-color:#f5f5f5}.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{color:#fff;text-decoration:none;background-color:#428bca;outline:0}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{color:#777}.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{text-decoration:none;cursor:not-allowed;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{right:0;left:auto}.dropdown-menu-left{right:auto;left:0}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#777;white-space:nowrap}.dropdown-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{content:"";border-top:0;border-bottom:4px solid}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:1px}@media (min-width:768px){.navbar-right .dropdown-menu{right:0;left:auto}.navbar-right .dropdown-menu-left{right:auto;left:0}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group>.btn,.btn-group-vertical>.btn{position:relative;float:left}.btn-group>.btn:hover,.btn-group-vertical>.btn:hover,.btn-group>.btn:focus,.btn-group-vertical>.btn:focus,.btn-group>.btn:active,.btn-group-vertical>.btn:active,.btn-group>.btn.active,.btn-group-vertical>.btn.active{z-index:2}.btn-group>.btn:focus,.btn-group-vertical>.btn:focus{outline:0}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{margin-left:-5px}.btn-toolbar .btn-group,.btn-toolbar .input-group{float:left}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child>.btn:last-child,.btn-group>.btn-group:first-child>.dropdown-toggle{border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:last-child>.btn:first-child{border-top-left-radius:0;border-bottom-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-right:8px;padding-left:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-right:12px;padding-left:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-top-left-radius:0;border-top-right-radius:0;border-bottom-left-radius:4px}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-top-right-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified>.btn,.btn-group-justified>.btn-group{display:table-cell;float:none;width:1%}.btn-group-justified>.btn-group .btn{width:100%}.btn-group-justified>.btn-group .dropdown-menu{left:auto}[data-toggle=buttons]>.btn input[type=radio],[data-toggle=buttons]>.btn-group>.btn input[type=radio],[data-toggle=buttons]>.btn input[type=checkbox],[data-toggle=buttons]>.btn-group>.btn input[type=checkbox]{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*=col-]{float:none;padding-right:0;padding-left:0}.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:46px;padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:46px;line-height:46px}textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn,select[multiple].input-group-lg>.form-control,select[multiple].input-group-lg>.input-group-addon,select[multiple].input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:30px;line-height:30px}textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn,select[multiple].input-group-sm>.form-control,select[multiple].input-group-sm>.input-group-addon,select[multiple].input-group-sm>.input-group-btn>.btn{height:auto}.input-group-addon,.input-group-btn,.input-group .form-control{display:table-cell}.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child),.input-group .form-control:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:6px 12px;font-size:14px;font-weight:400;line-height:1;color:#555;text-align:center;background-color:#eee;border:1px solid #ccc;border-radius:4px}.input-group-addon.input-sm{padding:5px 10px;font-size:12px;border-radius:3px}.input-group-addon.input-lg{padding:10px 16px;font-size:18px;border-radius:6px}.input-group-addon input[type=radio],.input-group-addon input[type=checkbox]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle),.input-group-btn:last-child>.btn-group:not(:last-child)>.btn{border-top-right-radius:0;border-bottom-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:first-child>.btn-group:not(:first-child)>.btn{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;font-size:0;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:hover,.input-group-btn>.btn:focus,.input-group-btn>.btn:active{z-index:2}.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group{margin-right:-1px}.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group{margin-left:-1px}.nav{padding-left:0;margin-bottom:0;list-style:none}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:hover,.nav>li>a:focus{text-decoration:none;background-color:#eee}.nav>li.disabled>a{color:#777}.nav>li.disabled>a:hover,.nav>li.disabled>a:focus{color:#777;text-decoration:none;cursor:not-allowed;background-color:transparent}.nav .open>a,.nav .open>a:hover,.nav .open>a:focus{background-color:#eee;border-color:#428bca}.nav .nav-divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.42857143;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:hover,.nav-tabs>li.active>a:focus{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border:1px solid #ddd}@media (min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border-bottom-color:#fff}}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:hover,.nav-pills>li.active>a:focus{color:#fff;background-color:#428bca}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border:1px solid #ddd}@media (min-width:768px){.nav-tabs-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border-bottom-color:#fff}}.tab-content>.tab-pane{display:none;visibility:hidden}.tab-content>.active{display:block;visibility:visible}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.navbar{position:relative;min-height:50px;margin-bottom:20px;border:1px solid transparent}@media (min-width:768px){.navbar{border-radius:4px}}@media (min-width:768px){.navbar-header{float:left}}.navbar-collapse{padding-right:15px;padding-left:15px;overflow-x:visible;-webkit-overflow-scrolling:touch;border-top:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1)}.navbar-collapse.in{overflow-y:auto}@media (min-width:768px){.navbar-collapse{width:auto;border-top:0;-webkit-box-shadow:none;box-shadow:none}.navbar-collapse.collapse{display:block!important;height:auto!important;padding-bottom:0;overflow:visible!important;visibility:visible!important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{padding-right:0;padding-left:0}}.navbar-fixed-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{max-height:340px}@media (max-device-width:480px) and (orientation:landscape){.navbar-fixed-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{max-height:200px}}.container>.navbar-header,.container-fluid>.navbar-header,.container>.navbar-collapse,.container-fluid>.navbar-collapse{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.container>.navbar-header,.container-fluid>.navbar-header,.container>.navbar-collapse,.container-fluid>.navbar-collapse{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 1px}@media (min-width:768px){.navbar-static-top{border-radius:0}}.navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;z-index:1030}@media (min-width:768px){.navbar-fixed-top,.navbar-fixed-bottom{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.navbar-brand{float:left;height:50px;padding:15px 15px;font-size:18px;line-height:20px}.navbar-brand:hover,.navbar-brand:focus{text-decoration:none}.navbar-brand>img{display:block}@media (min-width:768px){.navbar>.container .navbar-brand,.navbar>.container-fluid .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;padding:9px 10px;margin-top:8px;margin-right:15px;margin-bottom:8px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px}.navbar-toggle:focus{outline:0}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media (min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:7.5px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:20px}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-nav .open .dropdown-menu>li>a,.navbar-nav .open .dropdown-menu .dropdown-header{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:20px}.navbar-nav .open .dropdown-menu>li>a:hover,.navbar-nav .open .dropdown-menu>li>a:focus{background-image:none}}@media (min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:15px;padding-bottom:15px}}.navbar-form{padding:10px 15px;margin-top:8px;margin-right:-15px;margin-bottom:8px;margin-left:-15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1)}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .form-control-static{display:inline-block}.navbar-form .input-group{display:inline-table;vertical-align:middle}.navbar-form .input-group .input-group-addon,.navbar-form .input-group .input-group-btn,.navbar-form .input-group .form-control{width:auto}.navbar-form .input-group>.form-control{width:100%}.navbar-form .control-label{margin-bottom:0;vertical-align:middle}.navbar-form .radio,.navbar-form .checkbox{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.navbar-form .radio label,.navbar-form .checkbox label{padding-left:0}.navbar-form .radio input[type=radio],.navbar-form .checkbox input[type=checkbox]{position:relative;margin-left:0}.navbar-form .has-feedback .form-control-feedback{top:0}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}.navbar-form .form-group:last-child{margin-bottom:0}}@media (min-width:768px){.navbar-form{width:auto;padding-top:0;padding-bottom:0;margin-right:0;margin-left:0;border:0;-webkit-box-shadow:none;box-shadow:none}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-left-radius:0;border-top-right-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-btn{margin-top:8px;margin-bottom:8px}.navbar-btn.btn-sm{margin-top:10px;margin-bottom:10px}.navbar-btn.btn-xs{margin-top:14px;margin-bottom:14px}.navbar-text{margin-top:15px;margin-bottom:15px}@media (min-width:768px){.navbar-text{float:left;margin-right:15px;margin-left:15px}}@media (min-width:768px){.navbar-left{float:left!important}.navbar-right{float:right!important;margin-right:-15px}.navbar-right~.navbar-right{margin-right:0}}.navbar-default{background-color:#f8f8f8;border-color:#e7e7e7}.navbar-default .navbar-brand{color:#777}.navbar-default .navbar-brand:hover,.navbar-default .navbar-brand:focus{color:#5e5e5e;background-color:transparent}.navbar-default .navbar-text{color:#777}.navbar-default .navbar-nav>li>a{color:#777}.navbar-default .navbar-nav>li>a:hover,.navbar-default .navbar-nav>li>a:focus{color:#333;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:hover,.navbar-default .navbar-nav>.active>a:focus{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:hover,.navbar-default .navbar-nav>.disabled>a:focus{color:#ccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:#ddd}.navbar-default .navbar-toggle:hover,.navbar-default .navbar-toggle:focus{background-color:#ddd}.navbar-default .navbar-toggle .icon-bar{background-color:#888}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#e7e7e7}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:hover,.navbar-default .navbar-nav>.open>a:focus{color:#555;background-color:#e7e7e7}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus{color:#333;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#ccc;background-color:transparent}}.navbar-default .navbar-link{color:#777}.navbar-default .navbar-link:hover{color:#333}.navbar-default .btn-link{color:#777}.navbar-default .btn-link:hover,.navbar-default .btn-link:focus{color:#333}.navbar-default .btn-link[disabled]:hover,fieldset[disabled] .navbar-default .btn-link:hover,.navbar-default .btn-link[disabled]:focus,fieldset[disabled] .navbar-default .btn-link:focus{color:#ccc}.navbar-inverse{background-color:#222;border-color:#080808}.navbar-inverse .navbar-brand{color:#9d9d9d}.navbar-inverse .navbar-brand:hover,.navbar-inverse .navbar-brand:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-text{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a:hover,.navbar-inverse .navbar-nav>li>a:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:hover,.navbar-inverse .navbar-nav>.active>a:focus{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:hover,.navbar-inverse .navbar-nav>.disabled>a:focus{color:#444;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#333}.navbar-inverse .navbar-toggle:hover,.navbar-inverse .navbar-toggle:focus{background-color:#333}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#101010}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:hover,.navbar-inverse .navbar-nav>.open>a:focus{color:#fff;background-color:#080808}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#444;background-color:transparent}}.navbar-inverse .navbar-link{color:#9d9d9d}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .btn-link{color:#9d9d9d}.navbar-inverse .btn-link:hover,.navbar-inverse .btn-link:focus{color:#fff}.navbar-inverse .btn-link[disabled]:hover,fieldset[disabled] .navbar-inverse .btn-link:hover,.navbar-inverse .btn-link[disabled]:focus,fieldset[disabled] .navbar-inverse .btn-link:focus{color:#444}.breadcrumb{padding:8px 15px;margin-bottom:20px;list-style:none;background-color:#f5f5f5;border-radius:4px}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{padding:0 5px;color:#ccc;content:"/\00a0"}.breadcrumb>.active{color:#777}.pagination{display:inline-block;padding-left:0;margin:20px 0;border-radius:4px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 12px;margin-left:-1px;line-height:1.42857143;color:#428bca;text-decoration:none;background-color:#fff;border:1px solid #ddd}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-top-left-radius:4px;border-bottom-left-radius:4px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-top-right-radius:4px;border-bottom-right-radius:4px}.pagination>li>a:hover,.pagination>li>span:hover,.pagination>li>a:focus,.pagination>li>span:focus{color:#2a6496;background-color:#eee;border-color:#ddd}.pagination>.active>a,.pagination>.active>span,.pagination>.active>a:hover,.pagination>.active>span:hover,.pagination>.active>a:focus,.pagination>.active>span:focus{z-index:2;color:#fff;cursor:default;background-color:#428bca;border-color:#428bca}.pagination>.disabled>span,.pagination>.disabled>span:hover,.pagination>.disabled>span:focus,.pagination>.disabled>a,.pagination>.disabled>a:hover,.pagination>.disabled>a:focus{color:#777;cursor:not-allowed;background-color:#fff;border-color:#ddd}.pagination-lg>li>a,.pagination-lg>li>span{padding:10px 16px;font-size:18px}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-top-left-radius:6px;border-bottom-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-top-right-radius:6px;border-bottom-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-top-left-radius:3px;border-bottom-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-top-right-radius:3px;border-bottom-right-radius:3px}.pager{padding-left:0;margin:20px 0;text-align:center;list-style:none}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;border-radius:15px}.pager li>a:hover,.pager li>a:focus{text-decoration:none;background-color:#eee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:hover,.pager .disabled>a:focus,.pager .disabled>span{color:#777;cursor:not-allowed;background-color:#fff}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}a.label:hover,a.label:focus{color:#fff;text-decoration:none;cursor:pointer}.label:empty{display:none}.btn .label{position:relative;top:-1px}.label-default{background-color:#777}.label-default[href]:hover,.label-default[href]:focus{background-color:#5e5e5e}.label-primary{background-color:#428bca}.label-primary[href]:hover,.label-primary[href]:focus{background-color:#3071a9}.label-success{background-color:#5cb85c}.label-success[href]:hover,.label-success[href]:focus{background-color:#449d44}.label-info{background-color:#5bc0de}.label-info[href]:hover,.label-info[href]:focus{background-color:#31b0d5}.label-warning{background-color:#f0ad4e}.label-warning[href]:hover,.label-warning[href]:focus{background-color:#ec971f}.label-danger{background-color:#d9534f}.label-danger[href]:hover,.label-danger[href]:focus{background-color:#c9302c}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;background-color:#777;border-radius:10px}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.btn-xs .badge{top:0;padding:1px 5px}a.badge:hover,a.badge:focus{color:#fff;text-decoration:none;cursor:pointer}a.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#428bca;background-color:#fff}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding:30px 15px;margin-bottom:30px;color:inherit;background-color:#eee}.jumbotron h1,.jumbotron .h1{color:inherit}.jumbotron p{margin-bottom:15px;font-size:21px;font-weight:200}.jumbotron>hr{border-top-color:#d5d5d5}.container .jumbotron,.container-fluid .jumbotron{border-radius:6px}.jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding:48px 0}.container .jumbotron{padding-right:60px;padding-left:60px}.jumbotron h1,.jumbotron .h1{font-size:63px}}.thumbnail{display:block;padding:4px;margin-bottom:20px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:border .2s ease-in-out;-o-transition:border .2s ease-in-out;transition:border .2s ease-in-out}.thumbnail>img,.thumbnail a>img{margin-right:auto;margin-left:auto}a.thumbnail:hover,a.thumbnail:focus,a.thumbnail.active{border-color:#428bca}.thumbnail .caption{padding:9px;color:#333}.alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:700}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable,.alert-dismissible{padding-right:35px}.alert-dismissable .close,.alert-dismissible .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#2b542c}.alert-info{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.alert-info hr{border-top-color:#a6e1ec}.alert-info .alert-link{color:#245269}.alert-warning{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.alert-warning hr{border-top-color:#f7e1b5}.alert-warning .alert-link{color:#66512c}.alert-danger{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.alert-danger hr{border-top-color:#e4b9c0}.alert-danger .alert-link{color:#843534}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{height:20px;margin-bottom:20px;overflow:hidden;background-color:#f5f5f5;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1)}.progress-bar{float:left;width:0;height:100%;font-size:12px;line-height:20px;color:#fff;text-align:center;background-color:#428bca;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);-webkit-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress-striped .progress-bar,.progress-bar-striped{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);-webkit-background-size:40px 40px;background-size:40px 40px}.progress.active .progress-bar,.progress-bar.active{-webkit-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar-success{background-color:#5cb85c}.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-info{background-color:#5bc0de}.progress-striped .progress-bar-info{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-warning{background-color:#f0ad4e}.progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-danger{background-color:#d9534f}.progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.media{margin-top:15px}.media:first-child{margin-top:0}.media-right,.media>.pull-right{padding-left:10px}.media-left,.media>.pull-left{padding-right:10px}.media-left,.media-right,.media-body{display:table-cell;vertical-align:top}.media-middle{vertical-align:middle}.media-bottom{vertical-align:bottom}.media-heading{margin-top:0;margin-bottom:5px}.media-list{padding-left:0;list-style:none}.list-group{padding-left:0;margin-bottom:20px}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #ddd}.list-group-item:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}a.list-group-item{color:#555}a.list-group-item .list-group-item-heading{color:#333}a.list-group-item:hover,a.list-group-item:focus{color:#555;text-decoration:none;background-color:#f5f5f5}.list-group-item.disabled,.list-group-item.disabled:hover,.list-group-item.disabled:focus{color:#777;cursor:not-allowed;background-color:#eee}.list-group-item.disabled .list-group-item-heading,.list-group-item.disabled:hover .list-group-item-heading,.list-group-item.disabled:focus .list-group-item-heading{color:inherit}.list-group-item.disabled .list-group-item-text,.list-group-item.disabled:hover .list-group-item-text,.list-group-item.disabled:focus .list-group-item-text{color:#777}.list-group-item.active,.list-group-item.active:hover,.list-group-item.active:focus{z-index:2;color:#fff;background-color:#428bca;border-color:#428bca}.list-group-item.active .list-group-item-heading,.list-group-item.active:hover .list-group-item-heading,.list-group-item.active:focus .list-group-item-heading,.list-group-item.active .list-group-item-heading>small,.list-group-item.active:hover .list-group-item-heading>small,.list-group-item.active:focus .list-group-item-heading>small,.list-group-item.active .list-group-item-heading>.small,.list-group-item.active:hover .list-group-item-heading>.small,.list-group-item.active:focus .list-group-item-heading>.small{color:inherit}.list-group-item.active .list-group-item-text,.list-group-item.active:hover .list-group-item-text,.list-group-item.active:focus .list-group-item-text{color:#e1edf7}.list-group-item-success{color:#3c763d;background-color:#dff0d8}a.list-group-item-success{color:#3c763d}a.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:hover,a.list-group-item-success:focus{color:#3c763d;background-color:#d0e9c6}a.list-group-item-success.active,a.list-group-item-success.active:hover,a.list-group-item-success.active:focus{color:#fff;background-color:#3c763d;border-color:#3c763d}.list-group-item-info{color:#31708f;background-color:#d9edf7}a.list-group-item-info{color:#31708f}a.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:hover,a.list-group-item-info:focus{color:#31708f;background-color:#c4e3f3}a.list-group-item-info.active,a.list-group-item-info.active:hover,a.list-group-item-info.active:focus{color:#fff;background-color:#31708f;border-color:#31708f}.list-group-item-warning{color:#8a6d3b;background-color:#fcf8e3}a.list-group-item-warning{color:#8a6d3b}a.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:hover,a.list-group-item-warning:focus{color:#8a6d3b;background-color:#faf2cc}a.list-group-item-warning.active,a.list-group-item-warning.active:hover,a.list-group-item-warning.active:focus{color:#fff;background-color:#8a6d3b;border-color:#8a6d3b}.list-group-item-danger{color:#a94442;background-color:#f2dede}a.list-group-item-danger{color:#a94442}a.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:hover,a.list-group-item-danger:focus{color:#a94442;background-color:#ebcccc}a.list-group-item-danger.active,a.list-group-item-danger.active:hover,a.list-group-item-danger.active:focus{color:#fff;background-color:#a94442;border-color:#a94442}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:20px;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}.panel-body{padding:15px}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-left-radius:3px;border-top-right-radius:3px}.panel-heading>.dropdown .dropdown-toggle{color:inherit}.panel-title{margin-top:0;margin-bottom:0;font-size:16px;color:inherit}.panel-title>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.list-group,.panel>.panel-collapse>.list-group{margin-bottom:0}.panel>.list-group .list-group-item,.panel>.panel-collapse>.list-group .list-group-item{border-width:1px 0;border-radius:0}.panel>.list-group:first-child .list-group-item:first-child,.panel>.panel-collapse>.list-group:first-child .list-group-item:first-child{border-top:0;border-top-left-radius:3px;border-top-right-radius:3px}.panel>.list-group:last-child .list-group-item:last-child,.panel>.panel-collapse>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.list-group+.panel-footer{border-top-width:0}.panel>.table,.panel>.table-responsive>.table,.panel>.panel-collapse>.table{margin-bottom:0}.panel>.table caption,.panel>.table-responsive>.table caption,.panel>.panel-collapse>.table caption{padding-right:15px;padding-left:15px}.panel>.table:first-child,.panel>.table-responsive:first-child>.table:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table:first-child>thead:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child{border-top-left-radius:3px}.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child{border-top-right-radius:3px}.panel>.table:last-child,.panel>.table-responsive:last-child>.table:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table:last-child>tbody:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child{border-bottom-left-radius:3px}.panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child{border-bottom-right-radius:3px}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive,.panel>.table+.panel-body,.panel>.table-responsive+.panel-body{border-top:1px solid #ddd}.panel>.table>tbody:first-child>tr:first-child th,.panel>.table>tbody:first-child>tr:first-child td{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th{border-bottom:0}.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}.panel>.table-responsive{margin-bottom:0;border:0}.panel-group{margin-bottom:20px}.panel-group .panel{margin-bottom:0;border-radius:4px}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse>.panel-body,.panel-group .panel-heading+.panel-collapse>.list-group{border-top:1px solid #ddd}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ddd}.panel-default{border-color:#ddd}.panel-default>.panel-heading{color:#333;background-color:#f5f5f5;border-color:#ddd}.panel-default>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ddd}.panel-default>.panel-heading .badge{color:#f5f5f5;background-color:#333}.panel-default>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ddd}.panel-primary{border-color:#428bca}.panel-primary>.panel-heading{color:#fff;background-color:#428bca;border-color:#428bca}.panel-primary>.panel-heading+.panel-collapse>.panel-body{border-top-color:#428bca}.panel-primary>.panel-heading .badge{color:#428bca;background-color:#fff}.panel-primary>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#428bca}.panel-success{border-color:#d6e9c6}.panel-success>.panel-heading{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.panel-success>.panel-heading+.panel-collapse>.panel-body{border-top-color:#d6e9c6}.panel-success>.panel-heading .badge{color:#dff0d8;background-color:#3c763d}.panel-success>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#d6e9c6}.panel-info{border-color:#bce8f1}.panel-info>.panel-heading{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.panel-info>.panel-heading+.panel-collapse>.panel-body{border-top-color:#bce8f1}.panel-info>.panel-heading .badge{color:#d9edf7;background-color:#31708f}.panel-info>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#bce8f1}.panel-warning{border-color:#faebcc}.panel-warning>.panel-heading{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.panel-warning>.panel-heading+.panel-collapse>.panel-body{border-top-color:#faebcc}.panel-warning>.panel-heading .badge{color:#fcf8e3;background-color:#8a6d3b}.panel-warning>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#faebcc}.panel-danger{border-color:#ebccd1}.panel-danger>.panel-heading{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.panel-danger>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ebccd1}.panel-danger>.panel-heading .badge{color:#f2dede;background-color:#a94442}.panel-danger>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ebccd1}.embed-responsive{position:relative;display:block;height:0;padding:0;overflow:hidden}.embed-responsive .embed-responsive-item,.embed-responsive iframe,.embed-responsive embed,.embed-responsive object,.embed-responsive video{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive.embed-responsive-16by9{padding-bottom:56.25%}.embed-responsive.embed-responsive-4by3{padding-bottom:75%}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.05);box-shadow:inset 0 1px 1px rgba(0,0,0,.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,.15)}.well-lg{padding:24px;border-radius:6px}.well-sm{padding:9px;border-radius:3px}.close{float:right;font-size:21px;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;filter:alpha(opacity=20);opacity:.2}.close:hover,.close:focus{color:#000;text-decoration:none;cursor:pointer;filter:alpha(opacity=50);opacity:.5}button.close{-webkit-appearance:none;padding:0;cursor:pointer;background:0 0;border:0}.modal-open{overflow:hidden}.modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;display:none;overflow:hidden;-webkit-overflow-scrolling:touch;outline:0}.modal.fade .modal-dialog{-webkit-transition:-webkit-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:transform .3s ease-out;-webkit-transform:translate(0,-25%);-ms-transform:translate(0,-25%);-o-transform:translate(0,-25%);transform:translate(0,-25%)}.modal.in .modal-dialog{-webkit-transform:translate(0,0);-ms-transform:translate(0,0);-o-transform:translate(0,0);transform:translate(0,0)}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #999;border:1px solid rgba(0,0,0,.2);border-radius:6px;outline:0;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5)}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background-color:#000}.modal-backdrop.fade{filter:alpha(opacity=0);opacity:0}.modal-backdrop.in{filter:alpha(opacity=50);opacity:.5}.modal-header{min-height:16.43px;padding:15px;border-bottom:1px solid #e5e5e5}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.42857143}.modal-body{position:relative;padding:15px}.modal-footer{padding:15px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer .btn+.btn{margin-bottom:0;margin-left:5px}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,.5);box-shadow:0 5px 15px rgba(0,0,0,.5)}.modal-sm{width:300px}}@media (min-width:992px){.modal-lg{width:900px}}.tooltip{position:absolute;z-index:1070;display:block;font-size:12px;line-height:1.4;visibility:visible;filter:alpha(opacity=0);opacity:0}.tooltip.in{filter:alpha(opacity=90);opacity:.9}.tooltip.top{padding:5px 0;margin-top:-3px}.tooltip.right{padding:0 5px;margin-left:3px}.tooltip.bottom{padding:5px 0;margin-top:3px}.tooltip.left{padding:0 5px;margin-left:-3px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;text-decoration:none;background-color:#000;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-left .tooltip-arrow{bottom:0;left:5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-right .tooltip-arrow{right:5px;bottom:0;border-width:5px 5px 0;border-top-color:#000}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-left .tooltip-arrow{top:0;left:5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-right .tooltip-arrow{top:0;right:5px;border-width:0 5px 5px;border-bottom-color:#000}.popover{position:absolute;top:0;left:0;z-index:1060;display:none;max-width:276px;padding:1px;font-size:14px;font-weight:400;line-height:1.42857143;text-align:left;white-space:normal;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2)}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{padding:8px 14px;margin:0;font-size:14px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover>.arrow,.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover>.arrow{border-width:11px}.popover>.arrow:after{content:"";border-width:10px}.popover.top>.arrow{bottom:-11px;left:50%;margin-left:-11px;border-top-color:#999;border-top-color:rgba(0,0,0,.25);border-bottom-width:0}.popover.top>.arrow:after{bottom:1px;margin-left:-10px;content:" ";border-top-color:#fff;border-bottom-width:0}.popover.right>.arrow{top:50%;left:-11px;margin-top:-11px;border-right-color:#999;border-right-color:rgba(0,0,0,.25);border-left-width:0}.popover.right>.arrow:after{bottom:-10px;left:1px;content:" ";border-right-color:#fff;border-left-width:0}.popover.bottom>.arrow{top:-11px;left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,.25)}.popover.bottom>.arrow:after{top:1px;margin-left:-10px;content:" ";border-top-width:0;border-bottom-color:#fff}.popover.left>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:rgba(0,0,0,.25)}.popover.left>.arrow:after{right:1px;bottom:-10px;content:" ";border-right-width:0;border-left-color:#fff}.carousel{position:relative}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner>.item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>img,.carousel-inner>.item>a>img{line-height:1}@media all and (transform-3d),(-webkit-transform-3d){.carousel-inner>.item{-webkit-transition:-webkit-transform .6s ease-in-out;-o-transition:-o-transform .6s ease-in-out;transition:transform .6s ease-in-out;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000;perspective:1000}.carousel-inner>.item.next,.carousel-inner>.item.active.right{left:0;-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}.carousel-inner>.item.prev,.carousel-inner>.item.active.left{left:0;-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}.carousel-inner>.item.next.left,.carousel-inner>.item.prev.right,.carousel-inner>.item.active{left:0;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;bottom:0;left:0;width:15%;font-size:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6);filter:alpha(opacity=50);opacity:.5}.carousel-control.left{background-image:-webkit-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.5)),to(rgba(0,0,0,.0001)));background-image:linear-gradient(to right,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);background-repeat:repeat-x}.carousel-control.right{right:0;left:auto;background-image:-webkit-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.0001)),to(rgba(0,0,0,.5)));background-image:linear-gradient(to right,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);background-repeat:repeat-x}.carousel-control:hover,.carousel-control:focus{color:#fff;text-decoration:none;filter:alpha(opacity=90);outline:0;opacity:.9}.carousel-control .icon-prev,.carousel-control .icon-next,.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right{position:absolute;top:50%;z-index:5;display:inline-block}.carousel-control .icon-prev,.carousel-control .glyphicon-chevron-left{left:50%;margin-left:-10px}.carousel-control .icon-next,.carousel-control .glyphicon-chevron-right{right:50%;margin-right:-10px}.carousel-control .icon-prev,.carousel-control .icon-next{width:20px;height:20px;margin-top:-10px;font-family:serif}.carousel-control .icon-prev:before{content:'\2039'}.carousel-control .icon-next:before{content:'\203a'}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;padding-left:0;margin-left:-30%;text-align:center;list-style:none}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;cursor:pointer;background-color:#000 \9;background-color:rgba(0,0,0,0);border:1px solid #fff;border-radius:10px}.carousel-indicators .active{width:12px;height:12px;margin:0;background-color:#fff}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-prev,.carousel-control .icon-next{width:30px;height:30px;margin-top:-15px;font-size:30px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{margin-left:-15px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{margin-right:-15px}.carousel-caption{right:20%;left:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.clearfix:before,.clearfix:after,.dl-horizontal dd:before,.dl-horizontal dd:after,.container:before,.container:after,.container-fluid:before,.container-fluid:after,.row:before,.row:after,.form-horizontal .form-group:before,.form-horizontal .form-group:after,.btn-toolbar:before,.btn-toolbar:after,.btn-group-vertical>.btn-group:before,.btn-group-vertical>.btn-group:after,.nav:before,.nav:after,.navbar:before,.navbar:after,.navbar-header:before,.navbar-header:after,.navbar-collapse:before,.navbar-collapse:after,.pager:before,.pager:after,.panel-body:before,.panel-body:after,.modal-footer:before,.modal-footer:after{display:table;content:" "}.clearfix:after,.dl-horizontal dd:after,.container:after,.container-fluid:after,.row:after,.form-horizontal .form-group:after,.btn-toolbar:after,.btn-group-vertical>.btn-group:after,.nav:after,.navbar:after,.navbar-header:after,.navbar-collapse:after,.pager:after,.panel-body:after,.modal-footer:after{clear:both}.center-block{display:block;margin-right:auto;margin-left:auto}.pull-right{float:right!important}.pull-left{float:left!important}.hide{display:none!important}.show{display:block!important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none!important;visibility:hidden!important}.affix{position:fixed}@-ms-viewport{width:device-width}.visible-xs,.visible-sm,.visible-md,.visible-lg{display:none!important}.visible-xs-block,.visible-xs-inline,.visible-xs-inline-block,.visible-sm-block,.visible-sm-inline,.visible-sm-inline-block,.visible-md-block,.visible-md-inline,.visible-md-inline-block,.visible-lg-block,.visible-lg-inline,.visible-lg-inline-block{display:none!important}@media (max-width:767px){.visible-xs{display:block!important}table.visible-xs{display:table}tr.visible-xs{display:table-row!important}th.visible-xs,td.visible-xs{display:table-cell!important}}@media (max-width:767px){.visible-xs-block{display:block!important}}@media (max-width:767px){.visible-xs-inline{display:inline!important}}@media (max-width:767px){.visible-xs-inline-block{display:inline-block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block!important}table.visible-sm{display:table}tr.visible-sm{display:table-row!important}th.visible-sm,td.visible-sm{display:table-cell!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-block{display:block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline{display:inline!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline-block{display:inline-block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block!important}table.visible-md{display:table}tr.visible-md{display:table-row!important}th.visible-md,td.visible-md{display:table-cell!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-block{display:block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline{display:inline!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline-block{display:inline-block!important}}@media (min-width:1200px){.visible-lg{display:block!important}table.visible-lg{display:table}tr.visible-lg{display:table-row!important}th.visible-lg,td.visible-lg{display:table-cell!important}}@media (min-width:1200px){.visible-lg-block{display:block!important}}@media (min-width:1200px){.visible-lg-inline{display:inline!important}}@media (min-width:1200px){.visible-lg-inline-block{display:inline-block!important}}@media (max-width:767px){.hidden-xs{display:none!important}}@media (min-width:768px) and (max-width:991px){.hidden-sm{display:none!important}}@media (min-width:992px) and (max-width:1199px){.hidden-md{display:none!important}}@media (min-width:1200px){.hidden-lg{display:none!important}}.visible-print{display:none!important}@media print{.visible-print{display:block!important}table.visible-print{display:table}tr.visible-print{display:table-row!important}th.visible-print,td.visible-print{display:table-cell!important}}.visible-print-block{display:none!important}@media print{.visible-print-block{display:block!important}}.visible-print-inline{display:none!important}@media print{.visible-print-inline{display:inline!important}}.visible-print-inline-block{display:none!important}@media print{.visible-print-inline-block{display:inline-block!important}}@media print{.hidden-print{display:none!important}} \ No newline at end of file + *//*! normalize.css v3.0.2 | MIT License | git.io/normalize */html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{margin:.67em 0;font-size:2em}mark{color:#000;background:#ff0}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{height:0;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{margin:0;font:inherit;color:inherit}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}input{line-height:normal}input[type=checkbox],input[type=radio]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{padding:.35em .625em .75em;margin:0 2px;border:1px solid silver}legend{padding:0;border:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-spacing:0;border-collapse:collapse}td,th{padding:0}/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */@media print{*,:before,:after{color:#000!important;text-shadow:none!important;background:transparent!important;-webkit-box-shadow:none!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="#"]:after,a[href^="javascript:"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100%!important}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}select{background:#fff!important}.navbar{display:none}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered th,.table-bordered td{border:1px solid #ddd!important}}@font-face{font-family:'Glyphicons Halflings';src:url(../fonts/glyphicons-halflings-regular.eot);src:url(../fonts/glyphicons-halflings-regular.eot?#iefix) format('embedded-opentype'),url(../fonts/glyphicons-halflings-regular.woff) format('woff'),url(../fonts/glyphicons-halflings-regular.ttf) format('truetype'),url(../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format('svg')}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-asterisk:before{content:"\2a"}.glyphicon-plus:before{content:"\2b"}.glyphicon-euro:before,.glyphicon-eur:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-lock:before{content:"\e033"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-bookmark:before{content:"\e044"}.glyphicon-print:before{content:"\e045"}.glyphicon-camera:before{content:"\e046"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-fire:before{content:"\e104"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-calendar:before{content:"\e109"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-bell:before{content:"\e123"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-wrench:before{content:"\e136"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-briefcase:before{content:"\e139"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-paperclip:before{content:"\e142"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-pushpin:before{content:"\e146"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:before{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.glyphicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:before,:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:10px;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.42857143;color:#333;background-color:#fff}input,button,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#428bca;text-decoration:none}a:hover,a:focus{color:#2a6496;text-decoration:underline}a:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.img-responsive,.thumbnail>img,.thumbnail a>img,.carousel-inner>.item>img,.carousel-inner>.item>a>img{display:block;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{display:inline-block;max-width:100%;height:auto;padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6{font-family:inherit;font-weight:500;line-height:1.1;color:inherit}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small,.h1 small,.h2 small,.h3 small,.h4 small,.h5 small,.h6 small,h1 .small,h2 .small,h3 .small,h4 .small,h5 .small,h6 .small,.h1 .small,.h2 .small,.h3 .small,.h4 .small,.h5 .small,.h6 .small{font-weight:400;line-height:1;color:#777}h1,.h1,h2,.h2,h3,.h3{margin-top:20px;margin-bottom:10px}h1 small,.h1 small,h2 small,.h2 small,h3 small,.h3 small,h1 .small,.h1 .small,h2 .small,.h2 .small,h3 .small,.h3 .small{font-size:65%}h4,.h4,h5,.h5,h6,.h6{margin-top:10px;margin-bottom:10px}h4 small,.h4 small,h5 small,.h5 small,h6 small,.h6 small,h4 .small,.h4 .small,h5 .small,.h5 .small,h6 .small,.h6 .small{font-size:75%}h1,.h1{font-size:36px}h2,.h2{font-size:30px}h3,.h3{font-size:24px}h4,.h4{font-size:18px}h5,.h5{font-size:14px}h6,.h6{font-size:12px}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:16px;font-weight:300;line-height:1.4}@media (min-width:768px){.lead{font-size:21px}}small,.small{font-size:85%}mark,.mark{padding:.2em;background-color:#fcf8e3}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-nowrap{white-space:nowrap}.text-lowercase{text-transform:lowercase}.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.text-muted{color:#777}.text-primary{color:#428bca}a.text-primary:hover{color:#3071a9}.text-success{color:#3c763d}a.text-success:hover{color:#2b542c}.text-info{color:#31708f}a.text-info:hover{color:#245269}.text-warning{color:#8a6d3b}a.text-warning:hover{color:#66512c}.text-danger{color:#a94442}a.text-danger:hover{color:#843534}.bg-primary{color:#fff;background-color:#428bca}a.bg-primary:hover{background-color:#3071a9}.bg-success{background-color:#dff0d8}a.bg-success:hover{background-color:#c1e2b3}.bg-info{background-color:#d9edf7}a.bg-info:hover{background-color:#afd9ee}.bg-warning{background-color:#fcf8e3}a.bg-warning:hover{background-color:#f7ecb5}.bg-danger{background-color:#f2dede}a.bg-danger:hover{background-color:#e4b9b9}.page-header{padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}ul,ol{margin-top:0;margin-bottom:10px}ul ul,ol ul,ul ol,ol ol{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;margin-left:-5px;list-style:none}.list-inline>li{display:inline-block;padding-right:5px;padding-left:5px}dl{margin-top:0;margin-bottom:20px}dt,dd{line-height:1.42857143}dt{font-weight:700}dd{margin-left:0}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}}abbr[title],abbr[data-original-title]{cursor:help;border-bottom:1px dotted #777}.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}blockquote p:last-child,blockquote ul:last-child,blockquote ol:last-child{margin-bottom:0}blockquote footer,blockquote small,blockquote .small{display:block;font-size:80%;line-height:1.42857143;color:#777}blockquote footer:before,blockquote small:before,blockquote .small:before{content:'\2014 \00A0'}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;text-align:right;border-right:5px solid #eee;border-left:0}.blockquote-reverse footer:before,blockquote.pull-right footer:before,.blockquote-reverse small:before,blockquote.pull-right small:before,.blockquote-reverse .small:before,blockquote.pull-right .small:before{content:''}.blockquote-reverse footer:after,blockquote.pull-right footer:after,.blockquote-reverse small:after,blockquote.pull-right small:after,.blockquote-reverse .small:after,blockquote.pull-right .small:after{content:'\00A0 \2014'}address{margin-bottom:20px;font-style:normal;line-height:1.42857143}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;border-radius:4px}kbd{padding:2px 4px;font-size:90%;color:#fff;background-color:#333;border-radius:3px;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.25);box-shadow:inset 0 -1px 0 rgba(0,0,0,.25)}kbd kbd{padding:0;font-size:100%;font-weight:700;-webkit-box-shadow:none;box-shadow:none}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.42857143;color:#333;word-break:break-all;word-wrap:break-word;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.row{margin-right:-15px;margin-left:-15px}.col-xs-1,.col-sm-1,.col-md-1,.col-lg-1,.col-xs-2,.col-sm-2,.col-md-2,.col-lg-2,.col-xs-3,.col-sm-3,.col-md-3,.col-lg-3,.col-xs-4,.col-sm-4,.col-md-4,.col-lg-4,.col-xs-5,.col-sm-5,.col-md-5,.col-lg-5,.col-xs-6,.col-sm-6,.col-md-6,.col-lg-6,.col-xs-7,.col-sm-7,.col-md-7,.col-lg-7,.col-xs-8,.col-sm-8,.col-md-8,.col-lg-8,.col-xs-9,.col-sm-9,.col-md-9,.col-lg-9,.col-xs-10,.col-sm-10,.col-md-10,.col-lg-10,.col-xs-11,.col-sm-11,.col-md-11,.col-lg-11,.col-xs-12,.col-sm-12,.col-md-12,.col-lg-12{position:relative;min-height:1px;padding-right:15px;padding-left:15px}.col-xs-1,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-10,.col-xs-11,.col-xs-12{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:auto}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:auto}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0}@media (min-width:768px){.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:auto}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:auto}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0}}@media (min-width:992px){.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:auto}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:auto}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0}}@media (min-width:1200px){.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11,.col-lg-12{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:auto}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:auto}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0}}table{background-color:transparent}caption{padding-top:8px;padding-bottom:8px;color:#777;text-align:left}th{text-align:left}.table{width:100%;max-width:100%;margin-bottom:20px}.table>thead>tr>th,.table>tbody>tr>th,.table>tfoot>tr>th,.table>thead>tr>td,.table>tbody>tr>td,.table>tfoot>tr>td{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>th,.table>caption+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>td,.table>thead:first-child>tr:first-child>td{border-top:0}.table>tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed>thead>tr>th,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>tbody>tr>td,.table-condensed>tfoot>tr>td{padding:5px}.table-bordered{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>tbody>tr>td,.table-bordered>tfoot>tr>td{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>thead>tr>td{border-bottom-width:2px}.table-striped>tbody>tr:nth-child(odd){background-color:#f9f9f9}.table-hover>tbody>tr:hover{background-color:#f5f5f5}table col[class*=col-]{position:static;display:table-column;float:none}table td[class*=col-],table th[class*=col-]{position:static;display:table-cell;float:none}.table>thead>tr>td.active,.table>tbody>tr>td.active,.table>tfoot>tr>td.active,.table>thead>tr>th.active,.table>tbody>tr>th.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>tbody>tr.active>td,.table>tfoot>tr.active>td,.table>thead>tr.active>th,.table>tbody>tr.active>th,.table>tfoot>tr.active>th{background-color:#f5f5f5}.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover,.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr.active:hover>th{background-color:#e8e8e8}.table>thead>tr>td.success,.table>tbody>tr>td.success,.table>tfoot>tr>td.success,.table>thead>tr>th.success,.table>tbody>tr>th.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>tbody>tr.success>td,.table>tfoot>tr.success>td,.table>thead>tr.success>th,.table>tbody>tr.success>th,.table>tfoot>tr.success>th{background-color:#dff0d8}.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover,.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr.success:hover>th{background-color:#d0e9c6}.table>thead>tr>td.info,.table>tbody>tr>td.info,.table>tfoot>tr>td.info,.table>thead>tr>th.info,.table>tbody>tr>th.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>tbody>tr.info>td,.table>tfoot>tr.info>td,.table>thead>tr.info>th,.table>tbody>tr.info>th,.table>tfoot>tr.info>th{background-color:#d9edf7}.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover,.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr.info:hover>th{background-color:#c4e3f3}.table>thead>tr>td.warning,.table>tbody>tr>td.warning,.table>tfoot>tr>td.warning,.table>thead>tr>th.warning,.table>tbody>tr>th.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>tbody>tr.warning>td,.table>tfoot>tr.warning>td,.table>thead>tr.warning>th,.table>tbody>tr.warning>th,.table>tfoot>tr.warning>th{background-color:#fcf8e3}.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover,.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr.warning:hover>th{background-color:#faf2cc}.table>thead>tr>td.danger,.table>tbody>tr>td.danger,.table>tfoot>tr>td.danger,.table>thead>tr>th.danger,.table>tbody>tr>th.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>tbody>tr.danger>td,.table>tfoot>tr.danger>td,.table>thead>tr.danger>th,.table>tbody>tr.danger>th,.table>tfoot>tr.danger>th{background-color:#f2dede}.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover,.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr.danger:hover>th{background-color:#ebcccc}.table-responsive{min-height:.01%;overflow-x:auto}@media screen and (max-width:767px){.table-responsive{width:100%;margin-bottom:15px;overflow-y:hidden;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ddd}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>thead>tr>th,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tfoot>tr>td{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>thead>tr>th:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.table-responsive>.table-bordered>thead>tr>th:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>th,.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>td{border-bottom:0}}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:inherit;color:#333;border:0;border-bottom:1px solid #e5e5e5}label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:700}input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type=radio],input[type=checkbox]{margin:4px 0 0;margin-top:1px \9;line-height:normal}input[type=file]{display:block}input[type=range]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type=file]:focus,input[type=radio]:focus,input[type=checkbox]:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}output{display:block;padding-top:7px;font-size:14px;line-height:1.42857143;color:#555}.form-control{display:block;width:100%;height:34px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.form-control::-moz-placeholder{color:#999;opacity:1}.form-control:-ms-input-placeholder{color:#999}.form-control::-webkit-input-placeholder{color:#999}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{cursor:not-allowed;background-color:#eee;opacity:1}.form-control[type=radio]{-webkit-box-shadow: none;box-shadow: none;}textarea.form-control{height:auto}input[type=search]{-webkit-appearance:none}input[type=date],input[type=time],input[type=datetime-local],input[type=month]{line-height:34px;line-height:1.42857143 \0}input[type=date].input-sm,input[type=time].input-sm,input[type=datetime-local].input-sm,input[type=month].input-sm{line-height:30px;line-height:1.5 \0}input[type=date].input-lg,input[type=time].input-lg,input[type=datetime-local].input-lg,input[type=month].input-lg{line-height:46px;line-height:1.33 \0}_:-ms-fullscreen,:root input[type=date],_:-ms-fullscreen,:root input[type=time],_:-ms-fullscreen,:root input[type=datetime-local],_:-ms-fullscreen,:root input[type=month]{line-height:1.42857143}_:-ms-fullscreen.input-sm,:root input[type=date].input-sm,_:-ms-fullscreen.input-sm,:root input[type=time].input-sm,_:-ms-fullscreen.input-sm,:root input[type=datetime-local].input-sm,_:-ms-fullscreen.input-sm,:root input[type=month].input-sm{line-height:1.5}_:-ms-fullscreen.input-lg,:root input[type=date].input-lg,_:-ms-fullscreen.input-lg,:root input[type=time].input-lg,_:-ms-fullscreen.input-lg,:root input[type=datetime-local].input-lg,_:-ms-fullscreen.input-lg,:root input[type=month].input-lg{line-height:1.33}.form-group{margin-bottom:15px}.radio,.checkbox{position:relative;display:block;margin-top:10px;margin-bottom:10px}.radio label,.checkbox label{min-height:20px;padding-left:20px;margin-bottom:0;font-weight:400;cursor:pointer}.radio input[type=radio],.radio-inline input[type=radio],.checkbox input[type=checkbox],.checkbox-inline input[type=checkbox]{position:absolute;margin-top:4px \9;margin-left:-20px}.radio+.radio,.checkbox+.checkbox{margin-top:-5px}.radio-inline,.checkbox-inline{display:inline-block;padding-left:20px;margin-bottom:0;font-weight:400;vertical-align:middle;cursor:pointer}.radio-inline+.radio-inline,.checkbox-inline+.checkbox-inline{margin-top:0;margin-left:10px}input[type=radio][disabled],input[type=checkbox][disabled],input[type=radio].disabled,input[type=checkbox].disabled,fieldset[disabled] input[type=radio],fieldset[disabled] input[type=checkbox]{cursor:not-allowed}.radio-inline.disabled,.checkbox-inline.disabled,fieldset[disabled] .radio-inline,fieldset[disabled] .checkbox-inline{cursor:not-allowed}.radio.disabled label,.checkbox.disabled label,fieldset[disabled] .radio label,fieldset[disabled] .checkbox label{cursor:not-allowed}.form-control-static{padding-top:7px;padding-bottom:7px;margin-bottom:0}.form-control-static.input-lg,.form-control-static.input-sm{padding-right:0;padding-left:0}.input-sm,.form-group-sm .form-control{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-sm,select.form-group-sm .form-control{height:30px;line-height:30px}textarea.input-sm,textarea.form-group-sm .form-control,select[multiple].input-sm,select[multiple].form-group-sm .form-control{height:auto}.input-lg,.form-group-lg .form-control{height:46px;padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}select.input-lg,select.form-group-lg .form-control{height:46px;line-height:46px}textarea.input-lg,textarea.form-group-lg .form-control,select[multiple].input-lg,select[multiple].form-group-lg .form-control{height:auto}.has-feedback{position:relative}.has-feedback .form-control{padding-right:42.5px}.form-control-feedback{position:absolute;top:0;right:0;z-index:2;display:block;width:34px;height:34px;line-height:34px;text-align:center;pointer-events:none}.input-lg+.form-control-feedback{width:46px;height:46px;line-height:46px}.input-sm+.form-control-feedback{width:30px;height:30px;line-height:30px}.has-success .help-block,.has-success .control-label,.has-success .radio,.has-success .checkbox,.has-success .radio-inline,.has-success .checkbox-inline,.has-success.radio label,.has-success.checkbox label,.has-success.radio-inline label,.has-success.checkbox-inline label{color:#3c763d}.has-success .form-control{border-color:#3c763d;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-success .form-control:focus{border-color:#2b542c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168}.has-success .input-group-addon{color:#3c763d;background-color:#dff0d8;border-color:#3c763d}.has-success .form-control-feedback{color:#3c763d}.has-warning .help-block,.has-warning .control-label,.has-warning .radio,.has-warning .checkbox,.has-warning .radio-inline,.has-warning .checkbox-inline,.has-warning.radio label,.has-warning.checkbox label,.has-warning.radio-inline label,.has-warning.checkbox-inline label{color:#8a6d3b}.has-warning .form-control{border-color:#8a6d3b;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-warning .form-control:focus{border-color:#66512c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b}.has-warning .input-group-addon{color:#8a6d3b;background-color:#fcf8e3;border-color:#8a6d3b}.has-warning .form-control-feedback{color:#8a6d3b}.has-error .help-block,.has-error .control-label,.has-error .radio,.has-error .checkbox,.has-error .radio-inline,.has-error .checkbox-inline,.has-error.radio label,.has-error.checkbox label,.has-error.radio-inline label,.has-error.checkbox-inline label{color:#a94442}.has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483}.has-error .input-group-addon{color:#a94442;background-color:#f2dede;border-color:#a94442}.has-error .form-control-feedback{color:#a94442}.has-feedback label~.form-control-feedback{top:25px}.has-feedback label.sr-only~.form-control-feedback{top:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#737373}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-static{display:inline-block}.form-inline .input-group{display:inline-table;vertical-align:middle}.form-inline .input-group .input-group-addon,.form-inline .input-group .input-group-btn,.form-inline .input-group .form-control{width:auto}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .radio,.form-inline .checkbox{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.form-inline .radio label,.form-inline .checkbox label{padding-left:0}.form-inline .radio input[type=radio],.form-inline .checkbox input[type=checkbox]{position:relative;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .radio,.form-horizontal .checkbox,.form-horizontal .radio-inline,.form-horizontal .checkbox-inline{padding-top:7px;margin-top:0;margin-bottom:0}.form-horizontal .radio,.form-horizontal .checkbox{min-height:27px}.form-horizontal .form-group{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.form-horizontal .control-label{padding-top:7px;margin-bottom:0;text-align:right}}.form-horizontal .has-feedback .form-control-feedback{right:15px}@media (min-width:768px){.form-horizontal .form-group-lg .control-label{padding-top:14.3px}}@media (min-width:768px){.form-horizontal .form-group-sm .control-label{padding-top:6px}}.btn{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:4px}.btn:focus,.btn:active:focus,.btn.active:focus,.btn.focus,.btn:active.focus,.btn.active.focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn:hover,.btn:focus,.btn.focus{color:#333;text-decoration:none}.btn:active,.btn.active{background-image:none;outline:0;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{pointer-events:none;cursor:not-allowed;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none;opacity:.65}.btn-default{color:#333;background-color:#fff;border-color:#ccc}.btn-default:hover,.btn-default:focus,.btn-default.focus,.btn-default:active,.btn-default.active,.open>.dropdown-toggle.btn-default{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default:active,.btn-default.active,.open>.dropdown-toggle.btn-default{background-image:none}.btn-default.disabled,.btn-default[disabled],fieldset[disabled] .btn-default,.btn-default.disabled:hover,.btn-default[disabled]:hover,fieldset[disabled] .btn-default:hover,.btn-default.disabled:focus,.btn-default[disabled]:focus,fieldset[disabled] .btn-default:focus,.btn-default.disabled.focus,.btn-default[disabled].focus,fieldset[disabled] .btn-default.focus,.btn-default.disabled:active,.btn-default[disabled]:active,fieldset[disabled] .btn-default:active,.btn-default.disabled.active,.btn-default[disabled].active,fieldset[disabled] .btn-default.active{background-color:#fff;border-color:#ccc}.btn-default .badge{color:#fff;background-color:#333}.btn-primary{color:#fff;background-color:#428bca;border-color:#357ebd}.btn-primary:hover,.btn-primary:focus,.btn-primary.focus,.btn-primary:active,.btn-primary.active,.open>.dropdown-toggle.btn-primary{color:#fff;background-color:#3071a9;border-color:#285e8e}.btn-primary:active,.btn-primary.active,.open>.dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled,.btn-primary[disabled],fieldset[disabled] .btn-primary,.btn-primary.disabled:hover,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary:hover,.btn-primary.disabled:focus,.btn-primary[disabled]:focus,fieldset[disabled] .btn-primary:focus,.btn-primary.disabled.focus,.btn-primary[disabled].focus,fieldset[disabled] .btn-primary.focus,.btn-primary.disabled:active,.btn-primary[disabled]:active,fieldset[disabled] .btn-primary:active,.btn-primary.disabled.active,.btn-primary[disabled].active,fieldset[disabled] .btn-primary.active{background-color:#428bca;border-color:#357ebd}.btn-primary .badge{color:#428bca;background-color:#fff}.btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.btn-success:hover,.btn-success:focus,.btn-success.focus,.btn-success:active,.btn-success.active,.open>.dropdown-toggle.btn-success{color:#fff;background-color:#449d44;border-color:#398439}.btn-success:active,.btn-success.active,.open>.dropdown-toggle.btn-success{background-image:none}.btn-success.disabled,.btn-success[disabled],fieldset[disabled] .btn-success,.btn-success.disabled:hover,.btn-success[disabled]:hover,fieldset[disabled] .btn-success:hover,.btn-success.disabled:focus,.btn-success[disabled]:focus,fieldset[disabled] .btn-success:focus,.btn-success.disabled.focus,.btn-success[disabled].focus,fieldset[disabled] .btn-success.focus,.btn-success.disabled:active,.btn-success[disabled]:active,fieldset[disabled] .btn-success:active,.btn-success.disabled.active,.btn-success[disabled].active,fieldset[disabled] .btn-success.active{background-color:#5cb85c;border-color:#4cae4c}.btn-success .badge{color:#5cb85c;background-color:#fff}.btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.btn-info:hover,.btn-info:focus,.btn-info.focus,.btn-info:active,.btn-info.active,.open>.dropdown-toggle.btn-info{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info:active,.btn-info.active,.open>.dropdown-toggle.btn-info{background-image:none}.btn-info.disabled,.btn-info[disabled],fieldset[disabled] .btn-info,.btn-info.disabled:hover,.btn-info[disabled]:hover,fieldset[disabled] .btn-info:hover,.btn-info.disabled:focus,.btn-info[disabled]:focus,fieldset[disabled] .btn-info:focus,.btn-info.disabled.focus,.btn-info[disabled].focus,fieldset[disabled] .btn-info.focus,.btn-info.disabled:active,.btn-info[disabled]:active,fieldset[disabled] .btn-info:active,.btn-info.disabled.active,.btn-info[disabled].active,fieldset[disabled] .btn-info.active{background-color:#5bc0de;border-color:#46b8da}.btn-info .badge{color:#5bc0de;background-color:#fff}.btn-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.btn-warning:hover,.btn-warning:focus,.btn-warning.focus,.btn-warning:active,.btn-warning.active,.open>.dropdown-toggle.btn-warning{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning:active,.btn-warning.active,.open>.dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled,.btn-warning[disabled],fieldset[disabled] .btn-warning,.btn-warning.disabled:hover,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning:hover,.btn-warning.disabled:focus,.btn-warning[disabled]:focus,fieldset[disabled] .btn-warning:focus,.btn-warning.disabled.focus,.btn-warning[disabled].focus,fieldset[disabled] .btn-warning.focus,.btn-warning.disabled:active,.btn-warning[disabled]:active,fieldset[disabled] .btn-warning:active,.btn-warning.disabled.active,.btn-warning[disabled].active,fieldset[disabled] .btn-warning.active{background-color:#f0ad4e;border-color:#eea236}.btn-warning .badge{color:#f0ad4e;background-color:#fff}.btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.btn-danger:hover,.btn-danger:focus,.btn-danger.focus,.btn-danger:active,.btn-danger.active,.open>.dropdown-toggle.btn-danger{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger:active,.btn-danger.active,.open>.dropdown-toggle.btn-danger{background-image:none}.btn-danger.disabled,.btn-danger[disabled],fieldset[disabled] .btn-danger,.btn-danger.disabled:hover,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger:hover,.btn-danger.disabled:focus,.btn-danger[disabled]:focus,fieldset[disabled] .btn-danger:focus,.btn-danger.disabled.focus,.btn-danger[disabled].focus,fieldset[disabled] .btn-danger.focus,.btn-danger.disabled:active,.btn-danger[disabled]:active,fieldset[disabled] .btn-danger:active,.btn-danger.disabled.active,.btn-danger[disabled].active,fieldset[disabled] .btn-danger.active{background-color:#d9534f;border-color:#d43f3a}.btn-danger .badge{color:#d9534f;background-color:#fff}.btn-link{font-weight:400;color:#428bca;border-radius:0}.btn-link,.btn-link:active,.btn-link.active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:hover,.btn-link:focus,.btn-link:active{border-color:transparent}.btn-link:hover,.btn-link:focus{color:#2a6496;text-decoration:underline;background-color:transparent}.btn-link[disabled]:hover,fieldset[disabled] .btn-link:hover,.btn-link[disabled]:focus,fieldset[disabled] .btn-link:focus{color:#777;text-decoration:none}.btn-lg,.btn-group-lg>.btn{padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}.btn-sm,.btn-group-sm>.btn{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-xs,.btn-group-xs>.btn{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:5px}input[type=submit].btn-block,input[type=reset].btn-block,input[type=button].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none;visibility:hidden}.collapse.in{display:block;visibility:visible}tr.collapse.in{display:table-row}tbody.collapse.in{display:table-row-group}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition-timing-function:ease;-o-transition-timing-function:ease;transition-timing-function:ease;-webkit-transition-duration:.35s;-o-transition-duration:.35s;transition-duration:.35s;-webkit-transition-property:height,visibility;-o-transition-property:height,visibility;transition-property:height,visibility}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px solid;border-right:4px solid transparent;border-left:4px solid transparent}.dropdown{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;font-size:14px;text-align:left;list-style:none;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175)}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus{color:#262626;text-decoration:none;background-color:#f5f5f5}.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{color:#fff;text-decoration:none;background-color:#428bca;outline:0}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{color:#777}.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{text-decoration:none;cursor:not-allowed;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{right:0;left:auto}.dropdown-menu-left{right:auto;left:0}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#777;white-space:nowrap}.dropdown-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{content:"";border-top:0;border-bottom:4px solid}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:1px}@media (min-width:768px){.navbar-right .dropdown-menu{right:0;left:auto}.navbar-right .dropdown-menu-left{right:auto;left:0}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group>.btn,.btn-group-vertical>.btn{position:relative;float:left}.btn-group>.btn:hover,.btn-group-vertical>.btn:hover,.btn-group>.btn:focus,.btn-group-vertical>.btn:focus,.btn-group>.btn:active,.btn-group-vertical>.btn:active,.btn-group>.btn.active,.btn-group-vertical>.btn.active{z-index:2}.btn-group>.btn:focus,.btn-group-vertical>.btn:focus{outline:0}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{margin-left:-5px}.btn-toolbar .btn-group,.btn-toolbar .input-group{float:left}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child>.btn:last-child,.btn-group>.btn-group:first-child>.dropdown-toggle{border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:last-child>.btn:first-child{border-top-left-radius:0;border-bottom-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-right:8px;padding-left:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-right:12px;padding-left:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-top-left-radius:0;border-top-right-radius:0;border-bottom-left-radius:4px}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-top-right-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified>.btn,.btn-group-justified>.btn-group{display:table-cell;float:none;width:1%}.btn-group-justified>.btn-group .btn{width:100%}.btn-group-justified>.btn-group .dropdown-menu{left:auto}[data-toggle=buttons]>.btn input[type=radio],[data-toggle=buttons]>.btn-group>.btn input[type=radio],[data-toggle=buttons]>.btn input[type=checkbox],[data-toggle=buttons]>.btn-group>.btn input[type=checkbox]{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*=col-]{float:none;padding-right:0;padding-left:0}.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:46px;padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:46px;line-height:46px}textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn,select[multiple].input-group-lg>.form-control,select[multiple].input-group-lg>.input-group-addon,select[multiple].input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:30px;line-height:30px}textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn,select[multiple].input-group-sm>.form-control,select[multiple].input-group-sm>.input-group-addon,select[multiple].input-group-sm>.input-group-btn>.btn{height:auto}.input-group-addon,.input-group-btn,.input-group .form-control{display:table-cell}.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child),.input-group .form-control:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:6px 12px;font-size:14px;font-weight:400;line-height:1;color:#555;text-align:center;background-color:#eee;border:1px solid #ccc;border-radius:4px}.input-group-addon.input-sm{padding:5px 10px;font-size:12px;border-radius:3px}.input-group-addon.input-lg{padding:10px 16px;font-size:18px;border-radius:6px}.input-group-addon input[type=radio],.input-group-addon input[type=checkbox]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle),.input-group-btn:last-child>.btn-group:not(:last-child)>.btn{border-top-right-radius:0;border-bottom-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:first-child>.btn-group:not(:first-child)>.btn{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;font-size:0;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:hover,.input-group-btn>.btn:focus,.input-group-btn>.btn:active{z-index:2}.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group{margin-right:-1px}.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group{margin-left:-1px}.nav{padding-left:0;margin-bottom:0;list-style:none}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:hover,.nav>li>a:focus{text-decoration:none;background-color:#eee}.nav>li.disabled>a{color:#777}.nav>li.disabled>a:hover,.nav>li.disabled>a:focus{color:#777;text-decoration:none;cursor:not-allowed;background-color:transparent}.nav .open>a,.nav .open>a:hover,.nav .open>a:focus{background-color:#eee;border-color:#428bca}.nav .nav-divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.42857143;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:hover,.nav-tabs>li.active>a:focus{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border:1px solid #ddd}@media (min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border-bottom-color:#fff}}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:hover,.nav-pills>li.active>a:focus{color:#fff;background-color:#428bca}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border:1px solid #ddd}@media (min-width:768px){.nav-tabs-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border-bottom-color:#fff}}.tab-content>.tab-pane{display:none;visibility:hidden}.tab-content>.active{display:block;visibility:visible}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.navbar{position:relative;min-height:50px;margin-bottom:20px;border:1px solid transparent}@media (min-width:768px){.navbar{border-radius:4px}}@media (min-width:768px){.navbar-header{float:left}}.navbar-collapse{padding-right:15px;padding-left:15px;overflow-x:visible;-webkit-overflow-scrolling:touch;border-top:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1)}.navbar-collapse.in{overflow-y:auto}@media (min-width:768px){.navbar-collapse{width:auto;border-top:0;-webkit-box-shadow:none;box-shadow:none}.navbar-collapse.collapse{display:block!important;height:auto!important;padding-bottom:0;overflow:visible!important;visibility:visible!important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{padding-right:0;padding-left:0}}.navbar-fixed-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{max-height:340px}@media (max-device-width:480px) and (orientation:landscape){.navbar-fixed-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{max-height:200px}}.container>.navbar-header,.container-fluid>.navbar-header,.container>.navbar-collapse,.container-fluid>.navbar-collapse{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.container>.navbar-header,.container-fluid>.navbar-header,.container>.navbar-collapse,.container-fluid>.navbar-collapse{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 1px}@media (min-width:768px){.navbar-static-top{border-radius:0}}.navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;z-index:1030}@media (min-width:768px){.navbar-fixed-top,.navbar-fixed-bottom{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.navbar-brand{float:left;height:50px;padding:15px 15px;font-size:18px;line-height:20px}.navbar-brand:hover,.navbar-brand:focus{text-decoration:none}.navbar-brand>img{display:block}@media (min-width:768px){.navbar>.container .navbar-brand,.navbar>.container-fluid .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;padding:9px 10px;margin-top:8px;margin-right:15px;margin-bottom:8px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px}.navbar-toggle:focus{outline:0}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media (min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:7.5px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:20px}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-nav .open .dropdown-menu>li>a,.navbar-nav .open .dropdown-menu .dropdown-header{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:20px}.navbar-nav .open .dropdown-menu>li>a:hover,.navbar-nav .open .dropdown-menu>li>a:focus{background-image:none}}@media (min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:15px;padding-bottom:15px}}.navbar-form{padding:10px 15px;margin-top:8px;margin-right:-15px;margin-bottom:8px;margin-left:-15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1)}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .form-control-static{display:inline-block}.navbar-form .input-group{display:inline-table;vertical-align:middle}.navbar-form .input-group .input-group-addon,.navbar-form .input-group .input-group-btn,.navbar-form .input-group .form-control{width:auto}.navbar-form .input-group>.form-control{width:100%}.navbar-form .control-label{margin-bottom:0;vertical-align:middle}.navbar-form .radio,.navbar-form .checkbox{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.navbar-form .radio label,.navbar-form .checkbox label{padding-left:0}.navbar-form .radio input[type=radio],.navbar-form .checkbox input[type=checkbox]{position:relative;margin-left:0}.navbar-form .has-feedback .form-control-feedback{top:0}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}.navbar-form .form-group:last-child{margin-bottom:0}}@media (min-width:768px){.navbar-form{width:auto;padding-top:0;padding-bottom:0;margin-right:0;margin-left:0;border:0;-webkit-box-shadow:none;box-shadow:none}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-left-radius:0;border-top-right-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-btn{margin-top:8px;margin-bottom:8px}.navbar-btn.btn-sm{margin-top:10px;margin-bottom:10px}.navbar-btn.btn-xs{margin-top:14px;margin-bottom:14px}.navbar-text{margin-top:15px;margin-bottom:15px}@media (min-width:768px){.navbar-text{float:left;margin-right:15px;margin-left:15px}}@media (min-width:768px){.navbar-left{float:left!important}.navbar-right{float:right!important;margin-right:-15px}.navbar-right~.navbar-right{margin-right:0}}.navbar-default{background-color:#f8f8f8;border-color:#e7e7e7}.navbar-default .navbar-brand{color:#777}.navbar-default .navbar-brand:hover,.navbar-default .navbar-brand:focus{color:#5e5e5e;background-color:transparent}.navbar-default .navbar-text{color:#777}.navbar-default .navbar-nav>li>a{color:#777}.navbar-default .navbar-nav>li>a:hover,.navbar-default .navbar-nav>li>a:focus{color:#333;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:hover,.navbar-default .navbar-nav>.active>a:focus{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:hover,.navbar-default .navbar-nav>.disabled>a:focus{color:#ccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:#ddd}.navbar-default .navbar-toggle:hover,.navbar-default .navbar-toggle:focus{background-color:#ddd}.navbar-default .navbar-toggle .icon-bar{background-color:#888}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#e7e7e7}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:hover,.navbar-default .navbar-nav>.open>a:focus{color:#555;background-color:#e7e7e7}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus{color:#333;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#ccc;background-color:transparent}}.navbar-default .navbar-link{color:#777}.navbar-default .navbar-link:hover{color:#333}.navbar-default .btn-link{color:#777}.navbar-default .btn-link:hover,.navbar-default .btn-link:focus{color:#333}.navbar-default .btn-link[disabled]:hover,fieldset[disabled] .navbar-default .btn-link:hover,.navbar-default .btn-link[disabled]:focus,fieldset[disabled] .navbar-default .btn-link:focus{color:#ccc}.navbar-inverse{background-color:#222;border-color:#080808}.navbar-inverse .navbar-brand{color:#9d9d9d}.navbar-inverse .navbar-brand:hover,.navbar-inverse .navbar-brand:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-text{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a:hover,.navbar-inverse .navbar-nav>li>a:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:hover,.navbar-inverse .navbar-nav>.active>a:focus{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:hover,.navbar-inverse .navbar-nav>.disabled>a:focus{color:#444;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#333}.navbar-inverse .navbar-toggle:hover,.navbar-inverse .navbar-toggle:focus{background-color:#333}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#101010}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:hover,.navbar-inverse .navbar-nav>.open>a:focus{color:#fff;background-color:#080808}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#444;background-color:transparent}}.navbar-inverse .navbar-link{color:#9d9d9d}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .btn-link{color:#9d9d9d}.navbar-inverse .btn-link:hover,.navbar-inverse .btn-link:focus{color:#fff}.navbar-inverse .btn-link[disabled]:hover,fieldset[disabled] .navbar-inverse .btn-link:hover,.navbar-inverse .btn-link[disabled]:focus,fieldset[disabled] .navbar-inverse .btn-link:focus{color:#444}.breadcrumb{padding:8px 15px;margin-bottom:20px;list-style:none;background-color:#f5f5f5;border-radius:4px}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{padding:0 5px;color:#ccc;content:"/\00a0"}.breadcrumb>.active{color:#777}.pagination{display:inline-block;padding-left:0;margin:20px 0;border-radius:4px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 12px;margin-left:-1px;line-height:1.42857143;color:#428bca;text-decoration:none;background-color:#fff;border:1px solid #ddd}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-top-left-radius:4px;border-bottom-left-radius:4px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-top-right-radius:4px;border-bottom-right-radius:4px}.pagination>li>a:hover,.pagination>li>span:hover,.pagination>li>a:focus,.pagination>li>span:focus{color:#2a6496;background-color:#eee;border-color:#ddd}.pagination>.active>a,.pagination>.active>span,.pagination>.active>a:hover,.pagination>.active>span:hover,.pagination>.active>a:focus,.pagination>.active>span:focus{z-index:2;color:#fff;cursor:default;background-color:#428bca;border-color:#428bca}.pagination>.disabled>span,.pagination>.disabled>span:hover,.pagination>.disabled>span:focus,.pagination>.disabled>a,.pagination>.disabled>a:hover,.pagination>.disabled>a:focus{color:#777;cursor:not-allowed;background-color:#fff;border-color:#ddd}.pagination-lg>li>a,.pagination-lg>li>span{padding:10px 16px;font-size:18px}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-top-left-radius:6px;border-bottom-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-top-right-radius:6px;border-bottom-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-top-left-radius:3px;border-bottom-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-top-right-radius:3px;border-bottom-right-radius:3px}.pager{padding-left:0;margin:20px 0;text-align:center;list-style:none}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;border-radius:15px}.pager li>a:hover,.pager li>a:focus{text-decoration:none;background-color:#eee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:hover,.pager .disabled>a:focus,.pager .disabled>span{color:#777;cursor:not-allowed;background-color:#fff}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}a.label:hover,a.label:focus{color:#fff;text-decoration:none;cursor:pointer}.label:empty{display:none}.btn .label{position:relative;top:-1px}.label-default{background-color:#777}.label-default[href]:hover,.label-default[href]:focus{background-color:#5e5e5e}.label-primary{background-color:#428bca}.label-primary[href]:hover,.label-primary[href]:focus{background-color:#3071a9}.label-success{background-color:#5cb85c}.label-success[href]:hover,.label-success[href]:focus{background-color:#449d44}.label-info{background-color:#5bc0de}.label-info[href]:hover,.label-info[href]:focus{background-color:#31b0d5}.label-warning{background-color:#f0ad4e}.label-warning[href]:hover,.label-warning[href]:focus{background-color:#ec971f}.label-danger{background-color:#d9534f}.label-danger[href]:hover,.label-danger[href]:focus{background-color:#c9302c}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;background-color:#777;border-radius:10px}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.btn-xs .badge{top:0;padding:1px 5px}a.badge:hover,a.badge:focus{color:#fff;text-decoration:none;cursor:pointer}a.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#428bca;background-color:#fff}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding:30px 15px;margin-bottom:30px;color:inherit;background-color:#eee}.jumbotron h1,.jumbotron .h1{color:inherit}.jumbotron p{margin-bottom:15px;font-size:21px;font-weight:200}.jumbotron>hr{border-top-color:#d5d5d5}.container .jumbotron,.container-fluid .jumbotron{border-radius:6px}.jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding:48px 0}.container .jumbotron{padding-right:60px;padding-left:60px}.jumbotron h1,.jumbotron .h1{font-size:63px}}.thumbnail{display:block;padding:4px;margin-bottom:20px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:border .2s ease-in-out;-o-transition:border .2s ease-in-out;transition:border .2s ease-in-out}.thumbnail>img,.thumbnail a>img{margin-right:auto;margin-left:auto}a.thumbnail:hover,a.thumbnail:focus,a.thumbnail.active{border-color:#428bca}.thumbnail .caption{padding:9px;color:#333}.alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:700}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable,.alert-dismissible{padding-right:35px}.alert-dismissable .close,.alert-dismissible .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#2b542c}.alert-info{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.alert-info hr{border-top-color:#a6e1ec}.alert-info .alert-link{color:#245269}.alert-warning{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.alert-warning hr{border-top-color:#f7e1b5}.alert-warning .alert-link{color:#66512c}.alert-danger{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.alert-danger hr{border-top-color:#e4b9c0}.alert-danger .alert-link{color:#843534}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{height:20px;margin-bottom:20px;overflow:hidden;background-color:#f5f5f5;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1)}.progress-bar{float:left;width:0;height:100%;font-size:12px;line-height:20px;color:#fff;text-align:center;background-color:#428bca;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);-webkit-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress-striped .progress-bar,.progress-bar-striped{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);-webkit-background-size:40px 40px;background-size:40px 40px}.progress.active .progress-bar,.progress-bar.active{-webkit-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar-success{background-color:#5cb85c}.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-info{background-color:#5bc0de}.progress-striped .progress-bar-info{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-warning{background-color:#f0ad4e}.progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-danger{background-color:#d9534f}.progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.media{margin-top:15px}.media:first-child{margin-top:0}.media-right,.media>.pull-right{padding-left:10px}.media-left,.media>.pull-left{padding-right:10px}.media-left,.media-right,.media-body{display:table-cell;vertical-align:top}.media-middle{vertical-align:middle}.media-bottom{vertical-align:bottom}.media-heading{margin-top:0;margin-bottom:5px}.media-list{padding-left:0;list-style:none}.list-group{padding-left:0;margin-bottom:20px}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #ddd}.list-group-item:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}a.list-group-item{color:#555}a.list-group-item .list-group-item-heading{color:#333}a.list-group-item:hover,a.list-group-item:focus{color:#555;text-decoration:none;background-color:#f5f5f5}.list-group-item.disabled,.list-group-item.disabled:hover,.list-group-item.disabled:focus{color:#777;cursor:not-allowed;background-color:#eee}.list-group-item.disabled .list-group-item-heading,.list-group-item.disabled:hover .list-group-item-heading,.list-group-item.disabled:focus .list-group-item-heading{color:inherit}.list-group-item.disabled .list-group-item-text,.list-group-item.disabled:hover .list-group-item-text,.list-group-item.disabled:focus .list-group-item-text{color:#777}.list-group-item.active,.list-group-item.active:hover,.list-group-item.active:focus{z-index:2;color:#fff;background-color:#428bca;border-color:#428bca}.list-group-item.active .list-group-item-heading,.list-group-item.active:hover .list-group-item-heading,.list-group-item.active:focus .list-group-item-heading,.list-group-item.active .list-group-item-heading>small,.list-group-item.active:hover .list-group-item-heading>small,.list-group-item.active:focus .list-group-item-heading>small,.list-group-item.active .list-group-item-heading>.small,.list-group-item.active:hover .list-group-item-heading>.small,.list-group-item.active:focus .list-group-item-heading>.small{color:inherit}.list-group-item.active .list-group-item-text,.list-group-item.active:hover .list-group-item-text,.list-group-item.active:focus .list-group-item-text{color:#e1edf7}.list-group-item-success{color:#3c763d;background-color:#dff0d8}a.list-group-item-success{color:#3c763d}a.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:hover,a.list-group-item-success:focus{color:#3c763d;background-color:#d0e9c6}a.list-group-item-success.active,a.list-group-item-success.active:hover,a.list-group-item-success.active:focus{color:#fff;background-color:#3c763d;border-color:#3c763d}.list-group-item-info{color:#31708f;background-color:#d9edf7}a.list-group-item-info{color:#31708f}a.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:hover,a.list-group-item-info:focus{color:#31708f;background-color:#c4e3f3}a.list-group-item-info.active,a.list-group-item-info.active:hover,a.list-group-item-info.active:focus{color:#fff;background-color:#31708f;border-color:#31708f}.list-group-item-warning{color:#8a6d3b;background-color:#fcf8e3}a.list-group-item-warning{color:#8a6d3b}a.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:hover,a.list-group-item-warning:focus{color:#8a6d3b;background-color:#faf2cc}a.list-group-item-warning.active,a.list-group-item-warning.active:hover,a.list-group-item-warning.active:focus{color:#fff;background-color:#8a6d3b;border-color:#8a6d3b}.list-group-item-danger{color:#a94442;background-color:#f2dede}a.list-group-item-danger{color:#a94442}a.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:hover,a.list-group-item-danger:focus{color:#a94442;background-color:#ebcccc}a.list-group-item-danger.active,a.list-group-item-danger.active:hover,a.list-group-item-danger.active:focus{color:#fff;background-color:#a94442;border-color:#a94442}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:20px;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}.panel-body{padding:15px}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-left-radius:3px;border-top-right-radius:3px}.panel-heading>.dropdown .dropdown-toggle{color:inherit}.panel-title{margin-top:0;margin-bottom:0;font-size:16px;color:inherit}.panel-title>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.list-group,.panel>.panel-collapse>.list-group{margin-bottom:0}.panel>.list-group .list-group-item,.panel>.panel-collapse>.list-group .list-group-item{border-width:1px 0;border-radius:0}.panel>.list-group:first-child .list-group-item:first-child,.panel>.panel-collapse>.list-group:first-child .list-group-item:first-child{border-top:0;border-top-left-radius:3px;border-top-right-radius:3px}.panel>.list-group:last-child .list-group-item:last-child,.panel>.panel-collapse>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.list-group+.panel-footer{border-top-width:0}.panel>.table,.panel>.table-responsive>.table,.panel>.panel-collapse>.table{margin-bottom:0}.panel>.table caption,.panel>.table-responsive>.table caption,.panel>.panel-collapse>.table caption{padding-right:15px;padding-left:15px}.panel>.table:first-child,.panel>.table-responsive:first-child>.table:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table:first-child>thead:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child{border-top-left-radius:3px}.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child{border-top-right-radius:3px}.panel>.table:last-child,.panel>.table-responsive:last-child>.table:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table:last-child>tbody:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child{border-bottom-left-radius:3px}.panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child{border-bottom-right-radius:3px}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive,.panel>.table+.panel-body,.panel>.table-responsive+.panel-body{border-top:1px solid #ddd}.panel>.table>tbody:first-child>tr:first-child th,.panel>.table>tbody:first-child>tr:first-child td{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th{border-bottom:0}.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}.panel>.table-responsive{margin-bottom:0;border:0}.panel-group{margin-bottom:20px}.panel-group .panel{margin-bottom:0;border-radius:4px}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse>.panel-body,.panel-group .panel-heading+.panel-collapse>.list-group{border-top:1px solid #ddd}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ddd}.panel-default{border-color:#ddd}.panel-default>.panel-heading{color:#333;background-color:#f5f5f5;border-color:#ddd}.panel-default>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ddd}.panel-default>.panel-heading .badge{color:#f5f5f5;background-color:#333}.panel-default>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ddd}.panel-primary{border-color:#428bca}.panel-primary>.panel-heading{color:#fff;background-color:#428bca;border-color:#428bca}.panel-primary>.panel-heading+.panel-collapse>.panel-body{border-top-color:#428bca}.panel-primary>.panel-heading .badge{color:#428bca;background-color:#fff}.panel-primary>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#428bca}.panel-success{border-color:#d6e9c6}.panel-success>.panel-heading{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.panel-success>.panel-heading+.panel-collapse>.panel-body{border-top-color:#d6e9c6}.panel-success>.panel-heading .badge{color:#dff0d8;background-color:#3c763d}.panel-success>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#d6e9c6}.panel-info{border-color:#bce8f1}.panel-info>.panel-heading{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.panel-info>.panel-heading+.panel-collapse>.panel-body{border-top-color:#bce8f1}.panel-info>.panel-heading .badge{color:#d9edf7;background-color:#31708f}.panel-info>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#bce8f1}.panel-warning{border-color:#faebcc}.panel-warning>.panel-heading{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.panel-warning>.panel-heading+.panel-collapse>.panel-body{border-top-color:#faebcc}.panel-warning>.panel-heading .badge{color:#fcf8e3;background-color:#8a6d3b}.panel-warning>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#faebcc}.panel-danger{border-color:#ebccd1}.panel-danger>.panel-heading{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.panel-danger>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ebccd1}.panel-danger>.panel-heading .badge{color:#f2dede;background-color:#a94442}.panel-danger>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ebccd1}.embed-responsive{position:relative;display:block;height:0;padding:0;overflow:hidden}.embed-responsive .embed-responsive-item,.embed-responsive iframe,.embed-responsive embed,.embed-responsive object,.embed-responsive video{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive.embed-responsive-16by9{padding-bottom:56.25%}.embed-responsive.embed-responsive-4by3{padding-bottom:75%}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.05);box-shadow:inset 0 1px 1px rgba(0,0,0,.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,.15)}.well-lg{padding:24px;border-radius:6px}.well-sm{padding:9px;border-radius:3px}.close{float:right;font-size:21px;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;filter:alpha(opacity=20);opacity:.2}.close:hover,.close:focus{color:#000;text-decoration:none;cursor:pointer;filter:alpha(opacity=50);opacity:.5}button.close{-webkit-appearance:none;padding:0;cursor:pointer;background:0 0;border:0}.modal-open{overflow:hidden}.modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;display:none;overflow:hidden;-webkit-overflow-scrolling:touch;outline:0}.modal.fade .modal-dialog{-webkit-transition:-webkit-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:transform .3s ease-out;-webkit-transform:translate(0,-25%);-ms-transform:translate(0,-25%);-o-transform:translate(0,-25%);transform:translate(0,-25%)}.modal.in .modal-dialog{-webkit-transform:translate(0,0);-ms-transform:translate(0,0);-o-transform:translate(0,0);transform:translate(0,0)}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #999;border:1px solid rgba(0,0,0,.2);border-radius:6px;outline:0;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5)}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background-color:#000}.modal-backdrop.fade{filter:alpha(opacity=0);opacity:0}.modal-backdrop.in{filter:alpha(opacity=50);opacity:.5}.modal-header{min-height:16.43px;padding:15px;border-bottom:1px solid #e5e5e5}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.42857143}.modal-body{position:relative;padding:15px}.modal-footer{padding:15px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer .btn+.btn{margin-bottom:0;margin-left:5px}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,.5);box-shadow:0 5px 15px rgba(0,0,0,.5)}.modal-sm{width:300px}}@media (min-width:992px){.modal-lg{width:900px}}.tooltip{position:absolute;z-index:1070;display:block;font-size:12px;line-height:1.4;visibility:visible;filter:alpha(opacity=0);opacity:0}.tooltip.in{filter:alpha(opacity=90);opacity:.9}.tooltip.top{padding:5px 0;margin-top:-3px}.tooltip.right{padding:0 5px;margin-left:3px}.tooltip.bottom{padding:5px 0;margin-top:3px}.tooltip.left{padding:0 5px;margin-left:-3px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;text-decoration:none;background-color:#000;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-left .tooltip-arrow{bottom:0;left:5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-right .tooltip-arrow{right:5px;bottom:0;border-width:5px 5px 0;border-top-color:#000}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-left .tooltip-arrow{top:0;left:5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-right .tooltip-arrow{top:0;right:5px;border-width:0 5px 5px;border-bottom-color:#000}.popover{position:absolute;top:0;left:0;z-index:1060;display:none;max-width:276px;padding:1px;font-size:14px;font-weight:400;line-height:1.42857143;text-align:left;white-space:normal;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2)}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{padding:8px 14px;margin:0;font-size:14px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover>.arrow,.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover>.arrow{border-width:11px}.popover>.arrow:after{content:"";border-width:10px}.popover.top>.arrow{bottom:-11px;left:50%;margin-left:-11px;border-top-color:#999;border-top-color:rgba(0,0,0,.25);border-bottom-width:0}.popover.top>.arrow:after{bottom:1px;margin-left:-10px;content:" ";border-top-color:#fff;border-bottom-width:0}.popover.right>.arrow{top:50%;left:-11px;margin-top:-11px;border-right-color:#999;border-right-color:rgba(0,0,0,.25);border-left-width:0}.popover.right>.arrow:after{bottom:-10px;left:1px;content:" ";border-right-color:#fff;border-left-width:0}.popover.bottom>.arrow{top:-11px;left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,.25)}.popover.bottom>.arrow:after{top:1px;margin-left:-10px;content:" ";border-top-width:0;border-bottom-color:#fff}.popover.left>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:rgba(0,0,0,.25)}.popover.left>.arrow:after{right:1px;bottom:-10px;content:" ";border-right-width:0;border-left-color:#fff}.carousel{position:relative}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner>.item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>img,.carousel-inner>.item>a>img{line-height:1}@media all and (transform-3d),(-webkit-transform-3d){.carousel-inner>.item{-webkit-transition:-webkit-transform .6s ease-in-out;-o-transition:-o-transform .6s ease-in-out;transition:transform .6s ease-in-out;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000;perspective:1000}.carousel-inner>.item.next,.carousel-inner>.item.active.right{left:0;-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}.carousel-inner>.item.prev,.carousel-inner>.item.active.left{left:0;-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}.carousel-inner>.item.next.left,.carousel-inner>.item.prev.right,.carousel-inner>.item.active{left:0;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;bottom:0;left:0;width:15%;font-size:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6);filter:alpha(opacity=50);opacity:.5}.carousel-control.left{background-image:-webkit-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.5)),to(rgba(0,0,0,.0001)));background-image:linear-gradient(to right,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);background-repeat:repeat-x}.carousel-control.right{right:0;left:auto;background-image:-webkit-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.0001)),to(rgba(0,0,0,.5)));background-image:linear-gradient(to right,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);background-repeat:repeat-x}.carousel-control:hover,.carousel-control:focus{color:#fff;text-decoration:none;filter:alpha(opacity=90);outline:0;opacity:.9}.carousel-control .icon-prev,.carousel-control .icon-next,.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right{position:absolute;top:50%;z-index:5;display:inline-block}.carousel-control .icon-prev,.carousel-control .glyphicon-chevron-left{left:50%;margin-left:-10px}.carousel-control .icon-next,.carousel-control .glyphicon-chevron-right{right:50%;margin-right:-10px}.carousel-control .icon-prev,.carousel-control .icon-next{width:20px;height:20px;margin-top:-10px;font-family:serif}.carousel-control .icon-prev:before{content:'\2039'}.carousel-control .icon-next:before{content:'\203a'}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;padding-left:0;margin-left:-30%;text-align:center;list-style:none}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;cursor:pointer;background-color:#000 \9;background-color:rgba(0,0,0,0);border:1px solid #fff;border-radius:10px}.carousel-indicators .active{width:12px;height:12px;margin:0;background-color:#fff}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-prev,.carousel-control .icon-next{width:30px;height:30px;margin-top:-15px;font-size:30px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{margin-left:-15px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{margin-right:-15px}.carousel-caption{right:20%;left:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.clearfix:before,.clearfix:after,.dl-horizontal dd:before,.dl-horizontal dd:after,.container:before,.container:after,.container-fluid:before,.container-fluid:after,.row:before,.row:after,.form-horizontal .form-group:before,.form-horizontal .form-group:after,.btn-toolbar:before,.btn-toolbar:after,.btn-group-vertical>.btn-group:before,.btn-group-vertical>.btn-group:after,.nav:before,.nav:after,.navbar:before,.navbar:after,.navbar-header:before,.navbar-header:after,.navbar-collapse:before,.navbar-collapse:after,.pager:before,.pager:after,.panel-body:before,.panel-body:after,.modal-footer:before,.modal-footer:after{display:table;content:" "}.clearfix:after,.dl-horizontal dd:after,.container:after,.container-fluid:after,.row:after,.form-horizontal .form-group:after,.btn-toolbar:after,.btn-group-vertical>.btn-group:after,.nav:after,.navbar:after,.navbar-header:after,.navbar-collapse:after,.pager:after,.panel-body:after,.modal-footer:after{clear:both}.center-block{display:block;margin-right:auto;margin-left:auto}.pull-right{float:right!important}.pull-left{float:left!important}.hide{display:none!important}.show{display:block!important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none!important;visibility:hidden!important}.affix{position:fixed}@-ms-viewport{width:device-width}.visible-xs,.visible-sm,.visible-md,.visible-lg{display:none!important}.visible-xs-block,.visible-xs-inline,.visible-xs-inline-block,.visible-sm-block,.visible-sm-inline,.visible-sm-inline-block,.visible-md-block,.visible-md-inline,.visible-md-inline-block,.visible-lg-block,.visible-lg-inline,.visible-lg-inline-block{display:none!important}@media (max-width:767px){.visible-xs{display:block!important}table.visible-xs{display:table}tr.visible-xs{display:table-row!important}th.visible-xs,td.visible-xs{display:table-cell!important}}@media (max-width:767px){.visible-xs-block{display:block!important}}@media (max-width:767px){.visible-xs-inline{display:inline!important}}@media (max-width:767px){.visible-xs-inline-block{display:inline-block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block!important}table.visible-sm{display:table}tr.visible-sm{display:table-row!important}th.visible-sm,td.visible-sm{display:table-cell!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-block{display:block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline{display:inline!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline-block{display:inline-block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block!important}table.visible-md{display:table}tr.visible-md{display:table-row!important}th.visible-md,td.visible-md{display:table-cell!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-block{display:block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline{display:inline!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline-block{display:inline-block!important}}@media (min-width:1200px){.visible-lg{display:block!important}table.visible-lg{display:table}tr.visible-lg{display:table-row!important}th.visible-lg,td.visible-lg{display:table-cell!important}}@media (min-width:1200px){.visible-lg-block{display:block!important}}@media (min-width:1200px){.visible-lg-inline{display:inline!important}}@media (min-width:1200px){.visible-lg-inline-block{display:inline-block!important}}@media (max-width:767px){.hidden-xs{display:none!important}}@media (min-width:768px) and (max-width:991px){.hidden-sm{display:none!important}}@media (min-width:992px) and (max-width:1199px){.hidden-md{display:none!important}}@media (min-width:1200px){.hidden-lg{display:none!important}}.visible-print{display:none!important}@media print{.visible-print{display:block!important}table.visible-print{display:table}tr.visible-print{display:table-row!important}th.visible-print,td.visible-print{display:table-cell!important}}.visible-print-block{display:none!important}@media print{.visible-print-block{display:block!important}}.visible-print-inline{display:none!important}@media print{.visible-print-inline{display:inline!important}}.visible-print-inline-block{display:none!important}@media print{.visible-print-inline-block{display:inline-block!important}}@media print{.hidden-print{display:none!important}} \ No newline at end of file diff --git a/interface/web/themes/default/assets/stylesheets/ispconfig.css b/interface/web/themes/default/assets/stylesheets/ispconfig.css index 049322f29c9ac346bda1246f79e1399ea53d3e4d..449c05cdbc1b334a33fe900571f9a257687467bd 100644 --- a/interface/web/themes/default/assets/stylesheets/ispconfig.css +++ b/interface/web/themes/default/assets/stylesheets/ispconfig.css @@ -809,3 +809,16 @@ span.pbvaluemargin { .ip_suggestion_server { font-weight: bold; } +.finediff { + font-family: monospace; +} +.finediff ins { + color: green; + background: #dfd; + text-decoration: none; +} +.finediff del { + color: red; + background: #fdd; + text-decoration: none; +} \ No newline at end of file diff --git a/interface/web/tools/import_vpopmail.php b/interface/web/tools/import_vpopmail.php index d95e405a21b78d8b1c84cb74b5f92539323df689..036b9fbd5fc4ee42ebcb8883d935b210be1588ea 100644 --- a/interface/web/tools/import_vpopmail.php +++ b/interface/web/tools/import_vpopmail.php @@ -110,8 +110,8 @@ function start_import() { $country = 'FI'; //* add client - $sql = "INSERT INTO `client` (`sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `company_name`, `company_id`, `contact_name`, `customer_no`, `vat_id`, `street`, `zip`, `city`, `state`, `country`, `telephone`, `mobile`, `fax`, `email`, `internet`, `icq`, `notes`, `bank_account_owner`, `bank_account_number`, `bank_code`, `bank_name`, `bank_account_iban`, `bank_account_swift`, `default_mailserver`, `limit_maildomain`, `limit_mailbox`, `limit_mailalias`, `limit_mailaliasdomain`, `limit_mailforward`, `limit_mailcatchall`, `limit_mailrouting`, `limit_mailfilter`, `limit_fetchmail`, `limit_mailquota`, `limit_spamfilter_wblist`, `limit_spamfilter_user`, `limit_spamfilter_policy`, `default_webserver`, `limit_web_ip`, `limit_web_domain`, `limit_web_quota`, `web_php_options`, `limit_cgi`, `limit_ssi`, `limit_perl`, `limit_ruby`, `limit_python`, `force_suexec`, `limit_hterror`, `limit_wildcard`, `limit_ssl`, `limit_web_subdomain`, `limit_web_aliasdomain`, `limit_ftp_user`, `limit_shell_user`, `ssh_chroot`, `limit_webdav_user`, `limit_aps`, `default_dnsserver`, `limit_dns_zone`, `limit_dns_slave_zone`, `limit_dns_record`, `default_dbserver`, `limit_database`, `limit_cron`, `limit_cron_type`, `limit_cron_frequency`, `limit_traffic_quota`, `limit_client`, `limit_mailmailinglist`, `limit_openvz_vm`, `limit_openvz_vm_template_id`, `parent_client_id`, `username`, `password`, `language`, `usertheme`, `template_master`, `template_additional`, `created_at`, `id_rsa`, `ssh_rsa`) - VALUES(1, 1, 'riud', 'riud', '', '', '', ?, '', '', '', '', '', '', ?, '', '', '', '', 'http://', '', '', '', '', '', '', '', '', 1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, 0, 0, 0, 1, NULL, -1, -1, 'no,fast-cgi,mod', 'n', 'n', 'n', 'n', 'n', 'y', 'n', 'n', 'n', -1, -1, -1, 0, 'no,jailkit', 0, 0, 1, -1, -1, -1, 1, -1, 0, 'url', 5, -1, 0, -1, 0, 0, 0, ?, ?, ?, 'default', 0, '', NOW(), '', '')"; + $sql = "INSERT INTO `client` (`sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `company_name`, `company_id`, `contact_name`, `customer_no`, `vat_id`, `street`, `zip`, `city`, `state`, `country`, `telephone`, `mobile`, `fax`, `email`, `internet`, `icq`, `notes`, `bank_account_owner`, `bank_account_number`, `bank_code`, `bank_name`, `bank_account_iban`, `bank_account_swift`, `default_mailserver`, `limit_maildomain`, `limit_mailbox`, `limit_mailalias`, `limit_mailaliasdomain`, `limit_mailforward`, `limit_mailcatchall`, `limit_mailrouting`, `limit_mailfilter`, `limit_fetchmail`, `limit_mailquota`, `limit_spamfilter_wblist`, `limit_spamfilter_user`, `limit_spamfilter_policy`, `default_webserver`, `limit_web_ip`, `limit_web_domain`, `limit_web_quota`, `web_php_options`, `limit_cgi`, `limit_ssi`, `limit_perl`, `limit_ruby`, `limit_python`, `force_suexec`, `limit_hterror`, `limit_wildcard`, `limit_ssl`, `limit_web_subdomain`, `limit_web_aliasdomain`, `limit_ftp_user`, `limit_shell_user`, `ssh_chroot`, `limit_webdav_user`, `limit_aps`, `default_dnsserver`, `limit_dns_zone`, `limit_dns_slave_zone`, `limit_dns_record`, `default_dbserver`, `limit_database`, `limit_cron`, `limit_cron_type`, `limit_cron_frequency`, `limit_traffic_quota`, `limit_client`, `parent_client_id`, `username`, `password`, `language`, `usertheme`, `template_master`, `template_additional`, `created_at`, `id_rsa`, `ssh_rsa`) + VALUES(1, 1, 'riud', 'riud', '', '', '', ?, '', '', '', '', '', '', ?, '', '', '', '', 'http://', '', '', '', '', '', '', '', '', 1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, 0, 0, 0, 1, NULL, -1, -1, 'no,fast-cgi,mod', 'n', 'n', 'n', 'n', 'n', 'y', 'n', 'n', 'n', -1, -1, -1, 0, 'no,jailkit', 0, 0, 1, -1, -1, -1, 1, -1, 0, 'url', 5, -1, 0, 0, ?, ?, ?, 'default', 0, '', NOW(), '', '')"; $app->db->query($sql, $pw_domain,$country, $pw_domain, $pw_crypt_password, $conf['language']); $client_id = $app->db->insertID(); diff --git a/interface/web/tools/resync.php b/interface/web/tools/resync.php index e5958c064e388827fda93cee6617d28911b02e1e..b7cd96585208930d27e5e169ce5790a4252ad25e 100644 --- a/interface/web/tools/resync.php +++ b/interface/web/tools/resync.php @@ -103,11 +103,6 @@ class page_action extends tform_actions { 'server_type' => 'mail', 'server_id' => $server_id, ), - 'mail_mailinglist' => array ( - 'index_field' => 'mailinglist_id', - 'server_type' => 'mail', - 'server_id' => $server_id, - ), 'mail_user' => array ( 'index_field' => 'mailuser_id', 'server_type' => 'mail', @@ -207,15 +202,6 @@ class page_action extends tform_actions { ), ); } - if($type == 'vserver' ) { - $server_data = array ( - 'openvz_vm' => array ( - 'index_field' => 'vm_id', - 'server_type' => 'vserver', - 'server_id' => $server_id, - ), - ); - } //* proxy //* firewall $array_out = array(); @@ -291,17 +277,6 @@ class page_action extends tform_actions { unset($options_servers); } - //* mailinglist - $server_list = $this->create_list($mail_server_rec, 'mail', 'mail_mailinglist'); - $options_servers = $server_list[0];$server_count = $server_list[1]; - unset($server_list); - if (isset($options_servers)) { //* server with data found - if ($server_count > 1) $options_servers = "" . $options_servers; - $app->tpl->setVar('mailinglist_server_id', $options_servers); - $app->tpl->setVar('mailinglist_found', 1); - unset($options_servers); - } - //* mailtransport $server_list = $this->create_list($mail_server_rec, 'mail', 'mail_transport'); $options_servers = $server_list[0];$server_count = $server_list[1]; @@ -423,22 +398,6 @@ class page_action extends tform_actions { } } - //* fetch vserver - $v_server_rec = $app->db->queryAllRecords("SELECT server_id, server_name FROM server WHERE vserver_server = 1 AND active = 1 AND mirror_server_id = 0 ORDER BY active DESC, server_name"); - if (!empty($db_server_rec)) { - $app->tpl->setVar('vserver_server_found', 1); - - $server_list = $this->create_list($v_server_rec, 'vserver', 'openvz_vm'); - $options_servers = $server_list[0];$server_count = $server_list[1]; - unset($server_list); - if (isset($options_servers)) { //* server with data found - if ($server_count > 1) $options_servers = "" . $options_servers; - $app->tpl->setVar('vserver_server_id', $options_servers); - $app->tpl->setVar('vserver_found', 1); - unset($options_servers); - } - } - $csrf_token = $app->auth->csrf_token_get('tools_resync'); $app->tpl->setVar('_csrf_id', $csrf_token['csrf_id']); $app->tpl->setVar('_csrf_key', $csrf_token['csrf_key']); @@ -511,10 +470,8 @@ class page_action extends tform_actions { $this->dataRecord['resync_mailget'] = 1; $this->dataRecord['resync_mailbox'] = 1; $this->dataRecord['resync_mailfilter'] = 1; - $this->dataRecord['resync_mailinglist'] = 1; $this->dataRecord['resync_mailtransport'] = 1; $this->dataRecord['resync_mailrelay'] = 1; - $this->dataRecord['resync_vserver'] = 1; $this->dataRecord['resync_dns'] = 1; $this->dataRecord['resync_client'] = 1; $this->dataRecord['web_server_id'] = $this->dataRecord['all_server_id']; @@ -525,7 +482,6 @@ class page_action extends tform_actions { $this->dataRecord['db_server_id'] = $this->dataRecord['all_server_id']; $this->dataRecord['mail_server_id'] = $this->dataRecord['all_server_id']; $this->dataRecord['mailbox_server_id'] = $this->dataRecord['all_server_id']; - $this->dataRecord['vserver_server_id'] = $this->dataRecord['all_server_id']; $this->dataRecord['dns_server_id'] = $this->dataRecord['all_server_id']; } @@ -582,10 +538,6 @@ class page_action extends tform_actions { $msg .= $this->do_resync('spamfilter_wblist', 'wblist_id', 'mail', $this->dataRecord['mailbox_server_id'], '', $app->tform->wordbook['do_mail_spamfilter_txt']) ; } - //* mailinglists - if($this->dataRecord['resync_mailinglist'] == 1) - $msg .= $this->do_resync('mail_mailinglist', 'mailinglist_id', 'mail', $this->dataRecord['mail_server_id'], 'listname', $app->tform->wordbook['do_mailinglist_txt'], false); - //* mailtransport if($this->dataRecord['resync_mailtransport'] == 1) $msg .= $this->do_resync('mail_transport', 'transport_id', 'mail', $this->dataRecord['mail_server_id'], 'domain', $app->tform->wordbook['do_mailtransport_txt'], false); @@ -594,10 +546,6 @@ class page_action extends tform_actions { if($this->dataRecord['resync_mailrelay'] == 1) $msg .= $this->do_resync('mail_relay_recipient', 'relay_recipient_id', 'mail', $this->dataRecord['mail_server_id'], 'source', $app->tform->wordbook['do_mailrelay_txt'], false); - //* vserver - if($this->dataRecord['resync_vserver'] == 1) - $msg .= $this->do_resync('openvz_vm', 'vm_id', 'vserver', $this->dataRecord['vserver_server_id'], 'hostname', $app->tform->wordbook['do_vserver_txt']); - //* dns if($this->dataRecord['resync_dns'] == 1) { $rec=$this->query_server('dns_soa', $this->dataRecord['dns_server_id'], 'dns'); @@ -651,6 +599,19 @@ class page_action extends tform_actions { } $msg .= '
'; } + + $entries = $app->plugin->raiseEvent('tools:resync:get_resync_entries', $this->dataRecord, true); + if(is_array($entries) && !empty($entries)) { + foreach($entries as $entry) { + if(!isset($entry['db_table']) || !isset($entry['db_table']) || !isset($entry['db_table']) || !isset($entry['db_table']) || !isset($entry['db_table']) || !isset($entry['db_table'])) { + continue; + } + if(!isset($entry['active'])) { + $entry['active'] = true; + } + $msg .= $this->do_resync($entry['db_table'], $entry['index_field'], $entry['server_type'], $entry['server_id'], $entry['msg_field'], $entry['wordbook'], $entry['active']); + } + } echo $msg; } //* end onSumbmit diff --git a/interface/web/tools/templates/resync.htm b/interface/web/tools/templates/resync.htm index 3e66290fb0fd46e2117a7550bf0d0a12e18d76cd..d9d76a50e378e3b0e3cdd48273ff3359ff3cc550 100644 --- a/interface/web/tools/templates/resync.htm +++ b/interface/web/tools/templates/resync.htm @@ -89,13 +89,6 @@
- -
- -
-
-
-
@@ -122,16 +115,6 @@ - - -
- -
-
-
-
-
-
@@ -139,6 +122,8 @@
+ +{tmpl_hook name="end_form"}
diff --git a/interface/web/vm/ajax_get_ip.php b/interface/web/vm/ajax_get_ip.php deleted file mode 100644 index 3ff5c0d294a296167f0031f2fd80bf7155da4e99..0000000000000000000000000000000000000000 --- a/interface/web/vm/ajax_get_ip.php +++ /dev/null @@ -1,55 +0,0 @@ -auth->check_module_permissions('vm'); - -$server_id = $app->functions->intval($_GET["server_id"]); - -if($_SESSION["s"]["user"]["typ"] == 'admin' or $app->auth->has_clients($_SESSION['s']['user']['userid'])) { - - $sql = "SELECT ip_address FROM openvz_ip WHERE reserved = 'n' AND server_id = ?"; - $ips = $app->db->queryAllRecords($sql, $server_id); - $ip_select = ""; - if(is_array($ips)) { - foreach( $ips as $ip) { - //$selected = ($ip["ip_address"] == $this->dataRecord["ip_address"])?'SELECTED':''; - $ip_select .= "$ip[ip_address]#"; - } - } - unset($tmp); - unset($ips); -} -$ip_select = substr($ip_select, 0, -1); -echo $ip_select; -?> diff --git a/interface/web/vm/form/openvz_ip.tform.php b/interface/web/vm/form/openvz_ip.tform.php deleted file mode 100644 index e43b28de2028e4469629930918dd7e27152429ab..0000000000000000000000000000000000000000 --- a/interface/web/vm/form/openvz_ip.tform.php +++ /dev/null @@ -1,117 +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 - -$form["tabs"]['main'] = array ( - 'title' => "IP address", - 'width' => 100, - 'template' => "templates/openvz_ip_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 vserver_server = 1 AND mirror_server_id = 0 AND {AUTHSQL} ORDER BY server_name', - 'keyfield'=> 'server_id', - 'valuefield'=> 'server_name' - ), - 'value' => '' - ), - 'ip_address' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( - 0 => array ( 'type' => 'ISIP', 'errmsg'=> 'ip_error_wrong'), - 1 => array ( 'type' => 'UNIQUE', 'errmsg'=> 'ip_error_unique'), - ), - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '15', - 'maxlength' => '15', - 'rows' => '', - 'cols' => '', - 'searchable' => 1 - ), - 'vm_id' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'SELECT', - 'default' => '', - 'datasource' => array ( 'type' => 'SQL', - 'querystring' => 'SELECT vm_id,hostname FROM openvz_vm WHERE {AUTHSQL} ORDER BY hostname', - 'keyfield'=> 'vm_id', - 'valuefield'=> 'hostname' - ), - 'value' => array(0 => '- Not assigned -') - ), - 'reserved' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOX', - 'default' => 'n', - 'value' => array(0 => 'n', 1 => 'y') - ), - //################################# - // ENDE Datatable fields - //################################# - ) -); - - -?> diff --git a/interface/web/vm/form/openvz_ostemplate.tform.php b/interface/web/vm/form/openvz_ostemplate.tform.php deleted file mode 100644 index a28bbc6adeaf9ea3d28318f1d6d63945b5230db3..0000000000000000000000000000000000000000 --- a/interface/web/vm/form/openvz_ostemplate.tform.php +++ /dev/null @@ -1,148 +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 - -$form["tabs"]['main'] = array ( - 'title' => "Template", - 'width' => 100, - 'template' => "templates/openvz_ostemplate_edit.htm", - 'fields' => array ( - //################################# - // Begin Datatable fields - //################################# - 'template_name' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'template_name_error_empty'), - ), - 'filters' => array( - 0 => array( 'event' => 'SAVE', - 'type' => 'STRIPTAGS'), - 1 => array( 'event' => 'SAVE', - 'type' => 'STRIPNL') - ), - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255', - 'searchable' => 1 - ), - 'template_file' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'template_file_error_empty'), - ), - 'filters' => array( - 0 => array( 'event' => 'SAVE', - 'type' => 'STRIPTAGS'), - 1 => array( 'event' => 'SAVE', - 'type' => 'STRIPNL') - ), - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255', - 'searchable' => 2 - ), - 'server_id' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'SELECT', - 'default' => '', - 'datasource' => array ( 'type' => 'SQL', - 'querystring' => 'SELECT server_id,server_name FROM server WHERE vserver_server = 1 AND mirror_server_id = 0 AND {AUTHSQL} ORDER BY server_name', - 'keyfield'=> 'server_id', - 'valuefield'=> 'server_name' - ), - 'value' => '' - ), - 'allservers' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOX', - 'default' => 'y', - 'value' => array(0 => 'n', 1 => 'y') - ), - 'active' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOX', - 'default' => 'y', - 'value' => array(0 => 'n', 1 => 'y') - ), - 'description' => array ( - 'datatype' => 'TEXT', - 'formtype' => 'TEXTAREA', - 'filters' => array( - 0 => array( 'event' => 'SAVE', - 'type' => 'STRIPTAGS') - ), - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '', - 'maxlength' => '', - 'rows' => '10', - 'cols' => '30', - 'searchable' => 2 - ), - //################################# - // ENDE Datatable fields - //################################# - ) -); - - -?> diff --git a/interface/web/vm/form/openvz_template.tform.php b/interface/web/vm/form/openvz_template.tform.php deleted file mode 100644 index 1a069361cbdeb6d74ff5b792aab36f1a0dcc6efa..0000000000000000000000000000000000000000 --- a/interface/web/vm/form/openvz_template.tform.php +++ /dev/null @@ -1,523 +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 - -$form["tabs"]['main'] = array ( - 'title' => "Template", - 'width' => 100, - 'template' => "templates/openvz_template_edit.htm", - 'fields' => array ( - //################################# - // Begin Datatable fields - //################################# - 'template_name' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'template_name_error_empty'), - ), - 'filters' => array( - 0 => array( 'event' => 'SAVE', - 'type' => 'STRIPTAGS'), - 1 => array( 'event' => 'SAVE', - 'type' => 'STRIPNL') - ), - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255', - 'searchable' => 1 - ), - 'diskspace' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'diskspace_error_empty'), - ), - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'ram' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'ram_error_empty'), - ), - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'ram_burst' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'ram_burst_error_empty'), - ), - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'cpu_units' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'cpu_units_error_empty'), - ), - 'default' => '1000', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'cpu_num' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'cpu_num_error_empty'), - ), - 'default' => '4', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'cpu_limit' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'cpu_limit_error_empty'), - ), - 'default' => '400', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'io_priority' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'io_priority_error_empty'), - ), - 'default' => '4', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'hostname' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'filters' => array( - 0 => array( 'event' => 'SAVE', - 'type' => 'STRIPTAGS'), - 1 => array( 'event' => 'SAVE', - 'type' => 'STRIPNL') - ), - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'create_dns' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOX', - 'default' => 'y', - 'value' => array(0 => 'n', 1 => 'y') - ), - 'nameserver' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'template_nameserver_error_empty'), - ), - 'filters' => array( - 0 => array( 'event' => 'SAVE', - 'type' => 'STRIPTAGS'), - 1 => array( 'event' => 'SAVE', - 'type' => 'STRIPNL') - ), - 'default' => '8.8.8.8 8.8.4.4', - 'value' => '', - 'width' => '30', - 'maxlength' => '255', - 'searchable' => 2 - ), - 'active' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOX', - 'default' => 'y', - 'value' => array(0 => 'n', 1 => 'y') - ), - 'description' => array ( - 'datatype' => 'TEXT', - 'formtype' => 'TEXTAREA', - 'filters' => array( - 0 => array( 'event' => 'SAVE', - 'type' => 'STRIPTAGS') - ), - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '', - 'maxlength' => '', - 'rows' => '10', - 'cols' => '30' - ), - //################################# - // ENDE Datatable fields - //################################# - ) -); - -$form["tabs"]['advanced'] = array ( - 'title' => "Advanced", - 'width' => 100, - 'template' => "templates/openvz_template_advanced_edit.htm", - 'fields' => array ( - //################################# - // Begin Datatable fields - //################################# - 'numproc' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'numproc_error_empty'), - ), - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'numtcpsock' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'numtcpsock_error_empty'), - ), - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'numothersock' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'numothersock_error_empty'), - ), - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'vmguarpages' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'vmguarpages_error_empty'), - ), - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'kmemsize' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'kmemsize_error_empty'), - ), - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'tcpsndbuf' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'tcpsndbuf_error_empty'), - ), - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'tcprcvbuf' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'tcprcvbuf_error_empty'), - ), - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'othersockbuf' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'othersockbuf_error_empty'), - ), - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'dgramrcvbuf' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'dgramrcvbuf_error_empty'), - ), - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'oomguarpages' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'oomguarpages_error_empty'), - ), - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'privvmpages' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'privvmpages_error_empty'), - ), - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'lockedpages' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'lockedpages_error_empty'), - ), - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'shmpages' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'shmpages_error_empty'), - ), - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'physpages' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'physpages_error_empty'), - ), - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'numfile' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'numfile_error_empty'), - ), - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'avnumproc' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'avnumproc_error_empty'), - ), - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'numflock' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'numflock_error_empty'), - ), - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'numpty' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'numpty_error_empty'), - ), - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'numsiginfo' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'numsiginfo_error_empty'), - ), - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'dcachesize' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'dcachesize_error_empty'), - ), - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'numiptent' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'numiptent_error_empty'), - ), - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'swappages' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'swappages_error_empty'), - ), - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'capability' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'features' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'iptables' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'custom' => array ( - 'datatype' => 'TEXT', - 'formtype' => 'TEXTAREA', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '', - 'maxlength' => '', - 'rows' => '10', - 'cols' => '30', - 'validators' => array ( 0 => array ('type' => 'CUSTOM', - 'class' => 'validate_openvz', - 'function' => 'check_custom', - 'errmsg'=> 'custom_error'), - ), - ), - //################################# - // ENDE Datatable fields - //################################# - ) -); - - -?> diff --git a/interface/web/vm/form/openvz_vm.tform.php b/interface/web/vm/form/openvz_vm.tform.php deleted file mode 100644 index fe61e27c453e2957d5c8066ba50bccc6d98e258a..0000000000000000000000000000000000000000 --- a/interface/web/vm/form/openvz_vm.tform.php +++ /dev/null @@ -1,375 +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 - -$form["tabs"]['main'] = array ( - 'title' => "Virtual server", - 'width' => 100, - 'template' => "templates/openvz_vm_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 vserver_server = 1 AND mirror_server_id = 0 ORDER BY server_name', - 'keyfield'=> 'server_id', - 'valuefield'=> 'server_name' - ), - 'value' => '' - ), - 'ostemplate_id' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'SELECT', - 'default' => '', - 'datasource' => array ( 'type' => 'SQL', - 'querystring' => 'SELECT ostemplate_id,template_name FROM openvz_ostemplate WHERE 1 ORDER BY template_name', - 'keyfield'=> 'ostemplate_id', - 'valuefield'=> 'template_name' - ), - 'value' => '' - ), - 'template_id' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'SELECT', - 'default' => '', - /* - 'datasource' => array ( 'type' => 'SQL', - 'querystring' => 'SELECT template_id,template_name FROM openvz_template WHERE 1 ORDER BY template_name', - 'keyfield'=> 'template_id', - 'valuefield'=> 'template_name' - ), - */ - 'value' => '' - ), - 'ip_address' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'SELECT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'ip_address_error_empty'), - ), - 'default' => '', - /* - 'datasource' => array ( 'type' => 'SQL', - 'querystring' => "SELECT ip_address FROM openvz_ip WHERE reserved = 'n' AND (vm_id = 0 or vm_id = '{RECORDID}') ORDER BY ip_address", - 'keyfield'=> 'ip_address', - 'valuefield'=> 'ip_address' - ), - */ - 'value' => '' - ), - 'hostname' => 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'), - 3 => array( 'event' => 'SAVE', - 'type' => 'STRIPTAGS'), - 4 => array( 'event' => 'SAVE', - 'type' => 'STRIPNL') - ), - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'hostname_error_empty'), - ), - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255', - 'searchable' => 1 - ), - 'vm_password' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'vm_password_error_empty'), - ), - 'default' => $app->auth->get_random_password(10), - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'start_boot' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOX', - 'default' => 'y', - 'value' => array(0 => 'n', 1 => 'y') - ), - 'bootorder' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'default' => '0', - 'value' => '', - 'width' => '3', - 'maxlength' => '3', - 'validators' => array ( 0 => array ( 'type' => 'ISPOSITIVE', - 'errmsg'=> 'bootorder_error_notpositive'), - ), - ), - 'active' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOX', - 'default' => 'y', - 'value' => array(0 => 'n', 1 => 'y') - ), - 'active_until_date' => array ( - 'datatype' => 'DATE', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'description' => array ( - 'datatype' => 'TEXT', - 'formtype' => 'TEXTAREA', - 'filters' => array( - 0 => array( 'event' => 'SAVE', - 'type' => 'STRIPTAGS') - ), - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '', - 'maxlength' => '', - 'rows' => '10', - 'cols' => '30', - 'searchable' => 2 - ), - //################################# - // ENDE Datatable fields - //################################# - ) -); - -if($_SESSION["s"]["user"]["typ"] == 'admin') { - $form["tabs"]['advanced'] = array ( - 'title' => "Advanced", - 'width' => 100, - 'template' => "templates/openvz_vm_advanced_edit.htm", - 'fields' => array ( - //################################# - // Begin Datatable fields - //################################# - 'veid' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'veid_error_empty'), - 1 => array ( 'type' => 'UNIQUE', - 'errmsg'=> 'veid_error_unique'), - ), - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'create_dns' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOX', - 'default' => 'y', - 'value' => array(0 => 'n', 1 => 'y') - ), - 'diskspace' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'diskspace_error_empty'), - ), - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'ram' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'ram_error_empty'), - ), - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'ram_burst' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'ram_burst_error_empty'), - ), - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'cpu_units' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'cpu_units_error_empty'), - ), - 'default' => '1000', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'cpu_num' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'cpu_num_error_empty'), - ), - 'default' => '4', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'cpu_limit' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'cpu_limit_error_empty'), - ), - 'default' => '400', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'io_priority' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'io_priority_error_empty'), - ), - 'default' => '4', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'nameserver' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'template_nameserver_error_empty'), - ), - 'default' => '8.8.8.8 8.8.4.4', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'capability' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'features' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'iptables' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'custom' => array ( - 'datatype' => 'TEXT', - 'formtype' => 'TEXTAREA', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '', - 'maxlength' => '', - 'rows' => '10', - 'cols' => '30', - 'searchable' => 2, - 'validators' => array ( 0 => array ('type' => 'CUSTOM', - 'class' => 'validate_openvz', - 'function' => 'check_custom', - 'errmsg'=> 'custom_error'), - ), - ), - //################################# - // ENDE Datatable fields - //################################# - ) - ); - - $form["tabs"]['additional_ip'] = array ( - 'title' => "Additional IP", - 'width' => 100, - 'template' => "templates/openvz_vm_additional_ip_edit.htm", - ); -} - - -?> diff --git a/interface/web/vm/lib/admin.conf.php b/interface/web/vm/lib/admin.conf.php deleted file mode 100644 index acb6c3546c6150b4edbafb782d3ed85c499210b5..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/admin.conf.php +++ /dev/null @@ -1,2 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/ar.lng b/interface/web/vm/lib/lang/ar.lng deleted file mode 100644 index 4167e14a8a150090ecfb1aa6738fb8a6abf17760..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/ar.lng +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/ar_openvz_action.lng b/interface/web/vm/lib/lang/ar_openvz_action.lng deleted file mode 100644 index 52f73285824f2d6c4107d8c9eec5980a251d505c..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/ar_openvz_action.lng +++ /dev/null @@ -1,16 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/ar_openvz_ip.lng b/interface/web/vm/lib/lang/ar_openvz_ip.lng deleted file mode 100644 index 6016681df89f13323f60379acff5e7abd98f4c77..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/ar_openvz_ip.lng +++ /dev/null @@ -1,9 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/ar_openvz_ip_list.lng b/interface/web/vm/lib/lang/ar_openvz_ip_list.lng deleted file mode 100644 index e6a3a68c2c3b9cad34982f035b86d4446ea68439..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/ar_openvz_ip_list.lng +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/ar_openvz_ostemplate.lng b/interface/web/vm/lib/lang/ar_openvz_ostemplate.lng deleted file mode 100644 index 256750f19a0cf4d459214a327d3f86773f9312d7..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/ar_openvz_ostemplate.lng +++ /dev/null @@ -1,11 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/ar_openvz_ostemplate_list.lng b/interface/web/vm/lib/lang/ar_openvz_ostemplate_list.lng deleted file mode 100644 index 6471ec0e277b63b6e110ef8deef7ca35511a2a52..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/ar_openvz_ostemplate_list.lng +++ /dev/null @@ -1,8 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/ar_openvz_template.lng b/interface/web/vm/lib/lang/ar_openvz_template.lng deleted file mode 100644 index 4c098565a35b2573df455929e0d092a25e3e32be..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/ar_openvz_template.lng +++ /dev/null @@ -1,97 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/ar_openvz_template_list.lng b/interface/web/vm/lib/lang/ar_openvz_template_list.lng deleted file mode 100644 index de4045c36a75506c0452b17c1e9d61080b534ce2..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/ar_openvz_template_list.lng +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/ar_openvz_vm.lng b/interface/web/vm/lib/lang/ar_openvz_vm.lng deleted file mode 100644 index 3094f0aa8d3ee7538b84dc2de381d5051cbfe409..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/ar_openvz_vm.lng +++ /dev/null @@ -1,45 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/ar_openvz_vm_list.lng b/interface/web/vm/lib/lang/ar_openvz_vm_list.lng deleted file mode 100644 index 2238e2b8f4fa4db72f1b785d6e0849e356922faf..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/ar_openvz_vm_list.lng +++ /dev/null @@ -1,10 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/bg.lng b/interface/web/vm/lib/lang/bg.lng deleted file mode 100644 index b42a772d5b0cb34a9833f8bc7add1d2be8945ea4..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/bg.lng +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/bg_openvz_action.lng b/interface/web/vm/lib/lang/bg_openvz_action.lng deleted file mode 100644 index 52f73285824f2d6c4107d8c9eec5980a251d505c..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/bg_openvz_action.lng +++ /dev/null @@ -1,16 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/bg_openvz_ip.lng b/interface/web/vm/lib/lang/bg_openvz_ip.lng deleted file mode 100644 index 6016681df89f13323f60379acff5e7abd98f4c77..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/bg_openvz_ip.lng +++ /dev/null @@ -1,9 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/bg_openvz_ip_list.lng b/interface/web/vm/lib/lang/bg_openvz_ip_list.lng deleted file mode 100644 index e6a3a68c2c3b9cad34982f035b86d4446ea68439..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/bg_openvz_ip_list.lng +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/bg_openvz_ostemplate.lng b/interface/web/vm/lib/lang/bg_openvz_ostemplate.lng deleted file mode 100644 index 256750f19a0cf4d459214a327d3f86773f9312d7..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/bg_openvz_ostemplate.lng +++ /dev/null @@ -1,11 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/bg_openvz_ostemplate_list.lng b/interface/web/vm/lib/lang/bg_openvz_ostemplate_list.lng deleted file mode 100644 index 6471ec0e277b63b6e110ef8deef7ca35511a2a52..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/bg_openvz_ostemplate_list.lng +++ /dev/null @@ -1,8 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/bg_openvz_template.lng b/interface/web/vm/lib/lang/bg_openvz_template.lng deleted file mode 100644 index 4c098565a35b2573df455929e0d092a25e3e32be..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/bg_openvz_template.lng +++ /dev/null @@ -1,97 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/bg_openvz_template_list.lng b/interface/web/vm/lib/lang/bg_openvz_template_list.lng deleted file mode 100644 index de4045c36a75506c0452b17c1e9d61080b534ce2..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/bg_openvz_template_list.lng +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/bg_openvz_vm.lng b/interface/web/vm/lib/lang/bg_openvz_vm.lng deleted file mode 100644 index 3094f0aa8d3ee7538b84dc2de381d5051cbfe409..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/bg_openvz_vm.lng +++ /dev/null @@ -1,45 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/bg_openvz_vm_list.lng b/interface/web/vm/lib/lang/bg_openvz_vm_list.lng deleted file mode 100644 index 2238e2b8f4fa4db72f1b785d6e0849e356922faf..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/bg_openvz_vm_list.lng +++ /dev/null @@ -1,10 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/br.lng b/interface/web/vm/lib/lang/br.lng deleted file mode 100644 index 513a018bf515ddded5fc5a8cd55310f95c4c7101..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/br.lng +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/br_openvz_action.lng b/interface/web/vm/lib/lang/br_openvz_action.lng deleted file mode 100644 index a301f51d0ed92567fe5fbf18626d95ba1f1b5e05..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/br_openvz_action.lng +++ /dev/null @@ -1,16 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/br_openvz_ip.lng b/interface/web/vm/lib/lang/br_openvz_ip.lng deleted file mode 100644 index 61fbd6ed6839aa1a1e15523b025063b2cdecb1be..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/br_openvz_ip.lng +++ /dev/null @@ -1,9 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/br_openvz_ip_list.lng b/interface/web/vm/lib/lang/br_openvz_ip_list.lng deleted file mode 100644 index 99ddfbc7d88fefb63a0901c21c58c1d632eebfeb..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/br_openvz_ip_list.lng +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/br_openvz_ostemplate.lng b/interface/web/vm/lib/lang/br_openvz_ostemplate.lng deleted file mode 100644 index edce912056486708dfafd3b167fe2c53757f24e9..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/br_openvz_ostemplate.lng +++ /dev/null @@ -1,11 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/br_openvz_ostemplate_list.lng b/interface/web/vm/lib/lang/br_openvz_ostemplate_list.lng deleted file mode 100644 index 04e94a889d079ae3d2851c81f32bb43ad2000030..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/br_openvz_ostemplate_list.lng +++ /dev/null @@ -1,8 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/br_openvz_template.lng b/interface/web/vm/lib/lang/br_openvz_template.lng deleted file mode 100644 index 4190a31f9cd16067c6d529837e11c11f82fc823d..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/br_openvz_template.lng +++ /dev/null @@ -1,97 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/br_openvz_template_list.lng b/interface/web/vm/lib/lang/br_openvz_template_list.lng deleted file mode 100644 index 390869859ac1bb8ddabb9017d234439cdb3606d5..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/br_openvz_template_list.lng +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/br_openvz_vm.lng b/interface/web/vm/lib/lang/br_openvz_vm.lng deleted file mode 100644 index 04794daf86b2d3305ca3363c204af3f3dabd6f44..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/br_openvz_vm.lng +++ /dev/null @@ -1,45 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/br_openvz_vm_list.lng b/interface/web/vm/lib/lang/br_openvz_vm_list.lng deleted file mode 100644 index 03d510f2f765743f1d9be45a3ba8df08952bf815..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/br_openvz_vm_list.lng +++ /dev/null @@ -1,10 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/ca.lng b/interface/web/vm/lib/lang/ca.lng deleted file mode 100644 index 12ed30c07e14e10a2d49528061e916767267920f..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/ca.lng +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/ca_openvz_action.lng b/interface/web/vm/lib/lang/ca_openvz_action.lng deleted file mode 100644 index 22b6b07d2fa00077ed42e80dd0fef7deb076fa92..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/ca_openvz_action.lng +++ /dev/null @@ -1,16 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/ca_openvz_ip.lng b/interface/web/vm/lib/lang/ca_openvz_ip.lng deleted file mode 100644 index 9aa6f97ea79c466017aabe7c4e5b368998860331..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/ca_openvz_ip.lng +++ /dev/null @@ -1,9 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/ca_openvz_ip_list.lng b/interface/web/vm/lib/lang/ca_openvz_ip_list.lng deleted file mode 100644 index 4f1d3706b74a29bb417087ca7052c5570a331438..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/ca_openvz_ip_list.lng +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/ca_openvz_ostemplate.lng b/interface/web/vm/lib/lang/ca_openvz_ostemplate.lng deleted file mode 100644 index ba9193da2fd671af2016991bf00234f1891f160a..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/ca_openvz_ostemplate.lng +++ /dev/null @@ -1,11 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/ca_openvz_ostemplate_list.lng b/interface/web/vm/lib/lang/ca_openvz_ostemplate_list.lng deleted file mode 100644 index 377713cb9a60881c0d2366d46d86b335c5d951aa..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/ca_openvz_ostemplate_list.lng +++ /dev/null @@ -1,8 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/ca_openvz_template.lng b/interface/web/vm/lib/lang/ca_openvz_template.lng deleted file mode 100644 index f46b001bdf70b72b87ca2556cdf04a36803608d0..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/ca_openvz_template.lng +++ /dev/null @@ -1,97 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/ca_openvz_template_list.lng b/interface/web/vm/lib/lang/ca_openvz_template_list.lng deleted file mode 100644 index c4ce4edd5fe15b7df96e2ba445c467f78ab4c6ee..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/ca_openvz_template_list.lng +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/ca_openvz_vm.lng b/interface/web/vm/lib/lang/ca_openvz_vm.lng deleted file mode 100644 index 06710577d9a9a7e303103cadc6366e2b32c1bd3b..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/ca_openvz_vm.lng +++ /dev/null @@ -1,45 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/ca_openvz_vm_list.lng b/interface/web/vm/lib/lang/ca_openvz_vm_list.lng deleted file mode 100644 index 9a6f78f581edb1eb61149c880a181d02bc5f10a1..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/ca_openvz_vm_list.lng +++ /dev/null @@ -1,10 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/cz.lng b/interface/web/vm/lib/lang/cz.lng deleted file mode 100644 index 37034b56f50ed4ddf03e2d0c751d9c94219e4af7..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/cz.lng +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/cz_openvz_action.lng b/interface/web/vm/lib/lang/cz_openvz_action.lng deleted file mode 100644 index 3e2e3e0b84a82c5520e13f71eba231d40fe25eb1..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/cz_openvz_action.lng +++ /dev/null @@ -1,16 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/cz_openvz_ip.lng b/interface/web/vm/lib/lang/cz_openvz_ip.lng deleted file mode 100644 index e749c286487b84c832e4a69ec6ae0857b44b1e15..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/cz_openvz_ip.lng +++ /dev/null @@ -1,9 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/cz_openvz_ip_list.lng b/interface/web/vm/lib/lang/cz_openvz_ip_list.lng deleted file mode 100644 index 7778c6d8c76279e6221599a1afd8bc50c5eb2ae7..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/cz_openvz_ip_list.lng +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/cz_openvz_ostemplate.lng b/interface/web/vm/lib/lang/cz_openvz_ostemplate.lng deleted file mode 100644 index 72838a20de8c8ff4944856821cfd1786cde17674..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/cz_openvz_ostemplate.lng +++ /dev/null @@ -1,11 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/cz_openvz_ostemplate_list.lng b/interface/web/vm/lib/lang/cz_openvz_ostemplate_list.lng deleted file mode 100644 index 7705a4d18f342e0d87d90f049fae07fc75efc721..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/cz_openvz_ostemplate_list.lng +++ /dev/null @@ -1,8 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/cz_openvz_template.lng b/interface/web/vm/lib/lang/cz_openvz_template.lng deleted file mode 100644 index e54a2a9dbbb7a55db7e5d8a6172f6b7fd41d3eda..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/cz_openvz_template.lng +++ /dev/null @@ -1,97 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/cz_openvz_template_list.lng b/interface/web/vm/lib/lang/cz_openvz_template_list.lng deleted file mode 100644 index 89c11ef5d1926da64f4f787a778b7c0f9793149f..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/cz_openvz_template_list.lng +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/cz_openvz_vm.lng b/interface/web/vm/lib/lang/cz_openvz_vm.lng deleted file mode 100644 index 7c610fbe0421501e05b119d52cbbb03bf0b2a0c5..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/cz_openvz_vm.lng +++ /dev/null @@ -1,45 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/cz_openvz_vm_list.lng b/interface/web/vm/lib/lang/cz_openvz_vm_list.lng deleted file mode 100644 index c402181601eae2d72d3e15f3e77650ea37dc9256..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/cz_openvz_vm_list.lng +++ /dev/null @@ -1,10 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/de.lng b/interface/web/vm/lib/lang/de.lng deleted file mode 100644 index 474d2ac7b7c2a68a8f00f3841440390f21e3eac5..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/de.lng +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/de_openvz_action.lng b/interface/web/vm/lib/lang/de_openvz_action.lng deleted file mode 100644 index f40d2f28b1aa50485c994b8b2221986736ffe3fa..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/de_openvz_action.lng +++ /dev/null @@ -1,16 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/de_openvz_ip.lng b/interface/web/vm/lib/lang/de_openvz_ip.lng deleted file mode 100644 index 48c9a520c448c5d9a2cfc8a13db90ddb39d26d7d..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/de_openvz_ip.lng +++ /dev/null @@ -1,9 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/de_openvz_ip_list.lng b/interface/web/vm/lib/lang/de_openvz_ip_list.lng deleted file mode 100644 index f4302d813acc8a4eebaaf6193e017cc67abfa10a..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/de_openvz_ip_list.lng +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/de_openvz_ostemplate.lng b/interface/web/vm/lib/lang/de_openvz_ostemplate.lng deleted file mode 100644 index 8e4cfcb977fb52b136f96e937e737a0c9d856e31..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/de_openvz_ostemplate.lng +++ /dev/null @@ -1,11 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/de_openvz_ostemplate_list.lng b/interface/web/vm/lib/lang/de_openvz_ostemplate_list.lng deleted file mode 100644 index dff6bd2ded79845ca70f2a54f42b4fdb82680c8a..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/de_openvz_ostemplate_list.lng +++ /dev/null @@ -1,8 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/de_openvz_template.lng b/interface/web/vm/lib/lang/de_openvz_template.lng deleted file mode 100644 index 66ad4377bee0c2d32d0ae7b9c4b1c685adda2852..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/de_openvz_template.lng +++ /dev/null @@ -1,97 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/de_openvz_template_list.lng b/interface/web/vm/lib/lang/de_openvz_template_list.lng deleted file mode 100644 index 9e32b341b50d4cc945cde1d75676f469ce0661f1..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/de_openvz_template_list.lng +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/de_openvz_vm.lng b/interface/web/vm/lib/lang/de_openvz_vm.lng deleted file mode 100644 index a5b8d54b204df764f4d7a77cd62e2b1a68910120..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/de_openvz_vm.lng +++ /dev/null @@ -1,45 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/de_openvz_vm_list.lng b/interface/web/vm/lib/lang/de_openvz_vm_list.lng deleted file mode 100644 index 0b3ac30c7fe26d7bb47cde5a456cd75e297e5f98..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/de_openvz_vm_list.lng +++ /dev/null @@ -1,10 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/dk.lng b/interface/web/vm/lib/lang/dk.lng deleted file mode 100644 index 6a7764588e96b345ca6f7b65590f25c32ffce85d..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/dk.lng +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/dk_openvz_action.lng b/interface/web/vm/lib/lang/dk_openvz_action.lng deleted file mode 100644 index ec4b1c4663c6cc1ba754fb4f84f4d22419f4d0d4..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/dk_openvz_action.lng +++ /dev/null @@ -1,16 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/dk_openvz_ip.lng b/interface/web/vm/lib/lang/dk_openvz_ip.lng deleted file mode 100644 index 0ad41f87a38ab63152ffbcedebfb70847ffd6137..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/dk_openvz_ip.lng +++ /dev/null @@ -1,9 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/dk_openvz_ip_list.lng b/interface/web/vm/lib/lang/dk_openvz_ip_list.lng deleted file mode 100644 index 2467d5c0b8e3df1de8c72770fee1cd312eeca2ef..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/dk_openvz_ip_list.lng +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/dk_openvz_ostemplate.lng b/interface/web/vm/lib/lang/dk_openvz_ostemplate.lng deleted file mode 100644 index 5b71160eb1b718830f4b907609e52836778b96a6..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/dk_openvz_ostemplate.lng +++ /dev/null @@ -1,11 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/dk_openvz_ostemplate_list.lng b/interface/web/vm/lib/lang/dk_openvz_ostemplate_list.lng deleted file mode 100644 index 94a5ccc18e84fd717ab7c2ba673e31322f537fca..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/dk_openvz_ostemplate_list.lng +++ /dev/null @@ -1,8 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/dk_openvz_template.lng b/interface/web/vm/lib/lang/dk_openvz_template.lng deleted file mode 100644 index 9de4a6fd9266b3aef3579da5240ffbc0d1731450..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/dk_openvz_template.lng +++ /dev/null @@ -1,97 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/dk_openvz_template_list.lng b/interface/web/vm/lib/lang/dk_openvz_template_list.lng deleted file mode 100644 index 0d0d574c205f432508252129fa93b970933c204c..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/dk_openvz_template_list.lng +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/dk_openvz_vm.lng b/interface/web/vm/lib/lang/dk_openvz_vm.lng deleted file mode 100644 index b4b2a5ad90fed2d9884fdfccd954ba6fd0209842..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/dk_openvz_vm.lng +++ /dev/null @@ -1,45 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/dk_openvz_vm_list.lng b/interface/web/vm/lib/lang/dk_openvz_vm_list.lng deleted file mode 100644 index 1d684a1adc1f365caf42f3265a7913851570693b..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/dk_openvz_vm_list.lng +++ /dev/null @@ -1,10 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/el.lng b/interface/web/vm/lib/lang/el.lng deleted file mode 100644 index f6b13b9504d9514cd27ddf4234c17d6364ad83c3..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/el.lng +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/el_openvz_action.lng b/interface/web/vm/lib/lang/el_openvz_action.lng deleted file mode 100644 index d03a007696b44dcc24e9d2b5bec959f2f4d56d3f..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/el_openvz_action.lng +++ /dev/null @@ -1,16 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/el_openvz_ip.lng b/interface/web/vm/lib/lang/el_openvz_ip.lng deleted file mode 100644 index 8aecd92058ad6ab26b62918c4e889cdca91d3294..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/el_openvz_ip.lng +++ /dev/null @@ -1,9 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/el_openvz_ip_list.lng b/interface/web/vm/lib/lang/el_openvz_ip_list.lng deleted file mode 100644 index 5af2ea055bc9042997d8729be2e8b7f4414ef446..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/el_openvz_ip_list.lng +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/el_openvz_ostemplate.lng b/interface/web/vm/lib/lang/el_openvz_ostemplate.lng deleted file mode 100644 index 6f8a98ef7e2bc85827acce3636302d72c63d7298..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/el_openvz_ostemplate.lng +++ /dev/null @@ -1,11 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/el_openvz_ostemplate_list.lng b/interface/web/vm/lib/lang/el_openvz_ostemplate_list.lng deleted file mode 100644 index 7dbc03f06df9ae4b3ff3ccb48a61b85cbe605070..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/el_openvz_ostemplate_list.lng +++ /dev/null @@ -1,8 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/el_openvz_template.lng b/interface/web/vm/lib/lang/el_openvz_template.lng deleted file mode 100644 index 8e2a673de293498cd66050218ccd744d1fb26981..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/el_openvz_template.lng +++ /dev/null @@ -1,97 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/el_openvz_template_list.lng b/interface/web/vm/lib/lang/el_openvz_template_list.lng deleted file mode 100644 index 2b053470ab9b3e141471f0db95abf573aaf6e34d..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/el_openvz_template_list.lng +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/el_openvz_vm.lng b/interface/web/vm/lib/lang/el_openvz_vm.lng deleted file mode 100644 index 2a413883474b5b0d068b6773debbacf2fc8d3e65..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/el_openvz_vm.lng +++ /dev/null @@ -1,45 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/el_openvz_vm_list.lng b/interface/web/vm/lib/lang/el_openvz_vm_list.lng deleted file mode 100644 index e4298e66b093c413d9f8429feca6b3cba020a9fa..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/el_openvz_vm_list.lng +++ /dev/null @@ -1,10 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/en.lng b/interface/web/vm/lib/lang/en.lng deleted file mode 100644 index 860fc499dddd1425dcc9f9cdacb02164a56e9bf0..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/en.lng +++ /dev/null @@ -1,7 +0,0 @@ - \ No newline at end of file diff --git a/interface/web/vm/lib/lang/en_openvz_action.lng b/interface/web/vm/lib/lang/en_openvz_action.lng deleted file mode 100644 index d504e3ae5d79b0145ccf63fb306c5ab49ed27baa..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/en_openvz_action.lng +++ /dev/null @@ -1,17 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/en_openvz_ip.lng b/interface/web/vm/lib/lang/en_openvz_ip.lng deleted file mode 100644 index 13c16afb32b2540ca32b9b87798fe33605456076..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/en_openvz_ip.lng +++ /dev/null @@ -1,9 +0,0 @@ - \ No newline at end of file diff --git a/interface/web/vm/lib/lang/en_openvz_ip_list.lng b/interface/web/vm/lib/lang/en_openvz_ip_list.lng deleted file mode 100644 index cb6a0b53b9527ece0280e4c757b5ec8f4357006e..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/en_openvz_ip_list.lng +++ /dev/null @@ -1,7 +0,0 @@ - \ No newline at end of file diff --git a/interface/web/vm/lib/lang/en_openvz_ostemplate.lng b/interface/web/vm/lib/lang/en_openvz_ostemplate.lng deleted file mode 100644 index 55a4ae3938a1898d328a9e105852d36f592960fb..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/en_openvz_ostemplate.lng +++ /dev/null @@ -1,11 +0,0 @@ - \ No newline at end of file diff --git a/interface/web/vm/lib/lang/en_openvz_ostemplate_list.lng b/interface/web/vm/lib/lang/en_openvz_ostemplate_list.lng deleted file mode 100644 index 7fcfbb7e0cb62c9302fdb10dd8e4597c82479b04..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/en_openvz_ostemplate_list.lng +++ /dev/null @@ -1,8 +0,0 @@ - \ No newline at end of file diff --git a/interface/web/vm/lib/lang/en_openvz_template.lng b/interface/web/vm/lib/lang/en_openvz_template.lng deleted file mode 100644 index cb648cbd6aab68f5249f7b72bbbb06a2674ef197..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/en_openvz_template.lng +++ /dev/null @@ -1,97 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/en_openvz_template_list.lng b/interface/web/vm/lib/lang/en_openvz_template_list.lng deleted file mode 100644 index 248c57ff5bc60adda96d6ee744b79b65a3118f70..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/en_openvz_template_list.lng +++ /dev/null @@ -1,5 +0,0 @@ - \ No newline at end of file diff --git a/interface/web/vm/lib/lang/en_openvz_vm.lng b/interface/web/vm/lib/lang/en_openvz_vm.lng deleted file mode 100644 index f3562cb0543ff90192af351ee1d6e9f6a6ee75b1..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/en_openvz_vm.lng +++ /dev/null @@ -1,45 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/en_openvz_vm_list.lng b/interface/web/vm/lib/lang/en_openvz_vm_list.lng deleted file mode 100644 index 89c17a1bffa4adf27211876e0d58fe4d1d80c1b1..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/en_openvz_vm_list.lng +++ /dev/null @@ -1,10 +0,0 @@ - \ No newline at end of file diff --git a/interface/web/vm/lib/lang/es.lng b/interface/web/vm/lib/lang/es.lng deleted file mode 100644 index 1bd8750a155ad2179306d32c4f9830ea71fe84c5..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/es.lng +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/es_openvz_action.lng b/interface/web/vm/lib/lang/es_openvz_action.lng deleted file mode 100644 index ca0f39d6e42e9763762f0be85483b86d139b8004..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/es_openvz_action.lng +++ /dev/null @@ -1,16 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/es_openvz_ip.lng b/interface/web/vm/lib/lang/es_openvz_ip.lng deleted file mode 100644 index b1cfd4901ff994427366d4e36cdec3d7bf9d0990..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/es_openvz_ip.lng +++ /dev/null @@ -1,9 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/es_openvz_ip_list.lng b/interface/web/vm/lib/lang/es_openvz_ip_list.lng deleted file mode 100644 index 7e070b10c61357b4daf7c319c2ccda43af25a691..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/es_openvz_ip_list.lng +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/es_openvz_ostemplate.lng b/interface/web/vm/lib/lang/es_openvz_ostemplate.lng deleted file mode 100644 index 493d3b918264cb9ba1dfcf9dc57ad88a664fae98..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/es_openvz_ostemplate.lng +++ /dev/null @@ -1,11 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/es_openvz_ostemplate_list.lng b/interface/web/vm/lib/lang/es_openvz_ostemplate_list.lng deleted file mode 100644 index e6851a116d08d0492649dc4d44a5a1eb34682816..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/es_openvz_ostemplate_list.lng +++ /dev/null @@ -1,8 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/es_openvz_template.lng b/interface/web/vm/lib/lang/es_openvz_template.lng deleted file mode 100644 index 1abd562ed58126a73c61eee80753dc9140c8d06c..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/es_openvz_template.lng +++ /dev/null @@ -1,97 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/es_openvz_template_list.lng b/interface/web/vm/lib/lang/es_openvz_template_list.lng deleted file mode 100644 index dfeab8b67e81f7d4dbc8b50146d659cf4aac9e02..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/es_openvz_template_list.lng +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/es_openvz_vm.lng b/interface/web/vm/lib/lang/es_openvz_vm.lng deleted file mode 100644 index d197d3f572ea8d14caba717138373e91164d716a..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/es_openvz_vm.lng +++ /dev/null @@ -1,45 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/es_openvz_vm_list.lng b/interface/web/vm/lib/lang/es_openvz_vm_list.lng deleted file mode 100644 index 7dffa2d1edc74195d85a2f1c8d73de0139c11482..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/es_openvz_vm_list.lng +++ /dev/null @@ -1,10 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/fi.lng b/interface/web/vm/lib/lang/fi.lng deleted file mode 100644 index 4167e14a8a150090ecfb1aa6738fb8a6abf17760..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/fi.lng +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/fi_openvz_action.lng b/interface/web/vm/lib/lang/fi_openvz_action.lng deleted file mode 100644 index 52f73285824f2d6c4107d8c9eec5980a251d505c..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/fi_openvz_action.lng +++ /dev/null @@ -1,16 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/fi_openvz_ip.lng b/interface/web/vm/lib/lang/fi_openvz_ip.lng deleted file mode 100644 index 6016681df89f13323f60379acff5e7abd98f4c77..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/fi_openvz_ip.lng +++ /dev/null @@ -1,9 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/fi_openvz_ip_list.lng b/interface/web/vm/lib/lang/fi_openvz_ip_list.lng deleted file mode 100644 index e6a3a68c2c3b9cad34982f035b86d4446ea68439..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/fi_openvz_ip_list.lng +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/fi_openvz_ostemplate.lng b/interface/web/vm/lib/lang/fi_openvz_ostemplate.lng deleted file mode 100644 index 256750f19a0cf4d459214a327d3f86773f9312d7..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/fi_openvz_ostemplate.lng +++ /dev/null @@ -1,11 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/fi_openvz_ostemplate_list.lng b/interface/web/vm/lib/lang/fi_openvz_ostemplate_list.lng deleted file mode 100644 index 6471ec0e277b63b6e110ef8deef7ca35511a2a52..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/fi_openvz_ostemplate_list.lng +++ /dev/null @@ -1,8 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/fi_openvz_template.lng b/interface/web/vm/lib/lang/fi_openvz_template.lng deleted file mode 100644 index 4c098565a35b2573df455929e0d092a25e3e32be..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/fi_openvz_template.lng +++ /dev/null @@ -1,97 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/fi_openvz_template_list.lng b/interface/web/vm/lib/lang/fi_openvz_template_list.lng deleted file mode 100644 index de4045c36a75506c0452b17c1e9d61080b534ce2..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/fi_openvz_template_list.lng +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/fi_openvz_vm.lng b/interface/web/vm/lib/lang/fi_openvz_vm.lng deleted file mode 100644 index 3094f0aa8d3ee7538b84dc2de381d5051cbfe409..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/fi_openvz_vm.lng +++ /dev/null @@ -1,45 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/fi_openvz_vm_list.lng b/interface/web/vm/lib/lang/fi_openvz_vm_list.lng deleted file mode 100644 index 2238e2b8f4fa4db72f1b785d6e0849e356922faf..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/fi_openvz_vm_list.lng +++ /dev/null @@ -1,10 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/fr.lng b/interface/web/vm/lib/lang/fr.lng deleted file mode 100644 index ade277c2d0b609c9688ed16b85e8376289ba580d..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/fr.lng +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/fr_openvz_action.lng b/interface/web/vm/lib/lang/fr_openvz_action.lng deleted file mode 100644 index 78958fda88c8575fbfc0f7d2c915f9e9e4621da3..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/fr_openvz_action.lng +++ /dev/null @@ -1,16 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/fr_openvz_ip.lng b/interface/web/vm/lib/lang/fr_openvz_ip.lng deleted file mode 100644 index 4be05dafee57c8aae76009189bc4b9f8b0db0b30..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/fr_openvz_ip.lng +++ /dev/null @@ -1,9 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/fr_openvz_ip_list.lng b/interface/web/vm/lib/lang/fr_openvz_ip_list.lng deleted file mode 100644 index 4f1d3706b74a29bb417087ca7052c5570a331438..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/fr_openvz_ip_list.lng +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/fr_openvz_ostemplate.lng b/interface/web/vm/lib/lang/fr_openvz_ostemplate.lng deleted file mode 100644 index ba9193da2fd671af2016991bf00234f1891f160a..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/fr_openvz_ostemplate.lng +++ /dev/null @@ -1,11 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/fr_openvz_ostemplate_list.lng b/interface/web/vm/lib/lang/fr_openvz_ostemplate_list.lng deleted file mode 100644 index f84a0b0d3e93a180645f635019105fe5f33531b3..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/fr_openvz_ostemplate_list.lng +++ /dev/null @@ -1,8 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/fr_openvz_template.lng b/interface/web/vm/lib/lang/fr_openvz_template.lng deleted file mode 100644 index e86bd1c74e1553c3e86fec798efdf63733d72bd7..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/fr_openvz_template.lng +++ /dev/null @@ -1,97 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/fr_openvz_template_list.lng b/interface/web/vm/lib/lang/fr_openvz_template_list.lng deleted file mode 100644 index c4ce4edd5fe15b7df96e2ba445c467f78ab4c6ee..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/fr_openvz_template_list.lng +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/fr_openvz_vm.lng b/interface/web/vm/lib/lang/fr_openvz_vm.lng deleted file mode 100644 index 32741946cce204b0aff93c4de9e95cf3e8073659..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/fr_openvz_vm.lng +++ /dev/null @@ -1,45 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/fr_openvz_vm_list.lng b/interface/web/vm/lib/lang/fr_openvz_vm_list.lng deleted file mode 100644 index 287069e3b70890d1e8faa063049f014a051deed5..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/fr_openvz_vm_list.lng +++ /dev/null @@ -1,10 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/hr.lng b/interface/web/vm/lib/lang/hr.lng deleted file mode 100644 index 4f5dbe9e60a7ab11a355aeec476a46e2d1b35c61..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/hr.lng +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/hr_openvz_action.lng b/interface/web/vm/lib/lang/hr_openvz_action.lng deleted file mode 100644 index d6e5fb4ed61bcc829922814c3195f38bbbddacc8..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/hr_openvz_action.lng +++ /dev/null @@ -1,16 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/hr_openvz_ip.lng b/interface/web/vm/lib/lang/hr_openvz_ip.lng deleted file mode 100644 index debb04b96fa37a3c96961791830bda5960f7bbcc..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/hr_openvz_ip.lng +++ /dev/null @@ -1,9 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/hr_openvz_ip_list.lng b/interface/web/vm/lib/lang/hr_openvz_ip_list.lng deleted file mode 100644 index c578fc9976123c605de62d04c86ae4018e4eeb23..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/hr_openvz_ip_list.lng +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/hr_openvz_ostemplate.lng b/interface/web/vm/lib/lang/hr_openvz_ostemplate.lng deleted file mode 100644 index df88ca9f7b4e68889c971910a636fb4fe7247db3..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/hr_openvz_ostemplate.lng +++ /dev/null @@ -1,11 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/hr_openvz_ostemplate_list.lng b/interface/web/vm/lib/lang/hr_openvz_ostemplate_list.lng deleted file mode 100644 index 430d36b92986cdd38f7d04e22791162e31d0efb7..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/hr_openvz_ostemplate_list.lng +++ /dev/null @@ -1,8 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/hr_openvz_template.lng b/interface/web/vm/lib/lang/hr_openvz_template.lng deleted file mode 100644 index 68fd60e0bcc10756e6da4e52839279c45b180748..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/hr_openvz_template.lng +++ /dev/null @@ -1,97 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/hr_openvz_template_list.lng b/interface/web/vm/lib/lang/hr_openvz_template_list.lng deleted file mode 100644 index f9c8642f1d6b53c908bd8947dd307f391c04a2dc..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/hr_openvz_template_list.lng +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/hr_openvz_vm.lng b/interface/web/vm/lib/lang/hr_openvz_vm.lng deleted file mode 100644 index e5b9fe14c46bdc0a5b6f6090a381a0ad66972374..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/hr_openvz_vm.lng +++ /dev/null @@ -1,45 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/hr_openvz_vm_list.lng b/interface/web/vm/lib/lang/hr_openvz_vm_list.lng deleted file mode 100644 index ab3ef52529a3bf748df1edcf3d903226d3231bc8..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/hr_openvz_vm_list.lng +++ /dev/null @@ -1,10 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/hu.lng b/interface/web/vm/lib/lang/hu.lng deleted file mode 100644 index 4167e14a8a150090ecfb1aa6738fb8a6abf17760..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/hu.lng +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/hu_openvz_action.lng b/interface/web/vm/lib/lang/hu_openvz_action.lng deleted file mode 100644 index 52f73285824f2d6c4107d8c9eec5980a251d505c..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/hu_openvz_action.lng +++ /dev/null @@ -1,16 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/hu_openvz_ip.lng b/interface/web/vm/lib/lang/hu_openvz_ip.lng deleted file mode 100644 index 6016681df89f13323f60379acff5e7abd98f4c77..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/hu_openvz_ip.lng +++ /dev/null @@ -1,9 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/hu_openvz_ip_list.lng b/interface/web/vm/lib/lang/hu_openvz_ip_list.lng deleted file mode 100644 index e6a3a68c2c3b9cad34982f035b86d4446ea68439..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/hu_openvz_ip_list.lng +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/hu_openvz_ostemplate.lng b/interface/web/vm/lib/lang/hu_openvz_ostemplate.lng deleted file mode 100644 index 256750f19a0cf4d459214a327d3f86773f9312d7..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/hu_openvz_ostemplate.lng +++ /dev/null @@ -1,11 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/hu_openvz_ostemplate_list.lng b/interface/web/vm/lib/lang/hu_openvz_ostemplate_list.lng deleted file mode 100644 index 6471ec0e277b63b6e110ef8deef7ca35511a2a52..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/hu_openvz_ostemplate_list.lng +++ /dev/null @@ -1,8 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/hu_openvz_template.lng b/interface/web/vm/lib/lang/hu_openvz_template.lng deleted file mode 100644 index 4c098565a35b2573df455929e0d092a25e3e32be..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/hu_openvz_template.lng +++ /dev/null @@ -1,97 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/hu_openvz_template_list.lng b/interface/web/vm/lib/lang/hu_openvz_template_list.lng deleted file mode 100644 index de4045c36a75506c0452b17c1e9d61080b534ce2..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/hu_openvz_template_list.lng +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/hu_openvz_vm.lng b/interface/web/vm/lib/lang/hu_openvz_vm.lng deleted file mode 100644 index 3094f0aa8d3ee7538b84dc2de381d5051cbfe409..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/hu_openvz_vm.lng +++ /dev/null @@ -1,45 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/hu_openvz_vm_list.lng b/interface/web/vm/lib/lang/hu_openvz_vm_list.lng deleted file mode 100644 index 2238e2b8f4fa4db72f1b785d6e0849e356922faf..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/hu_openvz_vm_list.lng +++ /dev/null @@ -1,10 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/id.lng b/interface/web/vm/lib/lang/id.lng deleted file mode 100644 index 4167e14a8a150090ecfb1aa6738fb8a6abf17760..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/id.lng +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/id_openvz_action.lng b/interface/web/vm/lib/lang/id_openvz_action.lng deleted file mode 100644 index 52f73285824f2d6c4107d8c9eec5980a251d505c..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/id_openvz_action.lng +++ /dev/null @@ -1,16 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/id_openvz_ip.lng b/interface/web/vm/lib/lang/id_openvz_ip.lng deleted file mode 100644 index 6016681df89f13323f60379acff5e7abd98f4c77..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/id_openvz_ip.lng +++ /dev/null @@ -1,9 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/id_openvz_ip_list.lng b/interface/web/vm/lib/lang/id_openvz_ip_list.lng deleted file mode 100644 index e6a3a68c2c3b9cad34982f035b86d4446ea68439..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/id_openvz_ip_list.lng +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/id_openvz_ostemplate.lng b/interface/web/vm/lib/lang/id_openvz_ostemplate.lng deleted file mode 100644 index 256750f19a0cf4d459214a327d3f86773f9312d7..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/id_openvz_ostemplate.lng +++ /dev/null @@ -1,11 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/id_openvz_ostemplate_list.lng b/interface/web/vm/lib/lang/id_openvz_ostemplate_list.lng deleted file mode 100644 index 6471ec0e277b63b6e110ef8deef7ca35511a2a52..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/id_openvz_ostemplate_list.lng +++ /dev/null @@ -1,8 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/id_openvz_template.lng b/interface/web/vm/lib/lang/id_openvz_template.lng deleted file mode 100644 index 4c098565a35b2573df455929e0d092a25e3e32be..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/id_openvz_template.lng +++ /dev/null @@ -1,97 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/id_openvz_template_list.lng b/interface/web/vm/lib/lang/id_openvz_template_list.lng deleted file mode 100644 index de4045c36a75506c0452b17c1e9d61080b534ce2..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/id_openvz_template_list.lng +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/id_openvz_vm.lng b/interface/web/vm/lib/lang/id_openvz_vm.lng deleted file mode 100644 index 3094f0aa8d3ee7538b84dc2de381d5051cbfe409..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/id_openvz_vm.lng +++ /dev/null @@ -1,45 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/id_openvz_vm_list.lng b/interface/web/vm/lib/lang/id_openvz_vm_list.lng deleted file mode 100644 index 2238e2b8f4fa4db72f1b785d6e0849e356922faf..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/id_openvz_vm_list.lng +++ /dev/null @@ -1,10 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/it.lng b/interface/web/vm/lib/lang/it.lng deleted file mode 100644 index c59bc303bc4678243a0a083df58c797a2280f1b3..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/it.lng +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/it_openvz_action.lng b/interface/web/vm/lib/lang/it_openvz_action.lng deleted file mode 100644 index ecbe5eec258757d5cfe32eaf691a026bbaf09010..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/it_openvz_action.lng +++ /dev/null @@ -1,16 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/it_openvz_ip.lng b/interface/web/vm/lib/lang/it_openvz_ip.lng deleted file mode 100644 index 0a22248027640cbd27d27730cf3aa0726d80a360..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/it_openvz_ip.lng +++ /dev/null @@ -1,9 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/it_openvz_ip_list.lng b/interface/web/vm/lib/lang/it_openvz_ip_list.lng deleted file mode 100644 index c639477c4f0ec26651732ac1d81bae938a837c70..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/it_openvz_ip_list.lng +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/it_openvz_ostemplate.lng b/interface/web/vm/lib/lang/it_openvz_ostemplate.lng deleted file mode 100644 index 5b58e7ebc5c30df7f3e5a67f28d5803b20221601..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/it_openvz_ostemplate.lng +++ /dev/null @@ -1,11 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/it_openvz_ostemplate_list.lng b/interface/web/vm/lib/lang/it_openvz_ostemplate_list.lng deleted file mode 100644 index 7df4dc7fe63d8e2b1892bb6eb2fbe301590f7cc4..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/it_openvz_ostemplate_list.lng +++ /dev/null @@ -1,8 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/it_openvz_template.lng b/interface/web/vm/lib/lang/it_openvz_template.lng deleted file mode 100644 index b23f8623632c780e5e70f0156de887c00a3700d2..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/it_openvz_template.lng +++ /dev/null @@ -1,97 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/it_openvz_template_list.lng b/interface/web/vm/lib/lang/it_openvz_template_list.lng deleted file mode 100644 index f7520680851c11968f134ea1fa881d95cf83af53..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/it_openvz_template_list.lng +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/it_openvz_vm.lng b/interface/web/vm/lib/lang/it_openvz_vm.lng deleted file mode 100644 index 8290d94e99935a339ac53ce1b5c64d0b53101a9a..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/it_openvz_vm.lng +++ /dev/null @@ -1,45 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/it_openvz_vm_list.lng b/interface/web/vm/lib/lang/it_openvz_vm_list.lng deleted file mode 100644 index 3ed0a012af67354c2de67299b9428c29c21c4507..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/it_openvz_vm_list.lng +++ /dev/null @@ -1,10 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/ja.lng b/interface/web/vm/lib/lang/ja.lng deleted file mode 100644 index 4167e14a8a150090ecfb1aa6738fb8a6abf17760..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/ja.lng +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/ja_openvz_action.lng b/interface/web/vm/lib/lang/ja_openvz_action.lng deleted file mode 100644 index 52f73285824f2d6c4107d8c9eec5980a251d505c..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/ja_openvz_action.lng +++ /dev/null @@ -1,16 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/ja_openvz_ip.lng b/interface/web/vm/lib/lang/ja_openvz_ip.lng deleted file mode 100644 index 6016681df89f13323f60379acff5e7abd98f4c77..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/ja_openvz_ip.lng +++ /dev/null @@ -1,9 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/ja_openvz_ip_list.lng b/interface/web/vm/lib/lang/ja_openvz_ip_list.lng deleted file mode 100644 index e6a3a68c2c3b9cad34982f035b86d4446ea68439..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/ja_openvz_ip_list.lng +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/ja_openvz_ostemplate.lng b/interface/web/vm/lib/lang/ja_openvz_ostemplate.lng deleted file mode 100644 index 256750f19a0cf4d459214a327d3f86773f9312d7..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/ja_openvz_ostemplate.lng +++ /dev/null @@ -1,11 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/ja_openvz_ostemplate_list.lng b/interface/web/vm/lib/lang/ja_openvz_ostemplate_list.lng deleted file mode 100644 index 6471ec0e277b63b6e110ef8deef7ca35511a2a52..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/ja_openvz_ostemplate_list.lng +++ /dev/null @@ -1,8 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/ja_openvz_template.lng b/interface/web/vm/lib/lang/ja_openvz_template.lng deleted file mode 100644 index 4c098565a35b2573df455929e0d092a25e3e32be..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/ja_openvz_template.lng +++ /dev/null @@ -1,97 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/ja_openvz_template_list.lng b/interface/web/vm/lib/lang/ja_openvz_template_list.lng deleted file mode 100644 index de4045c36a75506c0452b17c1e9d61080b534ce2..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/ja_openvz_template_list.lng +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/ja_openvz_vm.lng b/interface/web/vm/lib/lang/ja_openvz_vm.lng deleted file mode 100644 index 3094f0aa8d3ee7538b84dc2de381d5051cbfe409..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/ja_openvz_vm.lng +++ /dev/null @@ -1,45 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/ja_openvz_vm_list.lng b/interface/web/vm/lib/lang/ja_openvz_vm_list.lng deleted file mode 100644 index 2238e2b8f4fa4db72f1b785d6e0849e356922faf..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/ja_openvz_vm_list.lng +++ /dev/null @@ -1,10 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/nl.lng b/interface/web/vm/lib/lang/nl.lng deleted file mode 100644 index 4167e14a8a150090ecfb1aa6738fb8a6abf17760..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/nl.lng +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/nl_openvz_action.lng b/interface/web/vm/lib/lang/nl_openvz_action.lng deleted file mode 100644 index 52f73285824f2d6c4107d8c9eec5980a251d505c..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/nl_openvz_action.lng +++ /dev/null @@ -1,16 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/nl_openvz_ip.lng b/interface/web/vm/lib/lang/nl_openvz_ip.lng deleted file mode 100644 index 6016681df89f13323f60379acff5e7abd98f4c77..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/nl_openvz_ip.lng +++ /dev/null @@ -1,9 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/nl_openvz_ip_list.lng b/interface/web/vm/lib/lang/nl_openvz_ip_list.lng deleted file mode 100644 index e6a3a68c2c3b9cad34982f035b86d4446ea68439..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/nl_openvz_ip_list.lng +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/nl_openvz_ostemplate.lng b/interface/web/vm/lib/lang/nl_openvz_ostemplate.lng deleted file mode 100644 index 256750f19a0cf4d459214a327d3f86773f9312d7..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/nl_openvz_ostemplate.lng +++ /dev/null @@ -1,11 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/nl_openvz_ostemplate_list.lng b/interface/web/vm/lib/lang/nl_openvz_ostemplate_list.lng deleted file mode 100644 index 6471ec0e277b63b6e110ef8deef7ca35511a2a52..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/nl_openvz_ostemplate_list.lng +++ /dev/null @@ -1,8 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/nl_openvz_template.lng b/interface/web/vm/lib/lang/nl_openvz_template.lng deleted file mode 100644 index 4c098565a35b2573df455929e0d092a25e3e32be..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/nl_openvz_template.lng +++ /dev/null @@ -1,97 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/nl_openvz_template_list.lng b/interface/web/vm/lib/lang/nl_openvz_template_list.lng deleted file mode 100644 index de4045c36a75506c0452b17c1e9d61080b534ce2..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/nl_openvz_template_list.lng +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/nl_openvz_vm.lng b/interface/web/vm/lib/lang/nl_openvz_vm.lng deleted file mode 100644 index 3094f0aa8d3ee7538b84dc2de381d5051cbfe409..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/nl_openvz_vm.lng +++ /dev/null @@ -1,45 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/nl_openvz_vm_list.lng b/interface/web/vm/lib/lang/nl_openvz_vm_list.lng deleted file mode 100644 index 2238e2b8f4fa4db72f1b785d6e0849e356922faf..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/nl_openvz_vm_list.lng +++ /dev/null @@ -1,10 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/pl.lng b/interface/web/vm/lib/lang/pl.lng deleted file mode 100644 index 4167e14a8a150090ecfb1aa6738fb8a6abf17760..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/pl.lng +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/pl_openvz_action.lng b/interface/web/vm/lib/lang/pl_openvz_action.lng deleted file mode 100644 index 52f73285824f2d6c4107d8c9eec5980a251d505c..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/pl_openvz_action.lng +++ /dev/null @@ -1,16 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/pl_openvz_ip.lng b/interface/web/vm/lib/lang/pl_openvz_ip.lng deleted file mode 100644 index 6016681df89f13323f60379acff5e7abd98f4c77..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/pl_openvz_ip.lng +++ /dev/null @@ -1,9 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/pl_openvz_ip_list.lng b/interface/web/vm/lib/lang/pl_openvz_ip_list.lng deleted file mode 100644 index f675aa57c90b098f904b8e9ea793903e2f028c36..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/pl_openvz_ip_list.lng +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/pl_openvz_ostemplate.lng b/interface/web/vm/lib/lang/pl_openvz_ostemplate.lng deleted file mode 100644 index 256750f19a0cf4d459214a327d3f86773f9312d7..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/pl_openvz_ostemplate.lng +++ /dev/null @@ -1,11 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/pl_openvz_ostemplate_list.lng b/interface/web/vm/lib/lang/pl_openvz_ostemplate_list.lng deleted file mode 100644 index 6471ec0e277b63b6e110ef8deef7ca35511a2a52..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/pl_openvz_ostemplate_list.lng +++ /dev/null @@ -1,8 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/pl_openvz_template.lng b/interface/web/vm/lib/lang/pl_openvz_template.lng deleted file mode 100644 index 4c098565a35b2573df455929e0d092a25e3e32be..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/pl_openvz_template.lng +++ /dev/null @@ -1,97 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/pl_openvz_template_list.lng b/interface/web/vm/lib/lang/pl_openvz_template_list.lng deleted file mode 100644 index de4045c36a75506c0452b17c1e9d61080b534ce2..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/pl_openvz_template_list.lng +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/pl_openvz_vm.lng b/interface/web/vm/lib/lang/pl_openvz_vm.lng deleted file mode 100644 index 3094f0aa8d3ee7538b84dc2de381d5051cbfe409..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/pl_openvz_vm.lng +++ /dev/null @@ -1,45 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/pl_openvz_vm_list.lng b/interface/web/vm/lib/lang/pl_openvz_vm_list.lng deleted file mode 100644 index 2238e2b8f4fa4db72f1b785d6e0849e356922faf..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/pl_openvz_vm_list.lng +++ /dev/null @@ -1,10 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/pt.lng b/interface/web/vm/lib/lang/pt.lng deleted file mode 100644 index 4167e14a8a150090ecfb1aa6738fb8a6abf17760..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/pt.lng +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/pt_openvz_action.lng b/interface/web/vm/lib/lang/pt_openvz_action.lng deleted file mode 100644 index 52f73285824f2d6c4107d8c9eec5980a251d505c..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/pt_openvz_action.lng +++ /dev/null @@ -1,16 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/pt_openvz_ip.lng b/interface/web/vm/lib/lang/pt_openvz_ip.lng deleted file mode 100644 index 6016681df89f13323f60379acff5e7abd98f4c77..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/pt_openvz_ip.lng +++ /dev/null @@ -1,9 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/pt_openvz_ip_list.lng b/interface/web/vm/lib/lang/pt_openvz_ip_list.lng deleted file mode 100644 index e6a3a68c2c3b9cad34982f035b86d4446ea68439..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/pt_openvz_ip_list.lng +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/pt_openvz_ostemplate.lng b/interface/web/vm/lib/lang/pt_openvz_ostemplate.lng deleted file mode 100644 index 256750f19a0cf4d459214a327d3f86773f9312d7..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/pt_openvz_ostemplate.lng +++ /dev/null @@ -1,11 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/pt_openvz_ostemplate_list.lng b/interface/web/vm/lib/lang/pt_openvz_ostemplate_list.lng deleted file mode 100644 index 6471ec0e277b63b6e110ef8deef7ca35511a2a52..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/pt_openvz_ostemplate_list.lng +++ /dev/null @@ -1,8 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/pt_openvz_template.lng b/interface/web/vm/lib/lang/pt_openvz_template.lng deleted file mode 100644 index 4c098565a35b2573df455929e0d092a25e3e32be..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/pt_openvz_template.lng +++ /dev/null @@ -1,97 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/pt_openvz_template_list.lng b/interface/web/vm/lib/lang/pt_openvz_template_list.lng deleted file mode 100644 index de4045c36a75506c0452b17c1e9d61080b534ce2..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/pt_openvz_template_list.lng +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/pt_openvz_vm.lng b/interface/web/vm/lib/lang/pt_openvz_vm.lng deleted file mode 100644 index 3094f0aa8d3ee7538b84dc2de381d5051cbfe409..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/pt_openvz_vm.lng +++ /dev/null @@ -1,45 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/pt_openvz_vm_list.lng b/interface/web/vm/lib/lang/pt_openvz_vm_list.lng deleted file mode 100644 index 2238e2b8f4fa4db72f1b785d6e0849e356922faf..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/pt_openvz_vm_list.lng +++ /dev/null @@ -1,10 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/ro.lng b/interface/web/vm/lib/lang/ro.lng deleted file mode 100644 index 4167e14a8a150090ecfb1aa6738fb8a6abf17760..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/ro.lng +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/ro_openvz_action.lng b/interface/web/vm/lib/lang/ro_openvz_action.lng deleted file mode 100644 index 52f73285824f2d6c4107d8c9eec5980a251d505c..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/ro_openvz_action.lng +++ /dev/null @@ -1,16 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/ro_openvz_ip.lng b/interface/web/vm/lib/lang/ro_openvz_ip.lng deleted file mode 100644 index 6016681df89f13323f60379acff5e7abd98f4c77..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/ro_openvz_ip.lng +++ /dev/null @@ -1,9 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/ro_openvz_ip_list.lng b/interface/web/vm/lib/lang/ro_openvz_ip_list.lng deleted file mode 100644 index e6a3a68c2c3b9cad34982f035b86d4446ea68439..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/ro_openvz_ip_list.lng +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/ro_openvz_ostemplate.lng b/interface/web/vm/lib/lang/ro_openvz_ostemplate.lng deleted file mode 100644 index 256750f19a0cf4d459214a327d3f86773f9312d7..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/ro_openvz_ostemplate.lng +++ /dev/null @@ -1,11 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/ro_openvz_ostemplate_list.lng b/interface/web/vm/lib/lang/ro_openvz_ostemplate_list.lng deleted file mode 100644 index 6471ec0e277b63b6e110ef8deef7ca35511a2a52..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/ro_openvz_ostemplate_list.lng +++ /dev/null @@ -1,8 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/ro_openvz_template.lng b/interface/web/vm/lib/lang/ro_openvz_template.lng deleted file mode 100644 index 4c098565a35b2573df455929e0d092a25e3e32be..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/ro_openvz_template.lng +++ /dev/null @@ -1,97 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/ro_openvz_template_list.lng b/interface/web/vm/lib/lang/ro_openvz_template_list.lng deleted file mode 100644 index de4045c36a75506c0452b17c1e9d61080b534ce2..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/ro_openvz_template_list.lng +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/ro_openvz_vm.lng b/interface/web/vm/lib/lang/ro_openvz_vm.lng deleted file mode 100644 index 3094f0aa8d3ee7538b84dc2de381d5051cbfe409..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/ro_openvz_vm.lng +++ /dev/null @@ -1,45 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/ro_openvz_vm_list.lng b/interface/web/vm/lib/lang/ro_openvz_vm_list.lng deleted file mode 100644 index 2238e2b8f4fa4db72f1b785d6e0849e356922faf..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/ro_openvz_vm_list.lng +++ /dev/null @@ -1,10 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/ru.lng b/interface/web/vm/lib/lang/ru.lng deleted file mode 100644 index b0691cfdae1f900b3f1bcbda7480a62e3e1ce710..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/ru.lng +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/ru_openvz_action.lng b/interface/web/vm/lib/lang/ru_openvz_action.lng deleted file mode 100644 index d1a95eb7ced962ed9be2bb59da92a55ed59d2f23..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/ru_openvz_action.lng +++ /dev/null @@ -1,16 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/ru_openvz_ip.lng b/interface/web/vm/lib/lang/ru_openvz_ip.lng deleted file mode 100644 index 5fcca20bbbe5ab502ec34ed01d53d15b08c973fb..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/ru_openvz_ip.lng +++ /dev/null @@ -1,9 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/ru_openvz_ip_list.lng b/interface/web/vm/lib/lang/ru_openvz_ip_list.lng deleted file mode 100644 index 787f378030f5168a9fc4a21eeb03584f4465ffce..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/ru_openvz_ip_list.lng +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/ru_openvz_ostemplate.lng b/interface/web/vm/lib/lang/ru_openvz_ostemplate.lng deleted file mode 100644 index 3d8de5c9442dc1bb93ae02a352e22cdca81854c5..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/ru_openvz_ostemplate.lng +++ /dev/null @@ -1,11 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/ru_openvz_ostemplate_list.lng b/interface/web/vm/lib/lang/ru_openvz_ostemplate_list.lng deleted file mode 100644 index 86af3ab1c32a87fcbfa0b51d5b44cb5e636f3dff..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/ru_openvz_ostemplate_list.lng +++ /dev/null @@ -1,8 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/ru_openvz_template.lng b/interface/web/vm/lib/lang/ru_openvz_template.lng deleted file mode 100644 index e8abefee5531cf09edd3add024374f694ecf2181..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/ru_openvz_template.lng +++ /dev/null @@ -1,97 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/ru_openvz_template_list.lng b/interface/web/vm/lib/lang/ru_openvz_template_list.lng deleted file mode 100644 index 4f85f544edd222d76df1abb4405a46d62f984c27..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/ru_openvz_template_list.lng +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/ru_openvz_vm.lng b/interface/web/vm/lib/lang/ru_openvz_vm.lng deleted file mode 100644 index 4794b7e169d4e3f0544acbbf65ba3e18c95f1f05..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/ru_openvz_vm.lng +++ /dev/null @@ -1,45 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/ru_openvz_vm_list.lng b/interface/web/vm/lib/lang/ru_openvz_vm_list.lng deleted file mode 100644 index f88013e208b4fe68b3272096564135426f66faec..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/ru_openvz_vm_list.lng +++ /dev/null @@ -1,10 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/se.lng b/interface/web/vm/lib/lang/se.lng deleted file mode 100644 index 4167e14a8a150090ecfb1aa6738fb8a6abf17760..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/se.lng +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/se_openvz_action.lng b/interface/web/vm/lib/lang/se_openvz_action.lng deleted file mode 100644 index 52f73285824f2d6c4107d8c9eec5980a251d505c..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/se_openvz_action.lng +++ /dev/null @@ -1,16 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/se_openvz_ip.lng b/interface/web/vm/lib/lang/se_openvz_ip.lng deleted file mode 100644 index 6016681df89f13323f60379acff5e7abd98f4c77..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/se_openvz_ip.lng +++ /dev/null @@ -1,9 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/se_openvz_ip_list.lng b/interface/web/vm/lib/lang/se_openvz_ip_list.lng deleted file mode 100644 index e6a3a68c2c3b9cad34982f035b86d4446ea68439..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/se_openvz_ip_list.lng +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/se_openvz_ostemplate.lng b/interface/web/vm/lib/lang/se_openvz_ostemplate.lng deleted file mode 100644 index 256750f19a0cf4d459214a327d3f86773f9312d7..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/se_openvz_ostemplate.lng +++ /dev/null @@ -1,11 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/se_openvz_ostemplate_list.lng b/interface/web/vm/lib/lang/se_openvz_ostemplate_list.lng deleted file mode 100644 index 6471ec0e277b63b6e110ef8deef7ca35511a2a52..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/se_openvz_ostemplate_list.lng +++ /dev/null @@ -1,8 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/se_openvz_template.lng b/interface/web/vm/lib/lang/se_openvz_template.lng deleted file mode 100644 index 4c098565a35b2573df455929e0d092a25e3e32be..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/se_openvz_template.lng +++ /dev/null @@ -1,97 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/se_openvz_template_list.lng b/interface/web/vm/lib/lang/se_openvz_template_list.lng deleted file mode 100644 index de4045c36a75506c0452b17c1e9d61080b534ce2..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/se_openvz_template_list.lng +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/se_openvz_vm.lng b/interface/web/vm/lib/lang/se_openvz_vm.lng deleted file mode 100644 index 3094f0aa8d3ee7538b84dc2de381d5051cbfe409..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/se_openvz_vm.lng +++ /dev/null @@ -1,45 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/se_openvz_vm_list.lng b/interface/web/vm/lib/lang/se_openvz_vm_list.lng deleted file mode 100644 index 2238e2b8f4fa4db72f1b785d6e0849e356922faf..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/se_openvz_vm_list.lng +++ /dev/null @@ -1,10 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/sk.lng b/interface/web/vm/lib/lang/sk.lng deleted file mode 100644 index 4167e14a8a150090ecfb1aa6738fb8a6abf17760..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/sk.lng +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/sk_openvz_action.lng b/interface/web/vm/lib/lang/sk_openvz_action.lng deleted file mode 100644 index 52f73285824f2d6c4107d8c9eec5980a251d505c..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/sk_openvz_action.lng +++ /dev/null @@ -1,16 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/sk_openvz_ip.lng b/interface/web/vm/lib/lang/sk_openvz_ip.lng deleted file mode 100644 index 6016681df89f13323f60379acff5e7abd98f4c77..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/sk_openvz_ip.lng +++ /dev/null @@ -1,9 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/sk_openvz_ip_list.lng b/interface/web/vm/lib/lang/sk_openvz_ip_list.lng deleted file mode 100644 index e6a3a68c2c3b9cad34982f035b86d4446ea68439..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/sk_openvz_ip_list.lng +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/sk_openvz_ostemplate.lng b/interface/web/vm/lib/lang/sk_openvz_ostemplate.lng deleted file mode 100644 index 256750f19a0cf4d459214a327d3f86773f9312d7..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/sk_openvz_ostemplate.lng +++ /dev/null @@ -1,11 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/sk_openvz_ostemplate_list.lng b/interface/web/vm/lib/lang/sk_openvz_ostemplate_list.lng deleted file mode 100644 index 6471ec0e277b63b6e110ef8deef7ca35511a2a52..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/sk_openvz_ostemplate_list.lng +++ /dev/null @@ -1,8 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/sk_openvz_template.lng b/interface/web/vm/lib/lang/sk_openvz_template.lng deleted file mode 100644 index 4c098565a35b2573df455929e0d092a25e3e32be..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/sk_openvz_template.lng +++ /dev/null @@ -1,97 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/sk_openvz_template_list.lng b/interface/web/vm/lib/lang/sk_openvz_template_list.lng deleted file mode 100644 index de4045c36a75506c0452b17c1e9d61080b534ce2..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/sk_openvz_template_list.lng +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/sk_openvz_vm.lng b/interface/web/vm/lib/lang/sk_openvz_vm.lng deleted file mode 100644 index 3094f0aa8d3ee7538b84dc2de381d5051cbfe409..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/sk_openvz_vm.lng +++ /dev/null @@ -1,45 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/sk_openvz_vm_list.lng b/interface/web/vm/lib/lang/sk_openvz_vm_list.lng deleted file mode 100644 index 2238e2b8f4fa4db72f1b785d6e0849e356922faf..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/sk_openvz_vm_list.lng +++ /dev/null @@ -1,10 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/tr.lng b/interface/web/vm/lib/lang/tr.lng deleted file mode 100644 index 82599dd038568772d46f805c842d38d8c7223bc1..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/tr.lng +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/tr_openvz_action.lng b/interface/web/vm/lib/lang/tr_openvz_action.lng deleted file mode 100644 index 29759e0266fdabd3883e23f8a93792a0a6df7554..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/tr_openvz_action.lng +++ /dev/null @@ -1,16 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/tr_openvz_ip.lng b/interface/web/vm/lib/lang/tr_openvz_ip.lng deleted file mode 100644 index 637a70f2ea87b83d0bfb467860a3c8722f111ac3..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/tr_openvz_ip.lng +++ /dev/null @@ -1,9 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/tr_openvz_ip_list.lng b/interface/web/vm/lib/lang/tr_openvz_ip_list.lng deleted file mode 100644 index 588273188abe2dd25fd7ab61a27413b1f5bff11b..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/tr_openvz_ip_list.lng +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/tr_openvz_ostemplate.lng b/interface/web/vm/lib/lang/tr_openvz_ostemplate.lng deleted file mode 100644 index 6ff2d2b9f53b33492ebfc1bc899a6ec238fbc798..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/tr_openvz_ostemplate.lng +++ /dev/null @@ -1,11 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/tr_openvz_ostemplate_list.lng b/interface/web/vm/lib/lang/tr_openvz_ostemplate_list.lng deleted file mode 100644 index bf5923aed17fe4dc744a7e9bd50877dfb3bbdbd3..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/tr_openvz_ostemplate_list.lng +++ /dev/null @@ -1,8 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/tr_openvz_template.lng b/interface/web/vm/lib/lang/tr_openvz_template.lng deleted file mode 100644 index fb1452e8853141d0135cf9607cc4a3b968bdfcc6..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/tr_openvz_template.lng +++ /dev/null @@ -1,97 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/tr_openvz_template_list.lng b/interface/web/vm/lib/lang/tr_openvz_template_list.lng deleted file mode 100644 index 5be17843134e05cdf984bf9de4d5968c8941c916..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/tr_openvz_template_list.lng +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/tr_openvz_vm.lng b/interface/web/vm/lib/lang/tr_openvz_vm.lng deleted file mode 100644 index fad86d9f3a29185664fa6c9bfe37ccff09f5742f..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/tr_openvz_vm.lng +++ /dev/null @@ -1,45 +0,0 @@ - diff --git a/interface/web/vm/lib/lang/tr_openvz_vm_list.lng b/interface/web/vm/lib/lang/tr_openvz_vm_list.lng deleted file mode 100644 index 1a4ed0e7b93f99627887ec8d3e7ba746c79f01a0..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/lang/tr_openvz_vm_list.lng +++ /dev/null @@ -1,10 +0,0 @@ - diff --git a/interface/web/vm/lib/module.conf.php b/interface/web/vm/lib/module.conf.php deleted file mode 100644 index ee5e6b6ad11b0f4eeb1dffc748ab5056426bff22..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/module.conf.php +++ /dev/null @@ -1,69 +0,0 @@ - 'Virtual Servers', - 'target' => 'content', - 'link' => 'vm/openvz_vm_list.php', - 'html_id' => 'openvz_vm_list'); - -if($_SESSION["s"]["user"]["typ"] == 'admin') { - $items[] = array( 'title' => 'OS Templates', - 'target' => 'content', - 'link' => 'vm/openvz_ostemplate_list.php', - 'html_id' => 'openvz_ostemplate_list'); - - $items[] = array( 'title' => 'VM Templates', - 'target' => 'content', - 'link' => 'vm/openvz_template_list.php', - 'html_id' => 'openvz_template_list'); - - $items[] = array( 'title' => 'IP addresses', - 'target' => 'content', - 'link' => 'vm/openvz_ip_list.php', - 'html_id' => 'openvz_ip_list'); -} -if(count($items)) -{ - $module['nav'][] = array( 'title' => 'OpenVZ', - 'open' => 1, - 'items' => $items); -} - - -//**** Statistics menu -/* -$items = array(); - -$items[] = array( 'title' => 'Traffic', - 'target' => 'content', - 'link' => 'vm/traffic_stats.php', - 'html_id' => 'vm_traffic_stats'); - -$items[] = array( 'title' => 'Vserver monitor', - 'target' => 'content', - 'link' => 'vm/traffic_stats.php', - 'html_id' => 'vm_traffic_stats'); - -if(count($items)) -{ - $module['nav'][] = array( 'title' => 'Statistics', - 'open' => 1, - 'items' => $items); -} -*/ - - - - - - -?> diff --git a/interface/web/vm/lib/remote.conf.php b/interface/web/vm/lib/remote.conf.php deleted file mode 100644 index 77222bf90b46b08d3892a0cd1f24cda737b4ed4d..0000000000000000000000000000000000000000 --- a/interface/web/vm/lib/remote.conf.php +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/interface/web/vm/list/openvz_ip.list.php b/interface/web/vm/list/openvz_ip.list.php deleted file mode 100644 index 80869918ad4dfc0b1275bde69a358d25ae433881..0000000000000000000000000000000000000000 --- a/interface/web/vm/list/openvz_ip.list.php +++ /dev/null @@ -1,100 +0,0 @@ - "server_id", - 'datatype' => "VARCHAR", - 'formtype' => "SELECT", - 'op' => "like", - 'prefix' => "", - 'suffix' => "", - 'datasource' => array ( 'type' => 'SQL', - 'querystring' => 'SELECT server_id, server_name FROM server WHERE vserver_server = 1 AND mirror_server_id = 0 ORDER BY server_name', - 'keyfield'=> 'server_id', - 'valuefield'=> 'server_name' - ), - 'width' => "", - 'value' => ""); - -$liste["item"][] = array( 'field' => "vm_id", - 'datatype' => "VARCHAR", - 'formtype' => "SELECT", - 'op' => "like", - 'prefix' => "", - 'suffix' => "", - 'datasource' => array ( 'type' => 'SQL', - 'querystring' => 'SELECT vm_id,hostname FROM openvz_vm WHERE {AUTHSQL} ORDER BY hostname', - 'keyfield'=> 'vm_id', - 'valuefield'=> 'hostname' - ), - 'width' => "", - 'value' => ""); - -$liste["item"][] = array( 'field' => "ip_address", - 'datatype' => "VARCHAR", - 'formtype' => "TEXT", - 'op' => "like", - 'prefix' => "%", - 'suffix' => "%", - 'width' => "", - 'value' => ""); - -$liste["item"][] = array( 'field' => "reserved", - 'datatype' => "VARCHAR", - 'formtype' => "SELECT", - 'op' => "=", - 'prefix' => "", - 'suffix' => "", - 'width' => "", - 'value' => array('y' => $app->lng('yes_txt'), 'n' => $app->lng('no_txt'))); - - - - - -?> diff --git a/interface/web/vm/list/openvz_ostemplate.list.php b/interface/web/vm/list/openvz_ostemplate.list.php deleted file mode 100644 index c2df7eb3867924ce031b0275b9dbb08ca859fdd4..0000000000000000000000000000000000000000 --- a/interface/web/vm/list/openvz_ostemplate.list.php +++ /dev/null @@ -1,103 +0,0 @@ - "active", - 'datatype' => "VARCHAR", - 'formtype' => "SELECT", - 'op' => "=", - 'prefix' => "", - 'suffix' => "", - 'width' => "", - 'value' => array('y' => $app->lng('yes_txt'), 'n' => $app->lng('no_txt'))); - -$liste["item"][] = array( 'field' => "ostemplate_id", - 'datatype' => "INTEGER", - 'formtype' => "TEXT", - 'op' => "=", - 'prefix' => "", - 'suffix' => "", - 'width' => "", - 'value' => ""); - - -$liste["item"][] = array( 'field' => "template_name", - 'datatype' => "VARCHAR", - 'formtype' => "TEXT", - 'op' => "like", - 'prefix' => "%", - 'suffix' => "%", - 'width' => "", - 'value' => ""); - -$liste["item"][] = array( 'field' => "server_id", - 'datatype' => "VARCHAR", - 'formtype' => "SELECT", - 'op' => "like", - 'prefix' => "", - 'suffix' => "", - 'datasource' => array ( 'type' => 'SQL', - 'querystring' => 'SELECT server_id, server_name FROM server WHERE vserver_server = 1 AND mirror_server_id = 0 ORDER BY server_name', - 'keyfield'=> 'server_id', - 'valuefield'=> 'server_name' - ), - 'width' => "", - 'value' => ""); - -$liste["item"][] = array( 'field' => "allservers", - 'datatype' => "VARCHAR", - 'formtype' => "SELECT", - 'op' => "=", - 'prefix' => "", - 'suffix' => "", - 'width' => "", - 'value' => array('y' => $app->lng('yes_txt'), 'n' => $app->lng('no_txt'))); - - - -?> diff --git a/interface/web/vm/list/openvz_template.list.php b/interface/web/vm/list/openvz_template.list.php deleted file mode 100644 index 2d92f7baf4bf1aef12d19b7a5edb38938e7e0fb3..0000000000000000000000000000000000000000 --- a/interface/web/vm/list/openvz_template.list.php +++ /dev/null @@ -1,70 +0,0 @@ - "active", - 'datatype' => "VARCHAR", - 'formtype' => "SELECT", - 'op' => "=", - 'prefix' => "", - 'suffix' => "", - 'width' => "", - 'value' => array('y' => $app->lng('yes_txt'), 'n' => $app->lng('no_txt'))); - - -$liste["item"][] = array( 'field' => "template_name", - 'datatype' => "VARCHAR", - 'formtype' => "TEXT", - 'op' => "like", - 'prefix' => "%", - 'suffix' => "%", - 'width' => "", - 'value' => ""); - - -?> diff --git a/interface/web/vm/list/openvz_vm.list.php b/interface/web/vm/list/openvz_vm.list.php deleted file mode 100644 index 261427491bf1a3e6130bfca9be4a5fbf40d2b557..0000000000000000000000000000000000000000 --- a/interface/web/vm/list/openvz_vm.list.php +++ /dev/null @@ -1,132 +0,0 @@ - "active", - 'datatype' => "VARCHAR", - 'formtype' => "SELECT", - 'op' => "=", - 'prefix' => "", - 'suffix' => "", - 'width' => "", - 'value' => array('y' => $app->lng('yes_txt'), 'n' => $app->lng('no_txt'))); - -$liste["item"][] = array( 'field' => "veid", - 'datatype' => "VARCHAR", - 'formtype' => "TEXT", - 'op' => "=", - 'prefix' => "", - 'suffix' => "", - 'width' => "", - 'value' => ""); - -$liste["item"][] = array( 'field' => "server_id", - 'datatype' => "VARCHAR", - 'formtype' => "SELECT", - 'op' => "like", - 'prefix' => "", - 'suffix' => "", - 'datasource' => array ( 'type' => 'SQL', - 'querystring' => 'SELECT server_id, server_name FROM server WHERE vserver_server = 1 AND mirror_server_id = 0 ORDER BY server_name', - 'keyfield'=> 'server_id', - 'valuefield'=> 'server_name' - ), - 'width' => "", - 'value' => ""); - -$liste["item"][] = array( 'field' => "ostemplate_id", - 'datatype' => "VARCHAR", - 'formtype' => "SELECT", - 'op' => "like", - 'prefix' => "", - 'suffix' => "", - 'datasource' => array ( 'type' => 'SQL', - 'querystring' => 'SELECT ostemplate_id,template_name FROM openvz_ostemplate WHERE {AUTHSQL} ORDER BY template_name', - 'keyfield'=> 'ostemplate_id', - 'valuefield'=> 'template_name' - ), - 'width' => "", - 'value' => ""); - -$liste["item"][] = array( 'field' => "template_id", - 'datatype' => "VARCHAR", - 'formtype' => "SELECT", - 'op' => "like", - 'prefix' => "", - 'suffix' => "", - 'datasource' => array ( 'type' => 'SQL', - 'querystring' => 'SELECT template_id,template_name FROM openvz_template WHERE {AUTHSQL} ORDER BY template_name', - 'keyfield'=> 'template_id', - 'valuefield'=> 'template_name' - ), - 'width' => "", - 'value' => ""); - -$liste["item"][] = array( 'field' => "hostname", - 'datatype' => "VARCHAR", - 'filters' => array( 0 => array( 'event' => 'SHOW', - 'type' => 'IDNTOUTF8') - ), - 'formtype' => "TEXT", - 'op' => "like", - 'prefix' => "%", - 'suffix' => "%", - 'width' => "", - 'value' => ""); - -$liste["item"][] = array( 'field' => "ip_address", - 'datatype' => "VARCHAR", - 'formtype' => "TEXT", - 'op' => "like", - 'prefix' => "", - 'suffix' => "%", - 'width' => "", - 'value' => ""); - - -?> diff --git a/interface/web/vm/openvz_action.php b/interface/web/vm/openvz_action.php deleted file mode 100644 index c0bedf19be0ba9ff218f895c0cbd722c963beb62..0000000000000000000000000000000000000000 --- a/interface/web/vm/openvz_action.php +++ /dev/null @@ -1,129 +0,0 @@ -auth->check_module_permissions('vm'); - -$action = (isset($_POST['action']) && $_POST['action'] != '')?$_POST['action']:'show'; -$vm_id = $app->functions->intval($_REQUEST['id']); -$error_msg = ''; -$notify_msg = ''; - -if($vm_id == 0) die('Invalid VM ID'); - -if(isset($_POST) && count($_POST) > 1) { - //* CSRF Check - $app->auth->csrf_token_check(); -} -$vm = $app->db->queryOneRecord("SELECT server_id, veid FROM openvz_vm WHERE vm_id = ?", $vm_id); -$veid = $app->functions->intval($vm['veid']); -$server_id = $app->functions->intval($vm['server_id']); - -//* Loading classes -$app->uses('tpl'); - -$app->tpl->newTemplate('form.tpl.htm'); -$app->tpl->setInclude('content_tpl', 'templates/openvz_action.htm'); - -//* load language file -$lng_file = 'lib/lang/'.$app->functions->check_language($_SESSION['s']['language']).'_openvz_action.lng'; -include_once $lng_file; -$app->tpl->setVar($wb); - -$app->tpl->setVar('id', $vm_id); -$app->tpl->setVar('veid', $veid); - -$options = array('start_option_enabled'=>'', 'stop_option_enabled'=>'', 'restart_option_enabled'=>'', 'ostemplate_option_enabled'=>''); - - -//* Show the action select page -if($action == 'show') { - - $options['start_option_enabled'] = 'checked="checked"'; - -} elseif ($action == 'start') { - - //* Start the virtual machine - $sql = "INSERT INTO sys_remoteaction (server_id, tstamp, action_type, action_param, action_state, response) " . - "VALUES (?, UNIX_TIMESTAMP(), 'openvz_start_vm', ?, 'pending', '')"; - $app->db->query($sql, $server_id, $veid); - - $app->tpl->setVar('msg', $wb['start_exec_txt']); - $options['start_option_enabled'] = 'checked="checked"'; - -} elseif ($action == 'stop') { - - //* Stop the virtual machine - $sql = "INSERT INTO sys_remoteaction (server_id, tstamp, action_type, action_param, action_state, response) " . - "VALUES (?, UNIX_TIMESTAMP(), 'openvz_stop_vm', ?, 'pending', '')"; - $app->db->query($sql, $server_id, $veid); - - $app->tpl->setVar('msg', $wb['stop_exec_txt']); - $options['stop_option_enabled'] = 'checked="checked"'; - -} elseif ($action == 'restart') { - - //* Restart the virtual machine - $sql = "INSERT INTO sys_remoteaction (server_id, tstamp, action_type, action_param, action_state, response) " . - "VALUES (?, UNIX_TIMESTAMP(), 'openvz_restart_vm', ?, 'pending', '')"; - $app->db->query($sql, $server_id, $veid); - - $app->tpl->setVar('msg', $wb['restart_exec_txt']); - $options['restart_option_enabled'] = 'checked="checked"'; - -} elseif ($action == 'ostemplate') { - - $ostemplate_name = $_POST['ostemplate_name']; - - if(!preg_match("/^[a-zA-Z0-9\.\-\_]{1,50}$/i", $ostemplate_name)) { - $error_msg .= $wb['ostemplate_name_error'].'
'; - $app->tpl->setVar('ostemplate_name', $ostemplate_name); - } - - //* Quote name - - //* Check for duplicates - $tmp = $app->db->queryOneRecord("SELECT count(ostemplate_id) as number FROM openvz_ostemplate WHERE template_file = ?", $ostemplate_name); - if($tmp['number'] > 0) $error_msg .= $wb['ostemplate_name_unique_error'].'
'; - unset($tmp); - - if($error_msg == '') { - //* Create ostemplate action - $sql = "INSERT INTO sys_remoteaction (server_id, tstamp, action_type, action_param, action_state, response) " . - "VALUES (?, UNIX_TIMESTAMP(), 'openvz_create_ostpl', ?, 'pending', '')"; - $app->db->query($sql, $server_id, $veid.":".$ostemplate_name); - - //* Create a record in the openvz_ostemplate table - $sql = "INSERT INTO `openvz_ostemplate` (`sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `template_name`, `template_file`, `server_id`, `allservers`, `active`, `description`) - VALUES(1, 1, 'riud', 'riud', '', ?, ?, ?, 'n', 'y', '')"; - $app->db->query($sql, $ostemplate_name, $ostemplate_name, $server_id); - - $app->tpl->setVar('msg', $wb['ostemplate_exec_txt']); - $options['ostemplate_option_enabled'] = 'checked="checked"'; - } - -} else { - $error_msg = $app->lng('Unknown action'); - $app->error($error_msg); -} - -$app->tpl->setVar($options); -$app->tpl->setVar('error', $error_msg); - -//* SET csrf token -$csrf_token = $app->auth->csrf_token_get('openvz_action'); -$app->tpl->setVar('_csrf_id',$csrf_token['csrf_id']); -$app->tpl->setVar('_csrf_key',$csrf_token['csrf_key']); - -$app->tpl_defaults(); -$app->tpl->pparse(); - - - -?> diff --git a/interface/web/vm/openvz_ip_del.php b/interface/web/vm/openvz_ip_del.php deleted file mode 100644 index 47d5d9a03205cbe59646038438066a74d72ae288..0000000000000000000000000000000000000000 --- a/interface/web/vm/openvz_ip_del.php +++ /dev/null @@ -1,59 +0,0 @@ -auth->check_module_permissions('vm'); -if($_SESSION["s"]["user"]["typ"] != 'admin') die('permission denied'); - -$app->uses('tpl,tform'); -$app->load('tform_actions'); - -class page_action extends tform_actions { - -} - -$page = new page_action; -$page->onDelete() - -?> diff --git a/interface/web/vm/openvz_ip_edit.php b/interface/web/vm/openvz_ip_edit.php deleted file mode 100644 index 20912eec00b462c854fa4e490f862e076704742e..0000000000000000000000000000000000000000 --- a/interface/web/vm/openvz_ip_edit.php +++ /dev/null @@ -1,59 +0,0 @@ -auth->check_module_permissions('vm'); -if($_SESSION["s"]["user"]["typ"] != 'admin') die('permission denied'); - -// Loading classes -$app->uses('tpl,tform'); -$app->load('tform_actions'); - -class page_action extends tform_actions { - -} - -$page = new page_action; -$page->onLoad(); - -?> diff --git a/interface/web/vm/openvz_ip_list.php b/interface/web/vm/openvz_ip_list.php deleted file mode 100644 index 229a792227c14032cc091709c19824dd2bc4992e..0000000000000000000000000000000000000000 --- a/interface/web/vm/openvz_ip_list.php +++ /dev/null @@ -1,55 +0,0 @@ -auth->check_module_permissions('vm'); -if($_SESSION["s"]["user"]["typ"] != 'admin') die('permission denied'); - -$app->uses('listform_actions'); - -// $app->listform_actions->SQLExtWhere = "limit_client = 0"; -$app->listform_actions->SQLOrderBy = 'ORDER BY openvz_ip.server_id, openvz_ip.ip_address'; -$app->listform_actions->onLoad(); - - -?> diff --git a/interface/web/vm/openvz_ostemplate_del.php b/interface/web/vm/openvz_ostemplate_del.php deleted file mode 100644 index 467465751d6690be3fc120d34b52194e5a185dac..0000000000000000000000000000000000000000 --- a/interface/web/vm/openvz_ostemplate_del.php +++ /dev/null @@ -1,59 +0,0 @@ -auth->check_module_permissions('vm'); -if($_SESSION["s"]["user"]["typ"] != 'admin') die('permission denied'); - -$app->uses('tpl,tform'); -$app->load('tform_actions'); - -class page_action extends tform_actions { - -} - -$page = new page_action; -$page->onDelete() - -?> diff --git a/interface/web/vm/openvz_ostemplate_edit.php b/interface/web/vm/openvz_ostemplate_edit.php deleted file mode 100644 index e19083e2e824846a18dd1a0de38f9e824d8054fb..0000000000000000000000000000000000000000 --- a/interface/web/vm/openvz_ostemplate_edit.php +++ /dev/null @@ -1,59 +0,0 @@ -auth->check_module_permissions('vm'); -if($_SESSION["s"]["user"]["typ"] != 'admin') die('permission denied'); - -// Loading classes -$app->uses('tpl,tform'); -$app->load('tform_actions'); - -class page_action extends tform_actions { - -} - -$page = new page_action; -$page->onLoad(); - -?> diff --git a/interface/web/vm/openvz_ostemplate_list.php b/interface/web/vm/openvz_ostemplate_list.php deleted file mode 100644 index fbce99bf99edd002aeb73e5e9569095ae9d0297e..0000000000000000000000000000000000000000 --- a/interface/web/vm/openvz_ostemplate_list.php +++ /dev/null @@ -1,55 +0,0 @@ -auth->check_module_permissions('vm'); -if($_SESSION["s"]["user"]["typ"] != 'admin') die('permission denied'); - -$app->uses('listform_actions'); - -// $app->listform_actions->SQLOrderBy = 'ORDER BY company_name, contact_name, client_id'; -// $app->listform_actions->SQLExtWhere = "limit_client = 0"; -$app->listform_actions->onLoad(); - - -?> diff --git a/interface/web/vm/openvz_template_del.php b/interface/web/vm/openvz_template_del.php deleted file mode 100644 index cc5c1320b1ad1140de368f5bce2b38f27345acf6..0000000000000000000000000000000000000000 --- a/interface/web/vm/openvz_template_del.php +++ /dev/null @@ -1,59 +0,0 @@ -auth->check_module_permissions('vm'); -if($_SESSION["s"]["user"]["typ"] != 'admin') die('permission denied'); - -$app->uses('tpl,tform'); -$app->load('tform_actions'); - -class page_action extends tform_actions { - -} - -$page = new page_action; -$page->onDelete() - -?> diff --git a/interface/web/vm/openvz_template_list.php b/interface/web/vm/openvz_template_list.php deleted file mode 100644 index 49d01fe6355fff8ecef23f5866a00ed0a10c525f..0000000000000000000000000000000000000000 --- a/interface/web/vm/openvz_template_list.php +++ /dev/null @@ -1,55 +0,0 @@ -auth->check_module_permissions('vm'); -if($_SESSION["s"]["user"]["typ"] != 'admin') die('permission denied'); - -$app->uses('listform_actions'); - -// $app->listform_actions->SQLOrderBy = 'ORDER BY company_name, contact_name, client_id'; -// $app->listform_actions->SQLExtWhere = "limit_client = 0"; -$app->listform_actions->onLoad(); - - -?> diff --git a/interface/web/vm/openvz_vm_del.php b/interface/web/vm/openvz_vm_del.php deleted file mode 100644 index bd9a9d414e28b9b1e24b828a7a8a90a7a25af797..0000000000000000000000000000000000000000 --- a/interface/web/vm/openvz_vm_del.php +++ /dev/null @@ -1,58 +0,0 @@ -auth->check_module_permissions('vm'); - -$app->uses('tpl,tform'); -$app->load('tform_actions'); - -class page_action extends tform_actions { - -} - -$page = new page_action; -$page->onDelete() - -?> diff --git a/interface/web/vm/openvz_vm_edit.php b/interface/web/vm/openvz_vm_edit.php deleted file mode 100644 index 4dd1a551deff4e8cb40c7f2cb23200acbc93627e..0000000000000000000000000000000000000000 --- a/interface/web/vm/openvz_vm_edit.php +++ /dev/null @@ -1,263 +0,0 @@ -auth->check_module_permissions('vm'); - -// Loading classes -$app->uses('tpl,tform'); -$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_openvz_vm')) { - $app->error($app->tform->wordbook["limit_openvz_vm_txt"]); - } - if(!$app->tform->checkResellerLimit('limit_openvz_vm')) { - $app->error('Reseller: '.$app->tform->wordbook["limit_openvz_vm_txt"]); - } - } - - parent::onShowNew(); - } - - function onShowEnd() { - global $app, $conf; - - //* Client: If the logged in user is not admin and has no sub clients (no rseller) - if($_SESSION["s"]["user"]["typ"] != 'admin' && !$app->auth->has_clients($_SESSION['s']['user']['userid'])) { - - //* Get the limits of the client - $client_group_id = $app->functions->intval($_SESSION["s"]["user"]["default_group"]); - $client = $app->db->queryOneRecord("SELECT client.client_id, client.contact_name, client.limit_openvz_vm_template_id FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id); - - //* Fill the template_id field - if($client['limit_openvz_vm_template_id'] == 0) { - $sql = 'SELECT template_id,template_name FROM openvz_template WHERE 1 ORDER BY template_name'; - } else { - $sql = 'SELECT template_id,template_name FROM openvz_template WHERE template_id = ? ORDER BY template_name'; - } - $records = $app->db->queryAllRecords($sql, $client['limit_openvz_vm_template_id']); - if(is_array($records)) { - foreach( $records as $rec) { - $selected = @($rec["template_id"] == $this->dataRecord["template_id"])?'SELECTED':''; - $template_id_select .= "\r\n"; - } - } - $app->tpl->setVar("template_id_select", $template_id_select); - - //* Reseller: If the logged in user is not admin and has sub clients (is a rseller) - } 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, client.limit_openvz_vm_template_id, 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 = ?", $client_group_id); - $client = $app->functions->htmlentities($client); - - //* 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"; - $records = $app->db->queryAllRecords($sql, $client['client_id']); - $records = $app->functions->htmlentities($records); - $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($records)) { - foreach( $records as $rec) { - $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); - - //* Fill the template_id field - if($client['limit_openvz_vm_template_id'] == 0) { - $sql = 'SELECT template_id,template_name FROM openvz_template WHERE 1 ORDER BY template_name'; - } else { - $sql = 'SELECT template_id,template_name FROM openvz_template WHERE template_id = ? ORDER BY template_name'; - } - $records = $app->db->queryAllRecords($sql, $client['limit_openvz_vm_template_id']); - if(is_array($records)) { - foreach( $records as $rec) { - $selected = @($rec["template_id"] == $this->dataRecord["template_id"])?'SELECTED':''; - $template_id_select .= "\r\n"; - } - } - $app->tpl->setVar("template_id_select", $template_id_select); - - //* Admin: If the logged in user is admin - } else { - - //* 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 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 = ""; - //$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); - - //* Fill the template_id field - $sql = 'SELECT template_id,template_name FROM openvz_template WHERE 1 ORDER BY template_name'; - $records = $app->db->queryAllRecords($sql); - if(is_array($records)) { - $template_id_select=''; - foreach( $records as $rec) { - $selected = @($rec["template_id"] == $this->dataRecord["template_id"])?'SELECTED':''; - $template_id_select .= "\r\n"; - } - } - $app->tpl->setVar("template_id_select", $template_id_select); - - } - - //* Fill the IPv4 select field with the IP addresses that are allowed for this client - //$sql = "SELECT ip_address FROM server_ip WHERE server_id = ".$client['default_webserver']." AND ip_type = 'IPv4' AND (client_id = 0 OR client_id=".$_SESSION['s']['user']['client_id'].")"; - if(isset($this->dataRecord["server_id"])) { -// $vm_server_id = $app->functions->intval($this->dataRecord["server_id"]); - $vm_server_id = $app->functions->intval($this->dataRecord["vm_id"]); - } else { - $tmp = $app->db->queryOneRecord('SELECT server_id FROM server WHERE vserver_server = 1 AND mirror_server_id = 0 ORDER BY server_name LIMIT 0,1'); - $vm_server_id = $app->functions->intval($tmp['server_id']); - } - $sql = "SELECT ip_address FROM openvz_ip WHERE reserved = 'n' AND (vm_id = 0 or vm_id = ?) AND server_id = ? ORDER BY ip_address"; - $ips = $app->db->queryAllRecords($sql, $this->id, $vm_server_id); - $ip_select = ""; - if(is_array($ips)) { - foreach( $ips as $ip) { - $selected = ($ip["ip_address"] == $this->dataRecord["ip_address"])?'SELECTED':''; - $ip_select .= "\r\n"; - } - } - $app->tpl->setVar("ip_address", $ip_select); - unset($tmp); - unset($ips); - - //* Additional IPs - $sql="SELECT * FROM openvz_ip WHERE reserved = 'n' AND ((vm_id = ? AND additional='y') OR vm_id = 0) AND server_id = ?"; - $additional_ips = $app->db->queryAllRecords($sql, $this->id, $vm_server_id); - foreach ($additional_ips as $idx => $rec) { - $temp .= ""; - $used = @($rec['additional']=='y')?'CHECKED':''; - $temp .= " ".$app->functions->htmlentities($rec['ip_address'])."
"; - } - $app->tpl->setVar("additional_ip", $temp); - unset($used); - unset($temp); - unset($additional_ips); - - 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); - $app->tpl->setVar("ostemplate_id_value", $this->dataRecord["ostemplate_id"], true); - } else { - $app->tpl->setVar("edit_disabled", 0); - } - - // Datepicker - $date_format = $app->lng('conf_format_dateshort'); - $trans = array("d" => "dd", "m" => "mm", "Y" => "yy"); - $date_format = strtr($date_format, $trans); - $app->tpl->setVar("date_format", $date_format); - $app->tpl->setVar("conf_format_datetime_js", strtr($app->lng('conf_format_dateshort'), array('d' => 'dd', 'm' => 'mm', 'Y' => 'yyyy', 'y' => 'yy', 'H' => 'hh', 'h' => 'HH', 'i' => 'ii'))); - - $app->tpl->setVar("daynamesmin_su", $app->lng('daynamesmin_su')); - $app->tpl->setVar("daynamesmin_mo", $app->lng('daynamesmin_mo')); - $app->tpl->setVar("daynamesmin_tu", $app->lng('daynamesmin_tu')); - $app->tpl->setVar("daynamesmin_we", $app->lng('daynamesmin_we')); - $app->tpl->setVar("daynamesmin_th", $app->lng('daynamesmin_th')); - $app->tpl->setVar("daynamesmin_fr", $app->lng('daynamesmin_fr')); - $app->tpl->setVar("daynamesmin_sa", $app->lng('daynamesmin_sa')); - - $app->tpl->setVar("daynames_sunday", $app->lng('daynames_sunday')); - $app->tpl->setVar("daynames_monday", $app->lng('daynames_monday')); - $app->tpl->setVar("daynames_tuesday", $app->lng('daynames_tuesday')); - $app->tpl->setVar("daynames_wednesday", $app->lng('daynames_wednesday')); - $app->tpl->setVar("daynames_thursday", $app->lng('daynames_thursday')); - $app->tpl->setVar("daynames_friday", $app->lng('daynames_friday')); - $app->tpl->setVar("daynames_saturday", $app->lng('daynames_saturday')); - - $app->tpl->setVar("monthnamesshort_jan", $app->lng('monthnamesshort_jan')); - $app->tpl->setVar("monthnamesshort_feb", $app->lng('monthnamesshort_feb')); - $app->tpl->setVar("monthnamesshort_mar", $app->lng('monthnamesshort_mar')); - $app->tpl->setVar("monthnamesshort_apr", $app->lng('monthnamesshort_apr')); - $app->tpl->setVar("monthnamesshort_may", $app->lng('monthnamesshort_may')); - $app->tpl->setVar("monthnamesshort_jun", $app->lng('monthnamesshort_jun')); - $app->tpl->setVar("monthnamesshort_jul", $app->lng('monthnamesshort_jul')); - $app->tpl->setVar("monthnamesshort_aug", $app->lng('monthnamesshort_aug')); - $app->tpl->setVar("monthnamesshort_sep", $app->lng('monthnamesshort_sep')); - $app->tpl->setVar("monthnamesshort_oct", $app->lng('monthnamesshort_oct')); - $app->tpl->setVar("monthnamesshort_nov", $app->lng('monthnamesshort_nov')); - $app->tpl->setVar("monthnamesshort_dec", $app->lng('monthnamesshort_dec')); - - $app->tpl->setVar("datepicker_nextText", $app->lng('datepicker_nextText')); - $app->tpl->setVar("datepicker_prevText", $app->lng('datepicker_prevText')); - - parent::onShowEnd(); - } - - function onSubmit() { - global $app, $conf; - - //* Clients may not set the client_group_id, so we unset them if user is not a admin and the client is not a reseller - if($_SESSION["s"]["user"]["typ"] != 'admin' && !$app->auth->has_clients($_SESSION['s']['user']['userid'])) unset($this->dataRecord["client_group_id"]); - - parent::onSubmit(); - } - -} - -$page = new page_action; -$page->onLoad(); - -?> diff --git a/interface/web/vm/templates/openvz.conf.tpl b/interface/web/vm/templates/openvz.conf.tpl deleted file mode 100644 index 7b099b1f9b45da7c4202df462e46299dee8a800c..0000000000000000000000000000000000000000 --- a/interface/web/vm/templates/openvz.conf.tpl +++ /dev/null @@ -1,120 +0,0 @@ - -# Template version -VERSION="2" - -# Parameters -ONBOOT="{tmpl_var name='onboot'}" -BOOTORDER="{tmpl_var name='bootorder'}" - -# VSwap requires RAM and SWAP, all other memory parameters are optional. - -# RAM -PHYSPAGES="{tmpl_var name='physpages'}" - - -# SWAP -SWAPPAGES="{tmpl_var name='swappages'}" - - - -KMEMSIZE="{tmpl_var name='kmemsize'}" - - -LOCKEDPAGES="{tmpl_var name='lockedpages'}" - - -PRIVVMPAGES="{tmpl_var name='privvmpages'}" - - -SHMPAGES="{tmpl_var name='shmpages'}" - - -VMGUARPAGES="{tmpl_var name='vmguarpages'}" - - -OOMGUARPAGES="{tmpl_var name='oomguarpages'}" - -# alternative meminfo: "pages:256000" -MEMINFO="privvmpages:1" - - -NUMPROC="{tmpl_var name='numproc'}" - - -NUMTCPSOCK="{tmpl_var name='numtcpsock'}" - - -NUMFLOCK="{tmpl_var name='numflock'}" - - -NUMPTY="{tmpl_var name='numpty'}" - - -NUMSIGINFO="{tmpl_var name='numsiginfo'}" - - -TCPSNDBUF="{tmpl_var name='tcpsndbuf'}" - - -TCPRCVBUF="{tmpl_var name='tcprcvbuf'}" - - -OTHERSOCKBUF="{tmpl_var name='othersockbuf'}" - - -DGRAMRCVBUF="{tmpl_var name='dgramrcvbuf'}" - - -NUMOTHERSOCK="{tmpl_var name='numothersock'}" - - -DCACHESIZE="{tmpl_var name='dcachesize'}" - - -NUMFILE="{tmpl_var name='numfile'}" - - -AVNUMPROC="{tmpl_var name='avnumproc'}" - - -NUMIPTENT="{tmpl_var name='numiptent'}" - - -DISKSPACE="{tmpl_var name='diskspace'}" -DISKINODES="{tmpl_var name='diskinodes'}" -QUOTAUGIDLIMIT="10000" -QUOTATIME="0" - -IOPRIO="{tmpl_var name='io_priority'}" - - - -CPUS="{tmpl_var name='cpu_num'}" - - -CPUUNITS="{tmpl_var name='cpu_units'}" - - -CPULIMIT="{tmpl_var name='cpu_limit'}" - - -VE_ROOT="/vz/root/$VEID" -VE_PRIVATE="/vz/private/$VEID" -OSTEMPLATE="{tmpl_var name='ostemplate'}" -ORIGIN_SAMPLE="vps.basic" -HOSTNAME="{tmpl_var name='hostname'}" -IP_ADDRESS="{tmpl_var name='ip_address'}" -NAMESERVER="{tmpl_var name='nameserver'}" - - -CAPABILITY="{tmpl_var name='capability'}" - - -FEATURES="{tmpl_var name='features'}" - - -IPTABLES="{tmpl_var name='iptables'}" - - -{tmpl_var name='custom'} - diff --git a/interface/web/vm/templates/openvz_action.htm b/interface/web/vm/templates/openvz_action.htm deleted file mode 100644 index 2d95f9cb0f8bd421081117ba0365b6d6c1282d2f..0000000000000000000000000000000000000000 --- a/interface/web/vm/templates/openvz_action.htm +++ /dev/null @@ -1,42 +0,0 @@ - -

- - - {tmpl_var name="head_txt"} {tmpl_var name='veid'} - - -

-
- -

-
- -
- -
-
- -
- -
-
- -
- -
-
- -
- -
 {tmpl_var name='ostemplate_desc_txt'} -
-
- - - -
- - -
\ No newline at end of file diff --git a/interface/web/vm/templates/openvz_ip_edit.htm b/interface/web/vm/templates/openvz_ip_edit.htm deleted file mode 100644 index 279066978411376ef1dd61ad9175aaa32f89be90..0000000000000000000000000000000000000000 --- a/interface/web/vm/templates/openvz_ip_edit.htm +++ /dev/null @@ -1,42 +0,0 @@ - -

- - - IP address -
- -
-
-
- -
-
- -
-
-
- -
- {tmpl_var name='reserved'} -
-
- - - - -
- - -
- \ No newline at end of file diff --git a/interface/web/vm/templates/openvz_ip_list.htm b/interface/web/vm/templates/openvz_ip_list.htm deleted file mode 100644 index fd12694c37c07ece5cec1f3ce46501ba50b6fb85..0000000000000000000000000000000000000000 --- a/interface/web/vm/templates/openvz_ip_list.htm +++ /dev/null @@ -1,60 +0,0 @@ - - - -

{tmpl_var name="toolsarea_head_txt"}

- - - - - - -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{tmpl_var name='search_limit'}
- -
{tmpl_var name="server_id"}{tmpl_var name="vm_id"}{tmpl_var name="ip_address"}{tmpl_var name="reserved"} - -
{tmpl_var name='globalsearch_noresults_text_txt'}
-
- - \ No newline at end of file diff --git a/interface/web/vm/templates/openvz_ostemplate_edit.htm b/interface/web/vm/templates/openvz_ostemplate_edit.htm deleted file mode 100644 index 642cf99126b8db4dace63ea44be2211543b3f58b..0000000000000000000000000000000000000000 --- a/interface/web/vm/templates/openvz_ostemplate_edit.htm +++ /dev/null @@ -1,43 +0,0 @@ - -

- - - Domain -
- -
-
- -
-
- -
-
-
- -
- {tmpl_var name='allservers'} -
-
-
- -
- {tmpl_var name='active'} -
-
-
- -
-
- - - - -
- - -
\ No newline at end of file diff --git a/interface/web/vm/templates/openvz_ostemplate_list.htm b/interface/web/vm/templates/openvz_ostemplate_list.htm deleted file mode 100644 index 85f46e6732c8a5f8234e7199af8c0f567ef4aa08..0000000000000000000000000000000000000000 --- a/interface/web/vm/templates/openvz_ostemplate_list.htm +++ /dev/null @@ -1,63 +0,0 @@ - - - -

{tmpl_var name="toolsarea_head_txt"}

- - - - - - -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{tmpl_var name='search_limit'}
- -
{tmpl_var name="active"}{tmpl_var name="ostemplate_id"}{tmpl_var name="template_name"}{tmpl_var name="server_id"}{tmpl_var name="allservers"} - -
{tmpl_var name='globalsearch_noresults_text_txt'}
-
- - \ No newline at end of file diff --git a/interface/web/vm/templates/openvz_template_advanced_edit.htm b/interface/web/vm/templates/openvz_template_advanced_edit.htm deleted file mode 100644 index 3712906ed0ce11b84e51b7d66f1a4a945109f19a..0000000000000000000000000000000000000000 --- a/interface/web/vm/templates/openvz_template_advanced_edit.htm +++ /dev/null @@ -1,92 +0,0 @@ - -

- - - Advanced -
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
- - - -
- - -
diff --git a/interface/web/vm/templates/openvz_template_edit.htm b/interface/web/vm/templates/openvz_template_edit.htm deleted file mode 100644 index d60efa274dd7aa8daceb816e19af7dd87a53f374..0000000000000000000000000000000000000000 --- a/interface/web/vm/templates/openvz_template_edit.htm +++ /dev/null @@ -1,69 +0,0 @@ - -

- - - Template -
- -
-
- -
 GB -
-
- -
 MB -
-
- -
 MB -
-
- -
 (8 - 500000) -
-
- -
 (1 - 64) -
-
- -
 (10 - 6400) -
-
- -
 (0 - 7) -
-
- -
-
- -
- {tmpl_var name='create_dns'} -
-
-
- -
 {tmpl_var name='nameserver_desc_txt'} -
-
- -
- {tmpl_var name='active'} -
-
-
- -
-
- - - - -
- - -
\ No newline at end of file diff --git a/interface/web/vm/templates/openvz_template_list.htm b/interface/web/vm/templates/openvz_template_list.htm deleted file mode 100644 index 5ec0cb79139a5d0e80b3f61f92f17625e1ab5e52..0000000000000000000000000000000000000000 --- a/interface/web/vm/templates/openvz_template_list.htm +++ /dev/null @@ -1,54 +0,0 @@ - - - -

{tmpl_var name="toolsarea_head_txt"}

- - - - - - -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{tmpl_var name='search_limit'}
- -
{tmpl_var name="active"}{tmpl_var name="template_name"} - -
{tmpl_var name='globalsearch_noresults_text_txt'}
-
- - \ No newline at end of file diff --git a/interface/web/vm/templates/openvz_vm_additional_ip_edit.htm b/interface/web/vm/templates/openvz_vm_additional_ip_edit.htm deleted file mode 100644 index f19eb6ca9c0d94bab783c60715ebd913528cc4e2..0000000000000000000000000000000000000000 --- a/interface/web/vm/templates/openvz_vm_additional_ip_edit.htm +++ /dev/null @@ -1,19 +0,0 @@ - -

- -Additional IPs - -
-
- {tmpl_var name='additional_ip'} -
-
- - - -
- - -
- - diff --git a/interface/web/vm/templates/openvz_vm_advanced_edit.htm b/interface/web/vm/templates/openvz_vm_advanced_edit.htm deleted file mode 100644 index a25d715e575fdc7fd92117aea208fc0fe0c9a85a..0000000000000000000000000000000000000000 --- a/interface/web/vm/templates/openvz_vm_advanced_edit.htm +++ /dev/null @@ -1,72 +0,0 @@ - -

- - - Advanced -
- -
-
- -
- {tmpl_var name='create_dns'} -
-
-
- -
 GB -
-
- -
 MB -
-
- -
 MB -
-
- -
 (8 - 500000) -
-
- -
 (1 - 64) -
-
- -
 (10 - 6400) -
-
- -
 (0 - 7) -
-
- -
 {tmpl_var name='nameserver_desc_txt'} -
-
- -
-
-
- -
-
-
- -
-
-
- -
-
- - - - -
- - -
diff --git a/interface/web/vm/templates/openvz_vm_edit.htm b/interface/web/vm/templates/openvz_vm_edit.htm deleted file mode 100644 index a045012d7c436b6db345b897eb034e609e05a109..0000000000000000000000000000000000000000 --- a/interface/web/vm/templates/openvz_vm_edit.htm +++ /dev/null @@ -1,101 +0,0 @@ - -

- - - Settings - -
- - -
- - - -
-
-
-
- -
-
-
- -
- -
-
-
- -
- -
-
- - -
- -
-
-
-
- -
-
-
- -
-
-
- -
-
- -
-
- -
- {tmpl_var name='start_boot'} -
-
-
- -
-
- -
- {tmpl_var name='active'} -
-
-
- -
-
- -
-
- - - - -
- - -
diff --git a/interface/web/vm/templates/openvz_vm_list.htm b/interface/web/vm/templates/openvz_vm_list.htm deleted file mode 100644 index 516b536bb39fb4077e22e25fb000f64b0a830749..0000000000000000000000000000000000000000 --- a/interface/web/vm/templates/openvz_vm_list.htm +++ /dev/null @@ -1,70 +0,0 @@ - - - -

{tmpl_var name="toolsarea_head_txt"}

- - - - - - -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{tmpl_var name='search_limit'}
- -
{tmpl_var name="veid"}{tmpl_var name="active"}{tmpl_var name="server_id"}{tmpl_var name="ostemplate_id"}{tmpl_var name="template_id"}{tmpl_var name="hostname"}{tmpl_var name="ip_address"} - - -
{tmpl_var name='globalsearch_noresults_text_txt'}
-
- - \ No newline at end of file diff --git a/remoting_client/examples/mail_mailinglist_add.php b/remoting_client/examples/mail_mailinglist_add.php deleted file mode 100644 index 3d6cd568ab55644fe163f4d88d8d018190327ff3..0000000000000000000000000000000000000000 --- a/remoting_client/examples/mail_mailinglist_add.php +++ /dev/null @@ -1,41 +0,0 @@ - $soap_location, - 'uri' => $soap_uri, - 'trace' => 1, - 'exceptions' => 1)); - - -try { - if($session_id = $client->login($username, $password)) { - echo 'Logged successfull. Session ID:'.$session_id.'
'; - } - - //* Set the function parameters. - $client_id = 1; - $params = array( - 'server_id' => 1, - 'domain' => 'test.int', - 'listname' => 'work', - 'email' => 'hmmnoe@test.int', - 'password' => 'hmmyea' - ); - - $mailinglist_id = $client->mail_mailinglist_add($session_id, $client_id, $params); - - echo "Mailinglist ID: ".$mailinglist_id."
"; - - if($client->logout($session_id)) { - echo 'Logged out.
'; - } - - -} catch (SoapFault $e) { - echo $client->__getLastResponse(); - die('SOAP Error: '.$e->getMessage()); -} - -?> diff --git a/remoting_client/examples/mail_mailinglist_delete.php b/remoting_client/examples/mail_mailinglist_delete.php deleted file mode 100644 index cf76336f28d972efeb1733d8f8bf97e1fcac0f12..0000000000000000000000000000000000000000 --- a/remoting_client/examples/mail_mailinglist_delete.php +++ /dev/null @@ -1,36 +0,0 @@ - $soap_location, - 'uri' => $soap_uri, - 'trace' => 1, - 'exceptions' => 1)); - - -try { - if($session_id = $client->login($username, $password)) { - echo 'Logged successfull. Session ID:'.$session_id.'
'; - } - - //* Parameters - $mailinglist_id = 1; - - - //* Delete the email mailinglist record - $affected_rows = $client->mail_mailinglist_delete($session_id, $mailinglist_id); - - echo "Number of records that have been deleted: ".$affected_rows."
"; - - if($client->logout($session_id)) { - echo 'Logged out.
'; - } - - -} catch (SoapFault $e) { - echo $client->__getLastResponse(); - die('SOAP Error: '.$e->getMessage()); -} - -?> diff --git a/remoting_client/examples/mail_mailinglist_get.php b/remoting_client/examples/mail_mailinglist_get.php deleted file mode 100644 index 7affe57a1e0ecaa883e8f890c9cbd402aab2ded7..0000000000000000000000000000000000000000 --- a/remoting_client/examples/mail_mailinglist_get.php +++ /dev/null @@ -1,34 +0,0 @@ - $soap_location, - 'uri' => $soap_uri, - 'trace' => 1, - 'exceptions' => 1)); - - -try { - if($session_id = $client->login($username, $password)) { - echo 'Logged successfull. Session ID:'.$session_id.'
'; - } - - //* Set the function parameters. - $mailinglist_id = 1; - - $mailinglist_record = $client->mail_mailinglist_get($session_id, $mailinglist_id); - - print_r($mailinglist_record); - - if($client->logout($session_id)) { - echo 'Logged out.
'; - } - - -} catch (SoapFault $e) { - echo $client->__getLastResponse(); - die('SOAP Error: '.$e->getMessage()); -} - -?> diff --git a/remoting_client/examples/mail_mailinglist_update.php b/remoting_client/examples/mail_mailinglist_update.php deleted file mode 100644 index c7d6216c11cf1332723a53439f8206491ad70782..0000000000000000000000000000000000000000 --- a/remoting_client/examples/mail_mailinglist_update.php +++ /dev/null @@ -1,42 +0,0 @@ - $soap_location, - 'uri' => $soap_uri, - 'trace' => 1, - 'exceptions' => 1)); - - -try { - if($session_id = $client->login($username, $password)) { - echo 'Logged successfull. Session ID:'.$session_id.'
'; - } - - //* Parameters - $mailinglist_id = 1; - $client_id = 1; - - - //* Get the email mailinglist record - $mailinglist_record = $client->mail_mailinglist_get($session_id, $mailinglist_id); - - //* Change the listname to home - $mailinglist_record['listname'] = 'home'; - - $affected_rows = $client->mail_mailinglist_update($session_id, $client_id, $mailinglist_id, $mailinglist_record); - - echo "Number of records that have been changed in the database: ".$affected_rows."
"; - - if($client->logout($session_id)) { - echo 'Logged out.
'; - } - - -} catch (SoapFault $e) { - echo $client->__getLastResponse(); - die('SOAP Error: '.$e->getMessage()); -} - -?> diff --git a/remoting_client/examples/openvz_get_free_ip.php b/remoting_client/examples/openvz_get_free_ip.php deleted file mode 100644 index d7ccc969742fb8f766c64a81f56f67632868d2fc..0000000000000000000000000000000000000000 --- a/remoting_client/examples/openvz_get_free_ip.php +++ /dev/null @@ -1,34 +0,0 @@ - $soap_location, - 'uri' => $soap_uri, - 'trace' => 1, - 'exceptions' => 1)); - - -try { - if($session_id = $client->login($username, $password)) { - echo 'Logged successfull. Session ID:'.$session_id.'
'; - } - - //* Set the function parameters. - - $record_record = $client->openvz_get_free_ip($session_id, $server_id = 0); - - print_r($record_record); - echo "
"; - - if($client->logout($session_id)) { - echo 'Logged out.
'; - } - - -} catch (SoapFault $e) { - echo $client->__getLastResponse(); - die('SOAP Error: '.$e->getMessage()); -} - -?> diff --git a/remoting_client/examples/openvz_ip_add.php b/remoting_client/examples/openvz_ip_add.php deleted file mode 100644 index cda9fa4a7fdbe6524e181d4ba2121e3cdd89faa7..0000000000000000000000000000000000000000 --- a/remoting_client/examples/openvz_ip_add.php +++ /dev/null @@ -1,40 +0,0 @@ - $soap_location, - 'uri' => $soap_uri, - 'trace' => 1, - 'exceptions' => 1)); - - -try { - if($session_id = $client->login($username, $password)) { - echo 'Logged successfull. Session ID:'.$session_id.'
'; - } - - //* Set the function parameters. - $client_id = 1; - $params = array( - 'server_id' => 1, - 'ip_address' => '192.168.0.111', - 'vm_id' => 1, - 'reserved' => 'n' - ); - - $ip_id = $client->openvz_ip_add($session_id, $client_id, $params); - - echo "IP ID: ".$ip_id."
"; - - if($client->logout($session_id)) { - echo 'Logged out.
'; - } - - -} catch (SoapFault $e) { - echo $client->__getLastResponse(); - die('SOAP Error: '.$e->getMessage()); -} - -?> diff --git a/remoting_client/examples/openvz_ip_delete.php b/remoting_client/examples/openvz_ip_delete.php deleted file mode 100644 index c7b07f8aae812f82c5bfe995117a9b0fbaf52b83..0000000000000000000000000000000000000000 --- a/remoting_client/examples/openvz_ip_delete.php +++ /dev/null @@ -1,36 +0,0 @@ - $soap_location, - 'uri' => $soap_uri, - 'trace' => 1, - 'exceptions' => 1)); - - -try { - if($session_id = $client->login($username, $password)) { - echo 'Logged successfull. Session ID:'.$session_id.'
'; - } - - //* Parameters - $ip_id = 2; - - - //* delete the ip record - $affected_rows = $client->openvz_ip_delete($session_id, $ip_id); - - echo "Number of records that have been deleted: ".$affected_rows."
"; - - if($client->logout($session_id)) { - echo 'Logged out.
'; - } - - -} catch (SoapFault $e) { - echo $client->__getLastResponse(); - die('SOAP Error: '.$e->getMessage()); -} - -?> diff --git a/remoting_client/examples/openvz_ip_get.php b/remoting_client/examples/openvz_ip_get.php deleted file mode 100644 index 9237ed4e1b848a12ab4d31ad278b75b46d5db606..0000000000000000000000000000000000000000 --- a/remoting_client/examples/openvz_ip_get.php +++ /dev/null @@ -1,34 +0,0 @@ - $soap_location, - 'uri' => $soap_uri, - 'trace' => 1, - 'exceptions' => 1)); - - -try { - if($session_id = $client->login($username, $password)) { - echo 'Logged successfull. Session ID:'.$session_id.'
'; - } - - //* Set the function parameters. - $ip_id = 2; - - $ip_record = $client->openvz_ip_get($session_id, $ip_id); - - print_r($ip_record); - - if($client->logout($session_id)) { - echo 'Logged out.
'; - } - - -} catch (SoapFault $e) { - echo $client->__getLastResponse(); - die('SOAP Error: '.$e->getMessage()); -} - -?> diff --git a/remoting_client/examples/openvz_ip_update.php b/remoting_client/examples/openvz_ip_update.php deleted file mode 100644 index 9867fe0a9cbff197df26bbbc8e61ddf14e0bd049..0000000000000000000000000000000000000000 --- a/remoting_client/examples/openvz_ip_update.php +++ /dev/null @@ -1,42 +0,0 @@ - $soap_location, - 'uri' => $soap_uri, - 'trace' => 1, - 'exceptions' => 1)); - - -try { - if($session_id = $client->login($username, $password)) { - echo 'Logged successfull. Session ID:'.$session_id.'
'; - } - - //* Parameters - $ip_id = 2; - $client_id = 1; - - - //* Get the openvz ip record - $ip_record = $client->openvz_ip_get($session_id, $ip_id); - - //* Change the reservation to yes - $ip_record['reserved'] = 'y'; - - $affected_rows = $client->openvz_ip_update($session_id, $client_id, $ip_id, $ip_record); - - echo "Number of records that have been changed in the database: ".$affected_rows."
"; - - if($client->logout($session_id)) { - echo 'Logged out.
'; - } - - -} catch (SoapFault $e) { - echo $client->__getLastResponse(); - die('SOAP Error: '.$e->getMessage()); -} - -?> diff --git a/remoting_client/examples/openvz_ostemplate_add.php b/remoting_client/examples/openvz_ostemplate_add.php deleted file mode 100644 index 3ad0c137286ce394e8a7c707003475fdfda96cba..0000000000000000000000000000000000000000 --- a/remoting_client/examples/openvz_ostemplate_add.php +++ /dev/null @@ -1,42 +0,0 @@ - $soap_location, - 'uri' => $soap_uri, - 'trace' => 1, - 'exceptions' => 1)); - - -try { - if($session_id = $client->login($username, $password)) { - echo 'Logged successfull. Session ID:'.$session_id.'
'; - } - - //* Set the function parameters. - $client_id = 1; - $params = array( - 'template_name' => 'tone', - 'template_file' => 'custom', - 'server_id' => 1, - 'allservers' => 'y', - 'active' => 'y', - 'description' => 'howto', - ); - - $ostemplate_id = $client->openvz_ostemplate_add($session_id, $client_id, $params); - - echo "Ostemplate ID: ".$ostemplate_id."
"; - - if($client->logout($session_id)) { - echo 'Logged out.
'; - } - - -} catch (SoapFault $e) { - echo $client->__getLastResponse(); - die('SOAP Error: '.$e->getMessage()); -} - -?> diff --git a/remoting_client/examples/openvz_ostemplate_delete.php b/remoting_client/examples/openvz_ostemplate_delete.php deleted file mode 100644 index 659d8afa09be8a1adc5886e2fee81d3426b876ad..0000000000000000000000000000000000000000 --- a/remoting_client/examples/openvz_ostemplate_delete.php +++ /dev/null @@ -1,36 +0,0 @@ - $soap_location, - 'uri' => $soap_uri, - 'trace' => 1, - 'exceptions' => 1)); - - -try { - if($session_id = $client->login($username, $password)) { - echo 'Logged successfull. Session ID:'.$session_id.'
'; - } - - //* Parameters - $ostemplate_id = 2; - - - //* delete the ostemplate record - $affected_rows = $client->openvz_ostemplate_delete($session_id, $ostemplate_id); - - echo "Number of records that have been deleted: ".$affected_rows."
"; - - if($client->logout($session_id)) { - echo 'Logged out.
'; - } - - -} catch (SoapFault $e) { - echo $client->__getLastResponse(); - die('SOAP Error: '.$e->getMessage()); -} - -?> diff --git a/remoting_client/examples/openvz_ostemplate_get.php b/remoting_client/examples/openvz_ostemplate_get.php deleted file mode 100644 index b2d940b4bb6f2f62c5111e3bef92a912c03e8a5d..0000000000000000000000000000000000000000 --- a/remoting_client/examples/openvz_ostemplate_get.php +++ /dev/null @@ -1,34 +0,0 @@ - $soap_location, - 'uri' => $soap_uri, - 'trace' => 1, - 'exceptions' => 1)); - - -try { - if($session_id = $client->login($username, $password)) { - echo 'Logged successfull. Session ID:'.$session_id.'
'; - } - - //* Set the function parameters. - $ostemplate_id = 2; - - $ostemplate_record = $client->openvz_ostemplate_get($session_id, $ostemplate_id); - - print_r($ostemplate_record); - - if($client->logout($session_id)) { - echo 'Logged out.
'; - } - - -} catch (SoapFault $e) { - echo $client->__getLastResponse(); - die('SOAP Error: '.$e->getMessage()); -} - -?> diff --git a/remoting_client/examples/openvz_ostemplate_update.php b/remoting_client/examples/openvz_ostemplate_update.php deleted file mode 100644 index a95fc175ff38abc4821501437891c1c332705ae1..0000000000000000000000000000000000000000 --- a/remoting_client/examples/openvz_ostemplate_update.php +++ /dev/null @@ -1,42 +0,0 @@ - $soap_location, - 'uri' => $soap_uri, - 'trace' => 1, - 'exceptions' => 1)); - - -try { - if($session_id = $client->login($username, $password)) { - echo 'Logged successfull. Session ID:'.$session_id.'
'; - } - - //* Parameters - $ostemplate_id = 2; - $client_id = 1; - - - //* Get the os template record - $ostemplate_record = $client->openvz_ostemplate_get($session_id, $ostemplate_id); - - //* Change the status to inactive - $ostemplate_record['active'] = 'n'; - - $affected_rows = $client->openvz_ostemplate_update($session_id, $client_id, $ostemplate_id, $ostemplate_record); - - echo "Number of records that have been changed in the database: ".$affected_rows."
"; - - if($client->logout($session_id)) { - echo 'Logged out.
'; - } - - -} catch (SoapFault $e) { - echo $client->__getLastResponse(); - die('SOAP Error: '.$e->getMessage()); -} - -?> diff --git a/remoting_client/examples/openvz_template_add.php b/remoting_client/examples/openvz_template_add.php deleted file mode 100644 index b602000de4697f67ee0c4e2eb3e03640608a53fc..0000000000000000000000000000000000000000 --- a/remoting_client/examples/openvz_template_add.php +++ /dev/null @@ -1,74 +0,0 @@ - $soap_location, - 'uri' => $soap_uri, - 'trace' => 1, - 'exceptions' => 1)); - - -try { - if($session_id = $client->login($username, $password)) { - echo 'Logged successfull. Session ID:'.$session_id.'
'; - } - - //* Set the function parameters. - $client_id = 1; - $params = array( - 'template_name' => 'tone', - 'diskspace' => 10, - 'traffic' => -1, - 'bandwidth' => -1, - 'ram' => 256, - 'ram_burst' => 512, - 'cpu_units' => 1000, - 'cpu_num' => 4, - 'cpu_limit' => 400, - 'io_priority' => 4, - 'active' => 'y', - 'description' => 'howto', - 'numproc' => '999999:999999', - 'numtcpsock' => '7999992:7999992', - 'numothersock' => '7999992:7999992', - 'vmguarpages' => '65536:unlimited', - 'kmemsize' => '2147483646:2147483646', - 'tcpsndbuf' => '214748160:396774400', - 'tcprcvbuf' => '214748160:396774400', - 'othersockbuf' => '214748160:396774400', - 'dgramrcvbuf' => '214748160:396774400', - 'oomguarpages' => '65536:65536', - 'privvmpages' => '131072:139264', - 'lockedpages' => '999999:999999', - 'shmpages' => '65536:65536', - 'physpages' => '0:2147483647', - 'numfile' => '23999976:23999976', - 'avnumproc' => '180:180', - 'numflock' => '999999:999999', - 'numpty' => '500000:500000', - 'numsiginfo' => '999999:999999', - 'dcachesize' => '2147483646:2147483646', - 'numiptent' => '999999:999999', - 'swappages' => '256000:256000', - 'hostname' => 'host', - 'nameserver' => 'ns1', - 'create_dns' => 'n', - 'capability' => '' - ); - - $template_id = $client->openvz_template_add($session_id, $client_id, $params); - - echo "Template ID: ".$template_id."
"; - - if($client->logout($session_id)) { - echo 'Logged out.
'; - } - - -} catch (SoapFault $e) { - echo $client->__getLastResponse(); - die('SOAP Error: '.$e->getMessage()); -} - -?> diff --git a/remoting_client/examples/openvz_template_delete.php b/remoting_client/examples/openvz_template_delete.php deleted file mode 100644 index 128034e85694a332dad9921947f584d4b0c96354..0000000000000000000000000000000000000000 --- a/remoting_client/examples/openvz_template_delete.php +++ /dev/null @@ -1,36 +0,0 @@ - $soap_location, - 'uri' => $soap_uri, - 'trace' => 1, - 'exceptions' => 1)); - - -try { - if($session_id = $client->login($username, $password)) { - echo 'Logged successfull. Session ID:'.$session_id.'
'; - } - - //* Parameters - $template_id = 2; - - - //* delete the template record - $affected_rows = $client->openvz_template_delete($session_id, $template_id); - - echo "Number of records that have been deleted: ".$affected_rows."
"; - - if($client->logout($session_id)) { - echo 'Logged out.
'; - } - - -} catch (SoapFault $e) { - echo $client->__getLastResponse(); - die('SOAP Error: '.$e->getMessage()); -} - -?> diff --git a/remoting_client/examples/openvz_template_get.php b/remoting_client/examples/openvz_template_get.php deleted file mode 100644 index dfe9c1113cc8830b13345429cc854e1eafb80d6c..0000000000000000000000000000000000000000 --- a/remoting_client/examples/openvz_template_get.php +++ /dev/null @@ -1,34 +0,0 @@ - $soap_location, - 'uri' => $soap_uri, - 'trace' => 1, - 'exceptions' => 1)); - - -try { - if($session_id = $client->login($username, $password)) { - echo 'Logged successfull. Session ID:'.$session_id.'
'; - } - - //* Set the function parameters. - $template_id = 2; - - $template_record = $client->openvz_template_get($session_id, $template_id); - - print_r($template_record); - - if($client->logout($session_id)) { - echo 'Logged out.
'; - } - - -} catch (SoapFault $e) { - echo $client->__getLastResponse(); - die('SOAP Error: '.$e->getMessage()); -} - -?> diff --git a/remoting_client/examples/openvz_template_update.php b/remoting_client/examples/openvz_template_update.php deleted file mode 100644 index 0425d9453035e8764afcc78e5394d25dbdae8068..0000000000000000000000000000000000000000 --- a/remoting_client/examples/openvz_template_update.php +++ /dev/null @@ -1,42 +0,0 @@ - $soap_location, - 'uri' => $soap_uri, - 'trace' => 1, - 'exceptions' => 1)); - - -try { - if($session_id = $client->login($username, $password)) { - echo 'Logged successfull. Session ID:'.$session_id.'
'; - } - - //* Parameters - $template_id = 2; - $client_id = 1; - - - //* Get the openvz template record - $template_record = $client->openvz_template_get($session_id, $template_id); - - //* Change the status to inactive - $template_record['active'] = 'n'; - - $affected_rows = $client->openvz_template_update($session_id, $client_id, $template_id, $template_record); - - echo "Number of records that have been changed in the database: ".$affected_rows."
"; - - if($client->logout($session_id)) { - echo 'Logged out.
'; - } - - -} catch (SoapFault $e) { - echo $client->__getLastResponse(); - die('SOAP Error: '.$e->getMessage()); -} - -?> diff --git a/remoting_client/examples/openvz_vm_add.php b/remoting_client/examples/openvz_vm_add.php deleted file mode 100644 index 408c62695eaaeee537cdadda5da120b816b1b1d8..0000000000000000000000000000000000000000 --- a/remoting_client/examples/openvz_vm_add.php +++ /dev/null @@ -1,60 +0,0 @@ - $soap_location, - 'uri' => $soap_uri, - 'trace' => 1, - 'exceptions' => 1)); - - -try { - if($session_id = $client->login($username, $password)) { - echo 'Logged successfull. Session ID:'.$session_id.'
'; - } - - //* Set the function parameters. - $client_id = 1; - $params = array( - 'server_id' => 1, - 'veid' => 1, - 'ostemplate_id' => 0, - 'template_id' => 0, - 'ip_address' => '192.168.0.111', - 'hostname' => 'host', - 'vm_password' => 'password', - 'start_boot' => 'y', - 'active' => 'y', - 'active_until_date' => '', - 'description' => '', - 'diskspace' => 10, - 'traffic' => -1, - 'bandwidth' => -1, - 'ram' => 256, - 'ram_burst' => 512, - 'cpu_units' => 1000, - 'cpu_num' => 4, - 'cpu_limit' => 400, - 'io_priority' => 4, - 'nameserver' => '8.8.8.8 8.8.4.4', - 'create_dns' => 'n', - 'capability' => '', - 'config' => '' - ); - - $vm_id = $client->openvz_vm_add($session_id, $client_id, $params); - - echo "VM ID: ".$vm_id."
"; - - if($client->logout($session_id)) { - echo 'Logged out.
'; - } - - -} catch (SoapFault $e) { - echo $client->__getLastResponse(); - die('SOAP Error: '.$e->getMessage()); -} - -?> diff --git a/remoting_client/examples/openvz_vm_add_from_template.php b/remoting_client/examples/openvz_vm_add_from_template.php deleted file mode 100644 index ea7328d166252d50cd05a2a2a4966dd6d931ce94..0000000000000000000000000000000000000000 --- a/remoting_client/examples/openvz_vm_add_from_template.php +++ /dev/null @@ -1,45 +0,0 @@ - $soap_location, - 'uri' => $soap_uri, - 'trace' => 1, - 'exceptions' => 1)); - - -try { - if($session_id = $client->login($username, $password)) { - echo 'Logged successfull. Session ID:'.$session_id.'
'; - } - - //* Params are optional for this function. If params are set, - //* then they override the template settings. - $params = array(); - - //* Set the function parameters. - $client_id = 0; - $ostemplate_id = 3; - $template_id = 3; - - $vm_id = $client->openvz_vm_add_from_template($session_id, $client_id, $ostemplate_id, $template_id, $params); - - print_r($vm_id); - echo "
"; - - if($client->logout($session_id)) { - echo 'Logged out.
'; - } - - -} catch (SoapFault $e) { - echo $client->__getLastResponse(); - die('SOAP Error: '.$e->getMessage()); -} - -?> diff --git a/remoting_client/examples/openvz_vm_delete.php b/remoting_client/examples/openvz_vm_delete.php deleted file mode 100644 index be0737cd90012bb6b757792e32abe2d8cdec99dc..0000000000000000000000000000000000000000 --- a/remoting_client/examples/openvz_vm_delete.php +++ /dev/null @@ -1,36 +0,0 @@ - $soap_location, - 'uri' => $soap_uri, - 'trace' => 1, - 'exceptions' => 1)); - - -try { - if($session_id = $client->login($username, $password)) { - echo 'Logged successfull. Session ID:'.$session_id.'
'; - } - - //* Parameters - $vm_id = 1; - - - //* delete the virtual machine record - $affected_rows = $client->openvz_vm_delete($session_id, $vm_id); - - echo "Number of records that have been deleted: ".$affected_rows."
"; - - if($client->logout($session_id)) { - echo 'Logged out.
'; - } - - -} catch (SoapFault $e) { - echo $client->__getLastResponse(); - die('SOAP Error: '.$e->getMessage()); -} - -?> diff --git a/remoting_client/examples/openvz_vm_get.php b/remoting_client/examples/openvz_vm_get.php deleted file mode 100644 index 78bd5712f6413bac04f95964e6ec4aa9d6def05b..0000000000000000000000000000000000000000 --- a/remoting_client/examples/openvz_vm_get.php +++ /dev/null @@ -1,34 +0,0 @@ - $soap_location, - 'uri' => $soap_uri, - 'trace' => 1, - 'exceptions' => 1)); - - -try { - if($session_id = $client->login($username, $password)) { - echo 'Logged successfull. Session ID:'.$session_id.'
'; - } - - //* Set the function parameters. - $vm_id = 1; - - $vm_record = $client->openvz_vm_get($session_id, $vm_id); - - print_r($vm_record); - - if($client->logout($session_id)) { - echo 'Logged out.
'; - } - - -} catch (SoapFault $e) { - echo $client->__getLastResponse(); - die('SOAP Error: '.$e->getMessage()); -} - -?> diff --git a/remoting_client/examples/openvz_vm_get_by_client.php b/remoting_client/examples/openvz_vm_get_by_client.php deleted file mode 100644 index 8497185971d7021da05696272905f7406ddf442e..0000000000000000000000000000000000000000 --- a/remoting_client/examples/openvz_vm_get_by_client.php +++ /dev/null @@ -1,34 +0,0 @@ - $soap_location, - 'uri' => $soap_uri, - 'trace' => 1, - 'exceptions' => 1)); - - -try { - if($session_id = $client->login($username, $password)) { - echo 'Logged successfull. Session ID:'.$session_id.'
'; - } - - //* Set function parameters - $client_id = 4; - - $vm_record = $client->openvz_vm_get_by_client($session_id, $client_id); - - print_r($vm_record); - - if($client->logout($session_id)) { - echo 'Logged out.
'; - } - - -} catch (SoapFault $e) { - echo $client->__getLastResponse(); - die('SOAP Error: '.$e->getMessage()); -} - -?> diff --git a/remoting_client/examples/openvz_vm_update.php b/remoting_client/examples/openvz_vm_update.php deleted file mode 100644 index f15386a64b4b763298cdb1839fbe4436907f8df8..0000000000000000000000000000000000000000 --- a/remoting_client/examples/openvz_vm_update.php +++ /dev/null @@ -1,42 +0,0 @@ - $soap_location, - 'uri' => $soap_uri, - 'trace' => 1, - 'exceptions' => 1)); - - -try { - if($session_id = $client->login($username, $password)) { - echo 'Logged successfull. Session ID:'.$session_id.'
'; - } - - //* Parameters - $vm_id = 1; - $client_id = 1; - - - //* Get the virtual machine record - $vm_record = $client->openvz_vm_get($session_id, $vm_id); - - //* Change active to no - $vm_record['active'] = 'n'; - - $affected_rows = $client->openvz_vm_update($session_id, $client_id, $vm_id, $vm_record); - - echo "Number of records that have been changed in the database: ".$affected_rows."
"; - - if($client->logout($session_id)) { - echo 'Logged out.
'; - } - - -} catch (SoapFault $e) { - echo $client->__getLastResponse(); - die('SOAP Error: '.$e->getMessage()); -} - -?> diff --git a/interface/web/mail/mail_ml_membership_del.php b/server/addons.php old mode 100644 new mode 100755 similarity index 56% rename from interface/web/mail/mail_ml_membership_del.php rename to server/addons.php index d2dcaf542b7b1d1a4466613edabb94676f666a5f..40bf727e94ee07070c582636162e5336acaf1612 --- a/interface/web/mail/mail_ml_membership_del.php +++ b/server/addons.php @@ -1,7 +1,7 @@ auth->check_module_permissions('mail'); - -// Loading classes -$app->uses('tpl,tform,tform_actions'); -$app->load('tform_actions'); - -class page_action extends tform_actions { +if(!isset($_SERVER['argv'])) { + die('No package path given.'); +} - function onBeforeDelete() { - global $app; $conf; +$action = ''; +$package = ''; +$force = false; +$argv = $_SERVER['argv']; +for($a = 1; $a < count($argv); $a++) { + if($argv[$a] === '--install' || $argv[$a] === 'install' + || $argv[$a] === '--update' || $argv[$a] === 'update') { + $action = 'install'; + } elseif($argv[$a] === '--uninstall' || $argv[$a] === 'uninstall') { + $action = 'uninstall'; + } elseif($argv[$a] === '--force') { + $force = true; + } elseif(substr($argv[$a], -4) === '.pkg' && is_file($argv[$a])) { + $package = $argv[$a]; + } else { + die('Unknown argument ' . $argv[$a]); } } -$page = new page_action; -$page->onDelete(); - -?> +if($action == 'uninstall') { + die('Automatic uninstall not supported, yet.'); +} else { + try { + $app->addon_installer->installAddon($package, $force); + } catch(Exception $e) { + die('Error: ' . $e->getMessage() . "\n"); + } +} \ No newline at end of file diff --git a/server/conf/apache_apps.vhost.master b/server/conf/apache_apps.vhost.master index 7dc2fd9ddf679462b6bb71740edc7a08625f17cc..d77cde2e4208373d79f5480ef675b8ea63d3cb84 100644 --- a/server/conf/apache_apps.vhost.master +++ b/server/conf/apache_apps.vhost.master @@ -24,12 +24,7 @@ Options FollowSymLinks AllowOverride None - Require all granted - - Order allow,deny - Allow from all - @@ -39,12 +34,7 @@ Options FollowSymLinks AllowOverride None - Require all granted - - Order allow,deny - Allow from all - @@ -58,15 +48,20 @@ SetHandler fcgid-script FCGIWrapper {tmpl_var name='apps_vhost_basedir'}/php-fcgi-scripts/apps/.php-fcgi-starter .php - Require all granted - - Order allow,deny - Allow from all - +{tmpl_if name="use_rspamd"} + + Order allow,deny + Allow from all + + RewriteEngine On + RewriteRule ^/rspamd$ /rspamd/ [R,L] + RewriteRule ^/rspamd/(.*) http://127.0.0.1:11334/$1 [P] +{/tmpl_if} + diff --git a/server/conf/apache_ispconfig.conf.master b/server/conf/apache_ispconfig.conf.master index 6165f0496b1624fef7f5aefdeb81717413359974..5fb618c13e5c023c92fb54773197367f48330a83 100644 --- a/server/conf/apache_ispconfig.conf.master +++ b/server/conf/apache_ispconfig.conf.master @@ -4,11 +4,9 @@ ServerTokens ProductOnly ServerSignature Off - SSLStaplingCache shmcb:/var/run/ocsp(128000) - ################################################ # ISPConfig Logfile configuration for vlogger @@ -18,6 +16,7 @@ SSLStaplingCache shmcb:/var/run/ocsp(128000) LogFormat '%v %h %l %u %t "%r" %>s %S "%{Referer}i" "%{User-Agent}i"' combined_ispconfig LogFormat "%v %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined_ispconfig + CustomLog "| /usr/local/ispconfig/server/scripts/vlogger -p -s access.log -t \"%Y%m%d-access.log\" /var/log/ispconfig/httpd" combined_ispconfig env=!dontlog @@ -27,131 +26,49 @@ CustomLog "| /usr/local/ispconfig/server/scripts/vlogger -s access.log -t \"%Y%m AllowOverride None - Require all denied - - Order Deny,Allow - Deny from all - # Do not allow access to the root file system of the server for security reasons Options -Indexes AllowOverride None - Require all denied - - Order Deny,Allow - Deny from all - AllowOverride None - Require all denied - - Order Deny,Allow - Deny from all - # Except of the following directories that contain website scripts - Require all granted - - Order allow,deny - Allow from all - - Require all granted - - Order allow,deny - Allow from all - - Require all granted - - Order allow,deny - Allow from all - - Require all granted - - Order allow,deny - Allow from all - - - -# Allow access to mailman on OpenSuSE - - - Require all granted - - Order allow,deny - Allow from all - - - - - - Require all granted - - Order allow,deny - Allow from all - - - - - Options +FollowSymLinks - - Require all granted - - Order allow,deny - Allow from all - # allow path to awstats and alias for awstats icons - Require all granted - - Order allow,deny - Allow from all - Alias /awstats-icon "/usr/share/awstats/icon" Alias /.well-known/acme-challenge /usr/local/ispconfig/interface/acme/.well-known/acme-challenge - Require all granted - - Order allow,deny - Allow from all - - AssignUserId www-data www-data - + AssignUserId www-data www-data + - - -NameVirtualHost *:80 -NameVirtualHost *:443 - -NameVirtualHost {tmpl_var name="ip_address"}:{tmpl_var name="port"} - - diff --git a/server/conf/autoresponder.master b/server/conf/autoresponder.master index 0126c998d49f8177d28e147c1642a6e9fe4532c4..3e84b802f227d7ec7f765bb86c30c23fb8467ccd 100644 --- a/server/conf/autoresponder.master +++ b/server/conf/autoresponder.master @@ -4,7 +4,7 @@ if ($RETURNCODE==1) { if (!/^List-Unsubscribe:.*/:h ) { - if (!/^X-Spam-Flag: YES/:h ) + if (!/^(X-Spam-Flag: YES|X-Spam: Yes|Subject: \*\*\*\s*SPAM\s*\*\*\*.*)/:h ) { NOW=time if ({start_date} lt $NOW && {end_date} gt $NOW) @@ -20,4 +20,4 @@ if ($RETURNCODE==1) } } } -} \ No newline at end of file +} diff --git a/server/conf/mailfilter_move_junk.master b/server/conf/mailfilter_move_junk.master deleted file mode 100644 index ef346c922c9c8bd59591785e161f916547c385f9..0000000000000000000000000000000000000000 --- a/server/conf/mailfilter_move_junk.master +++ /dev/null @@ -1,19 +0,0 @@ - -SPAMDIR="Junk" -SPAMDIRFULL="$DEFAULT/.Junk" - -if ( /^X-Spam-Flag: YES$/ ) -{ - exception { - - `test -e $SPAMDIRFULL` - if ( $RETURNCODE != 0 ) - { - `maildirmake -f $SPAMDIR $DEFAULT` - `chown vmail:vmail -R $SPAMDIRFULL` - `chmod 0700 $SPAMDIRFULL` - `echo INBOX.$SPAMDIR >> $DEFAULT/courierimapsubscribed` - } - to "$SPAMDIRFULL/" - } -} \ No newline at end of file diff --git a/server/conf/mm_cfg.py.master b/server/conf/mm_cfg.py.master deleted file mode 100644 index 3dcf5a6a6156f50ce3feba2a3518d0ab40853a5d..0000000000000000000000000000000000000000 --- a/server/conf/mm_cfg.py.master +++ /dev/null @@ -1,108 +0,0 @@ -# -*- python -*- - -# Copyright (C) 1998,1999,2000 by the Free Software Foundation, Inc. -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -# 02110-1301 USA - - -"""This is the module which takes your site-specific settings. - -From a raw distribution it should be copied to mm_cfg.py. If you -already have an mm_cfg.py, be careful to add in only the new settings -you want. The complete set of distributed defaults, with annotation, -are in ./Defaults. In mm_cfg, override only those you want to -change, after the - - from Defaults import * - -line (see below). - -Note that these are just default settings - many can be overridden via the -admin and user interfaces on a per-list or per-user basis. - -Note also that some of the settings are resolved against the active list -setting by using the value as a format string against the -list-instance-object's dictionary - see the distributed value of -DEFAULT_MSG_FOOTER for an example.""" - - -####################################################### -# Here's where we get the distributed defaults. # - -from Defaults import * - -############################################################## -# Put YOUR site-specific configuration below, in mm_cfg.py . # -# See Defaults.py for explanations of the values. # - -#------------------------------------------------------------- -# The name of the list Mailman uses to send password reminders -# and similar. Don't change if you want mailman-owner to be -# a valid local part. -MAILMAN_SITE_LIST = 'mailman' - -#------------------------------------------------------------- -# If you change these, you have to configure your http server -# accordingly (Alias and ScriptAlias directives in most httpds) -DEFAULT_URL_PATTERN = 'http://%s/cgi-bin/mailman/' -PRIVATE_ARCHIVE_URL = '/cgi-bin/mailman/private' -IMAGE_LOGOS = '/images/mailman/' - -#------------------------------------------------------------- -# Default domain for email addresses of newly created MLs -DEFAULT_EMAIL_HOST = '{hostname}' -#------------------------------------------------------------- -# Default host for web interface of newly created MLs -DEFAULT_URL_HOST = '{hostname}' -#------------------------------------------------------------- -# Required when setting any of its arguments. -add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST) - -#------------------------------------------------------------- -# The default language for this server. -DEFAULT_SERVER_LANGUAGE = {default_language} - -#------------------------------------------------------------- -# Iirc this was used in pre 2.1, leave it for now -USE_ENVELOPE_SENDER = 0 # Still used? - -#------------------------------------------------------------- -# Unset send_reminders on newly created lists -DEFAULT_SEND_REMINDERS = 0 - -#------------------------------------------------------------- -# Uncomment this if you configured your MTA such that it -# automatically recognizes newly created lists. -# (see /usr/share/doc/mailman/README.Exim4.Debian or -# /usr/share/mailman/postfix-to-mailman.py) -# MTA=None # Misnomer, suppresses alias output on newlist - -#------------------------------------------------------------- -# Uncomment if you use Postfix virtual domains (but not -# postfix-to-mailman.py), but be sure to see -# /usr/share/doc/mailman/README.Debian first. -MTA='Postfix' -POSTFIX_STYLE_VIRTUAL_DOMAINS = [{virtual_domains}] -#------------------------------------------------------------- -# Uncomment if you want to filter mail with SpamAssassin. For -# more information please visit this website: -# http://www.jamesh.id.au/articles/mailman-spamassassin/ -# GLOBAL_PIPELINE.insert(1, 'SpamAssassin') - -POSTFIX_MAP_CMD = '/etc/mailman/virtual_to_transport.sh' - -# Note - if you're looking for something that is imported from mm_cfg, but you -# didn't find it above, it's probably in /usr/lib/mailman/Mailman/Defaults.py. \ No newline at end of file diff --git a/server/conf/nginx_apps.vhost.master b/server/conf/nginx_apps.vhost.master index 75daa4df8f1692f48eacca62c217583473d9cbbf..d89faeaa92938c87a60206b0ca781233873d3f27 100644 --- a/server/conf/nginx_apps.vhost.master +++ b/server/conf/nginx_apps.vhost.master @@ -1,5 +1,13 @@ server { listen {apps_vhost_ip}{apps_vhost_port}; + listen [::]:{apps_vhost_port} ipv6only=on; + ssl {ssl_on}; + {ssl_comment}ssl_protocols TLSv1 TLSv1.1 TLSv1.2; + {ssl_comment}ssl_certificate /usr/local/ispconfig/interface/ssl/ispserver.crt; + {ssl_comment}ssl_certificate_key /usr/local/ispconfig/interface/ssl/ispserver.key; + + # redirect to https if accessed with http + {ssl_comment}error_page 497 https://$host:{vhost_port}$request_uri; server_name {apps_vhost_servername}; @@ -12,7 +20,7 @@ server { } # serve static files directly - location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt)$ { + location ~* ^.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt)$ { access_log off; } @@ -157,46 +165,28 @@ server { rewrite ^/* /squirrelmail last; } - location /cgi-bin/mailman { - root /usr/lib/; - fastcgi_split_path_info (^/cgi-bin/mailman/[^/]*)(.*)$; - fastcgi_param QUERY_STRING $query_string; - fastcgi_param REQUEST_METHOD $request_method; - fastcgi_param CONTENT_TYPE $content_type; - fastcgi_param CONTENT_LENGTH $content_length; - - fastcgi_param SCRIPT_NAME $fastcgi_script_name; - fastcgi_param REQUEST_URI $request_uri; - fastcgi_param DOCUMENT_URI $document_uri; - fastcgi_param DOCUMENT_ROOT $document_root; - fastcgi_param SERVER_PROTOCOL $server_protocol; - - fastcgi_param GATEWAY_INTERFACE CGI/1.1; - fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; - - fastcgi_param REMOTE_ADDR $remote_addr; - fastcgi_param REMOTE_PORT $remote_port; - fastcgi_param SERVER_ADDR $server_addr; - fastcgi_param SERVER_PORT $server_port; - fastcgi_param SERVER_NAME $server_name; - - fastcgi_param HTTPS $https; - - # PHP only, required if PHP was built with --enable-force-cgi-redirect - fastcgi_param REDIRECT_STATUS 200; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - fastcgi_param PATH_INFO $fastcgi_path_info; - fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; - fastcgi_intercept_errors on; - fastcgi_pass unix:{cgi_socket}; - } - - location /images/mailman { - alias /usr/share/images/mailman; - } + {use_rspamd}location /rspamd/ { + {use_rspamd}proxy_pass http://127.0.0.1:11334/; + {use_rspamd}rewrite ^//(.*) /$1; + {use_rspamd}proxy_set_header X-Forwarded-Proto $scheme; + {use_rspamd}proxy_set_header Host $host; + {use_rspamd}proxy_set_header X-Real-IP $remote_addr; + {use_rspamd}proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + {use_rspamd}proxy_pass_header Authorization; + {use_rspamd}client_max_body_size 0; + {use_rspamd}client_body_buffer_size 1m; + {use_rspamd}proxy_intercept_errors on; + {use_rspamd}proxy_buffering on; + {use_rspamd}proxy_buffer_size 128k; + {use_rspamd}proxy_buffers 256 16k; + {use_rspamd}proxy_busy_buffers_size 256k; + {use_rspamd}proxy_temp_file_write_size 256k; + {use_rspamd}proxy_max_temp_file_size 0; + {use_rspamd}proxy_read_timeout 300; + {use_rspamd} + {use_rspamd}location ~* ^/rspamd/(.+\.(jpg|jpeg|gif|css|png|js|ico|html?|xml|txt))$ { + {use_rspamd}alias /usr/share/rspamd/www/$1; + {use_rspamd}} + {use_rspamd}} - location /pipermail { - alias /var/lib/mailman/archives/public; - autoindex on; - } } diff --git a/server/conf/rspamd_users.inc.conf.master b/server/conf/rspamd_users.inc.conf.master new file mode 100644 index 0000000000000000000000000000000000000000..1fe08439a7db24e6403302123d1a7d63b5592689 --- /dev/null +++ b/server/conf/rspamd_users.inc.conf.master @@ -0,0 +1,41 @@ +spamfilter_users- { + priority = ; + rcpt = ""; + + want_spam = yes; + + + apply "default" { + CLAM_VIRUS = 1999.0; + JUST_EICAR = 1999.0; + actions { + reject = 999.0; + } + } + + + apply "default" { + CLAM_VIRUS = -999.0; + JUST_EICAR = -999.0; + actions { + greylist = ; + + = ; + reject = ; + } + } + + + apply "default" { + CLAM_VIRUS = ; + JUST_EICAR = ; + actions { + greylist = ; + + = ; + reject = ; + } + } + + +} \ No newline at end of file diff --git a/server/conf/rspamd_worker-controller.inc.master b/server/conf/rspamd_worker-controller.inc.master new file mode 100644 index 0000000000000000000000000000000000000000..75b744c88380c3ce63394caaadf79653e0fa8815 --- /dev/null +++ b/server/conf/rspamd_worker-controller.inc.master @@ -0,0 +1,8 @@ +# Included from top-level .conf file + +type = "controller"; +count = 1; +password = ""; +secure_ip = "127.0.0.1"; +secure_ip = "::1"; +static_dir = "${WWWDIR}"; \ No newline at end of file diff --git a/server/conf/sieve_filter.master b/server/conf/sieve_filter.master index bfd75c4d43e6279ecba65701c7151ccade11fa79..13c08dd56b18987573c18fd1fe1aee432db17e44 100644 --- a/server/conf/sieve_filter.master +++ b/server/conf/sieve_filter.master @@ -1,4 +1,4 @@ -require ["fileinto", "regex", "vacation", "imap4flags", "envelope", "subaddress"]; +require ["fileinto", "regex", "date", "relational", "vacation", "imap4flags", "envelope", "subaddress", "copy", "reject"]; # Send a copy of email to @@ -9,7 +9,7 @@ redirect ""; # Move spam to spam folder -if header :contains "X-Spam-Flag" "YES" { +if anyof (header :contains "X-Spam-Flag" "YES", header :contains "X-Spam" "Yes", header :contains "subject" "*** SPAM ***", header :contains "subject" "***SPAM***") { fileinto "Junk"; # Stop here so that we do not reply on spams stop; @@ -26,7 +26,7 @@ keep; ################################################################# # Move spam to spam folder -if header :contains "X-Spam-Flag" "YES" { +if anyof (header :contains "X-Spam-Flag" "YES", header :contains "X-Spam" "Yes", header :contains "subject" "*** SPAM ***", header :contains "subject" "***SPAM***") { fileinto "Junk"; # Stop here so that we do not reply on spams stop; diff --git a/server/conf/sieve_filter_1.2.master b/server/conf/sieve_filter_1.2.master index 8a1c80713fb7fafda8fbed675e2a7f1183aaff23..5244693102ce0778964ce2e25b61c377b1b2bf8a 100644 --- a/server/conf/sieve_filter_1.2.master +++ b/server/conf/sieve_filter_1.2.master @@ -1,8 +1,8 @@ -require ["fileinto", "regex", "date", "relational", "vacation", "imap4flags", "envelope", "subaddress"]; +require ["fileinto", "regex", "date", "relational", "vacation", "imap4flags", "envelope", "subaddress", "copy", "reject"]; # Move spam to spam folder -if header :contains "X-Spam-Flag" "YES" { +if anyof (header :contains "X-Spam-Flag" "YES", header :contains "X-Spam" "Yes", header :contains "subject" "*** SPAM ***", header :contains "subject" "***SPAM***") { fileinto "Junk"; # Stop here so that we do not reply on spams stop; @@ -26,7 +26,7 @@ keep; ################################################################# # Move spam to spam folder -if header :contains "X-Spam-Flag" "YES" { +if anyof (header :contains "X-Spam-Flag" "YES", header :contains "X-Spam" "Yes", header :contains "subject" "*** SPAM ***", header :contains "subject" "***SPAM***") { # Stop here so that we do not reply on spams stop; } diff --git a/server/conf/vhost.conf.master b/server/conf/vhost.conf.master index 52b0dc37204d9a5c0714c29eeb7e13636ffaab70..7d129e559627abf3e14cc3a86d9fb6ee814488a9 100644 --- a/server/conf/vhost.conf.master +++ b/server/conf/vhost.conf.master @@ -2,12 +2,7 @@ AllowOverride None - Require all denied - - Order Deny,Allow - Deny from all - @@ -89,12 +84,7 @@ DocumentRoot Options +FollowSymLinks AllowOverride - Require all granted - - Order allow,deny - Allow from all - # ssi enabled @@ -104,13 +94,7 @@ DocumentRoot - Require all denied - - Order allow,deny - Deny from all - Allow from none - @@ -121,12 +105,7 @@ DocumentRoot Options +FollowSymLinks AllowOverride - Require all granted - - Order allow,deny - Allow from all - # ssi enabled @@ -136,13 +115,7 @@ DocumentRoot - Require all denied - - Order allow,deny - Deny from all - Allow from none - @@ -209,12 +182,7 @@ DocumentRoot # cgi enabled - Require all granted - - Order allow,deny - Allow from all - ScriptAlias /cgi-bin/ /cgi-bin/ @@ -245,7 +213,6 @@ DocumentRoot # php as fast-cgi enabled # For config options see: http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html - FcgidIdleTimeout 300 FcgidProcessLifeTime 3600 # FcgidMaxProcesses 1000 @@ -256,16 +223,6 @@ DocumentRoot FcgidIOTimeout 600 FcgidBusyTimeout 3600 FcgidMaxRequestLen 1073741824 - - IdleTimeout 300 - ProcessLifeTime 3600 - # MaxProcessCount 1000 - DefaultMinClassProcessCount 0 - DefaultMaxClassProcessCount 10 - IPCConnectTimeout 3 - IPCCommTimeout 600 - BusyTimeout 3600 - @@ -277,12 +234,7 @@ DocumentRoot FCGIWrapper .php5 Options +ExecCGI AllowOverride - Require all granted - - Order allow,deny - Allow from all - @@ -294,44 +246,26 @@ DocumentRoot FCGIWrapper .php5 Options +ExecCGI AllowOverride - Require all granted - - Order allow,deny - Allow from all - - Require all granted - - Order allow,deny - Allow from all - - - - SetHandler php-fcgi - - - SetHandler php-fcgi - + + SetHandler php-fcgi + - - - SetHandler php-fcgi - - - SetHandler php-fcgi - + + SetHandler php-fcgi + Action php-fcgi /php-fcgi virtual @@ -348,13 +282,9 @@ DocumentRoot #ProxyPassMatch ^/(.*\.php[345]?(/.*)?)$ fcgi://127.0.0.1:/$1 - - - SetHandler "proxy:fcgi://127.0.0.1:" - - - SetHandler "proxy:fcgi://127.0.0.1:" - + + SetHandler "proxy:fcgi://127.0.0.1:" + @@ -362,13 +292,9 @@ DocumentRoot #ProxyPassMatch ^/(.*\.php[345]?(/.*)?)$ unix://|fcgi://localhost//$1 - - - SetHandler "proxy:unix:|fcgi://localhost" - - - SetHandler "proxy:unix:|fcgi://localhost" - + + SetHandler "proxy:unix:|fcgi://localhost" + @@ -377,38 +303,25 @@ DocumentRoot RewriteEngine on - RewriteCond %{REQUEST_URI} ^/\.well-known/acme-challenge/ RewriteRule ^ - [END] - RewriteCond %{HTTPS} off - RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/ - RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] RewriteCond %{HTTP_HOST} ^$ [NC] - - RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/ - RewriteRule ^ https://%{REQUEST_URI} [R=301,NE,L] RewriteCond %{HTTP_HOST} ^$ [NC] - - RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/ - RewriteRule ^ https://%{REQUEST_URI} [R=301,NE,L] RewriteCond %{HTTP_HOST} $ [NC] - - RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/ - RewriteCond %{REQUEST_URI} !^/webdav/ RewriteCond %{REQUEST_URI} !^/php-fcgi/ @@ -421,8 +334,6 @@ DocumentRoot RewriteCond %{HTTPS} off - RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/ - RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L,NE] 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/lib/app.inc.php b/server/lib/app.inc.php index 86df2a86f6b43181d8ba137a326d8cbf3fd643de..59bf8b9ebc10623512779d5d0e7eef47fd6f8664 100644 --- a/server/lib/app.inc.php +++ b/server/lib/app.inc.php @@ -69,6 +69,14 @@ class app { } + public function __get($prop) { + if(property_exists($this, $prop)) return $this->{$prop}; + + $this->uses($prop); + if(property_exists($this, $prop)) return $this->{$prop}; + else return null; + } + function setCaller($caller) { $this->_calling_script = $caller; } diff --git a/server/lib/classes/addon_installer.inc.php b/server/lib/classes/addon_installer.inc.php new file mode 100644 index 0000000000000000000000000000000000000000..3a108e8bbb2f128883ec03c97cbc54c5589bd760 --- /dev/null +++ b/server/lib/classes/addon_installer.inc.php @@ -0,0 +1,228 @@ +log('Extracting addon package ' . $package_file, 0, false); + + $cmd = 'which unzip'; + $tmp = explode("\n", exec($cmd, $ret, $retval)); + if($retval != 0) { + $app->log('The unzip command was not found on the server.', 2, false); + throw new AddonInstallerException('unzip tool not found.'); + } + $unzip = reset($tmp); + unset($tmp); + if(!$unzip) { + $app->log('Unzip tool was not found.', 2, false); + throw new AddonInstallerException('unzip tool not found.'); + } + + $temp_dir = $app->system->tempdir(sys_get_temp_dir(), 'addon_', 0700); + if(!$temp_dir) { + $app->log('Could not create the temp dir.', 2, false); + throw new AddonInstallerException('Could not create temp dir.'); + } + + $ret = null; + $retval = 0; + $cmd = $unzip . ' -d ' . escapeshellarg($temp_dir) . ' ' . escapeshellarg($package_file); + exec($cmd, $ret, $retval); + if($retval != 0) { + $app->log('Package extraction failed.', 2, false); + throw new AddonInstallerException('Package extraction failed.'); + } + + $app->log('Extracted to ' . $temp_dir, 0, false); + + return $temp_dir; + } + + /** + * @param string $path + * @return string + * @throws AddonInstallerValidationException + */ + private function validatePackage($path) { + global $app; + + $app->log('Validating extracted addon at ' . $path, 0, false); + + if(!is_dir($path)) { + $app->log('Invalid path.', 2, false); + throw new AddonInstallerValidationException('Invalid path.'); + } + + $ini_file = $path . '/addon.ini'; + if(!is_file($ini_file)) { + $app->log('Addon ini file missing.', 2, false); + throw new AddonInstallerValidationException('Addon ini file missing.'); + } + + $app->log('Parsing ini ' . $ini_file, 0, false); + $ini = parse_ini_file($ini_file, true); + if(!$ini || !isset($ini['addon'])) { + $app->log('Ini file could not be read.', 2, false); + throw new AddonInstallerValidationException('Ini file is missing addon section.'); + } + + $addon = $ini['addon']; + if(!isset($addon['ident']) || !isset($addon['name']) || !isset($addon['version'])) { + $app->log('Addon data in ini file missing or invalid.', 2, false); + throw new AddonInstallerValidationException('Ini file is missing addon ident/name/version.'); + } + + $class_file = $path . '/' . $addon['ident'] . '.addon.php'; + if(!is_file($class_file)) { + $app->log('Base class file in addon not found', 2, false); + throw new AddonInstallerValidationException('Package is missing main addon class.'); + } + + if(isset($ini['ispconfig']['version.min']) && $ini['ispconfig']['version.min'] && version_compare($ini['ispconfig']['version.min'], ISPC_APP_VERSION, '>')) { + $app->log('ISPConfig version too low for this addon.', 2, false); + throw new AddonInstallerValidationException('Addon requires at least ISPConfig version ' . $ini['ispconfig']['version.min'] . '.'); + } elseif(isset($ini['ispconfig']['version.max']) && $ini['ispconfig']['version.max'] && version_compare($ini['ispconfig']['version.min'], ISPC_APP_VERSION, '<')) { + $app->log('ISPConfig version too high for this addon.', 2, false); + throw new AddonInstallerValidationException('Addon allows at max ISPConfig version ' . $ini['ispconfig']['version.max'] . '.'); + } + + $app->log('Loaded addon installer ' . $class_file, 0, false); + + $addon['class_file'] = $class_file; + $addon['class_name'] = substr(basename($class_file), 0, -10) . '_addon_installer'; + + return $addon; + } + + private function getInstalledAddonVersion($ident) { + global $app, $conf; + + $file_version = false; + $db_version = false; + + $addon_path = realpath($conf['rootpath'] . '/..') . '/addons'; + // check for previous version + if(is_dir($addon_path . '/' . $ident) && is_file($addon_path . '/' . $ident . '/addon.ini')) { + $addon = parse_ini_file($addon_path . '/' . $ident . '/addon.ini', true); + if($addon && isset($addon['addon'])) { + $addon = $addon['addon']; // ini section + } else { + $addon = false; + } + if(!$addon || !isset($addon['version']) || !isset($addon['ident']) || $addon['ident'] != $ident) { + $app->log('Could not get version of installed addon.', 2, false); + throw new AddonInstallerException('Installed app ' . $ident . ' found but it is invalid.'); + } + + $file_version = $addon['version']; + $app->log('Installed version of addon ' . $ident . ' is ' . $file_version, 0, false); + } + + $check = $app->db->queryOneRecord('SELECT `addon_version` FROM `addons` WHERE `addon_ident` = ?', $ident); + if($check && $check['addon_version']) { + $db_version = $check['addon_version']; + $app->log('Installed version of addon ' . $ident . ' (in db) is ' . $db_version . '.', 0, false); + } + + if(!$file_version && !$db_version) { + return false; + } elseif($file_version != $db_version) { + $app->log('Version mismatch between ini file and database (' . $file_version . ' != ' . $db_version . ').', 0, false); + throw new AddonInstallerException('Addon version mismatch in database (' . $db_version . ') and file system (' . $file_version . ').'); + } + + return $file_version; + + } + + /** + * @param string $package_file Full path + * @param boolean $force true if previous addon with same or higher version should be overwritten + * @throws AddonInstallerException + * @throws AddonInstallerValidationException + */ + public function installAddon($package_file, $force = false) { + global $app; + + $app->load('ispconfig_addon_installer_base'); + + if(!is_file($package_file)) { + $app->log('Package file not found: ' . $package_file, 2, false); + throw new AddonInstallerException('Package file not found.'); + } elseif(substr($package_file, -4) !== '.pkg') { + $app->log('Invalid package file: ' . $package_file, 2, false); + throw new AddonInstallerException('Invalid package file.'); + } + + $tmp_dir = $this->extractPackage($package_file); + if(!$tmp_dir) { + // extracting failed + $app->log('Package extraction failed.', 2, false); + throw new AddonInstallerException('Package extraction failed.'); + } + + $addon = $this->validatePackage($tmp_dir); + if(!$addon) { + throw new AddonInstallerException('Package validation failed.'); + } + $app->log('Package validated.', 0, false); + + $is_update = false; + $previous = $this->getInstalledAddonVersion($addon['ident']); + if($previous !== false) { + // this is an update + if(version_compare($previous, $addon['version'], '>') && $force !== true) { + $app->log('Installed version is newer than the one to install and --force not used.', 2, false); + throw new AddonInstallerException('Installed version is newer than the one to install.'); + } elseif(version_compare($previous, $addon['version'], '=') && $force !== true) { + $app->log('Installed version is the same as the one to install and --force not used.', 2, false); + throw new AddonInstallerException('Installed version is the same as the one to install.'); + } + $is_update = true; + } + + $app->log('Including package class file ' . $addon['class_file'], 0, false); + + include $addon['class_file']; + $class_name = $addon['class_name']; + if(!class_exists($class_name)) { + $app->log('Class name ' . $class_name . ' not found in class file ' . $addon['class_file'], 2, false); + throw new AddonInstallerException('Could not find main class in addon file.'); + } + + /* @var $inst ispconfig_addon_installer_base */ + $app->log('Instanciating installer class ' . $class_name, 0, false); + + $inst = new $class_name(); + $inst->setAddonName($addon['name']); + $inst->setAddonIdent($addon['ident']); + $inst->setAddonVersion($addon['version']); + $inst->setAddonTempDir($tmp_dir); + + if($is_update === true) { + $inst->onBeforeUpdate(); + $inst->onUpdate(); + $inst->onAfterUpdate(); + } else { + $inst->onBeforeInstall(); + $inst->onInstall(); + $inst->onAfterInstall(); + } + + exec('rm -rf ' . escapeshellarg($tmp_dir)); + + $app->log('Installation completed.', 0, false); + return true; + } + +} diff --git a/server/lib/classes/cron.d/100-monitor_email_quota.inc.php b/server/lib/classes/cron.d/100-monitor_email_quota.inc.php index 75014c347def49072f048b235c5afadaa976feb5..b9a78e9e7a59a225b1a6ba44ff1c6ff6f2f609e2 100644 --- a/server/lib/classes/cron.d/100-monitor_email_quota.inc.php +++ b/server/lib/classes/cron.d/100-monitor_email_quota.inc.php @@ -80,7 +80,7 @@ class cronjob_monitor_email_quota extends cronjob { //* with dovecot we can use doveadm instead of 'du -s' $dovecot = false; - if (isset($mail_config['pop3_imap_daemon']) && $mail_config ['pop3_imap_daemon'] = 'dovecot' && is_executable('doveadm')) { + if (is_executable('doveadm')) { exec('doveadm quota 2>&1', $tmp_output, $tmp_retval); // with dovecot 2.2.x 'doveadm quota' is unuseable if ($retval = 64) $dovecot = true; } @@ -110,20 +110,6 @@ class cronjob_monitor_email_quota extends cronjob { unset($mailboxes); - //* Dovecot quota check Courier in progress lathama@gmail.com - /* - if($dir = opendir("/var/vmail")){ - while (($quotafiles = readdir($dir)) !== false){ - if(preg_match('/.\_quota$/', $quotafiles)){ - $quotafile = (file("/var/vmail/" . $quotafiles)); - $emailaddress = preg_replace('/_quota/',"", $quotafiles); - $emailaddress = preg_replace('/_/',"@", $emailaddress); - $data[$emailaddress]['used'] = trim($quotafile['1']); - } - } - closedir($dir); - } - */ $res = array(); $res['server_id'] = $server_id; $res['type'] = $type; diff --git a/server/lib/classes/cron.d/100-monitor_openvz.inc.php b/server/lib/classes/cron.d/100-monitor_openvz.inc.php deleted file mode 100644 index adc092ec95eb72d96b563202c5607f47c5f0ef64..0000000000000000000000000000000000000000 --- a/server/lib/classes/cron.d/100-monitor_openvz.inc.php +++ /dev/null @@ -1,173 +0,0 @@ -load('monitor_tools'); - $this->_tools = new monitor_tools(); - /* end global section for monitor cronjobs */ - - /* the id of the server as int */ - $server_id = intval($conf['server_id']); - - /** The type of the data */ - - - $type = 'openvz_veinfo'; - - /* - Fetch the data into a array - */ - $app->load('openvz_tools'); - $openVzTools = new openvz_tools(); - $data = $openVzTools->getOpenVzVeInfo(); - - /* the VE-Info has no state. It is, what it is */ - $state = 'no_state'; - - $res = array(); - $res['server_id'] = $server_id; - $res['type'] = $type; - $res['data'] = $data; - $res['state'] = $state; - - /* - * Insert the data into the database - */ - $sql = 'REPLACE INTO monitor_data (server_id, type, created, data, state) ' . - 'VALUES (?, ?, UNIX_TIMESTAMP(), ?, ?)'; - $app->dbmaster->query($sql, $res['server_id'], $res['type'], serialize($res['data']), $res['state']); - - /* The new data is written, now we can delete the old one */ - $this->_tools->delOldRecords($res['type'], $res['server_id']); - - /** The type of the data */ - $type = 'openvz_beancounter'; - - /* - Fetch the data into a array - */ - $app->load('openvz_tools'); - $openVzTools = new openvz_tools(); - $data = $openVzTools->getOpenVzVeBeanCounter(); - - /* calculate the state of the beancounter */ - if ($data == '') { - $state = 'no_state'; - } else { - $state = 'ok'; - - /* transfer this output-string into a array */ - $test = explode("\n", $data); - - /* the first list of the output is not needed */ - array_shift($test); - - /* now process all items of the rest */ - foreach ($test as $item) { - /* - * eliminate all doubled spaces and spaces at the beginning and end - */ - while (strpos($item, ' ') !== false) { - $item = str_replace(' ', ' ', $item); - } - $item = trim($item); - - /* - * The failcounter is the LAST - */ - if ($item != '') { - $tmp = explode(' ', $item); - $failCounter = $tmp[sizeof($tmp) - 1]; - if ($failCounter > 0) - $state = 'info'; - if ($failCounter > 50) - $state = 'warning'; - if ($failCounter > 200) - $state = 'critical'; - if ($failCounter > 10000) - $state = 'error'; - } - } - } - - $res = array(); - $res['server_id'] = $server_id; - $res['type'] = $type; - $res['data'] = $data; - $res['state'] = $state; - - /* - * Insert the data into the database - */ - $sql = 'REPLACE INTO monitor_data (server_id, type, created, data, state) ' . - 'VALUES (?, ?, UNIX_TIMESTAMP(), ?, ?)'; - $app->dbmaster->query($sql, $res['server_id'], $res['type'], serialize($res['data']), $res['state']); - - /* The new data is written, now we can delete the old one */ - $this->_tools->delOldRecords($res['type'], $res['server_id']); - - parent::onRunJob(); - } - - /* this function is optional if it contains no custom code */ - public function onAfterRun() { - global $app; - - parent::onAfterRun(); - } - -} - -?> diff --git a/server/lib/classes/cron.d/400-openvz.inc.php b/server/lib/classes/cron.d/100-send_sys_mailqueue.inc.php similarity index 69% rename from server/lib/classes/cron.d/400-openvz.inc.php rename to server/lib/classes/cron.d/100-send_sys_mailqueue.inc.php index c88e0e608f9fcd690937a8205a72abab845d9ece..2ab46dfc8157af227d4086b6fb1c5a6319ce2e52 100644 --- a/server/lib/classes/cron.d/400-openvz.inc.php +++ b/server/lib/classes/cron.d/100-send_sys_mailqueue.inc.php @@ -28,10 +28,11 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -class cronjob_openvz extends cronjob { +class cronjob_send_sys_mailqueue extends cronjob { // job schedule - protected $_schedule = '0 0 * * *'; + protected $_schedule = '* * * * *'; + protected $_run_at_new = true; /* this function is optional if it contains no custom code */ public function onPrepare() { @@ -50,20 +51,15 @@ class cronjob_openvz extends cronjob { public function onRunJob() { global $app, $conf; - //###################################################################################################### - // deactivate virtual servers (run only on the "master-server") - //###################################################################################################### - - if ($app->dbmaster == $app->db) { - //* Check which virtual machines have to be deactivated - $sql = "SELECT * FROM openvz_vm WHERE active = 'y' AND active_until_date IS NOT NULL AND active_until_date < CURDATE()"; - $records = $app->db->queryAllRecords($sql); - if(is_array($records)) { - foreach($records as $rec) { - $app->dbmaster->datalogUpdate('openvz_vm', array("active" => 'n'), 'vm_id', $rec['vm_id']); - $app->log('Virtual machine active date expired. Disabling VM '.$rec['veid'], LOGLEVEL_DEBUG); - } - } + $app->uses('getconf,ispcmail'); + + $mail_config = $app->getconf->get_global_config('mail'); + if($mail_config['smtp_enabled'] == 'y') { + $mail_config['use_smtp'] = true; + $app->ispcmail->setOptions($mail_config); + + // Mail queue is supported only with SMTP... + $app->ispcmail->send_queue(); } parent::onRunJob(); diff --git a/server/lib/classes/cron.d/500-jkupdate.inc.php b/server/lib/classes/cron.d/500-jkupdate.inc.php new file mode 100644 index 0000000000000000000000000000000000000000..fcf07912dcb047de7b68667dc4a2ff4228aed860 --- /dev/null +++ b/server/lib/classes/cron.d/500-jkupdate.inc.php @@ -0,0 +1,221 @@ +uses('getconf'); + $jailkit_conf = $app->getconf->get_server_config($conf['server_id'], 'jailkit'); + //$jailkit_programs = explode(' ', $jailkit_conf['jailkit_chroot_app_programs']); + $jailkit_programs = preg_split("/[\s,]+/", $jailkit_conf['jailkit_chroot_app_programs']); + $jailkit_sections = trim($jailkit_conf['jailkit_chroot_app_sections']); + + $sites = $app->db->queryAllRecords("SELECT domain_id, document_root, fastcgi_php_version FROM web_domain WHERE jailkit_jkupdate_cron = 'y' AND type = 'vhost' AND parent_domain_id = 0 AND document_root != '' ORDER BY domain_id"); + + foreach($sites as $site) { + $set_php_symlink = false; + + $users = $app->db->queryOneRecord("SELECT COUNT(*) AS user_count FROM shell_user WHERE parent_domain_id = ? AND active='y' AND chroot='jailkit'", intval($site['domain_id'])); + $crons = $app->db->queryOneRecord("SELECT COUNT(*) AS cron_count FROM cron WHERE parent_domain_id = ? AND active='y' AND type='chrooted'", $site['domain_id']); + if ($users['user_count'] > 0 || $crons['cron_count'] > 0) { + + if (!is_dir($site['document_root'])) { + return; + } + + //* Protect web folders + $app->system->web_folder_protection($site['document_root'], false); + + $app->log('Running jailkit init for '.$site['document_root']); + if($jailkit_sections != '') $this->run_jk_init($site['document_root'], $jailkit_sections); + + $app->log('Running jailkit updates for '.$site['document_root']); + + $this->run_jk_update($site['document_root']); + if(preg_match('@(\d\d?\.\d\d?\.\d\d?)@', $site['fastcgi_php_version'], $matches)){ + if(!in_array('/opt/php-'.$matches[1].'/bin/php', $jailkit_programs)) $jailkit_programs[] = '/opt/php-'.$matches[1].'/bin/php'; + if(!in_array('/opt/php-'.$matches[1].'/include', $jailkit_programs)) $jailkit_programs[] = '/opt/php-'.$matches[1].'/include'; + if(!in_array('/opt/php-'.$matches[1].'/lib', $jailkit_programs)) $jailkit_programs[] = '/opt/php-'.$matches[1].'/lib'; + if(!in_array('/opt/th-php-libs', $jailkit_programs)) $jailkit_programs[] = '/opt/th-php-libs'; + + $set_php_symlink = true; + + } + if(is_array($jailkit_programs) && !empty($jailkit_programs)) $this->run_jk_cp($site['document_root'], $jailkit_programs); + $this->fix_broken_symlinks($site['document_root']); + + if($set_php_symlink){ + // create symlink from /usr/bin/php to current PHP version + if(preg_match('@(\d\d?\.\d\d?\.\d\d?)@', $site['fastcgi_php_version'], $matches) && (!file_exists($site['document_root'].'/usr/bin/php') || is_link($site['document_root'].'/usr/bin/php'))){ + @unlink($site['document_root'].'/usr/bin/php'); + @symlink('/opt/php-'.$matches[1].'/bin/php', $site['document_root'].'/usr/bin/php'); + } + } + + //* Protect web folders + $app->system->web_folder_protection($site['document_root'], true); + } + } + + if(file_exists('/dev/tty')){ + chmod('/dev/tty', 0666); + } + + parent::onRunJob(); + } + + private function run_jk_init($document_root, $sections){ + global $app; + + $return_var = $this->exec_log('/usr/sbin/jk_init -f -k -c /etc/jailkit/jk_init.ini -j '.escapeshellarg($document_root).' '.$sections); + + if ($return_var > 0) { + $app->log('jk_init failed with -j, trying again without -j', LOGLEVEL_DEBUG); + + $return_var = $this->exec_log('/usr/sbin/jk_init -f -k -c /etc/jailkit/jk_init.ini '.escapeshellarg($document_root).' '.$sections); + + if ($return_var > 0) { + $app->log('jk_init failed (with and without -j parameter)', LOGLEVEL_WARN); + } + } + } + + private function run_jk_update($document_root) { + global $app; + + $return_var = $this->exec_log('/usr/sbin/jk_update -j '.escapeshellarg($document_root)); + + if ($return_var > 0) { + $app->log('jk_update failed with -j, trying again without -j', LOGLEVEL_DEBUG); + $return_var = $this->exec_log('/usr/sbin/jk_update '.escapeshellarg($document_root)); + + if ($return_var > 0) { + $app->log('jk_update failed (with and without -j parameter)', LOGLEVEL_WARN); + } + } + } + + private function run_jk_cp($document_root, $programs) { + global $app; + + foreach($programs as $program) { + $program = trim($program); + if($program == ''){ + continue; + } + if (!file_exists($program)) { + continue; + } + + $return_var = $this->exec_log('/usr/sbin/jk_cp '.escapeshellarg($document_root).' '.escapeshellarg($program)); + + if ($return_var > 0) { + $app->log('jk_cp failed with -j, trying again with -j', LOGLEVEL_DEBUG); + $return_var = $this->exec_log('/usr/sbin/jk_cp '.escapeshellarg($document_root).' '.escapeshellarg($program)); + + if ($return_var > 0) { + $app->log('jk_cp failed (without and with -j parameter)', LOGLEVEL_WARN); + } + } + } + + if(file_exists($document_root.'/dev/tty')){ + chmod($document_root.'/dev/tty', 0666); + } + } + + private function fix_broken_symlinks($document_root){ + global $app; + + exec('cd '.escapeshellarg($document_root).' && find . -type l \( ! -name web \) -xtype l', $output, $retval); + + if(is_array($output) && !empty($output)){ + foreach($output as $link){ + $link = trim($link); + if(preg_match('@\.so(\.\d+)*$@',$link)){ + if(substr($link, 0, 1) == '.') $link = substr($link, 1); + //echo $link."\n"; + $path = $document_root.$link; + //if(is_link($path)) echo "Ist Link\n"; + //if(!file_exists($path)) echo "Aber Link ist kaputt!\n"; + if(is_link($path) && !file_exists($path)){ + //echo $path."\n"; + @unlink($path); + $this->run_jk_cp($document_root, array($link)); + } + } + } + } + } + + private function exec_log($cmd) { + global $app; + + $app->log("Running $cmd", LOGLEVEL_DEBUG); + + exec($cmd, $output, $return_var); + + if (count($output) > 0) { + $app->log("Output:\n" . implode("\n", $output), LOGLEVEL_DEBUG); + } + + return $return_var; + } + + /* this function is optional if it contains no custom code */ + public function onAfterRun() { + global $app; + + parent::onAfterRun(); + } + +} + +?> diff --git a/server/lib/classes/cron.d/900-letsencrypt.inc.php b/server/lib/classes/cron.d/900-letsencrypt.inc.php index d03d4a184a7c2626f7d05816c9aa628d80da14f4..1fc06f357162f491c1715443c4e6fb4745ab40ec 100644 --- a/server/lib/classes/cron.d/900-letsencrypt.inc.php +++ b/server/lib/classes/cron.d/900-letsencrypt.inc.php @@ -35,15 +35,11 @@ class cronjob_letsencrypt extends cronjob { /* this function is optional if it contains no custom code */ public function onPrepare() { - global $app; - parent::onPrepare(); } /* this function is optional if it contains no custom code */ public function onBeforeRun() { - global $app; - return parent::onBeforeRun(); } @@ -52,9 +48,19 @@ class cronjob_letsencrypt extends cronjob { $server_config = $app->getconf->get_server_config($conf['server_id'], 'server'); if(!isset($server_config['migration_mode']) || $server_config['migration_mode'] != 'y') { - $letsencrypt = explode("\n", shell_exec('which letsencrypt certbot /root/.local/share/letsencrypt/bin/letsencrypt /opt/eff.org/certbot/venv/bin/certbot')); - $letsencrypt = reset($letsencrypt); - if(is_executable($letsencrypt)) { + + $acme = $app->letsencrypt->get_acme_script(); + if($acme) { + // skip letsencrypt + parent::onRunJob(); + return; + } + + $letsencrypt = $app->letsencrypt->get_certbot_script(); + if($letsencrypt) { + $ret = null; + $val = 0; + $matches = array(); $version = exec($letsencrypt . ' --version 2>&1', $ret, $val); if(preg_match('/^(\S+|\w+)\s+(\d+(\.\d+)+)$/', $version, $matches)) { $type = strtolower($matches[1]); @@ -85,11 +91,7 @@ class cronjob_letsencrypt extends cronjob { /* this function is optional if it contains no custom code */ public function onAfterRun() { - global $app; - parent::onAfterRun(); } } - -?> diff --git a/server/lib/classes/functions.inc.php b/server/lib/classes/functions.inc.php index e36ed5b04f5f4b8853a2f35bcec5358d7dc9f09e..0470f4746d560c5913b15d1c18d96b4729ac716f 100644 --- a/server/lib/classes/functions.inc.php +++ b/server/lib/classes/functions.inc.php @@ -244,12 +244,6 @@ class functions { if(preg_match($regex, $result['ip'])) $ips[] = $result['ip']; } } - $results = $app->db->queryAllRecords("SELECT ip_address AS ip FROM openvz_ip"); - if(!empty($results) && is_array($results)){ - foreach($results as $result){ - if(preg_match($regex, $result['ip'])) $ips[] = $result['ip']; - } - } $results = $app->db->queryAllRecords("SELECT data AS ip FROM dns_rr WHERE type = 'A' OR type = 'AAAA'"); if(!empty($results) && is_array($results)){ foreach($results as $result){ @@ -303,6 +297,12 @@ class functions { } } } + + $tmp_ips = $app->plugins->raiseAction('get_server_ips', 0, true); + if(is_array($tmp_ips) && !empty($tmp_ips)) { + $ips = array_merge($ips, $tmp_ips); + } + $ips = array_unique($ips); sort($ips, SORT_NUMERIC); diff --git a/server/lib/classes/ispcmail.inc.php b/server/lib/classes/ispcmail.inc.php index 305b39f35ba47e235413cf4e364cdc4987cd6ce0..3ffabe8c4fc70cc12bdedff935cd47c0895d2059 100644 --- a/server/lib/classes/ispcmail.inc.php +++ b/server/lib/classes/ispcmail.inc.php @@ -740,32 +740,22 @@ class ispcmail { } if($this->use_smtp == true) { - if(!$this->_logged_in || !$this->_smtp_conn) { - $result = $this->_smtp_login(); - if(!$result) return false; - } $bcc_cc_sent = false; foreach($recipients as $recipname => $recip) { - if($this->_sent_mails >= $this->smtp_max_mails) { - // close connection to smtp and reconnect - $this->_sent_mails = 0; - $this->_smtp_close(); - $result = $this->_smtp_login(); - if(!$result) return false; - } - $this->_sent_mails += 1; + // Build mail headers, content etc. + + $m_recipients = array(); + $m_mail_content = ''; $recipname = trim(str_replace('"', '', $recipname)); $recip = $this->_encodeHeader($recip, $this->mail_charset); $recipname = $this->_encodeHeader($recipname, $this->mail_charset); //Email From - fputs($this->_smtp_conn, 'MAIL FROM: <' . $this->_mail_sender . '>' . $this->_crlf); - $response = fgets($this->_smtp_conn, 515); + $m_from = $this->_mail_sender; //Email To - fputs($this->_smtp_conn, 'RCPT TO: <' . $recip . '>' . $this->_crlf); - $response = fgets($this->_smtp_conn, 515); + $m_recipients[] = $recip; if($bcc_cc_sent == false) { $add_recips = array(); @@ -773,17 +763,12 @@ class ispcmail { if($this->getHeader('Bcc') != '') $add_recips = array_merge($add_recips, $this->_extract_names($this->getHeader('Bcc'))); foreach($add_recips as $add_recip) { if(!$add_recip['mail']) continue; - fputs($this->_smtp_conn, 'RCPT TO: <' . $this->_encodeHeader($add_recip['mail'], $this->mail_charset) . '>' . $this->_crlf); - $response = fgets($this->_smtp_conn, 515); + $m_recipients[] = $this->_encodeHeader($add_recip['mail'], $this->mail_charset); } unset($add_recips); $bcc_cc_sent = true; } - //The Email - fputs($this->_smtp_conn, 'DATA' . $this->_crlf); - $response = fgets($this->_smtp_conn, 515); - //Construct Headers if($recipname && !is_numeric($recipname)) $this->setHeader('To', $recipname . ' <' . $recip . '>'); else $this->setHeader('To', $recip); @@ -793,10 +778,32 @@ class ispcmail { if($this->getHeader('Cc') != '') $mail_content .= 'Cc: ' . $this->_encodeHeader($this->getHeader('Cc'), $this->mail_charset) . $this->_crlf; $mail_content .= implode($this->_crlf, $headers) . $this->_crlf . ($this->_is_signed == false ? $this->_crlf : '') . $this->body; - fputs($this->_smtp_conn, $mail_content . $this->_crlf . '.' . $this->_crlf); - $response = fgets($this->_smtp_conn, 515); + $m_mail_content = $mail_content; + + // Attempt SMTP login: + + if(!$this->_logged_in || !$this->_smtp_conn) { + $result = $this->_smtp_login(); + } + + if($this->_sent_mails >= $this->smtp_max_mails) { + // close connection to smtp and reconnect + $this->_sent_mails = 0; + $this->_smtp_close(); + $result = $this->_smtp_login(); + } + $this->_sent_mails += 1; + + // Send mail or queue it + + if ($result) { + $this->send_smtp($m_from, $m_recipients, $m_mail_content); + } else { + $this->add_to_queue($m_from, $m_recipients, $m_mail_content); + } + + // hopefully message was correctly sent or queued now - // hopefully message was correctly sent now $result = true; } } else { @@ -824,7 +831,87 @@ class ispcmail { return $result; } + /** + * Send all mails in queue (usually called from cron) + */ + public function send_queue() { + global $app; + + $mails = $app->db->queryAllRecords('SELECT * FROM sys_mailqueue'); + + if (is_array($mails)) { + foreach ($mails as $mail) { + // Open SMTP connections if not open: + + if(!$this->_logged_in || !$this->_smtp_conn) { + $result = $this->_smtp_login(); + } + + if($this->_sent_mails >= $this->smtp_max_mails) { + // close connection to smtp and reconnect + $this->_sent_mails = 0; + $this->_smtp_close(); + $result = $this->_smtp_login(); + } + $this->_sent_mails += 1; + + if (!$result) { + return false; + } + + // Send mail: + + $id = $mail['id']; + $from = $mail['from_address']; + $recipients = explode("\n", $mail['recipients']); + $mail_content = $mail['mail_content']; + + $this->send_smtp($from, $recipients, $mail_content); + + // Delete from queue: + + $app->db->query('DELETE FROM sys_mailqueue WHERE id = ?', $id); + } + } + } + + /** + * Send mail via SMTP + */ + private function send_smtp($from, $recipients, $mail_content) { + // from: + + fputs($this->_smtp_conn, 'MAIL FROM: <' . $from . '>' . $this->_crlf); + $response = fgets($this->_smtp_conn, 515); + + // recipients (To, Cc or Bcc): + + foreach ($recipients as $recipient) { + fputs($this->_smtp_conn, 'RCPT TO: <' . $recipient . '>' . $this->_crlf); + $response = fgets($this->_smtp_conn, 515); + } + + // mail content: + fputs($this->_smtp_conn, 'DATA' . $this->_crlf); + $response = fgets($this->_smtp_conn, 515); + + fputs($this->_smtp_conn, $mail_content . $this->_crlf . '.' . $this->_crlf); + $response = fgets($this->_smtp_conn, 515); + + // hopefully message was correctly sent now + $result = true; + + return $result; + } + + /** + * Add mail to queue for sending later + */ + private function add_to_queue($from, $recipients, $mail_content) { + global $app; + $app->db->query('INSERT INTO `sys_mailqueue` (`from_address`, `recipients`, `mail_content`) VALUES (?,?,?)', $from, implode("\n", $recipients), $mail_content); + } /** * Close mail connections diff --git a/server/lib/classes/ispconfig_addon_installer_base.inc.php b/server/lib/classes/ispconfig_addon_installer_base.inc.php new file mode 100644 index 0000000000000000000000000000000000000000..d5b02c65d37a6b786fb7c4e526a561bc7a694043 --- /dev/null +++ b/server/lib/classes/ispconfig_addon_installer_base.inc.php @@ -0,0 +1,213 @@ +addon_ident = preg_replace('/_addon_installer$/', '', get_called_class()); + } + + public function setAddonName($name) { + $this->addon_name = $name; + } + + public function setAddonIdent($ident) { + $this->addon_ident = $ident; + } + + public function setAddonVersion($version) { + $this->addon_version = $version; + } + + public function setAddonTempDir($path) { + $this->temp_dir = $path; + } + + protected function copyInterfaceFiles() { + global $app, $conf; + + $app->log('Copying interface files.', 0, false); + $install_dir = realpath($conf['rootpath'] . '/..'); + + if(is_dir($this->temp_dir . '/interface')) { + $ret = null; + $retval = 0; + $command = 'cp -rf ' . escapeshellarg($this->temp_dir . '/interface') . ' ' . escapeshellarg($install_dir . '/'); + exec($command, $ret, $retval); + if($retval != 0) { + $app->log('Copying interface files failed.', 2, false); + throw new AddonInstallerException('Command ' . $command . ' failed with code ' . $retval); + } + + return true; + } else { + return false; + } + } + + protected function copyServerFiles() { + global $app, $conf; + + $app->log('Copying server files.', 0, false); + + $install_dir = realpath($conf['rootpath'] . '/..'); + + if(is_dir($this->temp_dir . '/server')) { + $ret = null; + $retval = 0; + $command = 'cp -rf ' . escapeshellarg($this->temp_dir . '/server'). ' ' . escapeshellarg($install_dir . '/'); + exec($command, $ret, $retval); + if($retval != 0) { + $app->log('Copying interface files failed.', 2, false); + throw new AddonInstallerException('Command ' . $command . ' failed with code ' . $retval); + } + return true; + } else { + return false; + } + } + + protected function copyAddonFiles() { + global $app, $conf; + + $app->log('Copying addon files.', 0, false); + + $install_dir = realpath($conf['rootpath'] . '/..') . '/addons/' . $this->addon_ident; + if(!is_dir($install_dir)) { + if(!$app->system->mkdir($install_dir, false, 0750, true)) { + $app->log('Addons dir missing and could not be created.', 2, false); + throw new AddonInstallerException('Could not create addons dir ' . $install_dir); + } + } + + if(is_dir($this->temp_dir . '/install')) { + $ret = null; + $retval = 0; + $command = 'cp -rf ' . escapeshellarg($this->temp_dir . '/addon.ini') . ' ' . escapeshellarg($this->temp_dir . '/' . $this->addon_ident . '.addon.php') . ' ' . escapeshellarg($this->temp_dir . '/install'). ' ' . escapeshellarg($install_dir . '/'); + exec($command, $ret, $retval); + if($retval != 0) { + /* TODO: logging */ + $app->log('Warning or error on copying addon files. Returncode of command ' . $command . ' was: ' . $retval .'.', 0, false); + } + + return true; + } else { + return false; + } + } + + protected function executeSqlStatements() { + global $app, $conf; + + $incremental = false; + $check = $app->db->queryOneRecord('SELECT `db_version` FROM `addons` WHERE `addon_ident` = ?', $this->addon_ident); + if($check) { + $incremental = 0; + if($check['db_version']) { + $incremental = $check['db_version']; + $app->log('Current db version is ' . $incremental . '.', 0, false); + } + } + + include '/usr/local/ispconfig/server/lib/mysql_clientdb.conf'; + + $app->log('Adding addon entry to db.', 0, false); + // create addon entry if not existing + $qry = 'INSERT IGNORE INTO `addons` (`addon_ident`, `addon_version`, `addon_name`, `db_version`) VALUES (?, ?, ?, ?)'; + $app->db->query($qry, $this->addon_ident, $this->addon_version, $this->addon_name, 0); + + $mysql_command = 'mysql --default-character-set=' . escapeshellarg($conf['db_charset']) . ' --force -h ' . escapeshellarg($clientdb_host) . ' -u ' . escapeshellarg($clientdb_user) . ' -p' . escapeshellarg($clientdb_password) . ' -P ' . escapeshellarg($clientdb_port) . ' -D ' . escapeshellarg($conf['db_database']); + + if($incremental === false) { + $sql_file = $this->temp_dir . '/install/sql/' . $this->addon_ident . '.sql'; + if(is_file($sql_file)) { + $ret = null; + $retval = 0; + $app->log('Loading ' . $sql_file . ' into db.', 0, false); + exec($mysql_command . ' < ' . escapeshellarg($sql_file), $ret, $retval); + if($retval != 0) { + /* TODO: log error! */ + $app->log('Loading ' . $sql_file . ' into db failed.', 1, false); + } + } + } else { + $new_db_version = $incremental; + while(true) { + $sql_file = $this->temp_dir . '/install/sql/incremental/upd_' . str_pad($new_db_version + 1, '0', 5, STR_PAD_LEFT) . '.sql'; + if(!is_file($sql_file)) { + break; + } else { + $ret = null; + $retval = 0; + $app->log('Loading ' . $sql_file . ' into db.', 0, false); + exec($mysql_command . ' < ' . escapeshellarg($sql_file), $ret, $retval); + if($retval != 0) { + /* TODO: log error! */ + $app->log('Loading ' . $sql_file . ' into db failed.', 1, false); + } + } + + $new_db_version++; + } + + $app->db->query('UPDATE `addons` SET `addon_version` = ?, `db_version` = ? WHERE `addon_ident` = ?', $this->addon_version, $new_db_version, $this->addon_ident); + $app->log('Db version of addon is now ' . $new_db_version . '.', 0, false); + } + + return true; + } + + public function onBeforeInstall() { } + + public function onInstall() { + global $app; + + $app->log('Running onInstall()', 0, false); + $this->copyAddonFiles(); + $this->copyInterfaceFiles(); + $this->copyServerFiles(); + $this->executeSqlStatements(); + $app->log('Finished onInstall()', 0, false); + } + + public function onAfterInstall() { } + + public function onBeforeUpdate() { } + + public function onUpdate() { + global $app; + + $app->log('Running onUpdate()', 0, false); + $this->copyAddonFiles(); + $this->copyInterfaceFiles(); + $this->copyServerFiles(); + $this->executeSqlStatements(); + $app->log('Finished onUpdate()', 0, false); + } + + public function onAfterUpdate() { } + + + + public function onRaisedInstallerEvent($event_name, $data = false) { + + } +} + +class AddonInstallerException extends Exception { + public function __construct($message = "", $code = 0, $previous = null) { + parent::__construct($message, $code, $previous); + } +} + +class AddonInstallerValidationException extends AddonInstallerException { } \ No newline at end of file diff --git a/server/lib/classes/letsencrypt.inc.php b/server/lib/classes/letsencrypt.inc.php index 4f681cc4852e5ed1b08ee6ec05f0769b4883f2c1..e38d4df6468186441afeb5276650dc85b62177de 100644 --- a/server/lib/classes/letsencrypt.inc.php +++ b/server/lib/classes/letsencrypt.inc.php @@ -42,10 +42,118 @@ class letsencrypt { public function __construct(){ } + + public function get_acme_script() { + $acme = explode("\n", shell_exec('which /usr/local/ispconfig/server/scripts/acme.sh /root/.acme.sh/acme.sh')); + $acme = reset($acme); + if(is_executable($acme)) { + return $acme; + } else { + return false; + } + } + + public function get_acme_command($domains, $key_file, $bundle_file, $cert_file) { + + $letsencrypt = $this->get_acme_script(); + + $cmd = ''; + // generate cli format + foreach($domains as $domain) { + $cmd .= (string) " -d " . $domain; + } + + if($cmd == '') { + return false; + } + + $cmd = 'R=0 ; C=0 ; ' . $letsencrypt . ' --issue ' . $cmd . ' -w /usr/local/ispconfig/interface/acme ; R=$? ; if [[ $R -eq 0 || $R -eq 2 ]] ; then ' . $letsencrypt . ' --install-cert ' . $cmd . ' --key-file ' . escapeshellarg($key_file) . ' --fullchain-file ' . escapeshellarg($bundle_file) . ' --cert-file ' . escapeshellarg($cert_file) . ' --reloadcmd ' . escapeshellarg($this->get_reload_command()) . '; C=$? ; fi ; if [[ $C -eq 0 ]] ; then exit $R ; else exit $C ; fi'; + + return $cmd; + } + + public function get_certbot_script() { + $letsencrypt = explode("\n", shell_exec('which letsencrypt certbot /root/.local/share/letsencrypt/bin/letsencrypt /opt/eff.org/certbot/venv/bin/certbot')); + $letsencrypt = reset($letsencrypt); + if(is_executable($letsencrypt)) { + return $letsencrypt; + } else { + return false; + } + } + + private function install_acme() { + $install_cmd = 'wget -O - https://get.acme.sh | sh'; + $ret = null; + $val = 0; + exec($install_cmd . ' 2>&1', $ret, $val); + + return ($val == 0 ? true : false); + } + + private function get_reload_command() { + global $app, $conf; + + $web_config = $app->getconf->get_server_config($conf['server_id'], 'web'); + + $daemon = ''; + switch ($web_config['server_type']) { + case 'nginx': + $daemon = $web_config['server_type']; + break; + default: + if(is_file($conf['init_scripts'] . '/' . 'httpd24-httpd') || is_dir('/opt/rh/httpd24/root/etc/httpd')) { + $daemon = 'httpd24-httpd'; + } elseif(is_file($conf['init_scripts'] . '/' . 'httpd') || is_dir('/etc/httpd')) { + $daemon = 'httpd'; + } else { + $daemon = 'apache2'; + } + } + $cmd = $app->system->getinitcommand($daemon, 'force-reload'); + return $cmd; + } + + public function get_certbot_command($domains) { + + $letsencrypt = $this->get_certbot_script(); + + $cmd = ''; + // generate cli format + foreach($domains as $domain) { + $cmd .= (string) " --domains " . $domain; + } + + if($cmd == '') { + return false; + } + + $matches = array(); + $ret = null; + $val = 0; + $letsencrypt_version = exec($letsencrypt . ' --version 2>&1', $ret, $val); + if(preg_match('/^(\S+|\w+)\s+(\d+(\.\d+)+)$/', $letsencrypt_version, $matches)) { + $letsencrypt_version = $matches[2]; + } + if (version_compare($letsencrypt_version, '0.22', '>=')) { + $acme_version = 'https://acme-v02.api.letsencrypt.org/directory'; + } else { + $acme_version = 'https://acme-v01.api.letsencrypt.org/directory'; + } + + $cmd = $letsencrypt . " certonly -n --text --agree-tos --expand --authenticator webroot --server $acme_version --rsa-key-size 4096 --email postmaster@$domain $cmd --webroot-path /usr/local/ispconfig/interface/acme"; + + return $cmd; + } + public function get_letsencrypt_certificate_paths($domains = array()) { global $app; + if($this->get_acme_script()) { + return false; + } + if(empty($domains)) return false; if(!is_dir($this->renew_config_path)) return false; @@ -133,7 +241,10 @@ class letsencrypt { } private function get_ssl_domain($data) { + global $app; + $domain = $data['new']['ssl_domain']; + if(!$domain) $domain = $data['new']['domain']; if($data['new']['ssl'] == 'y' && $data['new']['ssl_letsencrypt'] == 'y') { @@ -149,8 +260,6 @@ class letsencrypt { } public function get_website_certificate_paths($data) { - global $app; - $ssl_dir = $data['new']['document_root'].'/ssl'; $domain = $this->get_ssl_domain($data); @@ -183,11 +292,17 @@ class letsencrypt { $web_config = $app->getconf->get_server_config($conf['server_id'], 'web'); $server_config = $app->getconf->get_server_config($conf['server_id'], 'server'); + $use_acme = false; + if($this->get_acme_script()) { + $use_acme = true; + } elseif(!$this->get_certbot_script()) { + // acme and le missing + $this->install_acme(); + } + $tmp = $app->letsencrypt->get_website_certificate_paths($data); $domain = $tmp['domain']; $key_file = $tmp['key']; - $key_file2 = $tmp['key2']; - $csr_file = $tmp['csr']; $crt_file = $tmp['crt']; $bundle_file = $tmp['bundle']; @@ -256,43 +371,42 @@ class letsencrypt { $app->log("There were " . $le_domain_count . " domains in the domain list. LE only supports 100, so we strip the rest.", LOGLEVEL_WARN); } - // generate cli format - foreach($temp_domains as $temp_domain) { - $cli_domain_arg .= (string) " --domains " . $temp_domain; - } - // unset useless data unset($subdomains); unset($aliasdomains); $letsencrypt_cmd = ''; + $allow_return_codes = null; + if($use_acme) { + $letsencrypt_cmd = $this->get_acme_command($temp_domains, $key_file, $bundle_file, $crt_file); + $allow_return_codes = array(2); + } else { + $letsencrypt_cmd = $this->get_certbot_command($temp_domains); + } + $success = false; - if(!empty($cli_domain_arg)) { + if($letsencrypt_cmd) { if(!isset($server_config['migration_mode']) || $server_config['migration_mode'] != 'y') { $app->log("Create Let's Encrypt SSL Cert for: $domain", LOGLEVEL_DEBUG); $app->log("Let's Encrypt SSL Cert domains: $cli_domain_arg", LOGLEVEL_DEBUG); - $letsencrypt = explode("\n", shell_exec('which letsencrypt certbot /root/.local/share/letsencrypt/bin/letsencrypt /opt/eff.org/certbot/venv/bin/certbot')); - $letsencrypt = reset($letsencrypt); - if(is_executable($letsencrypt)) { - $letsencrypt_version = exec($letsencrypt . ' --version 2>&1', $ret, $val); - if(preg_match('/^(\S+|\w+)\s+(\d+(\.\d+)+)$/', $letsencrypt_version, $matches)) { - $letsencrypt_version = $matches[2]; - } - if ($letsencrypt_version >=0.22) { - $acme_version = 'https://acme-v02.api.letsencrypt.org/directory'; - } else { - $acme_version = 'https://acme-v01.api.letsencrypt.org/directory'; - } - $letsencrypt_cmd = $letsencrypt . " certonly -n --text --agree-tos --expand --authenticator webroot --server $acme_version --rsa-key-size 4096 --email postmaster@$domain $cli_domain_arg --webroot-path /usr/local/ispconfig/interface/acme"; - $success = $app->system->_exec($letsencrypt_cmd); - } + $success = $app->system->_exec($letsencrypt_cmd, $allow_return_codes); } else { $app->log("Migration mode active, skipping Let's Encrypt SSL Cert creation for: $domain", LOGLEVEL_DEBUG); $success = true; } } + if($use_acme === true) { + if(!$success) { + $app->log('Let\'s Encrypt SSL Cert for: ' . $domain . ' could not be issued.', LOGLEVEL_WARN); + $app->log($letsencrypt_cmd, LOGLEVEL_WARN); + return false; + } else { + return true; + } + } + $le_files = $this->get_letsencrypt_certificate_paths($temp_domains); unset($temp_domains); @@ -369,4 +483,3 @@ class letsencrypt { } } -?> diff --git a/server/lib/classes/monitor_tools.inc.php b/server/lib/classes/monitor_tools.inc.php index 04f654ccde7a6deb2548a163cf80ff8c90cf067f..49d2ebe6026574e38a440abb4b5ca2406c151588 100644 --- a/server/lib/classes/monitor_tools.inc.php +++ b/server/lib/classes/monitor_tools.inc.php @@ -37,314 +37,335 @@ class monitor_tools { // Please do not forget to remove the swriteln(); - lines here at this file function get_distname() { - $distname = ''; - $distver = ''; - $distid = ''; - $distbaseid = ''; - - //** Debian or Ubuntu - if(file_exists('/etc/debian_version')) { - - // Check if this is Ubuntu and not Debian - if (strstr(trim(file_get_contents('/etc/issue')), 'Ubuntu') || (is_file('/etc/os-release') && stristr(file_get_contents('/etc/os-release'), 'Ubuntu'))) { - - $issue = file_get_contents('/etc/issue'); - - // Use content of /etc/issue file - if(strstr($issue,'Ubuntu')) { - if (strstr(trim($issue), 'LTS')) { - $lts=" LTS"; + $distname = ''; + $distver = ''; + $distid = ''; + $distbaseid = ''; + $distsupported = false; + + //** Debian or Ubuntu + if(file_exists('/etc/debian_version')) { + + // Check if this is Ubuntu and not Debian + if (strstr(trim(file_get_contents('/etc/issue')), 'Ubuntu') || (is_file('/etc/os-release') && stristr(file_get_contents('/etc/os-release'), 'Ubuntu'))) { + + $issue = file_get_contents('/etc/issue'); + + // Use content of /etc/issue file + if(strstr($issue,'Ubuntu')) { + if (strstr(trim($issue), 'LTS')) { + $lts=" LTS"; + } else { + $lts=""; + } + + $distname = 'Ubuntu'; + $distid = 'debian40'; + $distbaseid = 'debian'; + $ver = explode(' ', $issue); + $ver = array_filter($ver); + $ver = next($ver); + $mainver = explode('.', $ver); + $mainver = array_filter($mainver); + $mainver = current($mainver).'.'.next($mainver); + // Use content of /etc/os-release file } else { - $lts=""; - } + $os_release = file_get_contents('/etc/os-release'); + if (strstr(trim($os_release), 'LTS')) { + $lts = " LTS"; + } else { + $lts = ""; + } - $distname = 'Ubuntu'; + $distname = 'Ubuntu'; + $distid = 'debian40'; + $distbaseid = 'debian'; + + preg_match("/.*VERSION=\"(.*)\".*/ui", $os_release, $ver); + $ver = str_replace("LTS", "", $ver[1]); + $ver = explode(" ", $ver, 2); + $ver = reset($ver); + $mainver = $ver; + $mainver = explode('.', $ver); + $mainver = array_filter($mainver); + $mainver = current($mainver).'.'.next($mainver); + } + switch ($mainver){ + case "18.04": + $relname = "(Bionic Beaver)"; + $distconfid = 'ubuntu1804'; + $distsupported = true; + break; + case "17.10": + $relname = "(Artful Aardvark)"; + $distconfid = 'ubuntu1710'; + $distsupported = true; + break; + case "17.04": + $relname = "(Zesty Zapus)"; + $distconfid = 'ubuntu1604'; + $distsupported = true; + break; + case "16.10": + $relname = "(Yakkety Yak)"; + $distconfid = 'ubuntu1604'; + $distsupported = true; + break; + case "16.04": + $relname = "(Xenial Xerus)"; + $distconfid = 'ubuntu1604'; + $distsupported = true; + break; + case "15.10": + $relname = "(Wily Werewolf)"; + break; + case "15.04": + $relname = "(Vivid Vervet)"; + break; + case "14.10": + $relname = "(Utopic Unicorn)"; + break; + case "14.04": + $relname = "(Trusty Tahr)"; + break; + case "13.10": + $relname = "(Saucy Salamander)"; + break; + case "13.04": + $relname = "(Raring Ringtail)"; + break; + case "12.10": + $relname = "(Quantal Quetzal)"; + break; + case "12.04": + $relname = "(Precise Pangolin)"; + break; + case "11.10": + $relname = "(Oneiric Ocelot)"; + break; + case "11.14": + $relname = "(Natty Narwhal)"; + break; + case "10.10": + $relname = "(Maverick Meerkat)"; + break; + case "10.04": + $relname = "(Lucid Lynx)"; + break; + case "9.10": + $relname = "(Karmic Koala)"; + break; + case "9.04": + $relname = "(Jaunty Jackpole)"; + break; + case "8.10": + $relname = "(Intrepid Ibex)"; + break; + case "8.04": + $relname = "(Hardy Heron)"; + break; + case "7.10": + $relname = "(Gutsy Gibbon)"; + break; + case "7.04": + $relname = "(Feisty Fawn)"; + break; + case "6.10": + $relname = "(Edgy Eft)"; + break; + case "6.06": + $relname = "(Dapper Drake)"; + break; + case "5.10": + $relname = "(Breezy Badger)"; + break; + case "5.04": + $relname = "(Hoary Hedgehog)"; + break; + case "4.10": + $relname = "(Warty Warthog)"; + break; + default: + $relname = "UNKNOWN"; + $distconfid = 'ubuntu1604'; + } + $distver = $ver.$lts." ".$relname; + } elseif(trim(file_get_contents('/etc/debian_version')) == '4.0') { + $distname = 'Debian'; + $distver = '4.0'; $distid = 'debian40'; $distbaseid = 'debian'; - $ver = explode(' ', $issue); - $ver = array_filter($ver); - $ver = next($ver); - $mainver = explode('.', $ver); - $mainver = array_filter($mainver); - $mainver = current($mainver).'.'.next($mainver); - // Use content of /etc/os-release file - } else { - $os_release = file_get_contents('/etc/os-release'); - if (strstr(trim($os_release), 'LTS')) { - $lts = " LTS"; - } else { - $lts = ""; - } - - $distname = 'Ubuntu'; + } elseif(strstr(trim(file_get_contents('/etc/debian_version')), '5.0')) { + $distname = 'Debian'; + $distver = 'Lenny'; $distid = 'debian40'; $distbaseid = 'debian'; - - preg_match("/.*VERSION=\"(.*)\".*/ui", $os_release, $ver); - $ver = str_replace("LTS", "", $ver[1]); - $ver = explode(" ", $ver, 2); - $ver = reset($ver); - $mainver = $ver; + } elseif(strstr(trim(file_get_contents('/etc/debian_version')), '6.0') || trim(file_get_contents('/etc/debian_version')) == 'squeeze/sid') { + $distname = 'Debian'; + $distver = 'Squeeze/Sid'; + $distid = 'debian60'; + $distbaseid = 'debian'; + } elseif(strstr(trim(file_get_contents('/etc/debian_version')), '7.0') || substr(trim(file_get_contents('/etc/debian_version')),0,2) == '7.' || trim(file_get_contents('/etc/debian_version')) == 'wheezy/sid') { + $distname = 'Debian'; + $distver = 'Wheezy/Sid'; + $distid = 'debian60'; + $distbaseid = 'debian'; + } elseif(strstr(trim(file_get_contents('/etc/debian_version')), '8') || substr(trim(file_get_contents('/etc/debian_version')),0,1) == '8') { + $distname = 'Debian'; + $distver = 'Jessie'; + $distid = 'debian60'; + $distbaseid = 'debian'; + $distsupported = true; + } elseif(strstr(trim(file_get_contents('/etc/debian_version')), '9') || substr(trim(file_get_contents('/etc/debian_version')),0,1) == '9') { + $distname = 'Debian'; + $distver = 'Stretch'; + $distconfid = 'debian90'; + $distid = 'debian60'; + $distbaseid = 'debian'; + $distsupported = true; + } elseif(strstr(trim(file_get_contents('/etc/debian_version')), '/sid')) { + $distname = 'Debian'; + $distver = 'Testing'; + $distid = 'debian60'; + $distconfid = 'debiantesting'; + $distbaseid = 'debian'; + $distsupported = true; + } else { + $distname = 'Debian'; + $distver = 'Unknown'; + $distid = 'debian60'; + $distconfid = 'debian90'; + $distbaseid = 'debian'; + $distsupported = true; } - switch ($mainver){ - case "18.04": - $relname = "(Bionic Beaver)"; - $distconfid = 'ubuntu1804'; - break; - case "17.10": - $relname = "(Artful Aardvark)"; - $distconfid = 'ubuntu1710'; - break; - case "17.04": - $relname = "(Zesty Zapus)"; - $distconfid = 'ubuntu1604'; - break; - case "16.10": - $relname = "(Yakkety Yak)"; - $distconfid = 'ubuntu1604'; - break; - case "16.04": - $relname = "(Xenial Xerus)"; - $distconfid = 'ubuntu1604'; - break; - case "15.10": - $relname = "(Wily Werewolf)"; - break; - case "15.04": - $relname = "(Vivid Vervet)"; - break; - case "14.10": - $relname = "(Utopic Unicorn)"; - break; - case "14.04": - $relname = "(Trusty Tahr)"; - break; - case "13.10": - $relname = "(Saucy Salamander)"; - break; - case "13.04": - $relname = "(Raring Ringtail)"; - break; - case "12.10": - $relname = "(Quantal Quetzal)"; - break; - case "12.04": - $relname = "(Precise Pangolin)"; - break; - case "11.10": - $relname = "(Oneiric Ocelot)"; - break; - case "11.14": - $relname = "(Natty Narwhal)"; - break; - case "10.10": - $relname = "(Maverick Meerkat)"; - break; - case "10.04": - $relname = "(Lucid Lynx)"; - break; - case "9.10": - $relname = "(Karmic Koala)"; - break; - case "9.04": - $relname = "(Jaunty Jackpole)"; - break; - case "8.10": - $relname = "(Intrepid Ibex)"; - break; - case "8.04": - $relname = "(Hardy Heron)"; - break; - case "7.10": - $relname = "(Gutsy Gibbon)"; - break; - case "7.04": - $relname = "(Feisty Fawn)"; - break; - case "6.10": - $relname = "(Edgy Eft)"; - break; - case "6.06": - $relname = "(Dapper Drake)"; - break; - case "5.10": - $relname = "(Breezy Badger)"; - break; - case "5.04": - $relname = "(Hoary Hedgehog)"; - break; - case "4.10": - $relname = "(Warty Warthog)"; - break; - default: - $relname = "UNKNOWN"; + } + + //** Devuan + elseif(file_exists('/etc/devuan_version')) { + if(false !== strpos(trim(file_get_contents('/etc/devuan_version')), 'jessie')) { + $distname = 'Devuan'; + $distver = 'Jessie'; + $distid = 'debian60'; + $distbaseid = 'debian'; + } elseif(false !== strpos(trim(file_get_contents('/etc/devuan_version')), 'ceres')) { + $distname = 'Devuan'; + $distver = 'Ceres'; + $distid = 'debiantesting'; + $distbaseid = 'debian'; + $distsupported = true; } - $distver = $ver.$lts." ".$relname; - } elseif(trim(file_get_contents('/etc/debian_version')) == '4.0') { - $distname = 'Debian'; - $distver = '4.0'; - $distid = 'debian40'; - $distbaseid = 'debian'; - } elseif(strstr(trim(file_get_contents('/etc/debian_version')), '5.0')) { - $distname = 'Debian'; - $distver = 'Lenny'; - $distid = 'debian40'; - $distbaseid = 'debian'; - } elseif(strstr(trim(file_get_contents('/etc/debian_version')), '6.0') || trim(file_get_contents('/etc/debian_version')) == 'squeeze/sid') { - $distname = 'Debian'; - $distver = 'Squeeze/Sid'; - $distid = 'debian60'; - $distbaseid = 'debian'; - } elseif(strstr(trim(file_get_contents('/etc/debian_version')), '7.0') || substr(trim(file_get_contents('/etc/debian_version')),0,2) == '7.' || trim(file_get_contents('/etc/debian_version')) == 'wheezy/sid') { - $distname = 'Debian'; - $distver = 'Wheezy/Sid'; - $distid = 'debian60'; - $distbaseid = 'debian'; - } elseif(strstr(trim(file_get_contents('/etc/debian_version')), '8') || substr(trim(file_get_contents('/etc/debian_version')),0,1) == '8') { - $distname = 'Debian'; - $distver = 'Jessie'; - $distid = 'debian60'; - $distbaseid = 'debian'; - } elseif(strstr(trim(file_get_contents('/etc/debian_version')), '9') || substr(trim(file_get_contents('/etc/debian_version')),0,1) == '9') { - $distname = 'Debian'; - $distver = 'Stretch'; - $distconfid = 'debian90'; - $distid = 'debian60'; - $distbaseid = 'debian'; - } elseif(strstr(trim(file_get_contents('/etc/debian_version')), '/sid')) { - $distname = 'Debian'; - $distver = 'Testing'; - $distid = 'debian60'; - $distconfid = 'debiantesting'; - $distbaseid = 'debian'; - } else { - $distname = 'Debian'; - $distver = 'Unknown'; - $distid = 'debian40'; - $distbaseid = 'debian'; } - } - //** Devuan - elseif(file_exists('/etc/devuan_version')) { - if(false !== strpos(trim(file_get_contents('/etc/devuan_version')), 'jessie')) { - $distname = 'Devuan'; - $distver = 'Jessie'; - $distid = 'debian60'; - $distbaseid = 'debian'; - } elseif(false !== strpos(trim(file_get_contents('/etc/devuan_version')), 'ceres')) { - $distname = 'Devuan'; - $distver = 'Testing'; - $distid = 'debiantesting'; - $distbaseid = 'debian'; - } - } - - //** OpenSuSE - elseif(file_exists('/etc/SuSE-release')) { - if(stristr(file_get_contents('/etc/SuSE-release'), '11.0')) { - $distname = 'openSUSE'; - $distver = '11.0'; - $distid = 'opensuse110'; - $distbaseid = 'opensuse'; - } elseif(stristr(file_get_contents('/etc/SuSE-release'), '11.1')) { - $distname = 'openSUSE'; - $distver = '11.1'; - $distid = 'opensuse110'; - $distbaseid = 'opensuse'; - } elseif(stristr(file_get_contents('/etc/SuSE-release'), '11.2')) { - $distname = 'openSUSE'; - $distver = '11.2'; - $distid = 'opensuse112'; - $distbaseid = 'opensuse'; - } else { - $distname = 'openSUSE'; - $distver = 'Unknown'; - $distid = 'opensuse112'; - $distbaseid = 'opensuse'; + //** OpenSuSE + elseif(file_exists('/etc/SuSE-release')) { + if(stristr(file_get_contents('/etc/SuSE-release'), '11.0')) { + $distname = 'openSUSE'; + $distver = '11.0'; + $distid = 'opensuse110'; + $distbaseid = 'opensuse'; + } elseif(stristr(file_get_contents('/etc/SuSE-release'), '11.1')) { + $distname = 'openSUSE'; + $distver = '11.1'; + $distid = 'opensuse110'; + $distbaseid = 'opensuse'; + } elseif(stristr(file_get_contents('/etc/SuSE-release'), '11.2')) { + $distname = 'openSUSE'; + $distver = '11.2'; + $distid = 'opensuse112'; + $distbaseid = 'opensuse'; + $distsupported = true; + } else { + $distname = 'openSUSE'; + $distver = 'Unknown'; + $distid = 'opensuse112'; + $distbaseid = 'opensuse'; + $distsupported = true; + } } - } - //** Redhat - elseif(file_exists('/etc/redhat-release')) { - - $content = file_get_contents('/etc/redhat-release'); - - if(stristr($content, 'Fedora release 9 (Sulphur)')) { - $distname = 'Fedora'; - $distver = '9'; - $distid = 'fedora9'; - $distbaseid = 'fedora'; - } elseif(stristr($content, 'Fedora release 10 (Cambridge)')) { - $distname = 'Fedora'; - $distver = '10'; - $distid = 'fedora9'; - $distbaseid = 'fedora'; - } elseif(stristr($content, 'Fedora release 10')) { - $distname = 'Fedora'; - $distver = '11'; - $distid = 'fedora9'; - $distbaseid = 'fedora'; - } elseif(stristr($content, 'CentOS release 5.2 (Final)')) { - $distname = 'CentOS'; - $distver = '5.2'; - $distid = 'centos52'; - $distbaseid = 'fedora'; - } elseif(stristr($content, 'CentOS release 5.3 (Final)')) { - $distname = 'CentOS'; - $distver = '5.3'; - $distid = 'centos53'; - $distbaseid = 'fedora'; - } elseif(stristr($content, 'CentOS release 5')) { - $distname = 'CentOS'; - $distver = '5'; - $distid = 'centos53'; - $distbaseid = 'fedora'; - } elseif(stristr($content, 'CentOS Linux release 6') || stristr($content, 'CentOS release 6')) { - $distname = 'CentOS'; - $distver = '6'; - $distid = 'centos53'; - $distbaseid = 'fedora'; - } elseif(stristr($content, 'CentOS Linux release 7')) { - $distname = 'CentOS'; - $distver = 'Unknown'; - $distbaseid = 'fedora'; - $var=explode(" ", $content); - $var=explode(".", $var[3]); - $var=$var[0].".".$var[1]; - if($var=='7.0' || $var=='7.1') { - $distid = 'centos70'; + //** Redhat + elseif(file_exists('/etc/redhat-release')) { + + $content = file_get_contents('/etc/redhat-release'); + + if(stristr($content, 'Fedora release 9 (Sulphur)')) { + $distname = 'Fedora'; + $distver = '9'; + $distid = 'fedora9'; + $distbaseid = 'fedora'; + } elseif(stristr($content, 'Fedora release 10 (Cambridge)')) { + $distname = 'Fedora'; + $distver = '10'; + $distid = 'fedora9'; + $distbaseid = 'fedora'; + } elseif(stristr($content, 'Fedora release 10')) { + $distname = 'Fedora'; + $distver = '11'; + $distid = 'fedora9'; + $distbaseid = 'fedora'; + } elseif(stristr($content, 'CentOS release 5.2 (Final)')) { + $distname = 'CentOS'; + $distver = '5.2'; + $distid = 'centos52'; + $distbaseid = 'fedora'; + $distsupported = true; + } elseif(stristr($content, 'CentOS release 5.3 (Final)')) { + $distname = 'CentOS'; + $distver = '5.3'; + $distid = 'centos53'; + $distbaseid = 'fedora'; + } elseif(stristr($content, 'CentOS release 5')) { + $distname = 'CentOS'; + $distver = 'Unknown'; + $distid = 'centos53'; + $distbaseid = 'fedora'; + } elseif(stristr($content, 'CentOS Linux release 6') || stristr($content, 'CentOS release 6')) { + $distname = 'CentOS'; + $distver = 'Unknown'; + $distid = 'centos53'; + $distbaseid = 'fedora'; + } elseif(stristr($content, 'CentOS Linux release 7')) { + $distname = 'CentOS'; + $distver = 'Unknown'; + $distbaseid = 'fedora'; + $var=explode(" ", $content); + $var=explode(".", $var[3]); + $var=$var[0].".".$var[1]; + $distver = $var; + $distsupported = true; + if($var=='7.0' || $var=='7.1') { + $distid = 'centos70'; + } else { + $distid = 'centos72'; + } } else { - $distid = 'centos72'; + $distname = 'Redhat'; + $distver = 'Unknown'; + $distid = 'fedora9'; + $distbaseid = 'fedora'; } - } else { - $distname = 'Redhat'; - $distver = 'Unknown'; - $distid = 'fedora9'; - $distbaseid = 'fedora'; } - } - //** Gentoo - elseif(file_exists('/etc/gentoo-release')) { + //** Gentoo + elseif(file_exists('/etc/gentoo-release')) { - $content = file_get_contents('/etc/gentoo-release'); + $content = file_get_contents('/etc/gentoo-release'); - preg_match_all('/([0-9]{1,2})/', $content, $version); - $distname = 'Gentoo'; - $distver = $version[0][0].$version[0][1]; - $distid = 'gentoo'; - $distbaseid = 'gentoo'; + preg_match_all('/([0-9]{1,2})/', $content, $version); + $distname = 'Gentoo'; + $distver = $version[0][0].$version[0][1]; + $distid = 'gentoo'; + $distbaseid = 'gentoo'; + $distsupported = true; + } else { + die('Unrecognized GNU/Linux distribution'); + } - } else { - die('Unrecognized GNU/Linux distribution'); - } - - // Set $distconfid to distid, if no different id for the config is defined - if(!isset($distconfid)) $distconfid = $distid; + // Set $distconfid to distid, if no different id for the config is defined + if(!isset($distconfid)) $distconfid = $distid; - return array('name' => $distname, 'version' => $distver, 'id' => $distid, 'confid' => $distconfid, 'baseid' => $distbaseid); + return array('name' => $distname, 'version' => $distver, 'id' => $distid, 'confid' => $distconfid, 'baseid' => $distbaseid, 'supported' => $distsupported); } // this function remains in the tools class, because it is used by cron AND rescue @@ -454,16 +475,6 @@ class monitor_tools { $state = 'error'; // because service is down } } -/* - $data['mongodbserver'] = -1; - if ($this->_checkTcp('localhost', 27017)) { - $data['mongodbserver'] = 1; - } else { - $data['mongodbserver'] = 0; -*/ - //$state = 'error'; // because service is down - /* TODO!!! check if this is a mongodbserver at all, otherwise it will always throw an error state!!! */ -// } /* * Return the Result @@ -598,9 +609,6 @@ class monitor_tools { $logfile = '/var/log/fail2ban.log'; } break; - case 'log_mongodb': - $logfile = '/var/log/mongodb/mongodb.log'; - break; case 'log_ispconfig': if ($dist == 'debian') { $logfile = $conf['ispconfig_log_dir'] . '/ispconfig.log'; diff --git a/server/lib/classes/openvz_tools.inc.php b/server/lib/classes/openvz_tools.inc.php deleted file mode 100644 index 16dc601e252630f2966d69fa49d5721cee9c9e7d..0000000000000000000000000000000000000000 --- a/server/lib/classes/openvz_tools.inc.php +++ /dev/null @@ -1,153 +0,0 @@ -isOpenVzHost()) { - return array(); - } - /* - * if it is a OpenVz-Host, we first have to get the VE - List and then parse it to a array - */ - $output = shell_exec('vzlist -a'); - - /* transfer this output-string into a array */ - $outputArray = explode("\n", $output); - - /* the first list of the output is not needed */ - array_shift($outputArray); - - /* now process all items of the rest */ - $res = array(); - foreach ($outputArray as $item) { - /* - * eliminate all doubled spaces and spaces at the beginning and end - */ - while (strpos($item, ' ') !== false) { - $item = str_replace(' ', ' ', $item); - } - $item = trim($item); - - /* - * Now get every token and insert it to the array - */ - if ($item != '') { - $tmp = explode(' ', $item); - $tmpRes['veid'] = $tmp[0]; - $tmpRes['nproc'] = $tmp[1]; - $tmpRes['status'] = $tmp[2]; - $tmpRes['ip_addr'] = $tmp[3]; - $tmpRes['hostname'] = $tmp[4]; - $res[] = $tmpRes; - } - } - - /* ready */ - return $res; - } - - /** - * Return information about the user_beancounters of this VE - */ - public function getOpenVzVeBeanCounter() { - /* - * If it is not a OpenVz - VE, we need no beancounter, because we use the beancounter - * "inside" of each VE - */ - if (!$this->isOpenVzVe()) { - return ""; - } - /* - * if it is a OpenVz-VE, we get the output to a string - */ - $res = file_get_contents('/proc/user_beancounters'); - - /* ready */ - return $res; - } - -} - -?> diff --git a/server/lib/classes/plugin_webserver_apache.inc.php b/server/lib/classes/plugin_webserver_apache.inc.php new file mode 100644 index 0000000000000000000000000000000000000000..027a8f18ab5723fd024700911b64e3ae52f75c14 --- /dev/null +++ b/server/lib/classes/plugin_webserver_apache.inc.php @@ -0,0 +1,500 @@ +getconf->get_server_config($conf['server_id'], 'web'); + + // Rewrite rules + $rewrite_rules = array(); + $rewrite_wildcard_rules = array(); + if($data['new']['redirect_type'] != '' && $data['new']['redirect_path'] != '') { + if(substr($data['new']['redirect_path'], -1) != '/' && !preg_match('/^(https?|\[scheme\]):\/\//', $data['new']['redirect_path'])) $data['new']['redirect_path'] .= '/'; + if(substr($data['new']['redirect_path'], 0, 8) == '[scheme]'){ + $rewrite_target = 'http'.substr($data['new']['redirect_path'], 8); + $rewrite_target_ssl = 'https'.substr($data['new']['redirect_path'], 8); + } else { + $rewrite_target = $data['new']['redirect_path']; + $rewrite_target_ssl = $data['new']['redirect_path']; + } + /* Disabled path extension + if($data['new']['redirect_type'] == 'no' && substr($data['new']['redirect_path'],0,4) != 'http') { + $data['new']['redirect_path'] = $data['new']['document_root'].'/web'.realpath($data['new']['redirect_path']).'/'; + } + */ + + switch($data['new']['subdomain']) { + case 'www': + $rewrite_rules[] = array( 'rewrite_domain' => '^'.$this->_rewrite_quote($data['new']['domain']), + 'rewrite_type' => ($data['new']['redirect_type'] == 'no')?'':'['.$data['new']['redirect_type'].']', + 'rewrite_target' => $rewrite_target, + 'rewrite_target_ssl' => $rewrite_target_ssl, + 'rewrite_is_url' => ($this->_is_url($rewrite_target) ? 'y' : 'n'), + 'rewrite_add_path' => (substr($rewrite_target, -1) == '/' ? 'y' : 'n')); + $rewrite_rules[] = array( 'rewrite_domain' => '^' . $this->_rewrite_quote('www.'.$data['new']['domain']), + 'rewrite_type' => ($data['new']['redirect_type'] == 'no')?'':'['.$data['new']['redirect_type'].']', + 'rewrite_target' => $rewrite_target, + 'rewrite_target_ssl' => $rewrite_target_ssl, + 'rewrite_is_url' => ($this->_is_url($rewrite_target) ? 'y' : 'n'), + 'rewrite_add_path' => (substr($rewrite_target, -1) == '/' ? 'y' : 'n')); + break; + case '*': + $rewrite_wildcard_rules[] = array( 'rewrite_domain' => '(^|\.)'.$this->_rewrite_quote($data['new']['domain']), + 'rewrite_type' => ($data['new']['redirect_type'] == 'no')?'':'['.$data['new']['redirect_type'].']', + 'rewrite_target' => $rewrite_target, + 'rewrite_target_ssl' => $rewrite_target_ssl, + 'rewrite_is_url' => ($this->_is_url($rewrite_target) ? 'y' : 'n'), + 'rewrite_add_path' => (substr($rewrite_target, -1) == '/' ? 'y' : 'n')); + break; + default: + $rewrite_rules[] = array( 'rewrite_domain' => '^'.$this->_rewrite_quote($data['new']['domain']), + 'rewrite_type' => ($data['new']['redirect_type'] == 'no')?'':'['.$data['new']['redirect_type'].']', + 'rewrite_target' => $rewrite_target, + 'rewrite_target_ssl' => $rewrite_target_ssl, + 'rewrite_is_url' => ($this->_is_url($rewrite_target) ? 'y' : 'n'), + 'rewrite_add_path' => (substr($rewrite_target, -1) == '/' ? 'y' : 'n')); + } + } + + $server_alias = array(); + $client = $app->dbmaster->queryOneRecord('SELECT client_id FROM sys_group WHERE sys_group.groupid = ?', $data['new']['sys_groupid']); + $client_id = intval($client['client_id']); + unset($client); + + // get autoalias + $auto_alias = $web_config['website_autoalias']; + if($auto_alias != '') { + // get the client username + $client = $app->db->queryOneRecord("SELECT `username` FROM `client` WHERE `client_id` = ?", $client_id); + $aa_search = array('[client_id]', '[website_id]', '[client_username]', '[website_domain]'); + $aa_replace = array($client_id, $data['new']['domain_id'], $client['username'], $data['new']['domain']); + $auto_alias = str_replace($aa_search, $aa_replace, $auto_alias); + unset($client); + unset($aa_search); + unset($aa_replace); + $server_alias[] .= $auto_alias; + } + + // get alias domains (co-domains and subdomains) + $aliases = $app->db->queryAllRecords("SELECT * FROM web_domain WHERE parent_domain_id = ? AND active = 'y' AND (type != 'vhostsubdomain' AND type != 'vhostalias')", $data['new']['domain_id']); + $alias_seo_redirects = array(); + switch($data['new']['subdomain']) { + case 'www': + $server_alias[] = 'www.'.$data['new']['domain']; + break; + case '*': + $server_alias[] = '*.'.$data['new']['domain']; + break; + } + if(is_array($aliases)) { + foreach($aliases as $alias) { + switch($alias['subdomain']) { + case 'www': + $server_alias[] .= 'www.'.$alias['domain'].' '.$alias['domain']; + break; + case '*': + $server_alias[] .= '*.'.$alias['domain'].' '.$alias['domain']; + break; + default: + $server_alias[] .= $alias['domain']; + break; + } + $app->log('Add server alias: '.$alias['domain'], LOGLEVEL_DEBUG); + + // Add SEO redirects for alias domains + if($alias['seo_redirect'] != '' && $data['new']['seo_redirect'] != '*_to_www_domain_tld' && $data['new']['seo_redirect'] != '*_to_domain_tld' && ($alias['type'] == 'alias' || ($alias['type'] == 'subdomain' && $data['new']['seo_redirect'] != '*_domain_tld_to_www_domain_tld' && $data['new']['seo_redirect'] != '*_domain_tld_to_domain_tld'))){ + $tmp_seo_redirects = $this->get_seo_redirects($alias, 'alias_', false, 'apache'); + if(is_array($tmp_seo_redirects) && !empty($tmp_seo_redirects)){ + $alias_seo_redirects[] = $tmp_seo_redirects; + } + } + + // Rewriting + if($alias['redirect_type'] != '' && $alias['redirect_path'] != '') { + if(substr($alias['redirect_path'], -1) != '/' && !preg_match('/^(https?|\[scheme\]):\/\//', $alias['redirect_path'])) $alias['redirect_path'] .= '/'; + if(substr($alias['redirect_path'], 0, 8) == '[scheme]'){ + $rewrite_target = 'http'.substr($alias['redirect_path'], 8); + $rewrite_target_ssl = 'https'.substr($alias['redirect_path'], 8); + } else { + $rewrite_target = $alias['redirect_path']; + $rewrite_target_ssl = $alias['redirect_path']; + } + + switch($alias['subdomain']) { + case 'www': + $rewrite_rules[] = array( 'rewrite_domain' => '^'.$this->_rewrite_quote($alias['domain']), + 'rewrite_type' => ($alias['redirect_type'] == 'no')?'':'['.$alias['redirect_type'].']', + 'rewrite_target' => $rewrite_target, + 'rewrite_target_ssl' => $rewrite_target_ssl, + 'rewrite_is_url' => ($this->_is_url($rewrite_target) ? 'y' : 'n'), + 'rewrite_add_path' => (substr($rewrite_target, -1) == '/' ? 'y' : 'n')); + $rewrite_rules[] = array( 'rewrite_domain' => '^' . $this->_rewrite_quote('www.'.$alias['domain']), + 'rewrite_type' => ($alias['redirect_type'] == 'no')?'':'['.$alias['redirect_type'].']', + 'rewrite_target' => $rewrite_target, + 'rewrite_target_ssl' => $rewrite_target_ssl, + 'rewrite_is_url' => ($this->_is_url($rewrite_target) ? 'y' : 'n'), + 'rewrite_add_path' => (substr($rewrite_target, -1) == '/' ? 'y' : 'n')); + break; + case '*': + $rewrite_wildcard_rules[] = array( 'rewrite_domain' => '(^|\.)'.$this->_rewrite_quote($alias['domain']), + 'rewrite_type' => ($alias['redirect_type'] == 'no')?'':'['.$alias['redirect_type'].']', + 'rewrite_target' => $rewrite_target, + 'rewrite_target_ssl' => $rewrite_target_ssl, + 'rewrite_is_url' => ($this->_is_url($rewrite_target) ? 'y' : 'n'), + 'rewrite_add_path' => (substr($rewrite_target, -1) == '/' ? 'y' : 'n')); + break; + default: + if(substr($alias['domain'], 0, 2) === '*.') $domain_rule = '(^|\.)'.$this->_rewrite_quote(substr($alias['domain'], 2)); + else $domain_rule = '^'.$this->_rewrite_quote($alias['domain']); + $rewrite_rules[] = array( 'rewrite_domain' => $domain_rule, + 'rewrite_type' => ($alias['redirect_type'] == 'no')?'':'['.$alias['redirect_type'].']', + 'rewrite_target' => $rewrite_target, + 'rewrite_target_ssl' => $rewrite_target_ssl, + 'rewrite_is_url' => ($this->_is_url($rewrite_target) ? 'y' : 'n'), + 'rewrite_add_path' => (substr($rewrite_target, -1) == '/' ? 'y' : 'n')); + } + } + } + } + + //* If we have some alias records + if($server_alias) { + //* begin a new ServerAlias line after 32 alias domains to avoid apache bugs + $server_alias_str = 'ServerAlias '.$server_alias[0]; + for($n=1;$nsetVar('alias', $server_alias_str); + unset($server_alias_str); + unset($n); + } else { + $tpl->setVar('alias', ''); + } + + if (count($rewrite_wildcard_rules) > 0) $rewrite_rules = array_merge($rewrite_rules, $rewrite_wildcard_rules); // Append wildcard rules to the end of rules + + if(count($rewrite_rules) > 0 || $vhost_data['seo_redirect_enabled'] > 0 || count($alias_seo_redirects) > 0 || $data['new']['rewrite_to_https'] == 'y') { + $tpl->setVar('rewrite_enabled', 1); + } else { + $tpl->setVar('rewrite_enabled', 0); + } + + //$tpl->setLoop('redirects',$rewrite_rules); + $this->rewrite_rules = $rewrite_rules; + $this->alias_seo_redirects = $alias_seo_redirects; + + return; + } + + /** + * This method may alter the $tpl template as well as $data and/or $vhost_data array! + * + * @param tpl $tpl + * @param array $data + * @param array $vhost_data + */ + public function processCustomDirectives(&$tpl, &$data, &$vhost_data) { + global $app; + + // Custom Apache directives + if(intval($data['new']['directive_snippets_id']) > 0){ + $snippet = $app->db->queryOneRecord("SELECT * FROM directive_snippets WHERE directive_snippets_id = ? AND type = 'apache' AND active = 'y' AND customer_viewable = 'y'", $data['new']['directive_snippets_id']); + if(isset($snippet['snippet'])){ + $vhost_data['apache_directives'] = $snippet['snippet']; + } + } + // Make sure we only have Unix linebreaks + $vhost_data['apache_directives'] = str_replace("\r\n", "\n", $vhost_data['apache_directives']); + $vhost_data['apache_directives'] = str_replace("\r", "\n", $vhost_data['apache_directives']); + $trans = array( + '{DOCROOT}' => $vhost_data['web_document_root_www'], + '{DOCROOT_CLIENT}' => $vhost_data['web_document_root'] + ); + $vhost_data['apache_directives'] = strtr($vhost_data['apache_directives'], $trans); + + return; + } + + /** + * This method may alter the $tpl template as well as $data and/or $vhost_data array! + * + * @param tpl $tpl + * @param array $data + * @param array $vhost_data + */ + public function processPhpStarters(&$tpl, &$data, &$vhost_data) { + global $app, $conf; + + $web_config = $app->getconf->get_server_config($conf['server_id'], 'web'); + $fastcgi_config = $app->getconf->get_server_config($conf['server_id'], 'fastcgi'); + + /** + * install fast-cgi starter script and add script aliasd config + * first we create the script directory if not already created, then copy over the starter script + * settings are copied over from the server ini config for now + * TODO: Create form for fastcgi configs per site. + */ + + $client = $app->dbmaster->queryOneRecord('SELECT client_id FROM sys_group WHERE sys_group.groupid = ?', $data['new']['sys_groupid']); + $client_id = intval($client['client_id']); + unset($client); + + if ($data['new']['php'] == 'fast-cgi') { + + $fastcgi_starter_path = str_replace('[system_user]', $data['new']['system_user'], $fastcgi_config['fastcgi_starter_path']); + $fastcgi_starter_path = str_replace('[client_id]', $client_id, $fastcgi_starter_path); + + if (!is_dir($fastcgi_starter_path)) { + $app->system->mkdirpath($fastcgi_starter_path); + $app->log('Creating fastcgi starter script directory: '.$fastcgi_starter_path, LOGLEVEL_DEBUG); + } + + $app->system->chown($fastcgi_starter_path, $data['new']['system_user']); + $app->system->chgrp($fastcgi_starter_path, $data['new']['system_group']); + if($web_config['security_level'] == 10) { + $app->system->chmod($fastcgi_starter_path, 0755); + } else { + $app->system->chmod($fastcgi_starter_path, 0550); + } + + $fcgi_tpl = new tpl(); + $fcgi_tpl->newTemplate('php-fcgi-starter.master'); + $fcgi_tpl->setVar('apache_version', $app->system->getapacheversion()); + $fcgi_tpl->setVar('apache_full_version', $app->system->getapacheversion(true)); + + if(trim($data['new']['fastcgi_php_version']) != ''){ + // $custom_fastcgi_php_name + list(, $custom_fastcgi_php_executable, $custom_fastcgi_php_ini_dir) = explode(':', trim($data['new']['fastcgi_php_version'])); + if(is_file($custom_fastcgi_php_ini_dir)) $custom_fastcgi_php_ini_dir = dirname($custom_fastcgi_php_ini_dir); + if(substr($custom_fastcgi_php_ini_dir, -1) == '/') $custom_fastcgi_php_ini_dir = substr($custom_fastcgi_php_ini_dir, 0, -1); + } + + if(trim($data['new']['custom_php_ini']) != '') { + $has_custom_php_ini = true; + } else { + $has_custom_php_ini = false; + } + + $web_folder = $app->plugin_webserver_base->getWebFolder($data, 'web', false); + + $custom_php_ini_dir = $web_config['website_basedir'].'/conf/'.$data['new']['system_user']; + if($data['new']['type'] == 'vhostsubdomain' || $data['new']['type'] == 'vhostalias') $custom_php_ini_dir .= '_' . $web_folder; + if(!is_dir($web_config['website_basedir'].'/conf')) $app->system->mkdir($web_config['website_basedir'].'/conf'); + + // Support for multiple PHP versions (FastCGI) + if(trim($data['new']['fastcgi_php_version']) != ''){ + $default_fastcgi_php = false; + if(substr($custom_fastcgi_php_ini_dir, -1) != '/') $custom_fastcgi_php_ini_dir .= '/'; + } else { + $default_fastcgi_php = true; + } + + if($has_custom_php_ini) { + $fcgi_tpl->setVar('php_ini_path', escapeshellcmd($custom_php_ini_dir)); + } else { + if($default_fastcgi_php){ + $fcgi_tpl->setVar('php_ini_path', escapeshellcmd($fastcgi_config['fastcgi_phpini_path'])); + } else { + $fcgi_tpl->setVar('php_ini_path', escapeshellcmd($custom_fastcgi_php_ini_dir)); + } + } + $fcgi_tpl->setVar('document_root', escapeshellcmd($data['new']['document_root'])); + $fcgi_tpl->setVar('php_fcgi_children', escapeshellcmd($fastcgi_config['fastcgi_children'])); + $fcgi_tpl->setVar('php_fcgi_max_requests', escapeshellcmd($fastcgi_config['fastcgi_max_requests'])); + if($default_fastcgi_php){ + $fcgi_tpl->setVar('php_fcgi_bin', escapeshellcmd($fastcgi_config['fastcgi_bin'])); + } else { + $fcgi_tpl->setVar('php_fcgi_bin', escapeshellcmd($custom_fastcgi_php_executable)); + } + $fcgi_tpl->setVar('security_level', intval($web_config['security_level'])); + $fcgi_tpl->setVar('domain', escapeshellcmd($data['new']['domain'])); + + $php_open_basedir = ($data['new']['php_open_basedir'] == '')?$data['new']['document_root']:$data['new']['php_open_basedir']; + $fcgi_tpl->setVar('open_basedir', escapeshellcmd($php_open_basedir)); + + $fcgi_starter_script = escapeshellcmd($fastcgi_starter_path.$fastcgi_config['fastcgi_starter_script'].(($data['new']['type'] == 'vhostsubdomain' || $data['new']['type'] == 'vhostalias') ? '_web' . $data['new']['domain_id'] : '')); + $app->system->file_put_contents($fcgi_starter_script, $fcgi_tpl->grab()); + unset($fcgi_tpl); + + $app->log('Creating fastcgi starter script: '.$fcgi_starter_script, LOGLEVEL_DEBUG); + + if($web_config['security_level'] == 10) { + $app->system->chmod($fcgi_starter_script, 0755); + } else { + $app->system->chmod($fcgi_starter_script, 0550); + } + $app->system->chown($fcgi_starter_script, $data['new']['system_user']); + $app->system->chgrp($fcgi_starter_script, $data['new']['system_group']); + + $tpl->setVar('fastcgi_alias', $fastcgi_config['fastcgi_alias']); + $tpl->setVar('fastcgi_starter_path', $fastcgi_starter_path); + $tpl->setVar('fastcgi_starter_script', $fastcgi_config['fastcgi_starter_script'].(($data['new']['type'] == 'vhostsubdomain' || $data['new']['type'] == 'vhostalias') ? '_web' . $data['new']['domain_id'] : '')); + $tpl->setVar('fastcgi_max_requests', $fastcgi_config['fastcgi_max_requests']); + + } else { + //remove the php fastgi starter script if available + $fastcgi_starter_script = $fastcgi_config['fastcgi_starter_script'].($data['old']['type'] == 'vhostsubdomain' ? '_web' . $data['old']['domain_id'] : ''); + if ($data['old']['php'] == 'fast-cgi') { + $fastcgi_starter_path = str_replace('[system_user]', $data['old']['system_user'], $fastcgi_config['fastcgi_starter_path']); + $fastcgi_starter_path = str_replace('[client_id]', $client_id, $fastcgi_starter_path); + if($data['old']['type'] == 'vhost') { + if(is_file($fastcgi_starter_script)) @unlink($fastcgi_starter_script); + if (is_dir($fastcgi_starter_path)) @rmdir($fastcgi_starter_path); + } else { + if(is_file($fastcgi_starter_script)) @unlink($fastcgi_starter_script); + } + } + } + + return; + } + + /** + * This method may alter the $tpl template as well as $data and/or $vhost_data array! + * + * @param tpl $tpl + * @param array $data + * @param array $vhost_data + */ + public function processVhosts(&$tpl, &$data, &$vhost_data) { + global $app, $conf; + + $web_config = $app->getconf->get_server_config($conf['server_id'], 'web'); + + //* create empty vhost array + $vhosts = array(); + + //* Add vhost for ipv4 IP + + //* use ip-mapping for web-mirror + if($data['new']['ip_address'] != '*' && $conf['mirror_server_id'] > 0) { + $sql = "SELECT destination_ip FROM server_ip_map WHERE server_id = ? AND source_ip = ?"; + $newip = $app->db->queryOneRecord($sql, $conf['server_id'], $data['new']['ip_address']); + $data['new']['ip_address'] = $newip['destination_ip']; + unset($newip); + } + + $tmp_vhost_arr = array('ip_address' => $data['new']['ip_address'], 'ssl_enabled' => 0, 'port' => 80); + if(count($this->rewrite_rules) > 0) $tmp_vhost_arr = $tmp_vhost_arr + array('redirects' => $this->rewrite_rules); + if(count($this->alias_seo_redirects) > 0) $tmp_vhost_arr = $tmp_vhost_arr + array('alias_seo_redirects' => $this->alias_seo_redirects); + $vhosts[] = $tmp_vhost_arr; + unset($tmp_vhost_arr); + + //* Add vhost for ipv4 IP with SSL + if($data['new']['ssl_domain'] != '' && $data['new']['ssl'] == 'y' && @is_file($vhost_data['ssl_crt_file']) && @is_file($vhost_data['ssl_key_file']) && (@filesize($vhost_data['ssl_crt_file'])>0) && (@filesize($vhost_data['ssl_key_file'])>0)) { + $tmp_vhost_arr = array('ip_address' => $data['new']['ip_address'], 'ssl_enabled' => 1, 'port' => '443'); + if(count($this->rewrite_rules) > 0) $tmp_vhost_arr = $tmp_vhost_arr + array('redirects' => $this->rewrite_rules); + $ipv4_ssl_alias_seo_redirects = $this->alias_seo_redirects; + if(is_array($ipv4_ssl_alias_seo_redirects) && !empty($ipv4_ssl_alias_seo_redirects)){ + for($i=0;$i 0) $tmp_vhost_arr = $tmp_vhost_arr + array('alias_seo_redirects' => $ipv4_ssl_alias_seo_redirects); + $vhosts[] = $tmp_vhost_arr; + unset($tmp_vhost_arr, $ipv4_ssl_alias_seo_redirects); + } + + //* Add vhost for IPv6 IP + if($data['new']['ipv6_address'] != '') { + //* rewrite ipv6 on mirrors + /* chang $conf to $web_config */ + if ($web_config['serverconfig']['web']['vhost_rewrite_v6'] == 'y') { + if (isset($web_config['serverconfig']['server']['v6_prefix']) && $web_config['serverconfig']['server']['v6_prefix'] <> '') { + $explode_v6prefix=explode(':', $web_config['serverconfig']['server']['v6_prefix']); + $explode_v6=explode(':', $data['new']['ipv6_address']); + + for ( $i = 0; $i <= count($explode_v6prefix)-1; $i++ ) { + $explode_v6[$i] = $explode_v6prefix[$i]; + } + $data['new']['ipv6_address'] = implode(':', $explode_v6); + } + } + if($data['new']['ipv6_address'] == '*') $data['new']['ipv6_address'] = '::'; + $tmp_vhost_arr = array('ip_address' => '['.$data['new']['ipv6_address'].']', 'ssl_enabled' => 0, 'port' => 80); + if(count($this->rewrite_rules) > 0) $tmp_vhost_arr = $tmp_vhost_arr + array('redirects' => $this->rewrite_rules); + if(count($this->alias_seo_redirects) > 0) $tmp_vhost_arr = $tmp_vhost_arr + array('alias_seo_redirects' => $this->alias_seo_redirects); + $vhosts[] = $tmp_vhost_arr; + unset($tmp_vhost_arr); + + //* Add vhost for ipv6 IP with SSL + if($data['new']['ssl_domain'] != '' && $data['new']['ssl'] == 'y' && @is_file($vhost_data['ssl_crt_file']) && @is_file($vhost_data['ssl_key_file']) && (@filesize($vhost_data['ssl_crt_file'])>0) && (@filesize($vhost_data['ssl_key_file'])>0)) { + $tmp_vhost_arr = array('ip_address' => '['.$data['new']['ipv6_address'].']', 'ssl_enabled' => 1, 'port' => '443'); + if(count($this->rewrite_rules) > 0) $tmp_vhost_arr = $tmp_vhost_arr + array('redirects' => $this->rewrite_rules); + $ipv6_ssl_alias_seo_redirects = $this->alias_seo_redirects; + if(is_array($ipv6_ssl_alias_seo_redirects) && !empty($ipv6_ssl_alias_seo_redirects)){ + for($i=0;$i 0) $tmp_vhost_arr = $tmp_vhost_arr + array('alias_seo_redirects' => $ipv6_ssl_alias_seo_redirects); + $vhosts[] = $tmp_vhost_arr; + unset($tmp_vhost_arr, $ipv6_ssl_alias_seo_redirects); + } + } + + //* Set the vhost loop + $tpl->setLoop('vhosts', $vhosts); + return; + } + + public function testWebserverConfig() { + global $app; + // if no output is given, check again + $webserver_binary = ''; + $webserver_check_output = null; + $webserver_check_retval = 0; + exec('which apache2ctl apache2 httpd2 httpd apache 2>/dev/null', $webserver_check_output, $webserver_check_retval); + if($webserver_check_retval == 0){ + $webserver_binary = reset($webserver_check_output); + } + if($webserver_binary != ''){ + $tmp_output = null; + $tmp_retval = 0; + exec($webserver_binary.' -t 2>&1', $tmp_output, $tmp_retval); + if($tmp_retval > 0 && is_array($tmp_output) && !empty($tmp_output)){ + $app->log('Reason for Apache restart failure: '.implode("\n", $tmp_output), LOGLEVEL_WARN); + $app->dbmaster->datalogError(implode("\n", $tmp_output)); + } + unset($tmp_output, $tmp_retval); + } + } +} diff --git a/server/lib/classes/plugin_webserver_base.inc.php b/server/lib/classes/plugin_webserver_base.inc.php new file mode 100644 index 0000000000000000000000000000000000000000..ea9ab8aa54102438a03c7b6596fbaa6e25ca94b3 --- /dev/null +++ b/server/lib/classes/plugin_webserver_base.inc.php @@ -0,0 +1,3009 @@ +plugins->registerEvent('web_domain_insert', $plugin_name, 'ssl'); + $app->plugins->registerEvent('web_domain_update', $plugin_name, 'ssl'); + $app->plugins->registerEvent('web_domain_delete', $plugin_name, 'ssl'); + + $app->plugins->registerEvent('web_domain_insert', $plugin_name, 'insert'); + $app->plugins->registerEvent('web_domain_update', $plugin_name, 'update'); + $app->plugins->registerEvent('web_domain_delete', $plugin_name, 'delete'); + + $app->plugins->registerEvent('server_ip_insert', $plugin_name, 'server_ip'); + $app->plugins->registerEvent('server_ip_update', $plugin_name, 'server_ip'); + $app->plugins->registerEvent('server_ip_delete', $plugin_name, 'server_ip'); + + $app->plugins->registerEvent('server_insert', $plugin_name, 'server_ip'); + $app->plugins->registerEvent('server_update', $plugin_name, 'server_ip'); + + $app->plugins->registerEvent('client_delete', $plugin_name, 'client_delete'); + + $app->plugins->registerEvent('web_folder_user_insert', $plugin_name, 'web_folder_user'); + $app->plugins->registerEvent('web_folder_user_update', $plugin_name, 'web_folder_user'); + $app->plugins->registerEvent('web_folder_user_delete', $plugin_name, 'web_folder_user'); + + $app->plugins->registerEvent('web_folder_update', $plugin_name, 'web_folder_update'); + $app->plugins->registerEvent('web_folder_delete', $plugin_name, 'web_folder_delete'); + + $app->plugins->registerEvent('ftp_user_delete', $plugin_name, 'ftp_user_delete'); + + $app->plugins->registerAction('php_ini_changed', $plugin_name, 'php_ini_changed'); + + if($server_type === 'apache') { + $app->plugins->registerEvent('webdav_user_insert', $plugin_name, 'webdav'); + $app->plugins->registerEvent('webdav_user_update', $plugin_name, 'webdav'); + $app->plugins->registerEvent('webdav_user_delete', $plugin_name, 'webdav'); + } + } + + private function get_master_php_ini_content($web_data) { + global $app, $conf; + + $app->uses('getconf'); + $web_config = $app->getconf->get_server_config($conf['server_id'], 'web'); + $fastcgi_config = $app->getconf->get_server_config($conf['server_id'], 'fastcgi'); + + $php_ini_content = ''; + $master_php_ini_path = ''; + + if($web_data['php'] == 'mod') { + $master_php_ini_path = $web_config['php_ini_path_apache']; + } else { + // check for custom php + if($web_data['fastcgi_php_version'] != '') { + $tmp = explode(':', $web_data['fastcgi_php_version']); + if(isset($tmp[2])) { + $tmppath = $tmp[2]; + if(substr($tmppath, -7) != 'php.ini') { + if(substr($tmppath, -1) != '/') $tmppath .= '/'; + $tmppath .= 'php.ini'; + } + if(file_exists($tmppath)) { + $master_php_ini_path = $tmppath; + } + unset($tmppath); + } + unset($tmp); + } + + if(!$master_php_ini_path) { + if($web_data['php'] == 'fast-cgi' && file_exists($fastcgi_config["fastcgi_phpini_path"])) { + $master_php_ini_path = $fastcgi_config["fastcgi_phpini_path"]; + } elseif($web_data['php'] == 'php-fpm' && file_exists($web_config['php_fpm_ini_path'])) { + $master_php_ini_path = $fastcgi_config["fastcgi_phpini_path"]; + } else { + $master_php_ini_path = $web_config['php_ini_path_cgi']; + } + } + } + + // Resolve inconsistant path settings + if($master_php_ini_path != '' && is_dir($master_php_ini_path) && is_file($master_php_ini_path.'/php.ini')) { + $master_php_ini_path .= '/php.ini'; + } + + // Load the custom php.ini content + if($master_php_ini_path != '' && substr($master_php_ini_path, -7) == 'php.ini' && is_file($master_php_ini_path)) { + $php_ini_content .= $app->system->file_get_contents($master_php_ini_path)."\n"; + } + + return $php_ini_content; + } + + // Handle php.ini changes + /* TODO: change to be compatible to nginx, too */ + public function eventPhpIniChanged($event_name, $data, $server_type = 'apache') { + global $app, $conf; + + if($server_type === 'nginx') { + // not yet implemented + return; + } + + $app->uses('getconf'); + $web_config = $app->getconf->get_server_config($conf['server_id'], 'web'); + + /* $data contains an array with these keys: + * file -> full path of changed php_ini + * mode -> web_domain php modes to change (mod, fast-cgi, php-fpm or '' for all except 'mod') + * php_version -> php ini path that changed (additional php versions) + */ + + $param = ''; + $qrystr = "SELECT * FROM web_domain WHERE custom_php_ini != ''"; + if($data['mode'] == 'mod') { + $qrystr .= " AND php = 'mod'"; + } elseif($data['mode'] == 'fast-cgi') { + $qrystr .= " AND php = 'fast-cgi'"; + if($data['php_version']) { + $qrystr .= " AND fastcgi_php_version LIKE ?"; + $param = '%:' . $data['php_version']; + } + } elseif($data['mode'] == 'php-fpm') { + $qrystr .= " AND php = 'php-fpm'"; + if($data['php_version']) { + $qrystr .= " AND fastcgi_php_version LIKE ?"; + $param = '%:' . $data['php_version'] . ':%'; + } + } else { + $qrystr .= " AND php != 'mod' AND php != 'fast-cgi'"; + } + + + //** Get all the webs + $web_domains = $app->db->queryAllRecords($qrystr, $param); + foreach($web_domains as $web_data) { + $custom_php_ini_dir = $web_config['website_basedir'].'/conf/'.$web_data['system_user']; + $web_folder = 'web'; + if($web_data['type'] == 'vhostsubdomain' || $web_data['type'] == 'vhostalias') { + $web_folder = $web_data['web_folder']; + $custom_php_ini_dir .= '_' . $web_folder; + } + if(!is_dir($web_config['website_basedir'].'/conf')) $app->system->mkdir($web_config['website_basedir'].'/conf'); + + if(!is_dir($custom_php_ini_dir)) $app->system->mkdir($custom_php_ini_dir); + + $php_ini_content = $this->get_master_php_ini_content($web_data); + + if(intval($web_data['directive_snippets_id']) > 0){ + $snippet = $app->db->queryOneRecord("SELECT * FROM directive_snippets WHERE directive_snippets_id = ? AND type = 'apache' AND active = 'y' AND customer_viewable = 'y'", intval($web_data['directive_snippets_id'])); + if(isset($snippet['required_php_snippets']) && trim($snippet['required_php_snippets']) != ''){ + $required_php_snippets = explode(',', trim($snippet['required_php_snippets'])); + if(is_array($required_php_snippets) && !empty($required_php_snippets)){ + foreach($required_php_snippets as $required_php_snippet){ + $required_php_snippet = intval($required_php_snippet); + if($required_php_snippet > 0){ + $php_snippet = $app->db->queryOneRecord("SELECT * FROM directive_snippets WHERE directive_snippets_id = ? AND type = 'php' AND active = 'y'", $required_php_snippet); + $php_snippet['snippet'] = trim($php_snippet['snippet']); + if($php_snippet['snippet'] != ''){ + $web_data['custom_php_ini'] .= "\n".$php_snippet['snippet']; + } + } + } + } + } + } + + $php_ini_content .= str_replace("\r", '', trim($web_data['custom_php_ini'])); + $app->system->file_put_contents($custom_php_ini_dir.'/php.ini', $php_ini_content); + $app->log('Info: rewrote custom php.ini for web ' . $web_data['domain_id'] . ' (' . $web_data['domain'] . ').', LOGLEVEL_DEBUG); + } + + if(count($web_domains) > 0) { + //* We do not check the apache config here - we only changed the php.ini + //* Check if this is a chrooted setup + if($web_config['website_basedir'] != '' && @is_file($web_config['website_basedir'].'/etc/passwd')) { + $is_chrooted = true; + $app->log('Info: Apache is chrooted.', LOGLEVEL_DEBUG); + } else { + $is_chrooted = false; + } + + $app->log('Info: rewrote all php.ini and reloading apache now.', LOGLEVEL_DEBUG); + if($is_chrooted) { + $app->services->restartServiceDelayed('httpd', 'restart'); + } else { + // request a httpd reload when all records have been processed + $app->services->restartServiceDelayed('httpd', 'reload'); + } + } else { + $app->log('Info: No webs affected by php.ini change.', LOGLEVEL_DEBUG); + } + } + + // Handle the creation of SSL certificates + public function eventSsl($event_name, $data, $server_type = 'apache') { + global $app, $conf; + + $app->uses('system'); + + // load the server configuration options + $app->uses('getconf'); + $web_config = $app->getconf->get_server_config($conf['server_id'], 'web'); + if ($web_config['CA_path']!='' && !file_exists($web_config['CA_path'].'/openssl.cnf')) + $app->log("CA path error, file does not exist:".$web_config['CA_path'].'/openssl.cnf', LOGLEVEL_ERROR); + + //* Only vhosts can have a ssl cert + if($data["new"]["type"] != "vhost" && $data["new"]["type"] != "vhostsubdomain" && $data["new"]["type"] != "vhostalias") return; + + // if(!is_dir($data['new']['document_root'].'/ssl')) exec('mkdir -p '.$data['new']['document_root'].'/ssl'); + if(!is_dir($data['new']['document_root'].'/ssl') && !is_dir($data['old']['document_root'].'/ssl')) $app->system->mkdirpath($data['new']['document_root'].'/ssl'); + + $ssl_dir = $data['new']['document_root'].'/ssl'; + $domain = ($data['new']['ssl_domain'] != '') ? $data['new']['ssl_domain'] : $data['new']['domain']; + $key_file = $ssl_dir.'/'.$domain.'.key'; + $key_file2 = $ssl_dir.'/'.$domain.'.key.org'; + $csr_file = $ssl_dir.'/'.$domain.'.csr'; + $crt_file = $ssl_dir.'/'.$domain.'.crt'; + $bundle_file = $ssl_dir.'/'.$domain.'.bundle'; + + //* 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($key_file)){ + $app->system->rename($key_file, $key_file.'.bak'); + $app->system->chmod($key_file.'.bak', 0400); + } + if(file_exists($key_file2)){ + $app->system->rename($key_file2, $key_file2.'.bak'); + $app->system->chmod($key_file2.'.bak', 0400); + } + 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'); + + $rand_file = $ssl_dir.'/random_file'; + $rand_data = md5(uniqid(microtime(), 1)); + for($i=0; $i<1000; $i++) { + $rand_data .= md5(uniqid(microtime(), 1)); + $rand_data .= md5(uniqid(microtime(), 1)); + $rand_data .= md5(uniqid(microtime(), 1)); + $rand_data .= md5(uniqid(microtime(), 1)); + } + $app->system->file_put_contents($rand_file, $rand_data); + + $ssl_password = substr(md5(uniqid(microtime(), 1)), 0, 15); + + $ssl_cnf = " RANDFILE = $rand_file + + [ req ] + default_bits = 2048 + default_md = sha256 + default_keyfile = keyfile.pem + distinguished_name = req_distinguished_name + attributes = req_attributes + prompt = no + output_password = $ssl_password + + [ req_distinguished_name ] + C = ".trim($data['new']['ssl_country'])." + " . (trim($data['new']['ssl_state']) == '' ? '' : "ST = ".trim($data['new']['ssl_state'])) . " + " . (trim($data['new']['ssl_locality']) == '' ? '' : "L = ".trim($data['new']['ssl_locality']))." + " . (trim($data['new']['ssl_organisation']) == '' ? '' : "O = ".trim($data['new']['ssl_organisation']))." + " . (trim($data['new']['ssl_organisation_unit']) == '' ? '' : "OU = ".trim($data['new']['ssl_organisation_unit']))." + CN = $domain + emailAddress = webmaster@".$data['new']['domain']." + + [ req_attributes ] + ";//challengePassword = A challenge password"; + + $ssl_cnf_file = $ssl_dir.'/openssl.conf'; + $app->system->file_put_contents($ssl_cnf_file, $ssl_cnf); + + $rand_file = escapeshellcmd($rand_file); + $key_file2 = escapeshellcmd($key_file2); + $openssl_cmd_key_file2 = $key_file2; + if(substr($domain, 0, 2) == '*.' && strpos($key_file2, '/ssl/\*.') !== false) $key_file2 = str_replace('/ssl/\*.', '/ssl/*.', $key_file2); // wildcard certificate + $key_file = escapeshellcmd($key_file); + $openssl_cmd_key_file = $key_file; + if(substr($domain, 0, 2) == '*.' && strpos($key_file, '/ssl/\*.') !== false) $key_file = str_replace('/ssl/\*.', '/ssl/*.', $key_file); // wildcard certificate + $ssl_days = 3650; + $csr_file = escapeshellcmd($csr_file); + $openssl_cmd_csr_file = $csr_file; + if(substr($domain, 0, 2) == '*.' && strpos($csr_file, '/ssl/\*.') !== false) $csr_file = str_replace('/ssl/\*.', '/ssl/*.', $csr_file); // wildcard certificate + $config_file = escapeshellcmd($ssl_cnf_file); + $crt_file = escapeshellcmd($crt_file); + $openssl_cmd_crt_file = $crt_file; + if(substr($domain, 0, 2) == '*.' && strpos($crt_file, '/ssl/\*.') !== false) $crt_file = str_replace('/ssl/\*.', '/ssl/*.', $crt_file); // wildcard certificate + + if(is_file($ssl_cnf_file) && !is_link($ssl_cnf_file)) { + + exec("openssl genrsa -des3 -rand $rand_file -passout pass:$ssl_password -out $openssl_cmd_key_file2 2048"); + exec("openssl req -new -sha256 -passin pass:$ssl_password -passout pass:$ssl_password -key $openssl_cmd_key_file2 -out $openssl_cmd_csr_file -days $ssl_days -config $config_file"); + exec("openssl rsa -passin pass:$ssl_password -in $openssl_cmd_key_file2 -out $openssl_cmd_key_file"); + + if(file_exists($web_config['CA_path'].'/openssl.cnf')) + { + exec("openssl ca -batch -out $openssl_cmd_crt_file -config ".$web_config['CA_path']."/openssl.cnf -passin pass:".$web_config['CA_pass']." -in $openssl_cmd_csr_file"); + $app->log("Creating CA-signed SSL Cert for: $domain", LOGLEVEL_DEBUG); + if (filesize($crt_file)==0 || !file_exists($crt_file)) $app->log("CA-Certificate signing failed. openssl ca -out $openssl_cmd_crt_file -config ".$web_config['CA_path']."/openssl.cnf -passin pass:".$web_config['CA_pass']." -in $openssl_cmd_csr_file", LOGLEVEL_ERROR); + } + if (@filesize($crt_file)==0 || !file_exists($crt_file)){ + exec("openssl req -x509 -passin pass:$ssl_password -passout pass:$ssl_password -key $openssl_cmd_key_file2 -in $openssl_cmd_csr_file -out $openssl_cmd_crt_file -days $ssl_days -config $config_file "); + $app->log("Creating self-signed SSL Cert for: $domain", LOGLEVEL_DEBUG); + } + + } + + $app->system->chmod($key_file2, 0400); + $app->system->chmod($key_file, 0400); + @$app->system->unlink($config_file); + @$app->system->unlink($rand_file); + $ssl_request = $app->system->file_get_contents($csr_file); + $ssl_cert = $app->system->file_get_contents($crt_file); + $ssl_key = $app->system->file_get_contents($key_file); + /* Update the DB of the (local) Server */ + $app->db->query("UPDATE web_domain SET ssl_request = ?, ssl_cert = ?, ssl_key = ? WHERE domain = ?", $ssl_request, $ssl_cert, $ssl_key, $data['new']['domain']); + $app->db->query("UPDATE web_domain SET ssl_action = '' WHERE domain = ?", $data['new']['domain']); + /* Update also the master-DB of the Server-Farm */ + $app->dbmaster->query("UPDATE web_domain SET ssl_request = ?, ssl_cert = ?, ssl_key = ? WHERE domain = ?", $ssl_request, $ssl_cert, $ssl_key, $data['new']['domain']); + $app->dbmaster->query("UPDATE web_domain SET ssl_action = '' WHERE domain = ?", $data['new']['domain']); + } + + //* Check that the SSL key is not password protected + if($data["new"]["ssl_action"] == 'save') { + if(stristr($data["new"]["ssl_key"],'Proc-Type: 4,ENCRYPTED')) { + $data["new"]["ssl_action"] = ''; + + $app->log('SSL Certificate not saved. The SSL key is encrypted.', LOGLEVEL_WARN); + $app->dbmaster->datalogError('SSL Certificate not saved. The SSL key is encrypted.'); + + /* Update the DB of the (local) Server */ + $app->db->query("UPDATE web_domain SET ssl_action = '' WHERE domain = ?", $data['new']['domain']); + + /* Update also the master-DB of the Server-Farm */ + $app->dbmaster->query("UPDATE web_domain SET ssl_action = '' WHERE domain = ?", $data['new']['domain']); + } + } + + //* and check that SSL cert does not contain subdomain of domain acme.invalid + if($data["new"]["ssl_action"] == 'save') { + $tmp = array(); + $crt_data = ''; + exec('openssl x509 -noout -text -in '.escapeshellarg($crt_file),$tmp); + $crt_data = implode("\n",$tmp); + if(stristr($crt_data,'.acme.invalid')) { + $data["new"]["ssl_action"] = ''; + + $app->log('SSL Certificate not saved. The SSL cert contains domain acme.invalid.', LOGLEVEL_WARN); + $app->dbmaster->datalogError('SSL Certificate not saved. The SSL cert contains domain acme.invalid.'); + + /* Update the DB of the (local) Server */ + $app->db->query("UPDATE web_domain SET ssl_action = '' WHERE domain = ?", $data['new']['domain']); + + /* Update also the master-DB of the Server-Farm */ + $app->dbmaster->query("UPDATE web_domain SET ssl_action = '' WHERE domain = ?", $data['new']['domain']); + } + } + + //* Save a SSL certificate to disk + if($data["new"]["ssl_action"] == 'save') { + $this->ssl_certificate_changed = true; + + //* Backup files + if(file_exists($key_file)){ + $app->system->copy($key_file, $key_file.'~'); + $app->system->chmod($key_file.'~', 0400); + } + if(file_exists($key_file2)){ + $app->system->copy($key_file2, $key_file2.'~'); + $app->system->chmod($key_file2.'~', 0400); + } + if(file_exists($csr_file)) $app->system->copy($csr_file, $csr_file.'~'); + if(file_exists($crt_file)) $app->system->copy($crt_file, $crt_file.'~'); + if(file_exists($bundle_file)) $app->system->copy($bundle_file, $bundle_file.'~'); + + //* Write new ssl files + if(trim($data["new"]["ssl_request"]) != '') $app->system->file_put_contents($csr_file, $data["new"]["ssl_request"]); + + if($server_type === 'nginx' || ($server_type === 'apache' && version_compare($app->system->getapacheversion(true), '2.4.8', '>='))) { + // In nginx and apache 2.4.8 and newer, the ssl crt file contains the bundle, so we need no separate bundle file + $tmp_data = ''; + if(trim($data["new"]["ssl_cert"]) != '') $tmp_data .= $data["new"]["ssl_cert"] . "\n"; + if(trim($data["new"]["ssl_bundle"]) != '') $tmp_data .= $data["new"]["ssl_bundle"]; + if(trim($tmp_data) != '') $app->system->file_put_contents($crt_file, $app->file->unix_nl($tmp_data)); + } else { + // Write separate crt and bundle file + if(trim($data["new"]["ssl_cert"]) != '') $app->system->file_put_contents($crt_file, $data["new"]["ssl_cert"]); + if(trim($data["new"]["ssl_bundle"]) != '') $app->system->file_put_contents($bundle_file, $data["new"]["ssl_bundle"]); + } + + //* 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); + } else { + $ssl_key = $app->system->file_get_contents($key_file); + /* Update the DB of the (local) Server */ + $app->db->query("UPDATE web_domain SET ssl_key = ? WHERE domain = ?", $ssl_key, $data['new']['domain']); + /* Update also the master-DB of the Server-Farm */ + $app->dbmaster->query("UPDATE web_domain SET ssl_key = ? WHERE domain = ?", $ssl_key, $data['new']['domain']); + } + + /* Update the DB of the (local) Server */ + $app->db->query("UPDATE web_domain SET ssl_action = '' WHERE domain = ?", $data['new']['domain']); + + /* Update also the master-DB of the Server-Farm */ + $app->dbmaster->query("UPDATE web_domain SET ssl_action = '' WHERE domain = ?", $data['new']['domain']); + $app->log('Saving SSL Cert for: '.$domain, LOGLEVEL_DEBUG); + } + + //* Delete a SSL certificate + if($data['new']['ssl_action'] == 'del') { + if(file_exists($web_config['CA_path'].'/openssl.cnf') && !is_link($web_config['CA_path'].'/openssl.cnf')) + { + exec("openssl ca -batch -config ".$web_config['CA_path']."/openssl.cnf -passin pass:".$web_config['CA_pass']." -revoke ".escapeshellcmd($crt_file)); + $app->log("Revoking CA-signed SSL Cert for: $domain", LOGLEVEL_DEBUG); + } + $app->system->unlink($csr_file); + $app->system->unlink($crt_file); + $app->system->unlink($bundle_file); + /* Update the DB of the (local) Server */ + $app->db->query("UPDATE web_domain SET ssl_request = '', ssl_cert = '' WHERE domain = ? AND server_id = ?", $data['new']['domain'], $data['new']['server_id']); + $app->db->query("UPDATE web_domain SET ssl_action = '' WHERE domain = ? AND server_id = ?", $data['new']['domain'], $data['new']['server_id']); + /* Update also the master-DB of the Server-Farm */ + $app->dbmaster->query("UPDATE web_domain SET ssl_request = '', ssl_cert = '' WHERE domain = ? AND server_id = ?", $data['new']['domain'], $data['new']['server_id']); + $app->dbmaster->query("UPDATE web_domain SET ssl_action = '' WHERE domain = ? AND server_id = ?", $data['new']['domain'], $data['new']['server_id']); + $app->log('Deleting SSL Cert for: '.$domain, LOGLEVEL_DEBUG); + } + + } + + + //* Update the awstats configuration file + public function awstats_update($data, $web_config) { + global $app; + + $web_folder = $data['new']['web_folder']; + if($data['new']['type'] == 'vhost') $web_folder = 'web'; + $awstats_conf_dir = $web_config['awstats_conf_dir']; + + if(!is_dir($data['new']['document_root']."/" . $web_folder . "/stats/")) mkdir($data['new']['document_root']."/" . $web_folder . "/stats"); + if(!@is_file($awstats_conf_dir.'/awstats.'.$data['new']['domain'].'.conf') || ($data['old']['domain'] != '' && $data['new']['domain'] != $data['old']['domain'])) { + if ( @is_file($awstats_conf_dir.'/awstats.'.$data['old']['domain'].'.conf') ) { + $app->system->unlink($awstats_conf_dir.'/awstats.'.$data['old']['domain'].'.conf'); + } + + $content = ''; + if (is_file($awstats_conf_dir."/awstats.conf")) { + $include_file = $awstats_conf_dir."/awstats.conf"; + } elseif (is_file($awstats_conf_dir."/awstats.model.conf")) { + $include_file = $awstats_conf_dir."/awstats.model.conf"; + } + $content .= "Include \"".$include_file."\"\n"; + $content .= "LogFile=\"/var/log/ispconfig/httpd/".$data['new']['domain']."/access.log\"\n"; + $content .= "SiteDomain=\"".$data['new']['domain']."\"\n"; + $content .= "HostAliases=\"www.".$data['new']['domain']." localhost 127.0.0.1\"\n"; + + if (isset($include_file)) { + $app->system->file_put_contents($awstats_conf_dir.'/awstats.'.$data['new']['domain'].'.conf', $content); + $app->log('Created AWStats config file: '.$awstats_conf_dir.'/awstats.'.$data['new']['domain'].'.conf', LOGLEVEL_DEBUG); + } else { + $app->log("No awstats base config found. Either awstats.conf or awstats.model.conf must exist in ".$awstats_conf_dir.".", LOGLEVEL_WARN); + } + } + + if(is_file($data['new']['document_root']."/" . $web_folder . "/stats/index.html")) $app->system->unlink($data['new']['document_root']."/" . $web_folder . "/stats/index.html"); + if(file_exists("/usr/local/ispconfig/server/conf-custom/awstats_index.php.master")) { + $app->system->copy("/usr/local/ispconfig/server/conf-custom/awstats_index.php.master", $data['new']['document_root']."/" . $web_folder . "/stats/index.php"); + } else { + $app->system->copy("/usr/local/ispconfig/server/conf/awstats_index.php.master", $data['new']['document_root']."/" . $web_folder . "/stats/index.php"); + } + } + + //* Delete the awstats configuration file + public function awstats_delete ($data, $web_config) { + global $app; + + $awstats_conf_dir = $web_config['awstats_conf_dir']; + + if ( @is_file($awstats_conf_dir.'/awstats.'.$data['old']['domain'].'.conf') ) { + $app->system->unlink($awstats_conf_dir.'/awstats.'.$data['old']['domain'].'.conf'); + $app->log('Removed AWStats config file: '.$awstats_conf_dir.'/awstats.'.$data['old']['domain'].'.conf', LOGLEVEL_DEBUG); + } + } + + public function eventUpdate($event_name, $data, $action, $server_type = 'apache') { + global $app, $conf; + + $this->action = $action; + + if($server_type === 'nginx') { + //* Check if the apache plugin is enabled + if(@is_link('/usr/local/ispconfig/server/plugins-enabled/apache2_plugin.inc.php')) { + $app->log('The nginx plugin cannot be used together with the apache2 plugin.', LOGLEVEL_WARN); + return 0; + } + } + + if($this->action != 'insert') $this->action = 'update'; + + if($data['new']['type'] != 'vhost' && $data['new']['type'] != 'vhostsubdomain' && $data['new']['type'] != 'vhostalias' && $data['new']['parent_domain_id'] > 0) { + + $old_parent_domain_id = intval($data['old']['parent_domain_id']); + $new_parent_domain_id = intval($data['new']['parent_domain_id']); + + // If the parent_domain_id has been changed, we will have to update the old site as well. + if($this->action == 'update' && $data['new']['parent_domain_id'] != $data['old']['parent_domain_id']) { + $tmp = $app->db->queryOneRecord('SELECT * FROM web_domain WHERE domain_id = ? AND active = ?', $old_parent_domain_id, 'y'); + $data['new'] = $tmp; + $data['old'] = $tmp; + $this->action = 'update'; + $this->update($event_name, $data); + } + + // This is not a vhost, so we need to update the parent record instead. + $tmp = $app->db->queryOneRecord('SELECT * FROM web_domain WHERE domain_id = ? AND active = ?', $new_parent_domain_id, 'y'); + $data['new'] = $tmp; + $data['old'] = $tmp; + $this->action = 'update'; + $this->update_letsencrypt = true; + } + + // load the server configuration options + $app->uses('getconf'); + $web_config = $app->getconf->get_server_config($conf['server_id'], 'web'); + + //* Check if this is a chrooted setup + if($web_config['website_basedir'] != '' && @is_file($web_config['website_basedir'].'/etc/passwd')) { + $is_chrooted = true; + $app->log('Info: Webserver is chrooted.', LOGLEVEL_DEBUG); + } else { + $is_chrooted = false; + } + + if($data['new']['document_root'] == '') { + if($data['new']['type'] == 'vhost' || $data['new']['type'] == 'vhostsubdomain' || $data['new']['type'] == 'vhostalias') $app->log('document_root not set', LOGLEVEL_WARN); + return 0; + } + if($app->system->is_allowed_user($data['new']['system_user'], $app->system->is_user($data['new']['system_user']), true) == false + || $app->system->is_allowed_group($data['new']['system_group'], $app->system->is_group($data['new']['system_group']), true) == false) { + $app->log('Websites cannot be owned by the root user or group. User: '.$data['new']['system_user'].' Group: '.$data['new']['system_group'], LOGLEVEL_WARN); + return 0; + } + if(trim($data['new']['domain']) == '') { + $app->log('domain is empty', LOGLEVEL_WARN); + return 0; + } + + $web_folder = $this->getWebFolder($data, 'web', false); + $log_folder = $this->getWebFolder($data, 'log', false); + $old_web_folder = $this->getWebFolder($data, 'web', true); + $old_log_folder = $this->getWebFolder($data, 'log', true); + + // Create group and user, if not exist + $app->uses('system'); + + if($web_config['connect_userid_to_webid'] == 'y') { + //* Calculate the uid and gid + $connect_userid_to_webid_start = ($web_config['connect_userid_to_webid_start'] < 1000)?1000:intval($web_config['connect_userid_to_webid_start']); + $fixed_uid_gid = intval($connect_userid_to_webid_start + $data['new']['domain_id']); + $fixed_uid_param = '--uid '.$fixed_uid_gid; + $fixed_gid_param = '--gid '.$fixed_uid_gid; + + //* Check if a ispconfigend user and group exists and create them + if(!$app->system->is_group('ispconfigend')) { + exec('groupadd --gid '.($connect_userid_to_webid_start + 10000).' ispconfigend'); + } + if(!$app->system->is_user('ispconfigend')) { + exec('useradd -g ispconfigend -d /usr/local/ispconfig --uid '.($connect_userid_to_webid_start + 10000).' ispconfigend'); + } + } else { + $fixed_uid_param = ''; + $fixed_gid_param = ''; + } + + $groupname = escapeshellcmd($data['new']['system_group']); + if($data['new']['system_group'] != '' && !$app->system->is_group($data['new']['system_group'])) { + exec('groupadd '.$fixed_gid_param.' '.$groupname); + if($is_chrooted) $app->system->_exec('chroot '.escapeshellcmd($web_config['website_basedir']).' groupadd '.$groupname); + $app->log('Adding the group: '.$groupname, LOGLEVEL_DEBUG); + } + + $username = escapeshellcmd($data['new']['system_user']); + if($data['new']['system_user'] != '' && !$app->system->is_user($data['new']['system_user'])) { + if($web_config['add_web_users_to_sshusers_group'] == 'y') { + exec('useradd -d '.escapeshellcmd($data['new']['document_root'])." -g $groupname $fixed_uid_param -G sshusers $username -s /bin/false"); + if($is_chrooted) $app->system->_exec('chroot '.escapeshellcmd($web_config['website_basedir']).' useradd -d '.escapeshellcmd($data['new']['document_root'])." -g $groupname $fixed_uid_param -G sshusers $username -s /bin/false"); + } else { + exec('useradd -d '.escapeshellcmd($data['new']['document_root'])." -g $groupname $fixed_uid_param $username -s /bin/false"); + if($is_chrooted) $app->system->_exec('chroot '.escapeshellcmd($web_config['website_basedir']).' useradd -d '.escapeshellcmd($data['new']['document_root'])." -g $groupname $fixed_uid_param $username -s /bin/false"); + } + $app->log('Adding the user: '.$username, LOGLEVEL_DEBUG); + } + + //* If the client of the site has been changed, we have a change of the document root + if($this->action == 'update' && $data['new']['document_root'] != $data['old']['document_root']) { + + //* Get the old client ID + $old_client = $app->dbmaster->queryOneRecord('SELECT client_id FROM sys_group WHERE sys_group.groupid = ?', $data['old']['sys_groupid']); + $old_client_id = intval($old_client['client_id']); + unset($old_client); + + //* Remove the old symlinks + $tmp_symlinks_array = explode(':', $web_config['website_symlinks']); + if(is_array($tmp_symlinks_array)) { + foreach($tmp_symlinks_array as $tmp_symlink) { + $tmp_symlink = str_replace('[client_id]', $old_client_id, $tmp_symlink); + $tmp_symlink = str_replace('[website_domain]', $data['old']['domain'], $tmp_symlink); + // Remove trailing slash + if(substr($tmp_symlink, -1, 1) == '/') $tmp_symlink = substr($tmp_symlink, 0, -1); + // create the symlinks, if not exist + if(is_link($tmp_symlink)) { + exec('rm -f '.escapeshellcmd($tmp_symlink)); + $app->log('Removed symlink: rm -f '.$tmp_symlink, LOGLEVEL_DEBUG); + } + } + } + + //* Remove protection of old folders + $app->system->web_folder_protection($data['old']['document_root'], false); + + if($data["new"]["type"] != "vhostsubdomain" && $data["new"]["type"] != "vhostalias") { + //* Move the site data + $tmp_docroot = explode('/', $data['new']['document_root']); + unset($tmp_docroot[count($tmp_docroot)-1]); + $new_dir = implode('/', $tmp_docroot); + + $tmp_docroot = explode('/', $data['old']['document_root']); + unset($tmp_docroot[count($tmp_docroot)-1]); + $old_dir = implode('/', $tmp_docroot); + + //* Check if there is already some data in the new docroot and rename it as we need a clean path to move the existing site to the new path + if(@is_dir($data['new']['document_root'])) { + $app->system->web_folder_protection($data['new']['document_root'], false); + $app->system->rename($data['new']['document_root'], $data['new']['document_root'].'_bak_'.date('Y_m_d_H_i_s')); + $app->log('Renaming existing directory in new docroot location. mv '.$data['new']['document_root'].' '.$data['new']['document_root'].'_bak_'.date('Y_m_d_H_i_s'), LOGLEVEL_DEBUG); + } + + //* Unmount the old log directory bfore we move the log dir + exec('umount -l '.escapeshellcmd($old_dir.'/log')); + + //* Create new base directory, if it does not exist yet + if(!is_dir($new_dir)) $app->system->mkdirpath($new_dir); + $app->system->web_folder_protection($data['old']['document_root'], false); + exec('mv '.escapeshellarg($data['old']['document_root']).' '.escapeshellarg($new_dir)); + //$app->system->rename($data['old']['document_root'],$new_dir); + $app->log('Moving site to new document root: mv '.$data['old']['document_root'].' '.$new_dir, LOGLEVEL_DEBUG); + + // Handle the change in php_open_basedir + $data['new']['php_open_basedir'] = str_replace($data['old']['document_root'], $data['new']['document_root'], $data['old']['php_open_basedir']); + + //* Change the owner of the website files to the new website owner + exec('chown --recursive --from='.escapeshellcmd($data['old']['system_user']).':'.escapeshellcmd($data['old']['system_group']).' '.escapeshellcmd($data['new']['system_user']).':'.escapeshellcmd($data['new']['system_group']).' '.$new_dir); + + //* Change the home directory and group of the website user + $command = 'killall -u '.escapeshellcmd($data['new']['system_user']).' ; usermod'; + $command .= ' --home '.escapeshellcmd($data['new']['document_root']); + $command .= ' --gid '.escapeshellcmd($data['new']['system_group']); + $command .= ' '.escapeshellcmd($data['new']['system_user']).' 2>/dev/null'; + exec($command); + } + + if($is_chrooted) $app->system->_exec('chroot '.escapeshellcmd($web_config['website_basedir']).' '.$command); + + //* Change the log mount + /* + $fstab_line = '/var/log/ispconfig/httpd/'.$data['old']['domain'].' '.$data['old']['document_root'].'/'.$old_log_folder.' none bind'; + $app->system->removeLine('/etc/fstab', $fstab_line); + $fstab_line = '/var/log/ispconfig/httpd/'.$data['old']['domain'].' '.$data['old']['document_root'].'/'.$old_log_folder.' none bind,nobootwait'; + $app->system->removeLine('/etc/fstab', $fstab_line); + $fstab_line = '/var/log/ispconfig/httpd/'.$data['old']['domain'].' '.$data['old']['document_root'].'/'.$old_log_folder.' none bind,nobootwait'; + $app->system->removeLine('/etc/fstab', $fstab_line); + */ + + $fstab_line_old = '/var/log/ispconfig/httpd/'.$data['old']['domain'].' '.$data['old']['document_root'].'/'.$old_log_folder.' none bind'; + + if($web_config['network_filesystem'] == 'y') { + $fstab_line = '/var/log/ispconfig/httpd/'.$data['new']['domain'].' '.$data['new']['document_root'].'/'.$log_folder.' none bind,nofail,_netdev 0 0'; + $app->system->replaceLine('/etc/fstab', $fstab_line_old, $fstab_line, 0, 1); + } else { + $fstab_line = '/var/log/ispconfig/httpd/'.$data['new']['domain'].' '.$data['new']['document_root'].'/'.$log_folder.' none bind,nofail 0 0'; + $app->system->replaceLine('/etc/fstab', $fstab_line_old, $fstab_line, 0, 1); + } + + exec('mount --bind '.escapeshellarg('/var/log/ispconfig/httpd/'.$data['new']['domain']).' '.escapeshellarg($data['new']['document_root'].'/'.$log_folder)); + + } + + //print_r($data); + + // Check if the directories are there and create them if necessary. + $app->system->web_folder_protection($data['new']['document_root'], false); + + if(!is_dir($data['new']['document_root'].'/' . $web_folder)) $app->system->mkdirpath($data['new']['document_root'].'/' . $web_folder); + if(!is_dir($data['new']['document_root'].'/' . $web_folder . '/error') and $data['new']['errordocs']) $app->system->mkdirpath($data['new']['document_root'].'/' . $web_folder . '/error'); + if($data['new']['stats_type'] != '' && !is_dir($data['new']['document_root'].'/' . $web_folder . '/stats')) $app->system->mkdirpath($data['new']['document_root'].'/' . $web_folder . '/stats'); + //if(!is_dir($data['new']['document_root'].'/'.$log_folder)) exec('mkdir -p '.$data['new']['document_root'].'/'.$log_folder); + if(!is_dir($data['new']['document_root'].'/ssl')) $app->system->mkdirpath($data['new']['document_root'].'/ssl'); + if(!is_dir($data['new']['document_root'].'/cgi-bin')) $app->system->mkdirpath($data['new']['document_root'].'/cgi-bin'); + if(!is_dir($data['new']['document_root'].'/tmp')) $app->system->mkdirpath($data['new']['document_root'].'/tmp'); + if($server_type === 'apache') { + if(!is_dir($data['new']['document_root'].'/webdav')) $app->system->mkdirpath($data['new']['document_root'].'/webdav'); + } + + if(!is_dir($data['new']['document_root'].'/.ssh')) { + $app->system->mkdirpath($data['new']['document_root'].'/.ssh'); + $app->system->chmod($data['new']['document_root'].'/.ssh', 0700); + $app->system->chown($data['new']['document_root'].'/.ssh', $username); + $app->system->chgrp($data['new']['document_root'].'/.ssh', $groupname); + } + + //* Create the new private directory + if(!is_dir($data['new']['document_root'].'/private')) { + $app->system->mkdirpath($data['new']['document_root'].'/private'); + $app->system->chmod($data['new']['document_root'].'/private', 0710); + $app->system->chown($data['new']['document_root'].'/private', $username); + $app->system->chgrp($data['new']['document_root'].'/private', $groupname); + } + + + // Remove the symlink for the site, if site is renamed + if($this->action == 'update' && $data['old']['domain'] != '' && $data['new']['domain'] != $data['old']['domain']) { + if(is_dir('/var/log/ispconfig/httpd/'.$data['old']['domain'])) exec('rm -rf /var/log/ispconfig/httpd/'.$data['old']['domain']); + if(is_link($data['old']['document_root'].'/'.$old_log_folder)) $app->system->unlink($data['old']['document_root'].'/'.$old_log_folder); + + //* remove old log mount + $fstab_line = '/var/log/ispconfig/httpd/'.$data['old']['domain'].' '.$data['old']['document_root'].'/'.$old_log_folder.' none bind'; + $app->system->removeLine('/etc/fstab', $fstab_line); + + //* Unmount log directory + //exec('fuser -km '.escapeshellarg($data['old']['document_root'].'/'.$old_log_folder)); + exec('umount -l '.escapeshellarg($data['old']['document_root'].'/'.$old_log_folder)); + } + + //* Create the log dir if nescessary and mount it + if(!is_dir($data['new']['document_root'].'/'.$log_folder) || !is_dir('/var/log/ispconfig/httpd/'.$data['new']['domain']) || is_link($data['new']['document_root'].'/'.$log_folder)) { + if(is_link($data['new']['document_root'].'/'.$log_folder)) unlink($data['new']['document_root'].'/'.$log_folder); + if(!is_dir('/var/log/ispconfig/httpd/'.$data['new']['domain'])) exec('mkdir -p /var/log/ispconfig/httpd/'.$data['new']['domain']); + $app->system->mkdirpath($data['new']['document_root'].'/'.$log_folder); + $app->system->chown($data['new']['document_root'].'/'.$log_folder, 'root'); + $app->system->chgrp($data['new']['document_root'].'/'.$log_folder, 'root'); + $app->system->chmod($data['new']['document_root'].'/'.$log_folder, 0755); + exec('mount --bind '.escapeshellarg('/var/log/ispconfig/httpd/'.$data['new']['domain']).' '.escapeshellarg($data['new']['document_root'].'/'.$log_folder)); + //* add mountpoint to fstab + $fstab_line = '/var/log/ispconfig/httpd/'.$data['new']['domain'].' '.$data['new']['document_root'].'/'.$log_folder.' none bind,nobootwait'; + $fstab_line .= @($web_config['network_filesystem'] == 'y')?',_netdev 0 0':' 0 0'; + $app->system->replaceLine('/etc/fstab', $fstab_line, $fstab_line, 1, 1); + } + + $app->system->web_folder_protection($data['new']['document_root'], true); + + // Get the client ID + $client = $app->dbmaster->queryOneRecord('SELECT client_id FROM sys_group WHERE sys_group.groupid = ?', $data['new']['sys_groupid']); + $client_id = intval($client['client_id']); + unset($client); + + // Remove old symlinks, if site is renamed + if($this->action == 'update' && $data['old']['domain'] != '' && $data['new']['domain'] != $data['old']['domain']) { + $tmp_symlinks_array = explode(':', $web_config['website_symlinks']); + if(is_array($tmp_symlinks_array)) { + foreach($tmp_symlinks_array as $tmp_symlink) { + $tmp_symlink = str_replace('[client_id]', $client_id, $tmp_symlink); + $tmp_symlink = str_replace('[website_domain]', $data['old']['domain'], $tmp_symlink); + // Remove trailing slash + if(substr($tmp_symlink, -1, 1) == '/') $tmp_symlink = substr($tmp_symlink, 0, -1); + // remove the symlinks, if not exist + if(is_link($tmp_symlink)) { + exec('rm -f '.escapeshellcmd($tmp_symlink)); + $app->log('Removed symlink: rm -f '.$tmp_symlink, LOGLEVEL_DEBUG); + } + } + } + } + + // Create the symlinks for the sites + $tmp_symlinks_array = explode(':', $web_config['website_symlinks']); + if(is_array($tmp_symlinks_array)) { + foreach($tmp_symlinks_array as $tmp_symlink) { + $tmp_symlink = str_replace('[client_id]', $client_id, $tmp_symlink); + $tmp_symlink = str_replace('[website_domain]', $data['new']['domain'], $tmp_symlink); + // Remove trailing slash + if(substr($tmp_symlink, -1, 1) == '/') $tmp_symlink = substr($tmp_symlink, 0, -1); + //* Remove symlink if target folder has been changed. + if($data['old']['document_root'] != '' && $data['old']['document_root'] != $data['new']['document_root'] && is_link($tmp_symlink)) { + $app->system->unlink($tmp_symlink); + } + // create the symlinks, if not exist + if(!is_link($tmp_symlink)) { + // exec("ln -s ".escapeshellcmd($data["new"]["document_root"])."/ ".escapeshellcmd($tmp_symlink)); + if ($web_config["website_symlinks_rel"] == 'y') { + $app->system->create_relative_link(escapeshellcmd($data["new"]["document_root"]), escapeshellcmd($tmp_symlink)); + } else { + exec("ln -s ".escapeshellcmd($data["new"]["document_root"])."/ ".escapeshellcmd($tmp_symlink)); + } + + $app->log('Creating symlink: ln -s '.$data['new']['document_root'].'/ '.$tmp_symlink, LOGLEVEL_DEBUG); + } + } + } + + + + // Install the Standard or Custom Error, Index and other related files + // /usr/local/ispconfig/server/conf is for the standard files + // /usr/local/ispconfig/server/conf-custom is for the custom files + // setting a local var here + + // normally $conf['templates'] = "/usr/local/ispconfig/server/conf"; + if($this->action == 'insert' && ($data['new']['type'] == 'vhost' || $data['new']['type'] == 'vhostsubdomain' || $data['new']['type'] == 'vhostalias')) { + + // Copy the error pages + if($data['new']['errordocs']) { + $error_page_path = escapeshellcmd($data['new']['document_root']).'/' . $web_folder . '/error/'; + if (file_exists($conf['rootpath'] . '/conf-custom/error/'.substr(escapeshellcmd($conf['language']), 0, 2))) { + exec('cp ' . $conf['rootpath'] . '/conf-custom/error/'.substr(escapeshellcmd($conf['language']), 0, 2).'/* '.$error_page_path); + } + else { + if (file_exists($conf['rootpath'] . '/conf-custom/error/400.html')) { + exec('cp '. $conf['rootpath'] . '/conf-custom/error/*.html '.$error_page_path); + } + else { + exec('cp ' . $conf['rootpath'] . '/conf/error/'.substr(escapeshellcmd($conf['language']), 0, 2).'/* '.$error_page_path); + } + } + exec('chmod -R a+r '.$error_page_path); + } + + //* Copy the web skeleton files only when there is no index.ph or index.html file yet + if(!file_exists($data['new']['document_root'].'/'.$web_folder.'/index.html') && !file_exists($data['new']['document_root'].'/'.$web_folder.'/index.php')) { + if (file_exists($conf['rootpath'] . '/conf-custom/index/standard_index.html_'.substr(escapeshellcmd($conf['language']), 0, 2))) { + if(!file_exists(escapeshellcmd($data['new']['document_root']).'/' . $web_folder . '/index.html')) exec('cp ' . $conf['rootpath'] . '/conf-custom/index/standard_index.html_'.substr(escapeshellcmd($conf['language']), 0, 2).' '.escapeshellcmd($data['new']['document_root']).'/' . $web_folder . '/index.html'); + + if(is_file($conf['rootpath'] . '/conf-custom/index/favicon.ico')) { + if(!file_exists(escapeshellcmd($data['new']['document_root']).'/' . $web_folder . '/favicon.ico')) exec('cp ' . $conf['rootpath'] . '/conf-custom/index/favicon.ico '.escapeshellcmd($data['new']['document_root']).'/' . $web_folder . '/'); + } + if(is_file($conf['rootpath'] . '/conf-custom/index/robots.txt')) { + if(!file_exists(escapeshellcmd($data['new']['document_root']).'/' . $web_folder . '/robots.txt')) exec('cp ' . $conf['rootpath'] . '/conf-custom/index/robots.txt '.escapeshellcmd($data['new']['document_root']).'/' . $web_folder . '/'); + } + //if(is_file($conf['rootpath'] . '/conf-custom/index/.htaccess')) { + // exec('cp ' . $conf['rootpath'] . '/conf-custom/index/.htaccess '.escapeshellcmd($data['new']['document_root']).'/' . $web_folder . '/'); + //} + } else { + if (file_exists($conf['rootpath'] . '/conf-custom/index/standard_index.html')) { + if(!file_exists(escapeshellcmd($data['new']['document_root']).'/' . $web_folder . '/index.html')) exec('cp ' . $conf['rootpath'] . '/conf-custom/index/standard_index.html '.escapeshellcmd($data['new']['document_root']).'/' . $web_folder . '/index.html'); + } else { + if(!file_exists(escapeshellcmd($data['new']['document_root']).'/' . $web_folder . '/index.html')) exec('cp ' . $conf['rootpath'] . '/conf/index/standard_index.html_'.substr(escapeshellcmd($conf['language']), 0, 2).' '.escapeshellcmd($data['new']['document_root']).'/' . $web_folder . '/index.html'); + if(is_file($conf['rootpath'] . '/conf/index/favicon.ico')){ + if(!file_exists(escapeshellcmd($data['new']['document_root']).'/' . $web_folder . '/favicon.ico')) exec('cp ' . $conf['rootpath'] . '/conf/index/favicon.ico '.escapeshellcmd($data['new']['document_root']).'/' . $web_folder . '/'); + } + if(is_file($conf['rootpath'] . '/conf/index/robots.txt')){ + if(!file_exists(escapeshellcmd($data['new']['document_root']).'/' . $web_folder . '/robots.txt')) exec('cp ' . $conf['rootpath'] . '/conf/index/robots.txt '.escapeshellcmd($data['new']['document_root']).'/' . $web_folder . '/'); + } + //if(is_file($conf['rootpath'] . '/conf/index/.htaccess')) exec('cp ' . $conf['rootpath'] . '/conf/index/.htaccess '.escapeshellcmd($data['new']['document_root']).'/' . $web_folder . '/'); + } + } + } + exec('chmod -R a+r '.escapeshellcmd($data['new']['document_root']).'/' . $web_folder . '/'); + + //** Copy the error documents on update when the error document checkbox has been activated and was deactivated before + } elseif ($this->action == 'update' && ($data['new']['type'] == 'vhost' || $data['new']['type'] == 'vhostsubdomain' || $data['new']['type'] == 'vhostalias') && $data['old']['errordocs'] == 0 && $data['new']['errordocs'] == 1) { + + $error_page_path = escapeshellcmd($data['new']['document_root']).'/' . $web_folder . '/error/'; + if (file_exists($conf['rootpath'] . '/conf-custom/error/'.substr(escapeshellcmd($conf['language']), 0, 2))) { + exec('cp ' . $conf['rootpath'] . '/conf-custom/error/'.substr(escapeshellcmd($conf['language']), 0, 2).'/* '.$error_page_path); + } + else { + if (file_exists($conf['rootpath'] . '/conf-custom/error/400.html')) { + exec('cp ' . $conf['rootpath'] . '/conf-custom/error/*.html '.$error_page_path); + } + else { + exec('cp ' . $conf['rootpath'] . '/conf/error/'.substr(escapeshellcmd($conf['language']), 0, 2).'/* '.$error_page_path); + } + } + exec('chmod -R a+r '.$error_page_path); + exec('chown -R '.$data['new']['system_user'].':'.$data['new']['system_group'].' '.$error_page_path); + } // end copy error docs + + // Set the quota for the user, but only for vhosts, not vhostsubdomains or vhostalias + if($username != '' && $app->system->is_user($username) && $data['new']['type'] == 'vhost') { + if($data['new']['hd_quota'] > 0) { + $blocks_soft = $data['new']['hd_quota'] * 1024; + $blocks_hard = $blocks_soft + 1024; + $mb_soft = $data['new']['hd_quota']; + $mb_hard = $mb_soft + 1; + } else { + $mb_soft = $mb_hard = $blocks_soft = $blocks_hard = 0; + } + + // get the primitive folder for document_root and the filesystem, will need it later. + $df_output=explode(" ", exec("df -T " . escapeshellarg($data['new']['document_root']) . "|awk 'END{print \$2,\$NF}'")); + $file_system = $df_output[0]; + $primitive_root = $df_output[1]; + + if($file_system == 'xfs') { + exec("xfs_quota -x -c " . escapeshellarg("limit -u bsoft=$mb_soft" . 'm'. " bhard=$mb_hard" . 'm'. " " . $username) . " " . escapeshellarg($primitive_root)); + + // xfs only supports timers globally, not per user. + exec("xfs_quota -x -c 'timer -bir -i 604800' " . escapeshellarg($primitive_root)); + + unset($primitive_root, $df_output, $mb_hard, $mb_soft); + } else { + if($app->system->is_installed('setquota')) { + exec('setquota -u '. $username . ' ' . $blocks_soft . ' ' . $blocks_hard . ' 0 0 -a &> /dev/null'); + exec('setquota -T -u '.$username.' 604800 604800 -a &> /dev/null'); + } + } + } + + if($this->action == 'insert' || $data["new"]["system_user"] != $data["old"]["system_user"]) { + // Chown and chmod the directories below the document root + $app->system->_exec('chown -R '.$username.':'.$groupname.' '.escapeshellcmd($data['new']['document_root']).'/' . $web_folder); + // The document root itself has to be owned by root in normal level and by the web owner in security level 20 + if($web_config['security_level'] == 20) { + $app->system->_exec('chown '.$username.':'.$groupname.' '.escapeshellcmd($data['new']['document_root']).'/' . $web_folder); + } else { + $app->system->_exec('chown root:root '.escapeshellcmd($data['new']['document_root']).'/' . $web_folder); + } + } + + //* add the user to the client group if this is a vhost and security level is set to high, no matter if this is an insert or update and regardless of set_folder_permissions_on_update + $user_config_key = 'user'; + if($server_type === 'nginx') { + $user_config_key = 'nginx_user'; + } + if($data['new']['type'] == 'vhost' && $web_config['security_level'] == 20) $app->system->add_user_to_group($groupname, escapeshellcmd($web_config[$user_config_key])); + + //* If the security level is set to high + if(($this->action == 'insert' && $data['new']['type'] == 'vhost') or ($web_config['set_folder_permissions_on_update'] == 'y' && $data['new']['type'] == 'vhost') or ($web_folder != $old_web_folder && $data['new']['type'] == 'vhost')) { + + $app->system->web_folder_protection($data['new']['document_root'], false); + + //* Check if we have the new private folder and create it if nescessary + if(!is_dir($data['new']['document_root'].'/private')) $app->system->mkdir($data['new']['document_root'].'/private'); + + if($web_config['security_level'] == 20) { + + $app->system->chmod($data['new']['document_root'], 0755); + $app->system->chmod($data['new']['document_root'].'/web', 0711); + if($server_type === 'apache') { + $app->system->chmod($data['new']['document_root'].'/webdav', 0710); + } + $app->system->chmod($data['new']['document_root'].'/private', 0710); + $app->system->chmod($data['new']['document_root'].'/ssl', 0755); + if($web_folder != 'web') $app->system->chmod($data['new']['document_root'].'/'.$web_folder, 0751); + + // make tmp directory writable for webserver and the website users + $app->system->chmod($data['new']['document_root'].'/tmp', 0770); + + // Set Log directory to 755 to make the logs accessible by the FTP user + if(realpath($data['new']['document_root'].'/'.$log_folder . '/error.log') == '/var/log/ispconfig/httpd/'.$data['new']['domain'].'/error.log') { + $app->system->chmod($data['new']['document_root'].'/'.$log_folder, 0755); + } + + if($web_config['add_web_users_to_sshusers_group'] == 'y') { + $command = 'usermod'; + $command .= ' --groups sshusers'; + $command .= ' '.escapeshellcmd($data['new']['system_user']).' 2>/dev/null'; + $app->system->_exec($command); + } + + //* if we have a chrooted environment + if($is_chrooted) { + $app->system->_exec('chroot '.escapeshellcmd($web_config['website_basedir']).' '.$command); + + //* add the user to the client group in the chroot environment + $tmp_groupfile = $app->system->server_conf['group_datei']; + $app->system->server_conf['group_datei'] = $web_config['website_basedir'].'/etc/group'; + $app->system->add_user_to_group($groupname, escapeshellcmd($web_config[$user_config_key])); + $app->system->server_conf['group_datei'] = $tmp_groupfile; + unset($tmp_groupfile); + } + + //* Chown all default directories + $app->system->chown($data['new']['document_root'], 'root'); + $app->system->chgrp($data['new']['document_root'], 'root'); + $app->system->chown($data['new']['document_root'].'/cgi-bin', $username); + $app->system->chgrp($data['new']['document_root'].'/cgi-bin', $groupname); + if(realpath($data['new']['document_root'].'/'.$log_folder . '/error.log') == '/var/log/ispconfig/httpd/'.$data['new']['domain'].'/error.log') { + $app->system->chown($data['new']['document_root'].'/'.$log_folder, 'root', false); + $app->system->chgrp($data['new']['document_root'].'/'.$log_folder, $groupname, false); + } + $app->system->chown($data['new']['document_root'].'/ssl', 'root'); + $app->system->chgrp($data['new']['document_root'].'/ssl', 'root'); + $app->system->chown($data['new']['document_root'].'/tmp', $username); + $app->system->chgrp($data['new']['document_root'].'/tmp', $groupname); + $app->system->chown($data['new']['document_root'].'/web', $username); + $app->system->chgrp($data['new']['document_root'].'/web', $groupname); + $app->system->chown($data['new']['document_root'].'/web/error', $username); + $app->system->chgrp($data['new']['document_root'].'/web/error', $groupname); + if($data['new']['stats_type'] != '') { + $app->system->chown($data['new']['document_root'].'/web/stats', $username); + $app->system->chgrp($data['new']['document_root'].'/web/stats', $groupname); + } + if($server_type === 'apache') { + $app->system->chown($data['new']['document_root'].'/webdav', $username); + $app->system->chgrp($data['new']['document_root'].'/webdav', $groupname); + } + $app->system->chown($data['new']['document_root'].'/private', $username); + $app->system->chgrp($data['new']['document_root'].'/private', $groupname); + + if($web_folder != 'web'){ + $app->system->chown($data['new']['document_root'].'/'.$web_folder, $username); + $app->system->chgrp($data['new']['document_root'].'/'.$web_folder, $groupname); + } + + // If the security Level is set to medium + } else { + + $app->system->chmod($data['new']['document_root'], 0755); + $app->system->chmod($data['new']['document_root'].'/web', 0755); + if($server_type === 'apache') { + $app->system->chmod($data['new']['document_root'].'/webdav', 0755); + } + $app->system->chmod($data['new']['document_root'].'/ssl', 0755); + $app->system->chmod($data['new']['document_root'].'/cgi-bin', 0755); + if($web_folder != 'web') $app->system->chmod($data['new']['document_root'].'/'.$web_folder, 0755); + + // make temp directory writable for webserver and the website users + $app->system->chmod($data['new']['document_root'].'/tmp', 0770); + + // Set Log directory to 755 to make the logs accessible by the FTP user + if(realpath($data['new']['document_root'].'/'.$log_folder . '/error.log') == '/var/log/ispconfig/httpd/'.$data['new']['domain'].'/error.log') { + $app->system->chmod($data['new']['document_root'].'/'.$log_folder, 0755); + } + + $app->system->chown($data['new']['document_root'], 'root'); + $app->system->chgrp($data['new']['document_root'], 'root'); + $app->system->chown($data['new']['document_root'].'/cgi-bin', $username); + $app->system->chgrp($data['new']['document_root'].'/cgi-bin', $groupname); + if(realpath($data['new']['document_root'].'/'.$log_folder . '/error.log') == '/var/log/ispconfig/httpd/'.$data['new']['domain'].'/error.log') { + $app->system->chown($data['new']['document_root'].'/'.$log_folder, 'root', false); + $app->system->chgrp($data['new']['document_root'].'/'.$log_folder, $groupname, false); + } + + $app->system->chown($data['new']['document_root'].'/ssl', 'root'); + $app->system->chgrp($data['new']['document_root'].'/ssl', 'root'); + $app->system->chown($data['new']['document_root'].'/tmp', $username); + $app->system->chgrp($data['new']['document_root'].'/tmp', $groupname); + $app->system->chown($data['new']['document_root'].'/web', $username); + $app->system->chgrp($data['new']['document_root'].'/web', $groupname); + $app->system->chown($data['new']['document_root'].'/web/error', $username); + $app->system->chgrp($data['new']['document_root'].'/web/error', $groupname); + if($data['new']['stats_type'] != '') { + $app->system->chown($data['new']['document_root'].'/web/stats', $username); + $app->system->chgrp($data['new']['document_root'].'/web/stats', $groupname); + } + if($server_type === 'apache') { + $app->system->chown($data['new']['document_root'].'/webdav', $username); + $app->system->chgrp($data['new']['document_root'].'/webdav', $groupname); + } + if($web_folder != 'web'){ + $app->system->chown($data['new']['document_root'].'/'.$web_folder, $username); + $app->system->chgrp($data['new']['document_root'].'/'.$web_folder, $groupname); + } + } + } elseif((($data['new']['type'] == 'vhostsubdomain') || ($data['new']['type'] == 'vhostalias')) && + (($this->action == 'insert') || ($web_config['set_folder_permissions_on_update'] == 'y'))) { + + if($web_config['security_level'] == 20) { + $app->system->chmod($data['new']['document_root'].'/' . $web_folder, 0710); + $app->system->chown($data['new']['document_root'].'/' . $web_folder, $username); + $app->system->chgrp($data['new']['document_root'].'/' . $web_folder, $groupname); + $app->system->chown($data['new']['document_root'].'/' . $web_folder . '/error', $username); + $app->system->chgrp($data['new']['document_root'].'/' . $web_folder . '/error', $groupname); + if($data['new']['stats_type'] != '') { + $app->system->chown($data['new']['document_root'].'/' . $web_folder . '/stats', $username); + $app->system->chgrp($data['new']['document_root'].'/' . $web_folder . '/stats', $groupname); + } + } else { + $app->system->chmod($data['new']['document_root'].'/' . $web_folder, 0755); + $app->system->chown($data['new']['document_root'].'/' . $web_folder, $username); + $app->system->chgrp($data['new']['document_root'].'/' . $web_folder, $groupname); + $app->system->chown($data['new']['document_root'].'/' . $web_folder . '/error', $username); + $app->system->chgrp($data['new']['document_root'].'/' . $web_folder . '/error', $groupname); + if($data['new']['stats_type'] != '') { + $app->system->chown($data['new']['document_root'].'/' . $web_folder . '/stats', $username); + $app->system->chgrp($data['new']['document_root'].'/' . $web_folder . '/stats', $groupname); + } + } + } + + //* Protect web folders + $app->system->web_folder_protection($data['new']['document_root'], true); + + if($data['new']['type'] == 'vhost') { + // Change the ownership of the error log to the root user + if(!@is_file('/var/log/ispconfig/httpd/'.$data['new']['domain'].'/error.log')) exec('touch '.escapeshellcmd('/var/log/ispconfig/httpd/'.$data['new']['domain'].'/error.log')); + $app->system->chown('/var/log/ispconfig/httpd/'.$data['new']['domain'].'/error.log', 'root'); + $app->system->chgrp('/var/log/ispconfig/httpd/'.$data['new']['domain'].'/error.log', 'root'); + } + + //* Write the custom php.ini file, if custom_php_ini field is not empty + $custom_php_ini_dir = $web_config['website_basedir'].'/conf/'.$data['new']['system_user']; + if($data['new']['type'] == 'vhostsubdomain' || $data['new']['type'] == 'vhostalias') $custom_php_ini_dir .= '_' . $web_folder; + if(!is_dir($web_config['website_basedir'].'/conf')) $app->system->mkdir($web_config['website_basedir'].'/conf'); + + if(trim($data['new']['fastcgi_php_version']) != ''){ + // $custom_fastcgi_php_name, $custom_fastcgi_php_executable + list(,, $custom_fastcgi_php_ini_dir) = explode(':', trim($data['new']['fastcgi_php_version'])); + if(is_file($custom_fastcgi_php_ini_dir)) $custom_fastcgi_php_ini_dir = dirname($custom_fastcgi_php_ini_dir); + if(substr($custom_fastcgi_php_ini_dir, -1) == '/') $custom_fastcgi_php_ini_dir = substr($custom_fastcgi_php_ini_dir, 0, -1); + } + + //* Create custom php.ini + if(trim($data['new']['custom_php_ini']) != '') { + $has_custom_php_ini = true; + if(!is_dir($custom_php_ini_dir)) $app->system->mkdirpath($custom_php_ini_dir); + + $php_ini_content = $this->get_master_php_ini_content($data['new']); + $php_ini_content .= str_replace("\r", '', trim($data['new']['custom_php_ini'])); + + if(intval($data['new']['directive_snippets_id']) > 0){ + $snippet = $app->db->queryOneRecord("SELECT * FROM directive_snippets WHERE directive_snippets_id = ? AND type = 'apache' AND active = 'y' AND customer_viewable = 'y'", intval($data['new']['directive_snippets_id'])); + if(isset($snippet['required_php_snippets']) && trim($snippet['required_php_snippets']) != ''){ + $required_php_snippets = explode(',', trim($snippet['required_php_snippets'])); + if(is_array($required_php_snippets) && !empty($required_php_snippets)){ + foreach($required_php_snippets as $required_php_snippet){ + $required_php_snippet = intval($required_php_snippet); + if($required_php_snippet > 0){ + $php_snippet = $app->db->queryOneRecord("SELECT * FROM directive_snippets WHERE directive_snippets_id = ? AND type = 'php' AND active = 'y'", $required_php_snippet); + $php_snippet['snippet'] = trim($php_snippet['snippet']); + if($php_snippet['snippet'] != ''){ + $php_ini_content .= "\n".$php_snippet['snippet']; + } + } + } + } + } + } + + $app->system->file_put_contents($custom_php_ini_dir.'/php.ini', $php_ini_content); + } else { + $has_custom_php_ini = false; + if(is_file($custom_php_ini_dir.'/php.ini')) $app->system->unlink($custom_php_ini_dir.'/php.ini'); + } + + $vhost_template_name = 'vhost.conf.master'; + if($server_type === 'nginx') { + $vhost_template_name = 'nginx_vhost.conf.master'; + } + + //* Create the vhost config file + $app->load('tpl'); + + $tpl = new tpl(); + $tpl->newTemplate($vhost_template_name); + + $vhost_data = $data['new']; + //unset($vhost_data['ip_address']); + $vhost_data['web_document_root'] = $data['new']['document_root'].'/' . $web_folder; + $vhost_data['web_document_root_www'] = $web_config['website_basedir'].'/'.$data['new']['domain'].'/' . $web_folder; + $vhost_data['web_basedir'] = $web_config['website_basedir']; + $vhost_data['security_level'] = $web_config['security_level']; + $vhost_data['allow_override'] = ($data['new']['allow_override'] == '')?'All':$data['new']['allow_override']; + $vhost_data['php_open_basedir'] = ($data['new']['php_open_basedir'] == '')?$data['new']['document_root']:$data['new']['php_open_basedir']; + $vhost_data['ssl_domain'] = $data['new']['ssl_domain']; + $vhost_data['has_custom_php_ini'] = $has_custom_php_ini; + $vhost_data['custom_php_ini_dir'] = escapeshellcmd($custom_php_ini_dir); + $vhost_data['logging'] = $web_config['logging']; + + // IPv6 + if($data['new']['ipv6_address'] != ''){ + $tpl->setVar('ipv6_enabled', 1); + if ($conf['serverconfig']['web']['vhost_rewrite_v6'] == 'y') { + if (isset($conf['serverconfig']['server']['v6_prefix']) && $conf['serverconfig']['server']['v6_prefix'] <> '') { + $explode_v6prefix=explode(':', $conf['serverconfig']['server']['v6_prefix']); + $explode_v6=explode(':', $data['new']['ipv6_address']); + + for ( $i = 0; $i <= count($explode_v6prefix)-1; $i++ ) { + $explode_v6[$i] = $explode_v6prefix[$i]; + } + $data['new']['ipv6_address'] = implode(':', $explode_v6); + $vhost_data['ipv6_address'] = $data['new']['ipv6_address']; + } + } + } + + if($server_type === 'nginx') { + $app->plugin_webserver_nginx->processPhpFpm($tpl, $data, $vhost_data); + $app->plugin_webserver_nginx->processRewriteRules($tpl, $data, $vhost_data); + } else { + $app->plugin_webserver_apache->processCustomDirectives($tpl, $data, $vhost_data); + } + + // Custom Apache directives + if(intval($data['new']['directive_snippets_id']) > 0){ + $snippet = $app->db->queryOneRecord("SELECT * FROM directive_snippets WHERE directive_snippets_id = ? AND type = 'apache' AND active = 'y' AND customer_viewable = 'y'", $data['new']['directive_snippets_id']); + if(isset($snippet['snippet'])){ + $vhost_data['apache_directives'] = $snippet['snippet']; + } + } + // Make sure we only have Unix linebreaks + $vhost_data['apache_directives'] = str_replace("\r\n", "\n", $vhost_data['apache_directives']); + $vhost_data['apache_directives'] = str_replace("\r", "\n", $vhost_data['apache_directives']); + $trans = array( + '{DOCROOT}' => $vhost_data['web_document_root_www'], + '{DOCROOT_CLIENT}' => $vhost_data['web_document_root'] + ); + $vhost_data['apache_directives'] = strtr($vhost_data['apache_directives'], $trans); + + $app->uses('letsencrypt'); + // Check if a SSL cert exists + $tmp = $app->letsencrypt->get_website_certificate_paths($data); + $domain = $tmp['domain']; + $key_file = $tmp['key']; + $key_file2 = $tmp['key2']; + $csr_file = $tmp['csr']; + $crt_file = $tmp['crt']; + $bundle_file = $tmp['bundle']; + unset($tmp); + + $data['new']['ssl_domain'] = $domain; + $vhost_data['ssl_domain'] = $domain; + $vhost_data['ssl_crt_file'] = $crt_file; + $vhost_data['ssl_key_file'] = $key_file; + $vhost_data['ssl_bundle_file'] = $bundle_file; + + //* Generate Let's Encrypt SSL certificat + if($data['new']['ssl'] == 'y' && $data['new']['ssl_letsencrypt'] == 'y' && $conf['mirror_server_id'] == 0 && ( // ssl and let's encrypt is active and no mirror server + ($data['old']['ssl'] == 'n' || $data['old']['ssl_letsencrypt'] == 'n') // we have new let's encrypt configuration + || ($data['old']['domain'] != $data['new']['domain']) // we have domain update + || ($data['old']['subdomain'] != $data['new']['subdomain']) // we have new or update on "auto" subdomain + || $this->update_letsencrypt == true + )) { + + $success = $app->letsencrypt->request_certificates($data, $server_type); + if($success) { + /* we don't need to store it. + /* Update the DB of the (local) Server */ + $app->db->query("UPDATE web_domain SET ssl_request = '', ssl_cert = '', ssl_key = '' WHERE domain = ?", $data['new']['domain']); + $app->db->query("UPDATE web_domain SET ssl_action = '' WHERE domain = ?", $data['new']['domain']); + /* Update also the master-DB of the Server-Farm */ + $app->dbmaster->query("UPDATE web_domain SET ssl_request = '', ssl_cert = '', ssl_key = '' WHERE domain = ?", $data['new']['domain']); + $app->dbmaster->query("UPDATE web_domain SET ssl_action = '' WHERE domain = ?", $data['new']['domain']); + } else { + $data['new']['ssl_letsencrypt'] = 'n'; + if($data['old']['ssl'] == 'n') $data['new']['ssl'] = 'n'; + /* Update the DB of the (local) Server */ + $app->db->query("UPDATE web_domain SET `ssl` = ?, `ssl_letsencrypt` = ? WHERE `domain` = ?", $data['new']['ssl'], 'n', $data['new']['domain']); + /* Update also the master-DB of the Server-Farm */ + $app->dbmaster->query("UPDATE web_domain SET `ssl` = ?, `ssl_letsencrypt` = ? WHERE `domain` = ? AND `server_id` = ?", $data['new']['ssl'], 'n', $data['new']['domain'], $conf['server_id']); + } + } + + if(@is_file($bundle_file)) $vhost_data['has_bundle_cert'] = 1; + + // HTTP/2.0 ? + $vhost_data['enable_http2'] = 'n'; + if($vhost_data['enable_spdy'] == 'y'){ + $tmp_output = null; + $tmp_retval = 0; + if($server_type === 'apache') { + // check if apache supports http_v2 + exec("2>&1 apachectl -M | grep http2_module", $tmp_output, $tmp_retval); + } else { + // check if nginx support http_v2; if so, use that instead of spdy + exec("2>&1 nginx -V | tr -- - '\n' | grep http_v2_module", $tmp_output, $tmp_retval); + } + if($tmp_retval == 0){ + $vhost_data['enable_http2'] = 'y'; + $vhost_data['enable_spdy'] = 'n'; + } + unset($tmp_output, $tmp_retval); + } + + // Set SEO Redirect + if($data['new']['seo_redirect'] != ''){ + $vhost_data['seo_redirect_enabled'] = 1; + $tmp_seo_redirects = $this->get_seo_redirects($data['new'], '', false, $server_type); + if(is_array($tmp_seo_redirects) && !empty($tmp_seo_redirects)){ + foreach($tmp_seo_redirects as $key => $val){ + $vhost_data[$key] = $val; + } + } else { + $vhost_data['seo_redirect_enabled'] = 0; + } + } else { + $vhost_data['seo_redirect_enabled'] = 0; + } + + if($server_type === 'nginx') { + if($domain!='' && $data['new']['ssl'] == 'y' && @is_file($crt_file) && @is_file($key_file) && (@filesize($crt_file)>0) && (@filesize($key_file)>0)) { + $vhost_data['ssl_enabled'] = 1; + $app->log('Enable SSL for: '.$domain, LOGLEVEL_DEBUG); + } else { + $vhost_data['ssl_enabled'] = 0; + $app->log('SSL Disabled. '.$domain, LOGLEVEL_DEBUG); + } + } + + // set logging variable + $vhost_data['logging'] = $web_config['logging']; + + $tpl->setVar($vhost_data); + + $config_prefix = ''; + if($server_type === 'apache') { + $tpl->setVar('apache_version', $app->system->getapacheversion()); + $tpl->setVar('apache_full_version', $app->system->getapacheversion(true)); + $app->plugin_webserver_apache->processRewriteRules($tpl, $data, $vhost_data); + $app->plugin_webserver_apache->processPhpStarters($tpl, $data, $vhost_data); + $app->plugin_webserver_apache->processVhosts($tpl, $data, $vhost_data); + } elseif($server_type === 'nginx') { + $app->plugin_webserver_nginx->processStatsAuth($tpl, $data, $vhost_data); + $config_prefix = 'nginx_'; + } + + /** + * PHP-FPM + */ + // Support for multiple PHP versions + if($data['new']['php'] == 'php-fpm'){ + if(trim($data['new']['fastcgi_php_version']) != ''){ + $default_php_fpm = false; + list($custom_php_fpm_name, $custom_php_fpm_init_script, $custom_php_fpm_ini_dir, $custom_php_fpm_pool_dir) = explode(':', trim($data['new']['fastcgi_php_version'])); + if(substr($custom_php_fpm_ini_dir, -1) != '/') $custom_php_fpm_ini_dir .= '/'; + } else { + $default_php_fpm = true; + } + } else { + if(trim($data['old']['fastcgi_php_version']) != '' && $data['old']['php'] == 'php-fpm'){ + $default_php_fpm = false; + list($custom_php_fpm_name, $custom_php_fpm_init_script, $custom_php_fpm_ini_dir, $custom_php_fpm_pool_dir) = explode(':', trim($data['old']['fastcgi_php_version'])); + if(substr($custom_php_fpm_ini_dir, -1) != '/') $custom_php_fpm_ini_dir .= '/'; + } else { + $default_php_fpm = true; + } + } + + if($default_php_fpm){ + $pool_dir = escapeshellcmd($web_config['php_fpm_pool_dir']); + } else { + $pool_dir = $custom_php_fpm_pool_dir; + } + $pool_dir = trim($pool_dir); + if(substr($pool_dir, -1) != '/') $pool_dir .= '/'; + $pool_name = 'web'.$data['new']['domain_id']; + $socket_dir = escapeshellcmd($web_config['php_fpm_socket_dir']); + if(substr($socket_dir, -1) != '/') $socket_dir .= '/'; + + if($data['new']['php_fpm_use_socket'] == 'y'){ + $use_tcp = 0; + $use_socket = 1; + if(!is_dir($socket_dir)) $app->system->mkdirpath($socket_dir); + } else { + $use_tcp = 1; + $use_socket = 0; + } + $tpl->setVar('use_tcp', $use_tcp); + $tpl->setVar('use_socket', $use_socket); + $fpm_socket = $socket_dir.$pool_name.'.sock'; + $tpl->setVar('fpm_socket', $fpm_socket); + $tpl->setVar('fpm_port', $web_config['php_fpm_start_port'] + $data['new']['domain_id'] - 1); + + $this->php_fpm_pool_update($data, $web_config, $pool_dir, $pool_name, $socket_dir, $server_type); + if($server_type === 'nginx') { + $fpm_data = array( + 'use_tcp' => $use_tcp, + 'use_socket' => $use_socket, + 'socket_dir' => $socket_dir, + 'fpm_socket' => $fpm_socket, + 'fpm_port' => $web_config['php_fpm_start_port'] + $data['new']['domain_id'] - 1 + ); + $app->plugin_webserver_nginx->processCustomDirectives($tpl, $data, $vhost_data, $fpm_data); + } + + $vhost_file = escapeshellcmd($web_config[$config_prefix.'vhost_conf_dir'].'/'.$data['new']['domain'].'.vhost'); + //* Make a backup copy of vhost file + if(file_exists($vhost_file)) $app->system->copy($vhost_file, $vhost_file.'~'); + + //* Write vhost file + if($server_type === 'apache') { + $app->system->file_put_contents($vhost_file, $tpl->grab()); + } else { + $app->system->file_put_contents($vhost_file, $this->nginx_merge_locations($tpl->grab())); + } + $app->log('Writing the vhost file: '.$vhost_file, LOGLEVEL_DEBUG); + + if($server_type === 'apache') { + /* + * maybe we have some webdav - user. If so, add them... + */ + $this->_patchVhostWebdav($vhost_file, $data['new']['document_root'] . '/webdav'); + } + + //* Set the symlink to enable the vhost + //* First we check if there is a old type of symlink and remove it + $vhost_symlink = escapeshellcmd($web_config[$config_prefix.'vhost_conf_enabled_dir'].'/'.$data['new']['domain'].'.vhost'); + if(is_link($vhost_symlink)) $app->system->unlink($vhost_symlink); + + //* Remove old or changed symlinks + if($data['new']['subdomain'] != $data['old']['subdomain'] or $data['new']['active'] == 'n') { + $vhost_symlink = escapeshellcmd($web_config[$config_prefix.'vhost_conf_enabled_dir'].'/900-'.$data['new']['domain'].'.vhost'); + if(is_link($vhost_symlink)) { + $app->system->unlink($vhost_symlink); + $app->log('Removing symlink: '.$vhost_symlink.'->'.$vhost_file, LOGLEVEL_DEBUG); + } + $vhost_symlink = escapeshellcmd($web_config[$config_prefix.'vhost_conf_enabled_dir'].'/100-'.$data['new']['domain'].'.vhost'); + if(is_link($vhost_symlink)) { + $app->system->unlink($vhost_symlink); + $app->log('Removing symlink: '.$vhost_symlink.'->'.$vhost_file, LOGLEVEL_DEBUG); + } + } + + //* New symlink + if($data['new']['subdomain'] == '*') { + $vhost_symlink = escapeshellcmd($web_config[$config_prefix.'vhost_conf_enabled_dir'].'/900-'.$data['new']['domain'].'.vhost'); + } else { + $vhost_symlink = escapeshellcmd($web_config[$config_prefix.'vhost_conf_enabled_dir'].'/100-'.$data['new']['domain'].'.vhost'); + } + if($data['new']['active'] == 'y' && !is_link($vhost_symlink)) { + symlink($vhost_file, $vhost_symlink); + $app->log('Creating symlink: '.$vhost_symlink.'->'.$vhost_file, LOGLEVEL_DEBUG); + } + + // remove old symlink and vhost file, if domain name of the site has changed + if($this->action == 'update' && $data['old']['domain'] != '' && $data['new']['domain'] != $data['old']['domain']) { + $vhost_symlink = escapeshellcmd($web_config[$config_prefix.'vhost_conf_enabled_dir'].'/900-'.$data['old']['domain'].'.vhost'); + if(is_link($vhost_symlink)) { + $app->system->unlink($vhost_symlink); + $app->log('Removing symlink: '.$vhost_symlink.'->'.$vhost_file, LOGLEVEL_DEBUG); + } + $vhost_symlink = escapeshellcmd($web_config[$config_prefix.'vhost_conf_enabled_dir'].'/100-'.$data['old']['domain'].'.vhost'); + if(is_link($vhost_symlink)) { + $app->system->unlink($vhost_symlink); + $app->log('Removing symlink: '.$vhost_symlink.'->'.$vhost_file, LOGLEVEL_DEBUG); + } + $vhost_symlink = escapeshellcmd($web_config[$config_prefix.'vhost_conf_enabled_dir'].'/'.$data['old']['domain'].'.vhost'); + if(is_link($vhost_symlink)) { + $app->system->unlink($vhost_symlink); + $app->log('Removing symlink: '.$vhost_symlink.'->'.$vhost_file, LOGLEVEL_DEBUG); + } + $vhost_file = escapeshellcmd($web_config[$config_prefix.'vhost_conf_dir'].'/'.$data['old']['domain'].'.vhost'); + $app->system->unlink($vhost_file); + $app->log('Removing file: '.$vhost_file, LOGLEVEL_DEBUG); + } + + if($server_type === 'apache') { + //* Create .htaccess and .htpasswd file for website statistics + if(!is_dir($data['new']['document_root'].'/' . $web_folder . '/stats')) $app->system->mkdir($data['new']['document_root'].'/' . $web_folder . '/stats'); + $ht_file = "AuthType Basic\nAuthName \"Members Only\"\nAuthUserFile ".$data['new']['document_root']."/web/stats/.htpasswd_stats\nrequire valid-user"; + $app->system->file_put_contents($data['new']['document_root'].'/' . $web_folder . '/stats/.htaccess', $ht_file); + $app->system->chmod($data['new']['document_root'].'/' . $web_folder . '/stats/.htaccess', 0755); + unset($ht_file); + + if(!is_file($data['new']['document_root'].'/web/stats/.htpasswd_stats') || $data['new']['stats_password'] != $data['old']['stats_password']) { + if(trim($data['new']['stats_password']) != '') { + $htp_file = 'admin:'.trim($data['new']['stats_password']); + $app->system->web_folder_protection($data['new']['document_root'], false); + $app->system->file_put_contents($data['new']['document_root'].'/web/stats/.htpasswd_stats', $htp_file); + $app->system->web_folder_protection($data['new']['document_root'], true); + $app->system->chmod($data['new']['document_root'].'/web/stats/.htpasswd_stats', 0755); + unset($htp_file); + } + } + } else { + // create password file for stats directory + $stats_web_folder = $app->plugin_webserver_nginx->getStatsFolder($data); + + if(!is_file($data['new']['document_root'].'/' . $stats_web_folder . '/stats/.htpasswd_stats') || $data['new']['stats_password'] != $data['old']['stats_password']) { + if(trim($data['new']['stats_password']) != '') { + $htp_file = 'admin:'.trim($data['new']['stats_password']); + $app->system->file_put_contents($data['new']['document_root'].'/' . $stats_web_folder . '/stats/.htpasswd_stats', $htp_file); + $app->system->chmod($data['new']['document_root'].'/' . $stats_web_folder . '/stats/.htpasswd_stats', 0755); + unset($htp_file); + } + } + } + + //* Create awstats configuration + if($data['new']['stats_type'] == 'awstats' && ($data['new']['type'] == 'vhost' || $data['new']['type'] == 'vhostsubdomain' || $data['new']['type'] == 'vhostalias')) { + $app->plugin_webserver_base->awstats_update($data, $web_config); + } + + if($web_config['check_apache_config'] == 'y') { + //* Test if server starts with the new configuration file + $online_status_before_restart = $this->_checkTcp('localhost', 80); + $app->log('web server status is: '.($online_status_before_restart === true? 'running' : 'down'), LOGLEVEL_DEBUG); + + $retval = $app->services->restartService('httpd', 'restart'); // $retval['retval'] is 0 on success and > 0 on failure + $app->log('web server restart return value is: '.$retval['retval'], LOGLEVEL_DEBUG); + + // wait a few seconds, before we test the status again + $online_status_after_restart = false; + sleep(2); + for($i = 0; $i < 5; $i++) { + $online_status_after_restart = $this->_checkTcp('localhost', 80); + if($online_status_after_restart) break; + sleep(1); + } + //* Check if server restarted successfully if it was online before + $app->log('web server online status after restart is: '.($online_status_after_restart === true? 'running' : 'down'), LOGLEVEL_DEBUG); + if($online_status_before_restart && !$online_status_after_restart || $retval['retval'] > 0) { + $app->log('web server did not restart after the configuration change for website '.$data['new']['domain'].'. Reverting the configuration. Saved non-working config as '.$vhost_file.'.err', LOGLEVEL_WARN); + if(is_array($retval['output']) && !empty($retval['output'])){ + $app->log('Reason for web server restart failure: '.implode("\n", $retval['output']), LOGLEVEL_WARN); + $app->dbmaster->datalogError(implode("\n", $retval['output'])); + } else { + $app->plugin_webserver_apache->testWebserverConfig(); + } + $app->system->copy($vhost_file, $vhost_file.'.err'); + + if(is_file($vhost_file.'~')) { + //* Copy back the last backup file + $app->system->copy($vhost_file.'~', $vhost_file); + } else { + //* There is no backup file, so we create a empty vhost file with a warning message inside + $app->system->file_put_contents($vhost_file, "# web server did not start after modifying this vhost file.\n# Please check file $vhost_file.err for syntax errors."); + } + + if($this->ssl_certificate_changed === true) { + if($server_type === 'nginx') { + /* TODO: check if needed! */ + $ssl_dir = $data['new']['document_root'].'/ssl'; + $domain = $data['new']['ssl_domain']; + $key_file = $ssl_dir.'/'.$domain.'.key.org'; + $key_file2 = $ssl_dir.'/'.$domain.'.key'; + $csr_file = $ssl_dir.'/'.$domain.'.csr'; + $crt_file = $ssl_dir.'/'.$domain.'.crt'; + } + + //* Backup the files that might have caused the error + if(is_file($key_file)){ + $app->system->copy($key_file, $key_file.'.err'); + $app->system->chmod($key_file.'.err', 0400); + } + if(is_file($key_file2)){ + $app->system->copy($key_file2, $key_file2.'.err'); + $app->system->chmod($key_file2.'.err', 0400); + } + if(is_file($csr_file)) $app->system->copy($csr_file, $csr_file.'.err'); + if(is_file($crt_file)) $app->system->copy($crt_file, $crt_file.'.err'); + if(is_file($bundle_file)) $app->system->copy($bundle_file, $bundle_file.'.err'); + + //* Restore the ~ backup files + if(is_file($key_file.'~')) $app->system->copy($key_file.'~', $key_file); + if(is_file($key_file2.'~')) $app->system->copy($key_file2.'~', $key_file2); + if(is_file($crt_file.'~')) $app->system->copy($crt_file.'~', $crt_file); + if(is_file($csr_file.'~')) $app->system->copy($csr_file.'~', $csr_file); + if(is_file($bundle_file.'~')) $app->system->copy($bundle_file.'~', $bundle_file); + + $app->log('web server did not restart after the configuration change for website '.$data['new']['domain'].' Reverting the SSL configuration. Saved non-working SSL files with .err extension.', LOGLEVEL_WARN); + } + + $app->services->restartService('httpd', 'restart'); + } + } else { + //* We do not check the web server config after changes (is faster) + if($is_chrooted) { + $app->services->restartServiceDelayed('httpd', 'restart'); + } else { + // request a httpd reload when all records have been processed + $app->services->restartServiceDelayed('httpd', 'reload'); + } + } + + //* The vhost is written and apache has been restarted, so we + // can reset the ssl changed var to false and cleanup some files + $this->ssl_certificate_changed = false; + + if(@is_file($key_file.'~')) $app->system->unlink($key_file.'~'); + if(@is_file($key_file2.'~')) $app->system->unlink($key_file2.'~'); + if(@is_file($crt_file.'~')) $app->system->unlink($crt_file.'~'); + if(@is_file($csr_file.'~')) $app->system->unlink($csr_file.'~'); + if(@is_file($bundle_file.'~')) $app->system->unlink($bundle_file.'~'); + + // Remove the backup copy of the config file. + if(@is_file($vhost_file.'~')) $app->system->unlink($vhost_file.'~'); + + //* Unset action to clean it for next processed vhost. + $this->action = ''; + } + + public function eventDelete($event_name, $data, $server_type = 'apache') { + global $app, $conf; + + // load the server configuration options + $app->uses('getconf'); + $app->uses('system'); + $web_config = $app->getconf->get_server_config($conf['server_id'], 'web'); + $fastcgi_config = $app->getconf->get_server_config($conf['server_id'], 'fastcgi'); + + if($data['old']['type'] == 'vhost') { + $app->system->web_folder_protection($data['old']['document_root'], false); + } elseif($data['old']['type'] == 'vhostsubdomain' || $data['old']['type'] == 'vhostalias') { + + $parent_domain_id = intval($data['old']['parent_domain_id']); + $tmp = $app->db->queryOneRecord("SELECT * FROM web_domain WHERE domain_id = ? AND active = 'y'", $parent_domain_id); + $app->system->web_folder_protection($tmp['document_root'], false); + } + + //* Check if this is a chrooted setup + if($web_config['website_basedir'] != '' && @is_file($web_config['website_basedir'].'/etc/passwd')) { + $is_chrooted = true; + } else { + $is_chrooted = false; + } + + //* Remove the mounts + $log_folder = 'log'; + $web_folder = ''; + if($data['old']['type'] == 'vhostsubdomain' || $data['old']['type'] == 'vhostalias') { + $tmp = $app->db->queryOneRecord('SELECT `domain`,`document_root` FROM web_domain WHERE domain_id = ?', $data['old']['parent_domain_id']); + if($tmp['domain'] != ''){ + $subdomain_host = preg_replace('/^(.*)\.' . preg_quote($tmp['domain'], '/') . '$/', '$1', $data['old']['domain']); + } else { + // we are deleting the parent domain, so we can delete everything in the log directory + $subdomain_hosts = array(); + $files = array_diff(scandir($data['old']['document_root'].'/'.$log_folder), array('.', '..')); + if(is_array($files) && !empty($files)){ + foreach($files as $file){ + if(is_dir($data['old']['document_root'].'/'.$log_folder.'/'.$file)){ + $subdomain_hosts[] = $file; + } + } + } + } + if(is_array($subdomain_hosts) && !empty($subdomain_hosts)){ + $log_folders = array(); + foreach($subdomain_hosts as $subdomain_host){ + $log_folders[] = $log_folder.'/'.$subdomain_host; + } + } else { + if($subdomain_host == '') $subdomain_host = 'web'.$data['old']['domain_id']; + $log_folder .= '/' . $subdomain_host; + } + $web_folder = $data['old']['web_folder']; + unset($tmp); + unset($subdomain_hosts); + } + + if($data['old']['type'] == 'vhost' || $data['old']['type'] == 'vhostsubdomain' || $data['old']['type'] == 'vhostalias'){ + if(is_array($log_folders) && !empty($log_folders)){ + foreach($log_folders as $log_folder){ + exec('umount -l '.escapeshellarg($data['old']['document_root'].'/'.$log_folder) . ' 2>/dev/null'); + } + } else { + exec('umount -l '.escapeshellarg($data['old']['document_root'].'/'.$log_folder) . ' 2>/dev/null'); + } + + //try umount mysql + if(file_exists($data['old']['document_root'].'/var/run/mysqld')) { + $fstab_line = '/var/run/mysqld ' . $data['old']['document_root'] . '/var/run/mysqld none bind,nobootwait 0 0'; + $app->system->removeLine('/etc/fstab', $fstab_line); + $command = 'umount ' . escapeshellarg($data['old']['document_root']) . '/var/run/mysqld/'; + exec($command); + } + + // remove letsencrypt if it exists (renew will always fail otherwise) + + $old_domain = $data['old']['domain']; + if(substr($old_domain, 0, 2) === '*.') { + // wildcard domain not yet supported by letsencrypt! + $old_domain = substr($old_domain, 2); + } + @rename('/etc/letsencrypt/renewal/' . $old_domain . '.conf', '/etc/letsencrypt/renewal/' . $old_domain . '.conf~backup'); + } + + //* remove mountpoint from fstab + if(is_array($log_folders) && !empty($log_folders)){ + foreach($log_folders as $log_folder){ + $fstab_line = '/var/log/ispconfig/httpd/'.$data['old']['domain'].' '.$data['old']['document_root'].'/'.$log_folder.' none bind'; + $app->system->removeLine('/etc/fstab', $fstab_line); + } + } else { + $fstab_line = '/var/log/ispconfig/httpd/'.$data['old']['domain'].' '.$data['old']['document_root'].'/'.$log_folder.' none bind'; + $app->system->removeLine('/etc/fstab', $fstab_line); + } + unset($log_folders); + + if($data['old']['type'] != 'vhost' && $data['old']['type'] != 'vhostsubdomain' && $data['old']['type'] != 'vhostalias' && $data['old']['parent_domain_id'] > 0) { + //* This is a alias domain or subdomain, so we have to update the website instead + $parent_domain_id = intval($data['old']['parent_domain_id']); + $tmp = $app->db->queryOneRecord("SELECT * FROM web_domain WHERE domain_id = ? AND active = 'y'", $parent_domain_id); + $data['new'] = $tmp; + $data['old'] = $tmp; + $this->action = 'update'; + $this->update_letsencrypt = true; + // just run the update function + $this->update($event_name, $data); + + } else { + $conf_prefix = ''; + if($server_type === 'nginx') { + $conf_prefix = 'nginx_'; + } + + //* This is a website + // Deleting the vhost file, symlink and the data directory + $vhost_file = escapeshellcmd($web_config[$conf_prefix.'vhost_conf_dir'].'/'.$data['old']['domain'].'.vhost'); + + $vhost_symlink = escapeshellcmd($web_config[$conf_prefix.'vhost_conf_enabled_dir'].'/'.$data['old']['domain'].'.vhost'); + if(is_link($vhost_symlink)){ + $app->system->unlink($vhost_symlink); + $app->log('Removing symlink: '.$vhost_symlink.'->'.$vhost_file, LOGLEVEL_DEBUG); + } + $vhost_symlink = escapeshellcmd($web_config[$conf_prefix.'vhost_conf_enabled_dir'].'/900-'.$data['old']['domain'].'.vhost'); + if(is_link($vhost_symlink)){ + $app->system->unlink($vhost_symlink); + $app->log('Removing symlink: '.$vhost_symlink.'->'.$vhost_file, LOGLEVEL_DEBUG); + } + $vhost_symlink = escapeshellcmd($web_config[$conf_prefix.'vhost_conf_enabled_dir'].'/100-'.$data['old']['domain'].'.vhost'); + if(is_link($vhost_symlink)){ + $app->system->unlink($vhost_symlink); + $app->log('Removing symlink: '.$vhost_symlink.'->'.$vhost_file, LOGLEVEL_DEBUG); + } + + $app->system->unlink($vhost_file); + $app->log('Removing vhost file: '.$vhost_file, LOGLEVEL_DEBUG); + + if($data['old']['type'] == 'vhost' || $data['old']['type'] == 'vhostsubdomain' || $data['old']['type'] == 'vhostalias') { + $docroot = escapeshellcmd($data['old']['document_root']); + if($docroot != '' && !stristr($docroot, '..')) { + if($data['old']['type'] == 'vhost') { + // this is a vhost - we delete everything in here. + exec('rm -rf '.$docroot); + } elseif(!stristr($data['old']['web_folder'], '..')) { + // this is a vhost subdomain + // IMPORTANT: do some folder checks before we delete this! + $do_delete = true; + $delete_folder = preg_replace('/[\/]{2,}/', '/', $web_folder); // replace / occuring multiple times + if(substr($delete_folder, 0, 1) === '/') $delete_folder = substr($delete_folder, 1); + if(substr($delete_folder, -1) === '/') $delete_folder = substr($delete_folder, 0, -1); + + $path_elements = explode('/', $delete_folder); + + if($path_elements[0] == 'web' || $path_elements[0] === '') { + // paths beginning with /web should NEVER EVER be deleted, empty paths should NEVER occur - but for safety reasons we check it here! + // we use strict check as otherwise directories named '0' may not be deleted + $do_delete = false; + } else { + // read all vhost subdomains and alias with same parent domain + $used_paths = array(); + $tmp = $app->db->queryAllRecords("SELECT `web_folder` FROM web_domain WHERE (type = 'vhostsubdomain' OR type = 'vhostalias') AND parent_domain_id = ? AND domain_id != ?", $data['old']['parent_domain_id'], $data['old']['domain_id']); + foreach($tmp as $tmprec) { + // we normalize the folder entries because we need to compare them + $tmp_folder = preg_replace('/[\/]{2,}/', '/', $tmprec['web_folder']); // replace / occuring multiple times + if(substr($tmp_folder, 0, 1) === '/') $tmp_folder = substr($tmp_folder, 1); + if(substr($tmp_folder, -1) === '/') $tmp_folder = substr($tmp_folder, 0, -1); + + // add this path and it's parent paths to used_paths array + while(strpos($tmp_folder, '/') !== false) { + if(in_array($tmp_folder, $used_paths) == false) $used_paths[] = $tmp_folder; + $tmp_folder = substr($tmp_folder, 0, strrpos($tmp_folder, '/')); + } + if(in_array($tmp_folder, $used_paths) == false) $used_paths[] = $tmp_folder; + } + unset($tmp); + + // loop and check if the path is still used and stop at first used one + // set do_delete to false so nothing gets deleted if the web_folder itself is still used + $do_delete = false; + while(count($path_elements) > 0) { + $tmp_folder = implode('/', $path_elements); + if(in_array($tmp_folder, $used_paths) == true) break; + + // this path is not used - set it as path to delete, strip the last element from the array and set do_delete to true + $delete_folder = $tmp_folder; + $do_delete = true; + array_pop($path_elements); + } + unset($tmp_folder); + unset($used_paths); + } + + if($do_delete === true && $delete_folder !== '') exec('rm -rf '.$docroot.'/'.$delete_folder); + + unset($delete_folder); + unset($path_elements); + } + } + + //remove the php fastgi starter script if available + if ($data['old']['php'] == 'fast-cgi') { + $fastcgi_starter_path = str_replace('[system_user]', $data['old']['system_user'], $fastcgi_config['fastcgi_starter_path']); + if($data['old']['type'] == 'vhost') { + if (is_dir($fastcgi_starter_path)) { + exec('rm -rf '.$fastcgi_starter_path); + } + } else { + $fcgi_starter_script = $fastcgi_starter_path.$fastcgi_config['fastcgi_starter_script'].'_web'.$data['old']['domain_id']; + if (file_exists($fcgi_starter_script)) { + exec('rm -f '.$fcgi_starter_script); + } + } + } + + // remove PHP-FPM pool + if ($data['old']['php'] == 'php-fpm') { + $this->php_fpm_pool_delete($data, $web_config, $server_type); + } + + $app->log('Removing website: '.$docroot, LOGLEVEL_DEBUG); + + // Delete the symlinks for the sites + $client = $app->db->queryOneRecord('SELECT client_id FROM sys_group WHERE sys_group.groupid = ?', $data['old']['sys_groupid']); + $client_id = intval($client['client_id']); + unset($client); + $tmp_symlinks_array = explode(':', $web_config['website_symlinks']); + if(is_array($tmp_symlinks_array)) { + foreach($tmp_symlinks_array as $tmp_symlink) { + $tmp_symlink = str_replace('[client_id]', $client_id, $tmp_symlink); + $tmp_symlink = str_replace('[website_domain]', $data['old']['domain'], $tmp_symlink); + // Remove trailing slash + if(substr($tmp_symlink, -1, 1) == '/') $tmp_symlink = substr($tmp_symlink, 0, -1); + // delete the symlink + if(is_link($tmp_symlink)) { + $app->system->unlink($tmp_symlink); + $app->log('Removing symlink: '.$tmp_symlink, LOGLEVEL_DEBUG); + } + } + } + // end removing symlinks + } + + // Delete the log file directory + $vhost_logfile_dir = escapeshellcmd('/var/log/ispconfig/httpd/'.$data['old']['domain']); + if($data['old']['domain'] != '' && !stristr($vhost_logfile_dir, '..')) exec('rm -rf '.$vhost_logfile_dir); + $app->log('Removing website logfile directory: '.$vhost_logfile_dir, LOGLEVEL_DEBUG); + + if($data['old']['type'] == 'vhost') { + //delete the web user + $command = 'killall -u '.escapeshellcmd($data['old']['system_user']).' ; userdel'; + $command .= ' '.escapeshellcmd($data['old']['system_user']); + exec($command); + if($is_chrooted) $app->system->_exec('chroot '.escapeshellcmd($web_config['website_basedir']).' '.$command); + + } + + //* Remove the awstats configuration file + if($data['old']['stats_type'] == 'awstats') { + $this->awstats_delete($data, $web_config); + } + + if($data['old']['type'] == 'vhostsubdomain' || $data['old']['type'] == 'vhostalias') { + $parent_domain_id = intval($data['old']['parent_domain_id']); + $tmp = $app->db->queryOneRecord("SELECT * FROM web_domain WHERE domain_id = ? AND active = 'y'", $parent_domain_id); $app->system->web_folder_protection($tmp['document_root'], true); + } + + if($is_chrooted) { + $app->services->restartServiceDelayed('httpd', 'restart'); + } else { + // request a httpd reload when all records have been processed + $app->services->restartServiceDelayed('httpd', 'reload'); + } + + //* Delete the web-backups + if($data['old']['type'] == 'vhost') { + $server_config = $app->getconf->get_server_config($conf['server_id'], 'server'); + $backup_dir = $server_config['backup_dir']; + $mount_backup = true; + if($server_config['backup_dir'] != '' && $server_config['backup_delete'] == 'y') { + //* mount backup directory, if necessary + if( $server_config['backup_dir_is_mount'] == 'y' && !$app->system->mount_backup_dir($backup_dir) ) $mount_backup = false; + + if($mount_backup){ + $web_backup_dir = $backup_dir.'/web'.$data['old']['domain_id']; + //** do not use rm -rf $web_backup_dir because database(s) may exits + exec(escapeshellcmd('rm -f '.$web_backup_dir.'/web'.$data['old']['domain_id'].'_').'*'); + //* cleanup database + $sql = "DELETE FROM web_backup WHERE server_id = ? AND parent_domain_id = ? AND filename LIKE ?"; + $app->db->query($sql, $conf['server_id'], $data['old']['domain_id'], "web".$data['old']['domain_id']."_%"); + if($app->db->dbHost != $app->dbmaster->dbHost) $app->dbmaster->query($sql, $conf['server_id'], $data['old']['domain_id'], "web".$data['old']['domain_id']."_%"); + + $app->log('Deleted the web backup files', LOGLEVEL_DEBUG); + } + } + } + } + if($data['old']['type'] != 'vhost') $app->system->web_folder_protection($data['old']['document_root'], true); + } + + //* This function is called when a IP on the server is inserted, updated or deleted or when anon_ip setting is altered + function eventServerIp($event_name, $data, $server_type = 'apache') { + global $app, $conf; + + if($server_type === 'nginx') { + // not yet implemented + return; + } + + // load the server configuration options + $app->uses('getconf'); + $web_config = $app->getconf->get_server_config($conf['server_id'], 'web'); + + $app->load('tpl'); + + $tpl = new tpl(); + $tpl->newTemplate('apache_ispconfig.conf.master'); + $tpl->setVar('apache_version', $app->system->getapacheversion()); + $tpl->setVar('logging', $web_config['logging']); + $tpl->setVar('apache_full_version', $app->system->getapacheversion(true)); + $records = $app->db->queryAllRecords("SELECT * FROM server_ip WHERE server_id = ? AND virtualhost = 'y'", $conf['server_id']); + + $records_out= array(); + if(is_array($records)) { + foreach($records as $rec) { + if($rec['ip_type'] == 'IPv6') { + $ip_address = '['.$rec['ip_address'].']'; + } else { + $ip_address = $rec['ip_address']; + } + $ports = explode(',', $rec['virtualhost_port']); + if(is_array($ports)) { + foreach($ports as $port) { + $port = intval($port); + if($port > 0 && $port < 65536 && $ip_address != '') { + $records_out[] = array('ip_address' => $ip_address, 'port' => $port); + } + } + } + } + } + + + if(count($records_out) > 0) { + $tpl->setLoop('ip_adresses', $records_out); + } + + $vhost_file = escapeshellcmd($web_config['vhost_conf_dir'].'/ispconfig.conf'); + $app->system->file_put_contents($vhost_file, $tpl->grab()); + $app->log('Writing the conf file: '.$vhost_file, LOGLEVEL_DEBUG); + unset($tpl); + + } + + //* Create or update the .htaccess folder protection + public function eventWebFolderUser($event_name, $data, $server_type = 'apache') { + global $app; + + $app->uses('system'); + + if($event_name == 'web_folder_user_delete') { + $folder_id = $data['old']['web_folder_id']; + } else { + $folder_id = $data['new']['web_folder_id']; + } + + $folder = $app->db->queryOneRecord("SELECT * FROM web_folder WHERE web_folder_id = ?", $folder_id); + $website = $app->db->queryOneRecord("SELECT * FROM web_domain WHERE domain_id = ?", $folder['parent_domain_id']); + + if(!is_array($folder) or !is_array($website)) { + $app->log('Not able to retrieve folder or website record.', LOGLEVEL_DEBUG); + return false; + } + + $web_folder = 'web'; + if($website['type'] == 'vhostsubdomain' || $website['type'] == 'vhostalias') $web_folder = $website['web_folder']; + + //* Get the folder path. + if(substr($folder['path'], 0, 1) == '/') $folder['path'] = substr($folder['path'], 1); + if(substr($folder['path'], -1) == '/') $folder['path'] = substr($folder['path'], 0, -1); + $folder_path = escapeshellcmd($website['document_root'].'/' . $web_folder . '/'.$folder['path']); + if(substr($folder_path, -1) != '/') $folder_path .= '/'; + + //* Check if the resulting path is inside the docroot + if(stristr($folder_path, '..') || stristr($folder_path, './') || stristr($folder_path, '\\')) { + $app->log('Folder path "'.$folder_path.'" contains .. or ./.', LOGLEVEL_DEBUG); + return false; + } + + //* Create the folder path, if it does not exist + if(!is_dir($folder_path)) { + $app->system->mkdirpath($folder_path, 0755, $website['system_user'], $website['system_group']); + } + + //* Create empty .htpasswd file, if it does not exist + if(!is_file($folder_path.'.htpasswd')) { + $app->system->touch($folder_path.'.htpasswd'); + $app->system->chmod($folder_path.'.htpasswd', 0751); + $app->system->chown($folder_path.'.htpasswd', $website['system_user']); + $app->system->chgrp($folder_path.'.htpasswd', $website['system_group']); + $app->log('Created file '.$folder_path.'.htpasswd', LOGLEVEL_DEBUG); + } + + if(($data['new']['username'] != $data['old']['username'] || $data['new']['active'] == 'n') && $data['old']['username'] != '') { + $app->system->removeLine($folder_path.'.htpasswd', $data['old']['username'].':'); + $app->log('Removed user: '.$data['old']['username'], LOGLEVEL_DEBUG); + } + + //* Add or remove the user from .htpasswd file + if($event_name == 'web_folder_user_delete') { + $app->system->removeLine($folder_path.'.htpasswd', $data['old']['username'].':'); + $app->log('Removed user: '.$data['old']['username'], LOGLEVEL_DEBUG); + } else { + if($data['new']['active'] == 'y') { + $app->system->replaceLine($folder_path.'.htpasswd', $data['new']['username'].':', $data['new']['username'].':'.$data['new']['password'], 0, 1); + $app->log('Added or updated user: '.$data['new']['username'], LOGLEVEL_DEBUG); + } + } + + if($server_type === 'apache') { + //* Create the .htaccess file + //if(!is_file($folder_path.'.htaccess')) { + $begin_marker = '### ISPConfig folder protection begin ###'; + $end_marker = "### ISPConfig folder protection end ###\n\n"; + $ht_file = $begin_marker."\nAuthType Basic\nAuthName \"Members Only\"\nAuthUserFile ".$folder_path.".htpasswd\nrequire valid-user\n".$end_marker; + + if(file_exists($folder_path.'.htaccess')) { + $old_content = $app->system->file_get_contents($folder_path.'.htaccess'); + + $matches = array(); + if(preg_match('/' . preg_quote($begin_marker, '/') . '(.*?)' . preg_quote($end_marker, '/') . '/s', $old_content, $matches)) { + $ht_file = str_replace($matches[0], $ht_file, $old_content); + } else { + $ht_file .= $old_content; + } + } + unset($old_content); + + $app->system->file_put_contents($folder_path.'.htaccess', $ht_file); + $app->system->chmod($folder_path.'.htaccess', 0751); + $app->system->chown($folder_path.'.htaccess', $website['system_user']); + $app->system->chgrp($folder_path.'.htaccess', $website['system_group']); + $app->log('Created/modified file '.$folder_path.'.htaccess', LOGLEVEL_DEBUG); + } else { + // write basic auth configuration to vhost file because nginx does not support .htaccess + $webdata['new'] = $webdata['old'] = $website; + $this->update('web_domain_update', $webdata); + } + + } + + //* Remove .htaccess and .htpasswd file, when folder protection is removed + public function eventWebFolderDelete($event_name, $data, $server_type = 'apache') { + global $app; + + $folder = $data['old']; + $website = $app->db->queryOneRecord("SELECT * FROM web_domain WHERE domain_id = ?", $folder['parent_domain_id']); + + if(!is_array($folder) or !is_array($website)) { + $app->log('Not able to retrieve folder or website record.', LOGLEVEL_DEBUG); + return false; + } + + $web_folder = 'web'; + if($website['type'] == 'vhostsubdomain' || $website['type'] == 'vhostalias') $web_folder = $website['web_folder']; + + //* Get the folder path. + if(substr($folder['path'], 0, 1) == '/') $folder['path'] = substr($folder['path'], 1); + if(substr($folder['path'], -1) == '/') $folder['path'] = substr($folder['path'], 0, -1); + $folder_path = realpath($website['document_root'].'/' . $web_folder . '/'.$folder['path']); + if(substr($folder_path, -1) != '/') $folder_path .= '/'; + + //* Check if the resulting path is inside the docroot + if(substr($folder_path, 0, strlen($website['document_root'])) != $website['document_root']) { + $app->log('Folder path is outside of docroot.', LOGLEVEL_DEBUG); + return false; + } + + //* Remove .htpasswd file + if(is_file($folder_path.'.htpasswd')) { + $app->system->unlink($folder_path.'.htpasswd'); + $app->log('Removed file '.$folder_path.'.htpasswd', LOGLEVEL_DEBUG); + } + + if($server_type === 'apache') { + //* Remove .htaccess file + if(is_file($folder_path.'.htaccess')) { + $begin_marker = '### ISPConfig folder protection begin ###'; + $end_marker = "### ISPConfig folder protection end ###\n\n"; + + $ht_file = $app->system->file_get_contents($folder_path.'.htaccess'); + + $matches = array(); + if(preg_match('/' . preg_quote($begin_marker, '/') . '(.*?)' . preg_quote($end_marker, '/') . '/s', $ht_file, $matches)) { + $ht_file = str_replace($matches[0], '', $ht_file); + } else { + $ht_file = str_replace("AuthType Basic\nAuthName \"Members Only\"\nAuthUserFile ".$folder_path.".htpasswd\nrequire valid-user", '', $ht_file); + } + + if(trim($ht_file) == '') { + $app->system->unlink($folder_path.'.htaccess'); + $app->log('Removed file '.$folder_path.'.htaccess', LOGLEVEL_DEBUG); + } else { + $app->system->file_put_contents($folder_path.'.htaccess', $ht_file); + $app->log('Removed protection content from file '.$folder_path.'.htaccess', LOGLEVEL_DEBUG); + } + } + } else { + // write basic auth configuration to vhost file because nginx does not support .htaccess + $webdata['new'] = $webdata['old'] = $website; + $this->update('web_domain_update', $webdata); + } + } + + //* Update folder protection, when path has been changed + public function eventWebFolderUpdate($event_name, $data, $server_type = 'apache') { + global $app; + + $website = $app->db->queryOneRecord("SELECT * FROM web_domain WHERE domain_id = ?", $data['new']['parent_domain_id']); + + if(!is_array($website)) { + $app->log('Not able to retrieve folder or website record.', LOGLEVEL_DEBUG); + return false; + } + + $web_folder = 'web'; + if($website['type'] == 'vhostsubdomain' || $website['type'] == 'vhostalias') $web_folder = $website['web_folder']; + + //* Get the folder path. + if(substr($data['old']['path'], 0, 1) == '/') $data['old']['path'] = substr($data['old']['path'], 1); + if(substr($data['old']['path'], -1) == '/') $data['old']['path'] = substr($data['old']['path'], 0, -1); + $old_folder_path = realpath($website['document_root'].'/' . $web_folder . '/'.$data['old']['path']); + if(substr($old_folder_path, -1) != '/') $old_folder_path .= '/'; + + if(substr($data['new']['path'], 0, 1) == '/') $data['new']['path'] = substr($data['new']['path'], 1); + if(substr($data['new']['path'], -1) == '/') $data['new']['path'] = substr($data['new']['path'], 0, -1); + $new_folder_path = escapeshellcmd($website['document_root'].'/' . $web_folder . '/'.$data['new']['path']); + if(substr($new_folder_path, -1) != '/') $new_folder_path .= '/'; + + //* Check if the resulting path is inside the docroot + if(stristr($new_folder_path, '..') || stristr($new_folder_path, './') || stristr($new_folder_path, '\\')) { + $app->log('Folder path "'.$new_folder_path.'" contains .. or ./.', LOGLEVEL_DEBUG); + return false; + } + if(stristr($old_folder_path, '..') || stristr($old_folder_path, './') || stristr($old_folder_path, '\\')) { + $app->log('Folder path "'.$old_folder_path.'" contains .. or ./.', LOGLEVEL_DEBUG); + return false; + } + + //* Check if the resulting path is inside the docroot + if(substr($old_folder_path, 0, strlen($website['document_root'])) != $website['document_root']) { + $app->log('Old folder path '.$old_folder_path.' is outside of docroot.', LOGLEVEL_DEBUG); + return false; + } + if(substr($new_folder_path, 0, strlen($website['document_root'])) != $website['document_root']) { + $app->log('New folder path '.$new_folder_path.' is outside of docroot.', LOGLEVEL_DEBUG); + return false; + } + + //* Create the folder path, if it does not exist + if(!is_dir($new_folder_path)) $app->system->mkdirpath($new_folder_path); + + $begin_marker = '### ISPConfig folder protection begin ###'; + $end_marker = "### ISPConfig folder protection end ###\n\n"; + + if($data['old']['path'] != $data['new']['path']) { + + + //* move .htpasswd file + if(is_file($old_folder_path.'.htpasswd')) { + $app->system->rename($old_folder_path.'.htpasswd', $new_folder_path.'.htpasswd'); + $app->log('Moved file '.$old_folder_path.'.htpasswd to '.$new_folder_path.'.htpasswd', LOGLEVEL_DEBUG); + } + + if($server_type === 'apache') { + //* delete old .htaccess file + if(is_file($old_folder_path.'.htaccess')) { + $ht_file = $app->system->file_get_contents($old_folder_path.'.htaccess'); + + $matches = array(); + if(preg_match('/' . preg_quote($begin_marker, '/') . '(.*?)' . preg_quote($end_marker, '/') . '/s', $ht_file, $matches)) { + $ht_file = str_replace($matches[0], '', $ht_file); + } else { + $ht_file = str_replace("AuthType Basic\nAuthName \"Members Only\"\nAuthUserFile ".$old_folder_path.".htpasswd\nrequire valid-user", '', $ht_file); + } + + if(trim($ht_file) == '') { + $app->system->unlink($old_folder_path.'.htaccess'); + $app->log('Removed file '.$old_folder_path.'.htaccess', LOGLEVEL_DEBUG); + } else { + $app->system->file_put_contents($old_folder_path.'.htaccess', $ht_file); + $app->log('Removed protection content from file '.$old_folder_path.'.htaccess', LOGLEVEL_DEBUG); + } + } + } + + } + + if($server_type === 'apache') { + //* Create the .htaccess file + if($data['new']['active'] == 'y') { + $ht_file = $begin_marker."\nAuthType Basic\nAuthName \"Members Only\"\nAuthUserFile ".$new_folder_path.".htpasswd\nrequire valid-user\n".$end_marker; + + if(file_exists($new_folder_path.'.htaccess')) { + $old_content = $app->system->file_get_contents($new_folder_path.'.htaccess'); + + if(preg_match('/' . preg_quote($begin_marker, '/') . '(.*?)' . preg_quote($end_marker, '/') . '/s', $old_content, $matches)) { + $ht_file = str_replace($matches[0], $ht_file, $old_content); + } else { + $ht_file .= $old_content; + } + } + + $app->system->file_put_contents($new_folder_path.'.htaccess', $ht_file); + $app->system->chmod($new_folder_path.'.htaccess', 0751); + $app->system->chown($new_folder_path.'.htaccess', $website['system_user']); + $app->system->chgrp($new_folder_path.'.htaccess', $website['system_group']); + $app->log('Created/modified file '.$new_folder_path.'.htaccess', LOGLEVEL_DEBUG); + + //* Create empty .htpasswd file, if it does not exist + if(!is_file($new_folder_path.'.htpasswd')) { + $app->system->touch($new_folder_path.'.htpasswd'); + $app->system->chmod($new_folder_path.'.htpasswd', 0751); + $app->system->chown($new_folder_path.'.htpasswd', $website['system_user']); + $app->system->chgrp($new_folder_path.'.htpasswd', $website['system_group']); + $app->log('Created file '.$new_folder_path.'.htpasswd', LOGLEVEL_DEBUG); + } + } + + //* Remove .htaccess file + if($data['new']['active'] == 'n' && is_file($new_folder_path.'.htaccess')) { + $ht_file = $app->system->file_get_contents($new_folder_path.'.htaccess'); + + if(preg_match('/' . preg_quote($begin_marker, '/') . '(.*?)' . preg_quote($end_marker, '/') . '/s', $ht_file, $matches)) { + $ht_file = str_replace($matches[0], '', $ht_file); + } else { + $ht_file = str_replace("AuthType Basic\nAuthName \"Members Only\"\nAuthUserFile ".$new_folder_path.".htpasswd\nrequire valid-user", '', $ht_file); + } + + if(trim($ht_file) == '') { + $app->system->unlink($new_folder_path.'.htaccess'); + $app->log('Removed file '.$new_folder_path.'.htaccess', LOGLEVEL_DEBUG); + } else { + $app->system->file_put_contents($new_folder_path.'.htaccess', $ht_file); + $app->log('Removed protection content from file '.$new_folder_path.'.htaccess', LOGLEVEL_DEBUG); + } + } + } else { + // write basic auth configuration to vhost file because nginx does not support .htaccess + $webdata['new'] = $webdata['old'] = $website; + $this->update('web_domain_update', $webdata); + } + } + + + //* Update the PHP-FPM pool configuration file + private function php_fpm_pool_update($data, $web_config, $pool_dir, $pool_name, $socket_dir, $server_type = 'apache') { + global $app, $conf; + $pool_dir = trim($pool_dir); + $rh_releasefiles = array('/etc/centos-release', '/etc/redhat-release'); + + if($data['new']['php'] == 'php-fpm'){ + if(trim($data['new']['fastcgi_php_version']) != ''){ + $default_php_fpm = false; + list($custom_php_fpm_name, $custom_php_fpm_init_script, $custom_php_fpm_ini_dir, $custom_php_fpm_pool_dir) = explode(':', trim($data['new']['fastcgi_php_version'])); + if(substr($custom_php_fpm_ini_dir, -1) != '/') $custom_php_fpm_ini_dir .= '/'; + } else { + $default_php_fpm = true; + } + } else { + if(trim($data['old']['fastcgi_php_version']) != '' && $data['old']['php'] == 'php-fpm'){ + $default_php_fpm = false; + list($custom_php_fpm_name, $custom_php_fpm_init_script, $custom_php_fpm_ini_dir, $custom_php_fpm_pool_dir) = explode(':', trim($data['old']['fastcgi_php_version'])); + if(substr($custom_php_fpm_ini_dir, -1) != '/') $custom_php_fpm_ini_dir .= '/'; + } else { + $default_php_fpm = true; + } + } + + $app->uses("getconf"); + $web_config = $app->getconf->get_server_config($conf["server_id"], 'web'); + + if($data['new']['php'] != 'php-fpm'){ + if(@is_file($pool_dir.$pool_name.'.conf')){ + $app->system->unlink($pool_dir.$pool_name.'.conf'); + //$reload = true; + } + if($data['old']['php'] == 'php-fpm'){ + if(!$default_php_fpm){ + $app->services->restartService('php-fpm', 'reload:'.$custom_php_fpm_init_script); + } else { + $app->services->restartService('php-fpm', 'reload:'.$conf['init_scripts'].'/'.$web_config['php_fpm_init_script']); + } + } + return; + } + + $app->load('tpl'); + $tpl = new tpl(); + $tpl->newTemplate('php_fpm_pool.conf.master'); + + if($data['new']['php_fpm_chroot'] == 'y'){ + $php_fpm_chroot = 1; + } else { + $php_fpm_chroot = 0; + } + if($server_type === 'apache') { + $tpl->setVar('apache_version', $app->system->getapacheversion()); + $tpl->setVar('apache_full_version', $app->system->getapacheversion(true)); + } + if($data['new']['php_fpm_use_socket'] == 'y'){ + $use_tcp = 0; + $use_socket = 1; + if(!is_dir($socket_dir)) $app->system->mkdirpath($socket_dir); + } else { + $use_tcp = 1; + $use_socket = 0; + } + $tpl->setVar('use_tcp', $use_tcp); + $tpl->setVar('use_socket', $use_socket); + $fpm_socket = $socket_dir.$pool_name.'.sock'; + + $tpl->setVar('php_fpm_chroot', $php_fpm_chroot); + + $tpl->setVar('fpm_socket', $fpm_socket); + $tpl->setVar('fpm_listen_mode', '0660'); + + $tpl->setVar('fpm_pool', $pool_name); + $tpl->setVar('fpm_port', $web_config['php_fpm_start_port'] + $data['new']['domain_id'] - 1); + $tpl->setVar('fpm_user', $data['new']['system_user']); + + //Red Hat workaround for group ownership of socket files + foreach($rh_releasefiles as $rh_file) { + if(file_exists($rh_file) && (filesize($rh_file) > 0)) { + $tmp = file_get_contents($rh_file); + if(preg_match('/[67]+\.[0-9]+/m', $tmp)) { + $tpl->setVar('fpm_group', $data['new']['system_group']); + $tpl->setVar('fpm_listen_group', $data['new']['system_group']); + } + unset($tmp); + } elseif(!file_exists($rh_file)) { + //OS seems to be not Red Hat'ish + $tpl->setVar('fpm_group', $data['new']['system_group']); + $tpl->setVar('fpm_listen_group', $web_config['group']); + } + break; + } + + $tpl->setVar('fpm_listen_user', $data['new']['system_user']); + $tpl->setVar('fpm_domain', $data['new']['domain']); + $tpl->setVar('pm', $data['new']['pm']); + $tpl->setVar('pm_max_children', $data['new']['pm_max_children']); + $tpl->setVar('pm_start_servers', $data['new']['pm_start_servers']); + $tpl->setVar('pm_min_spare_servers', $data['new']['pm_min_spare_servers']); + $tpl->setVar('pm_max_spare_servers', $data['new']['pm_max_spare_servers']); + $tpl->setVar('pm_process_idle_timeout', $data['new']['pm_process_idle_timeout']); + $tpl->setVar('pm_max_requests', $data['new']['pm_max_requests']); + $tpl->setVar('document_root', $data['new']['document_root']); + $tpl->setVar('security_level', $web_config['security_level']); + $tpl->setVar('domain', $data['new']['domain']); + $php_open_basedir = ($data['new']['php_open_basedir'] == '')?escapeshellcmd($data['new']['document_root']):escapeshellcmd($data['new']['php_open_basedir']); + if($php_fpm_chroot){ + $document_root = $data['new']['document_root']; + $domain = $data['new']['domain']; + $php_open_basedir = str_replace(":/srv/www/$domain/web",'',$php_open_basedir); + $php_open_basedir = str_replace(":/var/www/$domain/web",'',$php_open_basedir); + $php_open_basedir = str_replace("$document_root",'',$php_open_basedir); + } + $tpl->setVar('php_open_basedir', $php_open_basedir); + if($php_open_basedir != ''){ + $tpl->setVar('enable_php_open_basedir', ''); + } else { + $tpl->setVar('enable_php_open_basedir', ';'); + } + + // Custom php.ini settings + $final_php_ini_settings = array(); + $custom_php_ini_settings = trim($data['new']['custom_php_ini']); + + if(intval($data['new']['directive_snippets_id']) > 0){ + $snippet = $app->db->queryOneRecord("SELECT * FROM directive_snippets WHERE directive_snippets_id = ? AND type = ? AND active = 'y' AND customer_viewable = 'y'", intval($data['new']['directive_snippets_id']), $server_type); + if(isset($snippet['required_php_snippets']) && trim($snippet['required_php_snippets']) != ''){ + $required_php_snippets = explode(',', trim($snippet['required_php_snippets'])); + if(is_array($required_php_snippets) && !empty($required_php_snippets)){ + foreach($required_php_snippets as $required_php_snippet){ + $required_php_snippet = intval($required_php_snippet); + if($required_php_snippet > 0){ + $php_snippet = $app->db->queryOneRecord("SELECT * FROM directive_snippets WHERE ".($snippet['master_directive_snippets_id'] > 0 ? 'master_' : '')."directive_snippets_id = ? AND type = 'php' AND active = 'y'", $required_php_snippet); + $php_snippet['snippet'] = trim($php_snippet['snippet']); + if($php_snippet['snippet'] != ''){ + $custom_php_ini_settings .= "\n".$php_snippet['snippet']; + } + } + } + } + } + } + + $custom_session_save_path = false; + if($custom_php_ini_settings != ''){ + // Make sure we only have Unix linebreaks + $custom_php_ini_settings = str_replace("\r\n", "\n", $custom_php_ini_settings); + $custom_php_ini_settings = str_replace("\r", "\n", $custom_php_ini_settings); + $ini_settings = explode("\n", $custom_php_ini_settings); + if(is_array($ini_settings) && !empty($ini_settings)){ + foreach($ini_settings as $ini_setting){ + $ini_setting = trim($ini_setting); + if(substr($ini_setting, 0, 1) == ';') continue; + if(substr($ini_setting, 0, 1) == '#') continue; + if(substr($ini_setting, 0, 2) == '//') continue; + list($key, $value) = explode('=', $ini_setting, 2); + $value = trim($value); + if($value != ''){ + $key = trim($key); + if($key == 'session.save_path') $custom_session_save_path = true; + switch (strtolower($value)) { + case '0': + // PHP-FPM might complain about invalid boolean value if you use 0 + $value = 'off'; + case '1': + case 'on': + case 'off': + case 'true': + case 'false': + case 'yes': + case 'no': + $final_php_ini_settings[] = array('ini_setting' => 'php_admin_flag['.$key.'] = '.$value); + break; + default: + $final_php_ini_settings[] = array('ini_setting' => 'php_admin_value['.$key.'] = '.$value); + } + } + } + } + } + + $tpl->setVar('custom_session_save_path', ($custom_session_save_path ? 'y' : 'n')); + + $tpl->setLoop('custom_php_ini_settings', $final_php_ini_settings); + + $app->system->file_put_contents($pool_dir.$pool_name.'.conf', $tpl->grab()); + $app->log('Writing the PHP-FPM config file: '.$pool_dir.$pool_name.'.conf', LOGLEVEL_DEBUG); + unset($tpl); + + // delete pool in all other PHP versions + $default_pool_dir = trim(escapeshellcmd($web_config['php_fpm_pool_dir'])); + if(substr($default_pool_dir, -1) != '/') $default_pool_dir .= '/'; + if($default_pool_dir != $pool_dir){ + if ( @is_file($default_pool_dir.$pool_name.'.conf') ) { + $app->system->unlink($default_pool_dir.$pool_name.'.conf'); + $app->log('Removed PHP-FPM config file: '.$default_pool_dir.$pool_name.'.conf', LOGLEVEL_DEBUG); + $app->services->restartService('php-fpm', 'reload:'.$conf['init_scripts'].'/'.$web_config['php_fpm_init_script']); + } + } + $php_versions = $app->db->queryAllRecords("SELECT * FROM server_php WHERE php_fpm_init_script != '' AND php_fpm_ini_dir != '' AND php_fpm_pool_dir != '' AND server_id = ?", $conf["server_id"]); + if(is_array($php_versions) && !empty($php_versions)){ + foreach($php_versions as $php_version){ + $php_version['php_fpm_pool_dir'] = trim($php_version['php_fpm_pool_dir']); + if(substr($php_version['php_fpm_pool_dir'], -1) != '/') $php_version['php_fpm_pool_dir'] .= '/'; + if($php_version['php_fpm_pool_dir'] != $pool_dir){ + if ( @is_file($php_version['php_fpm_pool_dir'].$pool_name.'.conf') ) { + $app->system->unlink($php_version['php_fpm_pool_dir'].$pool_name.'.conf'); + $app->log('Removed PHP-FPM config file: '.$php_version['php_fpm_pool_dir'].$pool_name.'.conf', LOGLEVEL_DEBUG); + $app->services->restartService('php-fpm', 'reload:'.$php_version['php_fpm_init_script']); + } + } + } + } + // Reload current PHP-FPM after all others + sleep(1); + if(!$default_php_fpm){ + $app->services->restartService('php-fpm', 'reload:'.$custom_php_fpm_init_script); + } else { + $app->services->restartService('php-fpm', 'reload:'.$conf['init_scripts'].'/'.$web_config['php_fpm_init_script']); + } + } + + //* Delete the PHP-FPM pool configuration file + private function php_fpm_pool_delete ($data, $web_config, $server_type = 'apache') { + global $app, $conf; + + if(trim($data['old']['fastcgi_php_version']) != '' && $data['old']['php'] == 'php-fpm'){ + $default_php_fpm = false; + // $custom_php_fpm_name + list(, $custom_php_fpm_init_script, $custom_php_fpm_ini_dir, $custom_php_fpm_pool_dir) = explode(':', trim($data['old']['fastcgi_php_version'])); + if(substr($custom_php_fpm_ini_dir, -1) != '/') $custom_php_fpm_ini_dir .= '/'; + } else { + $default_php_fpm = true; + } + + if($default_php_fpm){ + $pool_dir = escapeshellcmd($web_config['php_fpm_pool_dir']); + } else { + $pool_dir = $custom_php_fpm_pool_dir; + } + $pool_dir = trim($pool_dir); + + if(substr($pool_dir, -1) != '/') $pool_dir .= '/'; + $pool_name = 'web'.$data['old']['domain_id']; + + if ( @is_file($pool_dir.$pool_name.'.conf') ) { + $app->system->unlink($pool_dir.$pool_name.'.conf'); + $app->log('Removed PHP-FPM config file: '.$pool_dir.$pool_name.'.conf', LOGLEVEL_DEBUG); + } + + // delete pool in all other PHP versions + $default_pool_dir = trim(escapeshellcmd($web_config['php_fpm_pool_dir'])); + if(substr($default_pool_dir, -1) != '/') $default_pool_dir .= '/'; + if($default_pool_dir != $pool_dir){ + if ( @is_file($default_pool_dir.$pool_name.'.conf') ) { + $app->system->unlink($default_pool_dir.$pool_name.'.conf'); + $app->log('Removed PHP-FPM config file: '.$default_pool_dir.$pool_name.'.conf', LOGLEVEL_DEBUG); + $app->services->restartService('php-fpm', 'reload:'.$conf['init_scripts'].'/'.$web_config['php_fpm_init_script']); + } + } + $php_versions = $app->db->queryAllRecords("SELECT * FROM server_php WHERE php_fpm_init_script != '' AND php_fpm_ini_dir != '' AND php_fpm_pool_dir != '' AND server_id = ?", $data['old']['server_id']); + if(is_array($php_versions) && !empty($php_versions)){ + foreach($php_versions as $php_version){ + $php_version['php_fpm_pool_dir'] = trim($php_version['php_fpm_pool_dir']); + if(substr($php_version['php_fpm_pool_dir'], -1) != '/') $php_version['php_fpm_pool_dir'] .= '/'; + if($php_version['php_fpm_pool_dir'] != $pool_dir){ + if ( @is_file($php_version['php_fpm_pool_dir'].$pool_name.'.conf') ) { + $app->system->unlink($php_version['php_fpm_pool_dir'].$pool_name.'.conf'); + $app->log('Removed PHP-FPM config file: '.$php_version['php_fpm_pool_dir'].$pool_name.'.conf', LOGLEVEL_DEBUG); + $app->services->restartService('php-fpm', 'reload:'.$php_version['php_fpm_init_script']); + } + } + } + } + + // Reload current PHP-FPM after all others + sleep(1); + if(!$default_php_fpm){ + $app->services->restartService('php-fpm', 'reload:'.$custom_php_fpm_init_script); + } else { + $app->services->restartService('php-fpm', 'reload:'.$conf['init_scripts'].'/'.$web_config['php_fpm_init_script']); + } + } + + public function eventClientDelete($event_name, $data, $server_type = 'apache') { + global $app, $conf; + + $app->uses("getconf"); + $web_config = $app->getconf->get_server_config($conf["server_id"], 'web'); + + $client_id = intval($data['old']['client_id']); + if($client_id > 0) { + + $client_dir = $web_config['website_basedir'].'/clients/client'.$client_id; + if(is_dir($client_dir) && !stristr($client_dir, '..')) { + // remove symlinks from $client_dir + $files = array_diff(scandir($client_dir), array('.', '..')); + if(is_array($files) && !empty($files)){ + foreach($files as $file){ + if(is_link($client_dir.'/'.$file)){ + unlink($client_dir.'/'.$file); + $app->log('Removed symlink: '.$client_dir.'/'.$file, LOGLEVEL_DEBUG); + } + } + } + + @rmdir($client_dir); + $app->log('Removed client directory: '.$client_dir, LOGLEVEL_DEBUG); + } + + if($app->system->is_group('client'.$client_id)){ + $app->system->_exec('groupdel client'.$client_id); + $app->log('Removed group client'.$client_id, LOGLEVEL_DEBUG); + } + } + + } + + private function get_seo_redirects($web, $prefix = '', $force_subdomain = false, $server_type = 'apache'){ + $seo_redirects = array(); + + if(substr($web['domain'], 0, 2) === '*.') $web['subdomain'] = '*'; + + if($server_type === 'apache') { + if($web['subdomain'] == 'www' || $web['subdomain'] == '*'){ + $domain = str_replace('.', '\.', $web['domain']); + if($web['seo_redirect'] == 'non_www_to_www'){ + $seo_redirects[$prefix.'seo_redirect_origin_domain'] = $domain; + $seo_redirects[$prefix.'seo_redirect_target_domain'] = 'www.'.$web['domain']; + $seo_redirects[$prefix.'seo_redirect_operator'] = ''; + } + if($web['seo_redirect'] == '*_domain_tld_to_www_domain_tld'){ + $seo_redirects[$prefix.'seo_redirect_origin_domain'] = $domain.'|.*\.'.$domain.'(?db->queryAllRecords("SELECT * FROM web_domain WHERE active = 'y' ORDER BY subdomain ASC"); + if(is_array($webs) && !empty($webs)){ + foreach($webs as $web){ + // web domain doesn't match hostname + if(substr($hostname, -strlen($web['domain'])) != $web['domain']) continue; + // own vhost and therefore server {} container of its own + //if($web['type'] == 'vhostsubdomain' || $web['type'] == 'vhostalias') continue; + // alias domains/subdomains using rewrites and therefore a server {} container of their own + //if(($web['type'] == 'alias' || $web['type'] == 'subdomain') && $web['redirect_type'] != '' && $web['redirect_path'] != '') continue; + + if($web['subdomain'] == '*'){ + $pattern = '/\.?'.str_replace('.', '\.', $web['domain']).'$/i'; + } + if($web['subdomain'] == 'none'){ + if($web['domain'] == $hostname){ + if($web['domain_id'] == $domain_id || $web['parent_domain_id'] == $domain_id){ + // own vhost and therefore server {} container of its own + if($web['type'] == 'vhostsubdomain' || $web['type'] == 'vhostalias') return false; + // alias domains/subdomains using rewrites and therefore a server {} container of their own + if(($web['type'] == 'alias' || $web['type'] == 'subdomain') && $web['redirect_type'] != '' && $web['redirect_path'] != '') return false; + return true; + } else { + return false; + } + } + $pattern = '/^'.str_replace('.', '\.', $web['domain']).'$/i'; + } + if($web['subdomain'] == 'www'){ + if($web['domain'] == $hostname || $web['subdomain'].'.'.$web['domain'] == $hostname){ + if($web['domain_id'] == $domain_id || $web['parent_domain_id'] == $domain_id){ + // own vhost and therefore server {} container of its own + if($web['type'] == 'vhostsubdomain' || $web['type'] == 'vhostalias') return false; + // alias domains/subdomains using rewrites and therefore a server {} container of their own + if(($web['type'] == 'alias' || $web['type'] == 'subdomain') && $web['redirect_type'] != '' && $web['redirect_path'] != '') return false; + return true; + } else { + return false; + } + } + $pattern = '/^(www\.)?'.str_replace('.', '\.', $web['domain']).'$/i'; + } + if(preg_match($pattern, $hostname)){ + if($web['domain_id'] == $domain_id || $web['parent_domain_id'] == $domain_id){ + // own vhost and therefore server {} container of its own + if($web['type'] == 'vhostsubdomain' || $web['type'] == 'vhostalias') return false; + // alias domains/subdomains using rewrites and therefore a server {} container of their own + if(($web['type'] == 'alias' || $web['type'] == 'subdomain') && $web['redirect_type'] != '' && $web['redirect_path'] != '') return false; + return true; + } else { + return false; + } + } + } + } + + return false; + } + + private function nginx_replace($matches){ + $location = 'location'.($matches[1] != '' ? ' '.$matches[1] : '').' '.$matches[2].' '.$matches[3]; + if($matches[4] == '##merge##' || $matches[7] == '##merge##') $location .= ' ##merge##'; + if($matches[4] == '##delete##' || $matches[7] == '##delete##') $location .= ' ##delete##'; + $location .= "\n"; + $location .= $matches[5]."\n"; + $location .= $matches[6]; + return $location; + } + + private function nginx_merge_locations($vhost_conf) { + global $app, $conf; + + $subroot = array(); + if(preg_match('/##subroot (.+?)\s*##/', $vhost_conf, $subroot)) { + if(!preg_match('/^(?:[a-z0-9\/_-]|\.(?!\.))+$/iD', $subroot[1])) { + $app->log('Token ##subroot is unsecure (server ID: '.$conf['server_id'].').', LOGLEVEL_WARN); + } else { + $insert_pos = strpos($vhost_conf, ';', strpos($vhost_conf, 'root ')); + $vhost_conf = substr_replace($vhost_conf, ltrim($subroot[1], '/'), $insert_pos, 0); + } + } + + $lines = explode("\n", $vhost_conf); + + // if whole location block is in one line, split it up into multiple lines + if(is_array($lines) && !empty($lines)){ + $linecount = sizeof($lines); + for($h=0;$h<$linecount;$h++){ + // remove comments + if(substr(trim($lines[$h]), 0, 1) == '#'){ + unset($lines[$h]); + continue; + } + + $lines[$h] = rtrim($lines[$h]); + /* + if(substr(ltrim($lines[$h]), 0, 8) == 'location' && strpos($lines[$h], '{') !== false && strpos($lines[$h], ';') !== false){ + $lines[$h] = str_replace("{", "{\n", $lines[$h]); + $lines[$h] = str_replace(";", ";\n", $lines[$h]); + if(strpos($lines[$h], '##merge##') !== false){ + $lines[$h] = str_replace('##merge##', '', $lines[$h]); + $lines[$h] = substr($lines[$h],0,strpos($lines[$h], '{')).' ##merge##'.substr($lines[$h],strpos($lines[$h], '{')+1); + } + } + if(substr(ltrim($lines[$h]), 0, 8) == 'location' && strpos($lines[$h], '{') !== false && strpos($lines[$h], '}') !== false && strpos($lines[$h], ';') === false){ + $lines[$h] = str_replace("{", "{\n", $lines[$h]); + if(strpos($lines[$h], '##merge##') !== false){ + $lines[$h] = str_replace('##merge##', '', $lines[$h]); + $lines[$h] = substr($lines[$h],0,strpos($lines[$h], '{')).' ##merge##'.substr($lines[$h],strpos($lines[$h], '{')+1); + } + } + */ + $pattern = '/^[^\S\n]*location[^\S\n]+(?:(.+)[^\S\n]+)?(.+)[^\S\n]*(\{)[^\S\n]*(##merge##|##delete##)?[^\S\n]*(.+)[^\S\n]*(\})[^\S\n]*(##merge##|##delete##)?[^\S\n]*$/'; + $lines[$h] = preg_replace_callback($pattern, array($this, 'nginx_replace') , $lines[$h]); + } + } + $vhost_conf = implode("\n", $lines); + unset($lines); + unset($linecount); + + $lines = explode("\n", $vhost_conf); + + if(is_array($lines) && !empty($lines)){ + $locations = array(); + $locations_to_delete = array(); + $islocation = false; + $linecount = sizeof($lines); + $server_count = 0; + + for($i=0;$i<$linecount;$i++){ + $l = trim($lines[$i]); + if(substr($l, 0, 8) == 'server {') $server_count += 1; + if($server_count > 1) break; + if(substr($l, 0, 8) == 'location' && !$islocation){ + + $islocation = true; + $level = 0; + + // Remove unnecessary whitespace + $l = preg_replace('/\s\s+/', ' ', $l); + + $loc_parts = explode(' ', $l); + // see http://wiki.nginx.org/HttpCoreModule#location + if($loc_parts[1] == '=' || $loc_parts[1] == '~' || $loc_parts[1] == '~*' || $loc_parts[1] == '^~'){ + $location = $loc_parts[1].' '.$loc_parts[2]; + } else { + $location = $loc_parts[1]; + } + unset($loc_parts); + + if(!isset($locations[$location]['action'])) $locations[$location]['action'] = 'replace'; + if(substr($l, -9) == '##merge##') $locations[$location]['action'] = 'merge'; + if(substr($l, -10) == '##delete##') $locations[$location]['action'] = 'delete'; + + if(!isset($locations[$location]['open_tag'])) $locations[$location]['open_tag'] = ' location '.$location.' {'; + if(!isset($locations[$location]['location']) || $locations[$location]['action'] == 'replace') $locations[$location]['location'] = ''; + if($locations[$location]['action'] == 'delete') $locations_to_delete[] = $location; + if(!isset($locations[$location]['end_tag'])) $locations[$location]['end_tag'] = ' }'; + if(!isset($locations[$location]['start_line'])) $locations[$location]['start_line'] = $i; + + unset($lines[$i]); + + } else { + + if($islocation){ + $openingbracketpos = strrpos($l, '{'); + if($openingbracketpos !== false){ + $level += 1; + } + $closingbracketpos = strrpos($l, '}'); + if($closingbracketpos !== false && $level > 0 && $closingbracketpos >= intval($openingbracketpos)){ + $level -= 1; + $locations[$location]['location'] .= $lines[$i]."\n"; + } elseif($closingbracketpos !== false && $level == 0 && $closingbracketpos >= intval($openingbracketpos)){ + $islocation = false; + } else { + $locations[$location]['location'] .= $lines[$i]."\n"; + } + unset($lines[$i]); + } + + } + } + + if(is_array($locations) && !empty($locations)){ + if(is_array($locations_to_delete) && !empty($locations_to_delete)){ + foreach($locations_to_delete as $location_to_delete){ + if(isset($locations[$location_to_delete])) unset($locations[$location_to_delete]); + } + } + + foreach($locations as $val){ + $new_location = $val['open_tag']."\n".$val['location'].$val['end_tag']; + $lines[$val['start_line']] = $new_location; + } + } + ksort($lines); + $vhost_conf = implode("\n", $lines); + } + + return trim($vhost_conf); + } + + + /** + * This function patches the vhost-file and adds all webdav - user. + * This function is written, because the creation of the vhost - file is sophisticated and + * i don't want to make it more "heavy" by also adding this code too... + * @author Oliver Vogel + * @param string $fileName The Name of the .vhost-File (path included) + * @param string $webdavRoot The root of the webdav-folder + */ + private function _patchVhostWebdav($fileName, $webdavRoot) { + global $app; + $in = fopen($fileName, 'r'); + $output = ''; + $inWebdavSection = false; + //* read line by line and search for the username and authname + while ($line = fgets($in)) { + //* is the "replace-comment" found... + if (trim($line) == '# WEBDAV BEGIN') { + //* The begin of the webdav - section is found, so ignore all lines til the end is found + $inWebdavSection = true; + $output .= "# WEBDAV BEGIN\n"; + //* add all the webdav-dirs to the webdav-section + $files = @scandir($webdavRoot); + if(is_array($files)) { + foreach($files as $file) { + if (substr($file, strlen($file) - strlen('.htdigest')) == '.htdigest' && preg_match("/^[a-zA-Z0-9\-_\.]*$/", $file)) { + //* found a htdigest - file, so add it to webdav + $fn = substr($file, 0, strlen($file) - strlen('.htdigest')); + $output .= "\n"; + $output .= "Alias /webdav/$fn $webdavRoot/$fn\n"; + $output .= "\n"; + $output .= "DAV On\n"; + $output .= "BrowserMatch MSIE AuthDigestEnableQueryStringHack=On\n"; + $output .= "AuthType Digest\n"; + if($fn != '' && $fn != '/') { + $output .= "AuthName \"" . $fn . "\"\n"; + } else { + $output .= "AuthName \"Restricted Area\"\n"; + } + $output .= "AuthUserFile $webdavRoot/$file\n"; + $output .= "Require valid-user\n"; + $output .= "Options +Indexes\n"; + $output .= "\n"; + } + } + } + } + //* is the "replace-comment-end" found... + if (trim($line) == '# WEBDAV END') { + //* The end of the webdav - section is found, so stop ignoring + $inWebdavSection = false; + } + //* Write the line to the output, if it is not in the section + if (!$inWebdavSection) { + $output .= $line; + } + } + fclose($in); + //* Now lets write the new file + $app->system->file_put_contents($fileName, $output); + } + + public function getWebFolder(&$data, $type, $use_old = false) { + global $app; + + $folder = $type; + + if($type === 'web' && $data['new']['type'] == 'vhost'){ + if($use_old === true) { + if($data['old']['web_folder'] != ''){ + if(substr($data['old']['web_folder'],0,1) == '/') $data['old']['web_folder'] = substr($data['old']['web_folder'],1); + if(substr($data['old']['web_folder'],-1) == '/') $data['old']['web_folder'] = substr($data['old']['web_folder'],0,-1); + } + $folder .= '/'.$data['old']['web_folder']; + } else { + if($data['new']['web_folder'] != ''){ + if(substr($data['new']['web_folder'],0,1) == '/') $data['new']['web_folder'] = substr($data['new']['web_folder'],1); + if(substr($data['new']['web_folder'],-1) == '/') $data['new']['web_folder'] = substr($data['new']['web_folder'],0,-1); + } + $folder .= '/'.$data['new']['web_folder']; + } + } elseif($data['new']['type'] == 'vhostsubdomain' || $data['new']['type'] == 'vhostalias') { + if($use_old === true) { + if(isset($data['old']['parent_domain_id'])) { + // old one + $tmp = $app->db->queryOneRecord('SELECT `domain` FROM web_domain WHERE domain_id = ?', $data['old']['parent_domain_id']); + $subdomain_host = preg_replace('/^(.*)\.' . preg_quote($tmp['domain'], '/') . '$/', '$1', $data['old']['domain']); + if($subdomain_host == '') $subdomain_host = 'web'.$data['old']['domain_id']; + if($type === 'web') { + $folder = $data['old']['web_folder']; + } else { + $folder .= '/' . $subdomain_host; + } + unset($tmp); + } + } else { + // new one + $tmp = $app->db->queryOneRecord('SELECT `domain` FROM web_domain WHERE domain_id = ?', $data['new']['parent_domain_id']); + $subdomain_host = preg_replace('/^(.*)\.' . preg_quote($tmp['domain'], '/') . '$/', '$1', $data['new']['domain']); + if($subdomain_host == '') $subdomain_host = 'web'.$data['new']['domain_id']; + if($type === 'web') { + $folder = $data['new']['web_folder']; + } else { + $folder .= '/' . $subdomain_host; + } + unset($tmp); + } + } + + return $folder; + } +} diff --git a/server/lib/classes/plugins.inc.php b/server/lib/classes/plugins.inc.php index 9b9b143776d3e4ffe390cc73406c96fef4ae0b6c..b56f69608e7bc03ad4b92c18975f9382ac275a87 100644 --- a/server/lib/classes/plugins.inc.php +++ b/server/lib/classes/plugins.inc.php @@ -156,7 +156,13 @@ class plugins { $state = call_user_func(array($app->loaded_plugins[$plugin_name], $function_name), $action_name, $data); //* ensure that we return the highest warning / error level if a error occured in one of the functions if($return_data) { - if($state) $result .= $state; + if($state) { + if(is_array($state) && (!$result || is_array($result))) { + $result = array_merge($result, $state); + } elseif(!is_array($state)) { + $result .= $state; + } + } } else { if($state == 'warning' && $state_out != 'error') $state_out = 'warning'; elseif($state == 'error') $state_out = 'error'; diff --git a/server/lib/classes/system.inc.php b/server/lib/classes/system.inc.php index f4d94743a16c82903215378d2aac5993a4a05af9..dc5a8dde8aa7e03822c2891c2a25243a08fe8a6a 100644 --- a/server/lib/classes/system.inc.php +++ b/server/lib/classes/system.inc.php @@ -1639,29 +1639,15 @@ class system{ //* Add the subfolder to the subscriptions and courierimapsubscribed files if($subfolder != '') { - // Courier - if($mail_config['pop3_imap_daemon'] == 'courier') { - if(!is_file($maildir_path.'/courierimapsubscribed')) { - $tmp_file = escapeshellcmd($maildir_path.'/courierimapsubscribed'); - touch($tmp_file); - chmod($tmp_file, 0744); - chown($tmp_file, 'vmail'); - chgrp($tmp_file, 'vmail'); - } - $this->replaceLine($maildir_path.'/courierimapsubscribed', 'INBOX.'.$subfolder, 'INBOX.'.$subfolder, 1, 1); - } - // Dovecot - if($mail_config['pop3_imap_daemon'] == 'dovecot') { - if(!is_file($maildir_path.'/subscriptions')) { - $tmp_file = escapeshellcmd($maildir_path.'/subscriptions'); - touch($tmp_file); - chmod($tmp_file, 0744); - chown($tmp_file, 'vmail'); - chgrp($tmp_file, 'vmail'); - } - $this->replaceLine($maildir_path.'/subscriptions', $subfolder, $subfolder, 1, 1); + if(!is_file($maildir_path.'/subscriptions')) { + $tmp_file = escapeshellcmd($maildir_path.'/subscriptions'); + touch($tmp_file); + chmod($tmp_file, 0744); + chown($tmp_file, 'vmail'); + chgrp($tmp_file, 'vmail'); } + $this->replaceLine($maildir_path.'/subscriptions', $subfolder, $subfolder, 1, 1); } $app->log('Created Maildir '.$maildir_path.' with subfolder: '.$subfolder, LOGLEVEL_DEBUG); @@ -1686,14 +1672,24 @@ class system{ } - function _exec($command) { + function _exec($command, $return_codes_ok = null) { global $app; + + if(!is_null($return_codes_ok) && !is_array($return_codes_ok)) { + $return_codes_ok = array($return_codes_ok); + } + $out = array(); $ret = 0; $app->log('exec: '.$command, LOGLEVEL_DEBUG); exec($command, $out, $ret); - if($ret != 0) return false; - else return true; + if($ret == 0) { + return true; + } elseif(is_array($return_codes_ok) && !empty($return_codes_ok) && in_array($ret, $return_codes_ok)) { + return true; + } else { + return false; + } } //* Check if a application is installed @@ -1945,20 +1941,20 @@ class system{ elseif($this->is_installed('apachectl')) $cmd = 'apachectl -v'; else { $app->log("Could not check apache version, apachectl not found.", LOGLEVEL_DEBUG); - return '2.2'; + return '2.4'; } exec($cmd, $output, $return_var); if($return_var != 0 || !$output[0]) { $app->log("Could not check apache version, apachectl did not return any data.", LOGLEVEL_WARN); - return '2.2'; + return '2.4'; } if(preg_match('/version:\s*Apache\/(\d+)(\.(\d+)(\.(\d+))*)?(\D|$)/i', $output[0], $matches)) { return $matches[1] . (isset($matches[3]) ? '.' . $matches[3] : '') . (isset($matches[5]) && $get_minor == true ? '.' . $matches[5] : ''); } else { $app->log("Could not check apache version, did not find version string in apachectl output.", LOGLEVEL_WARN); - return '2.2'; + return '2.4'; } } @@ -2048,7 +2044,32 @@ class system{ return true; } + + public function tempdir($parent_path = null, $prefix = 'tmp_', $mode = 0700) { + if(is_null($parent_path)) { + $parent_path = sys_get_temp_dir(); + } + + $parent_path = rtrim($parent_path, '/'); + if(!is_dir($parent_path) || !is_writable($parent_path)) { + return false; + } + + if(strpbrk($prefix, '\\/:*?"<>|') !== false) { + return false; + } + + $path = false; + $tries = 0; + while($tries < 1000) { + $tries++; + $path = $parent_path . FS_DIV . uniqid($prefix, true); + if(mkdir($path, $mode)) { + break; + } + } + + return $path; + } } - -?> diff --git a/server/mods-available/mail_module.inc.php b/server/mods-available/mail_module.inc.php index 8460d5d96a6f1a7b58cdee2837840f72378e5038..ded0900752d9049a6c3ac2e6d4ec77fb87b88499 100644 --- a/server/mods-available/mail_module.inc.php +++ b/server/mods-available/mail_module.inc.php @@ -53,12 +53,12 @@ class mail_module { 'mail_content_filter_insert', 'mail_content_filter_update', 'mail_content_filter_delete', - 'mail_mailinglist_insert', - 'mail_mailinglist_update', - 'mail_mailinglist_delete', - 'mail_ml_member_insert', - 'mail_ml_member_update', - 'mail_ml_member_delete'); + 'spamfilter_users_insert', + 'spamfilter_users_update', + 'spamfilter_users_delete', + 'spamfilter_wblist_insert', + 'spamfilter_wblist_update', + 'spamfilter_wblist_delete'); //* This function is called during ispconfig installation to determine // if a symlink shall be created for this plugin. @@ -104,9 +104,11 @@ class mail_module { $app->modules->registerTableHook('mail_user', 'mail_module', 'process'); $app->modules->registerTableHook('mail_get', 'mail_module', 'process'); $app->modules->registerTableHook('mail_content_filter', 'mail_module', 'process'); - $app->modules->registerTableHook('mail_mailinglist', 'mail_module', 'process'); - $app->modules->registerTableHook('mail_ml_membership', 'mail_module', 'process'); + $app->modules->registerTableHook('spamfilter_users', 'mail_module', 'process'); + $app->modules->registerTableHook('spamfilter_wblist', 'mail_module', 'process'); + + $app->services->registerService('rspamd', 'mail_module', 'restartRspamd'); } /* @@ -153,19 +155,36 @@ class mail_module { if($action == 'u') $app->plugins->raiseEvent('mail_content_filter_update', $data); if($action == 'd') $app->plugins->raiseEvent('mail_content_filter_delete', $data); break; - case 'mail_mailinglist': - if($action == 'i') $app->plugins->raiseEvent('mail_mailinglist_insert', $data); - if($action == 'u') $app->plugins->raiseEvent('mail_mailinglist_update', $data); - if($action == 'd') $app->plugins->raiseEvent('mail_mailinglist_delete', $data); + case 'spamfilter_users': + if($action == 'i') $app->plugins->raiseEvent('spamfilter_users_insert', $data); + if($action == 'u') $app->plugins->raiseEvent('spamfilter_users_update', $data); + if($action == 'd') $app->plugins->raiseEvent('spamfilter_users_delete', $data); break; - case 'mail_ml_membership': - if($action == 'i') $app->plugins->raiseEvent('mail_ml_member_insert', $data); - if($action == 'u') $app->plugins->raiseEvent('mail_ml_member_update', $data); - if($action == 'd') $app->plugins->raiseEvent('mail_ml_member_delete', $data); + case 'spamfilter_wblist': + if($action == 'i') $app->plugins->raiseEvent('spamfilter_wblist_insert', $data); + if($action == 'u') $app->plugins->raiseEvent('spamfilter_wblist_update', $data); + if($action == 'd') $app->plugins->raiseEvent('spamfilter_wblist_delete', $data); break; } // end switch } // end function + function restartRspamd($action = 'reload') { + global $app; + + $app->uses('system'); + + $daemon = 'rspamd'; + + $retval = array('output' => '', 'retval' => 0); + if($action == 'restart') { + exec($app->system->getinitcommand($daemon, 'restart').' 2>&1', $retval['output'], $retval['retval']); + } else { + exec($app->system->getinitcommand($daemon, 'reload').' 2>&1', $retval['output'], $retval['retval']); + } + return $retval; + } + + } // end class ?> diff --git a/server/mods-available/remoteaction_core_module.inc.php b/server/mods-available/remoteaction_core_module.inc.php deleted file mode 100644 index 15e9d279e9e4952a405e937859a60add020afe3e..0000000000000000000000000000000000000000 --- a/server/mods-available/remoteaction_core_module.inc.php +++ /dev/null @@ -1,248 +0,0 @@ -_execActions(); - } - - /* - 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) { - // not needed - } // end function - - private function _actionDone($id, $state) { - /* - * First set the state - */ - global $app; - $sql = "UPDATE sys_remoteaction SET action_state = ? WHERE action_id = ?"; - $app->dbmaster->query($sql, $state, $id); - - /* - * Then save the maxid for the next time... - */ - $fp = fopen(dirname(__FILE__) . "/../lib/remote_action.inc.php", 'wb'); - $content = '"; - fwrite($fp, $content); - fclose($fp); - } - - - /** - * This method searches for scheduled actions and exec then - */ - - - private function _execActions() { - global $app; - global $conf; - - /* the id of the server as int */ - $server_id = intval($conf["server_id"]); - - /* - * First we (till and i, oliver) thought, it was enough to write - * "select from where action_status = 'pending'" and then execute this actions. - * But it is not! - * If a hacker can hack into a server, she can change the valus of action_status - * and so re-exec a action, executed some days bevore. So she can (for example) - * stop a service, a admin stopped some days before! To avoid this, we ignore - * the status (it is only for the interface to show) and use our own maxid - */ - include_once SCRIPT_PATH."/lib/remote_action.inc.php"; - - /* - * Get all actions this server should execute - */ - $sql = "SELECT action_id, action_type, action_param FROM sys_remoteaction WHERE server_id = ? AND action_id > ? ORDER BY action_id"; - $actions = $app->dbmaster->queryAllRecords($sql, $server_id, $maxid_remote_action); - - /* - * process all actions - */ - if(is_array($actions)) { - foreach ($actions as $action) { - if ($action['action_type'] == 'os_update') { - /* do the update */ - $this->_doOsUpdate($action); - /* this action takes so much time, - * we stop executing the actions not to waste more time */ - return; - } - - if ($action['action_type'] == 'ispc_update') { - /* do the update */ - // Update function has been removed - // $this->_doIspCUpdate($action); - /* this action takes so much time, - * we stop executing the actions not to waste more time */ - $this->_actionDone($action['action_id'], 'ok'); - } - if ($action['action_type'] == 'openvz_start_vm') { - $veid = intval($action['action_param']); - if($veid > 0) { - exec("vzctl start $veid"); - } - $this->_actionDone($action['action_id'], 'ok'); - } - if ($action['action_type'] == 'openvz_stop_vm') { - $veid = intval($action['action_param']); - if($veid > 0) { - exec("vzctl stop $veid"); - } - $this->_actionDone($action['action_id'], 'ok'); - } - if ($action['action_type'] == 'openvz_restart_vm') { - $veid = intval($action['action_param']); - if($veid > 0) { - exec("vzctl restart $veid"); - } - $this->_actionDone($action['action_id'], 'ok'); - } - if ($action['action_type'] == 'openvz_create_ostpl') { - $parts = explode(':', $action['action_param']); - $veid = intval($parts[0]); - $template_cache_dir = '/vz/template/cache/'; - $template_name = escapeshellcmd($parts[1]); - if($veid > 0 && $template_name != '' && is_dir($template_cache_dir)) { - $command = "vzdump --suspend --compress --stdexcludes --dumpdir $template_cache_dir $veid"; - exec($command); - exec("mv ".$template_cache_dir."vzdump-openvz-".$veid."*.tgz ".$template_cache_dir.$template_name.".tar.gz"); - exec("rm -f ".$template_cache_dir."vzdump-openvz-".$veid."*.log"); - } - $this->_actionDone($action['action_id'], 'ok'); - /* this action takes so much time, - * we stop executing the actions not to waste more time */ - return; - } - - - } - } - } - - private function _doOsUpdate($action) { - /* - * Do the update - */ - //Guess this is not wanted here? - //exec("aptitude update"); - //exec("aptitude safe-upgrade -y"); - - //TODO : change this when distribution information has been integrated into server record - if(file_exists('/etc/gentoo-release')) { - exec("glsa-check -f --nocolor affected"); - } - else { - exec("apt-get update"); - exec("apt-get -y upgrade"); - } - - /* - * All well done! - */ - $this->_actionDone($action['action_id'], 'ok'); - } - - private function _doIspCUpdate($action) { - - // Ensure that this code is not executed twice as this would cause a loop in case of a failure - $this->_actionDone($action['action_id'], 'ok'); - - /* - * Get the version-number of the newest version - */ - $new_version = @file_get_contents('http://www.ispconfig.org/downloads/ispconfig3_version.txt'); - $new_version = trim($new_version); - - /* - * Do the update - */ - - /* jump into the temporary dir */ - $oldDir = getcwd(); - chdir("/tmp"); - - /* delete the old files (if there are any...) */ - exec("rm /tmp/ISPConfig-" . $new_version . ".tar.gz"); - exec("rm /tmp/ispconfig3_install -R"); - - /* get the newest version */ - exec("wget http://www.ispconfig.org/downloads/ISPConfig-" . $new_version . ".tar.gz"); - - /* extract the files */ - exec("tar xvfz ISPConfig-" . $new_version . ".tar.gz"); - - /* - * Initialize the automated update - * (the update is then done next start of server.sh - */ - chdir("/tmp/ispconfig3_install/install"); - exec("touch autoupdate"); - - /* - * do some clean-up - */ - exec("rm /tmp/ISPConfig-" . $new_version . ".tar.gz"); - - /* - * go back to the "old path" - */ - chdir($oldDir); - - /* - * All well done! - */ - //$this->_actionDone($action['action_id'], 'ok'); - } - -} - -?> diff --git a/server/mods-available/rescue_core_module.inc.php b/server/mods-available/rescue_core_module.inc.php index 5e8f3db9ce5aef12d38a956b2668f691ac797e6d..a434a63a62d8b9202554238bf32b2d0aeb77527f 100644 --- a/server/mods-available/rescue_core_module.inc.php +++ b/server/mods-available/rescue_core_module.inc.php @@ -94,11 +94,6 @@ class rescue_core_module { */ $this->_rescueData = $this->_getRescueData(); - /* - * rescue MongoDB if needed - */ -// $this->_rescueMongoDB(); - /* * rescue mysql if needed (maybe httpd depends on mysql, so try this first!) */ @@ -311,73 +306,6 @@ class rescue_core_module { $this->_rescueDaemon($daemon); } - - /** - * restarts MongoDB, if needed - */ -// private function _rescueMongoDB(){ -// global $app, $conf; - - /* - * do nothing, if it is not allowed to rescue mysql - */ -// if ((isset($conf['serverconfig']['rescue']['do_not_try_rescue_mongodb']) && ($conf['serverconfig']['rescue']['do_not_try_rescue_mongodb']) == 'y')){ -// return; -// } - - /* - * if the service is up and running, or the service is not installed there is nothing to do... - */ -// if ($this->_monitoringData[0][0]['data']['mongodbserver'] != 0){ -// /* Clear the try counter, because we do not have to try to rescue the service */ -// $this->_rescueData['mongodbserver']['try_counter'] = 0; -// return; -// } - - /* - * OK, the service is installed and down. - * Maybe this is because of a restart of the service by the admin. - * This means, we check the data 1 minute ago - */ -// if ((!isset($this->_monitoringData[1][0]['data']['mongodbserver'])) || -// ((isset($this->_monitoringData[1][0]['data']['mongodbserver'])) && ($this->_monitoringData[1][0]['data']['mongodbserver'] != 0))){ - /* - * We do NOT have this data or we have this data, but the webserver was not down 1 minute ago. - * This means, it could be, that the admin is restarting the server. - * We wait one more minute... - */ -// return; -// } - - /*##### - * The service is down and it was down 1 minute ago. - * We try to rescue it - *#####*/ - - /* Get the try counter */ -// $tryCount = (!isset($this->_rescueData['mongodbserver']['try_counter']))? 1 : $this->_rescueData['mongodbserver']['try_counter'] + 1; - - /* Set the new try counter */ -// $this->_rescueData['mongodbserver']['try_counter'] = $tryCount; - - /* if 5 times will not work, we have to give up... */ -// if ($tryCount > 5){ -// $app->log('MongoDB is down! Rescue will not help!', LOGLEVEL_ERROR); -// return; -// } - - -// $app->log('MongoDB is down! Try rescue MongoDB (try:' . $tryCount . ')...', LOGLEVEL_WARN); - -// if(is_file($conf['init_scripts'] . '/' . 'mongodb')) { -// $daemon = 'mongodb'; -// } else { -// $daemon = 'mongodb'; -// } - -// $this->_rescueDaemon($daemon); -// } - /** * restarts mysql, if needed */ diff --git a/server/mods-available/vm_module.inc.php b/server/mods-available/vm_module.inc.php deleted file mode 100644 index b3c636d6526c65ab212fd02c5a58525863c9fba5..0000000000000000000000000000000000000000 --- a/server/mods-available/vm_module.inc.php +++ /dev/null @@ -1,118 +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('openvz_vm', $this->module_name, 'process'); - $app->modules->registerTableHook('openvz_ip', $this->module_name, 'process'); - $app->modules->registerTableHook('openvz_ostemplate', $this->module_name, 'process'); - - } - - /* - 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 'openvz_vm': - if($action == 'i') $app->plugins->raiseEvent('openvz_vm_insert', $data); - if($action == 'u') $app->plugins->raiseEvent('openvz_vm_update', $data); - if($action == 'd') $app->plugins->raiseEvent('openvz_vm_delete', $data); - break; - case 'openvz_ip': - if($action == 'i') $app->plugins->raiseEvent('openvz_ip_insert', $data); - if($action == 'u') $app->plugins->raiseEvent('openvz_ip_update', $data); - if($action == 'd') $app->plugins->raiseEvent('openvz_ip_delete', $data); - break; - case 'openvz_ostemplate': - if($action == 'i') $app->plugins->raiseEvent('openvz_ostemplate_insert', $data); - if($action == 'u') $app->plugins->raiseEvent('openvz_ostemplate_update', $data); - if($action == 'd') $app->plugins->raiseEvent('openvz_ostemplate_delete', $data); - break; - } // end switch - } // end function - - -} // end class - -?> 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/apache2_plugin.inc.php b/server/plugins-available/apache2_plugin.inc.php index 5be47d050dc0573c0b3fc3a6e8f34ddeaa2d71ef..68b29b222ef4fbb9469260564c967112694b76ce 100644 --- a/server/plugins-available/apache2_plugin.inc.php +++ b/server/plugins-available/apache2_plugin.inc.php @@ -2388,11 +2388,7 @@ class apache2_plugin { $web_folder = 'web'; if($website['type'] == 'vhostsubdomain' || $website['type'] == 'vhostalias') $web_folder = $website['web_folder']; - //* Get the folder path. - if(substr($folder['path'], 0, 1) == '/') $folder['path'] = substr($folder['path'], 1); - if(substr($folder['path'], -1) == '/') $folder['path'] = substr($folder['path'], 0, -1); - $folder_path = realpath($website['document_root'].'/' . $web_folder . '/'.$folder['path']); - if(substr($folder_path, -1) != '/') $folder_path .= '/'; + $app->plugin_webserver_base->eventUpdate($event_name, $data, $this->action, 'apache'); //* Check if the resulting path is inside the docroot if(substr($folder_path, 0, strlen($website['document_root'])) != $website['document_root']) { diff --git a/server/plugins-available/apps_vhost_plugin.inc.php b/server/plugins-available/apps_vhost_plugin.inc.php index b843e3c8a4e45f86adedf8106207d79e1c4b586f..32a62174ffc15681633fcb9c39f30f1639f06d01 100644 --- a/server/plugins-available/apps_vhost_plugin.inc.php +++ b/server/plugins-available/apps_vhost_plugin.inc.php @@ -106,6 +106,16 @@ class apps_vhost_plugin { $vhost_port_listen = '#'; } $tpl->setVar('vhost_port_listen', $vhost_port_listen); + + $mail_config = $app->getconf->get_server_config($conf['server_id'], 'mail'); + if($mail_config['content_filter'] == 'rspamd'){ + $use_rspamd = true; + exec('/usr/sbin/a2enmod proxy'); + exec('/usr/sbin/a2enmod proxy_http'); + } else { + $use_rspamd = false; + } + $tpl->setVar('use_rspamd', $use_rspamd); $content = $tpl->grab(); @@ -184,6 +194,14 @@ class apps_vhost_plugin { $content = str_replace('{use_tcp}', $use_tcp, $content); $content = str_replace('{use_socket}', $use_socket, $content); + $mail_config = $app->getconf->get_server_config($conf['server_id'], 'mail'); + if($mail_config['content_filter'] == 'rspamd'){ + $use_rspamd = ''; + } else { + $use_rspamd = '#'; + } + $content = str_replace('{use_rspamd}', $use_rspamd, $content); + // Fix socket path on PHP 7 systems if(file_exists('/var/run/php/php7.0-fpm.sock')) $content = str_replace('/var/run/php5-fpm.sock', '/var/run/php/php7.0-fpm.sock', $content); if(file_exists('/var/run/php/php7.1-fpm.sock')) $content = str_replace('/var/run/php5-fpm.sock', '/var/run/php/php7.1-fpm.sock', $content); @@ -221,7 +239,3 @@ class apps_vhost_plugin { } // end class - - - -?> diff --git a/server/plugins-available/backup_plugin.inc.php b/server/plugins-available/backup_plugin.inc.php index 12f58c1f1b7046c748b36ec52781426c4a2b2adf..cba46b85784606e4e3e5ed084f5dff028412cc84 100644 --- a/server/plugins-available/backup_plugin.inc.php +++ b/server/plugins-available/backup_plugin.inc.php @@ -93,32 +93,6 @@ class backup_plugin { } } - //* Restore a MongoDB backup - if($action_name == 'backup_restore' && $backup['backup_type'] == 'mongodb') { - if(file_exists($backup_dir.'/'.$backup['filename'])) { - //$parts = explode('_',$backup['filename']); - //$db_name = $parts[1]; - preg_match('@^db_(.+)_\d{4}-\d{2}-\d{2}_\d{2}-\d{2}\.tar\.gz$@', $backup['filename'], $matches); - $db_name = $matches[1]; - - // extract tar.gz archive - $dump_directory = str_replace(".tar.gz", "", $backup['filename']); - $extracted = "/usr/local/ispconfig/server/temp"; - exec("tar -xzvf ".escapeshellarg($backup_dir.'/'.$backup['filename'])." --directory=".escapeshellarg($extracted)); - $restore_directory = $extracted."/".$dump_directory."/".$db_name; - - // mongorestore -h 127.0.0.1 -u root -p 123456 --authenticationDatabase admin -d c1debug --drop ./toRestore - $command = "mongorestore -h 127.0.0.1 --port 27017 -u root -p 123456 --authenticationDatabase admin -d ".$db_name." --drop ".escapeshellarg($restore_directory); - exec($command); - exec("rm -rf ".escapeshellarg($extracted."/".$dump_directory)); - } - - unset($clientdb_host); - unset($clientdb_user); - unset($clientdb_password); - $app->log('Restored MongoDB backup '.$backup_dir.'/'.$backup['filename'], LOGLEVEL_DEBUG); - } - //* Restore a mysql backup if($action_name == 'backup_restore' && $backup['backup_type'] == 'mysql') { //* Load sql dump into db diff --git a/server/plugins-available/mail_plugin.inc.php b/server/plugins-available/mail_plugin.inc.php index 17f48efe26cfc1d16cd27082f352289b8e5b4182..2b9384826a3b83ed1caccbbcb6a3e7a02e9aca7e 100644 --- a/server/plugins-available/mail_plugin.inc.php +++ b/server/plugins-available/mail_plugin.inc.php @@ -145,11 +145,9 @@ class mail_plugin { } else { // Dovecot uses a different mail layout with a separate 'Maildir' subdirectory. - if($mail_config['pop3_imap_daemon'] == 'dovecot') { - $app->system->mkdirpath($maildomain_path, 0700, $user, $group); - $app->log('Created Directory: '.$maildomain_path, LOGLEVEL_DEBUG); - $maildomain_path .= '/Maildir'; - } + $app->system->mkdirpath($maildomain_path, 0700, $user, $group); + $app->log('Created Directory: '.$maildomain_path, LOGLEVEL_DEBUG); + $maildomain_path .= '/Maildir'; //* When the mail user dir exists but it is not a valid maildir, move it to corrupted maildir folder if(!empty($maildomain_path) && is_dir($maildomain_path) && !is_dir($maildomain_path.'/new') && !is_dir($maildomain_path.'/cur')) { @@ -163,12 +161,6 @@ class mail_plugin { //exec("su -c 'maildirmake ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name']); $app->system->maildirmake($maildomain_path, $user, '', $group); - - //* This is to fix the maildrop quota not being rebuilt after the quota is changed. - if($mail_config['pop3_imap_daemon'] != 'dovecot') { - if(is_dir($maildomain_path)) exec("su -c 'maildirmake -q ".$data['new']['quota']."S ".escapeshellcmd($maildomain_path)."' ".$user); // Avoid maildirmake quota bug, see debian bug #214911 - $app->log('Created Maildir: '."su -c 'maildirmake -q ".$data['new']['quota']."S ".escapeshellcmd($maildomain_path)."' ".$user, LOGLEVEL_DEBUG); - } } if(!is_dir($data['new']['maildir'].'/.Sent')) { @@ -196,13 +188,6 @@ class mail_plugin { exec('chown -R '.$user.':'.$group.' '.escapeshellcmd($data['new']['maildir'])); $app->log('Set ownership on '.escapeshellcmd($data['new']['maildir']), LOGLEVEL_DEBUG); - //* Set the maildir quota - if(is_dir($data['new']['maildir'].'/new') && $mail_config['pop3_imap_daemon'] != 'dovecot') { - if($data['new']['quota'] > 0) { - if(is_dir($data['new']['maildir'])) exec("su -c 'maildirmake -q ".$data['new']['quota']."S ".escapeshellcmd($data['new']['maildir'])."' ".$user); - $app->log('Set Maildir quota: '."su -c 'maildirmake -q ".$data['new']['quota']."S ".escapeshellcmd($data['new']['maildir'])."' ".$user, LOGLEVEL_DEBUG); - } - } } //* Send the welcome email message @@ -360,11 +345,9 @@ class mail_plugin { } else { // Dovecot uses a different mail layout with a separate 'Maildir' subdirectory. - if($mail_config['pop3_imap_daemon'] == 'dovecot') { - $app->system->mkdirpath($maildomain_path, 0700, $user, $group); - $app->log('Created Directory: '.$base_path, LOGLEVEL_DEBUG); - $maildomain_path .= '/Maildir'; - } + $app->system->mkdirpath($maildomain_path, 0700, $user, $group); + $app->log('Created Directory: '.$base_path, LOGLEVEL_DEBUG); + $maildomain_path .= '/Maildir'; //* When the mail user dir exists but it is not a valid maildir, move it to corrupted maildir folder if(!empty($maildomain_path) && is_dir($maildomain_path) && !is_dir($maildomain_path.'/new') && !is_dir($maildomain_path.'/cur')) { @@ -378,17 +361,6 @@ class mail_plugin { //exec("su -c 'maildirmake ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name']); //$app->log("Created Maildir "."su -c 'maildirmake ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name'],LOGLEVEL_DEBUG); $app->system->maildirmake($maildomain_path, $user, '', $group); - - //* This is to fix the maildrop quota not being rebuilt after the quota is changed. - if($mail_config['pop3_imap_daemon'] != 'dovecot') { - if($data['new']['quota'] > 0) { - if(is_dir($maildomain_path)) exec("su -c 'maildirmake -q ".$data['new']['quota']."S ".escapeshellcmd($maildomain_path)."' ".$user); // Avoid maildirmake quota bug, see debian bug #214911 - $app->log('Updated Maildir quota: '."su -c 'maildirmake -q ".$data['new']['quota']."S ".escapeshellcmd($maildomain_path)."' ".$user, LOGLEVEL_DEBUG); - } else { - if(file_exists($data['new']['maildir'].'/maildirsize')) unlink($data['new']['maildir'].'/maildirsize'); - $app->log('Set Maildir quota to unlimited.', LOGLEVEL_DEBUG); - } - } } if(!is_dir($data['new']['maildir'].'/.Sent')) { @@ -429,16 +401,6 @@ class mail_plugin { $app->log('Moved Maildir from: '.$data['old']['maildir'].' to '.$data['new']['maildir'], LOGLEVEL_DEBUG); } //This is to fix the maildrop quota not being rebuilt after the quota is changed. - // Courier Layout - if(is_dir($data['new']['maildir'].'/new') && $mail_config['pop3_imap_daemon'] != 'dovecot') { - if($data['new']['quota'] > 0) { - if(is_dir($data['new']['maildir'])) exec("su -c 'maildirmake -q ".$data['new']['quota']."S ".escapeshellcmd($data['new']['maildir'])."' ".$user); - $app->log('Updated Maildir quota: '."su -c 'maildirmake -q ".$data['new']['quota']."S ".escapeshellcmd($data['new']['maildir'])."' ".$user, LOGLEVEL_DEBUG); - } else { - if(file_exists($data['new']['maildir'].'/maildirsize')) unlink($data['new']['maildir'].'/maildirsize'); - $app->log('Set Maildir quota to unlimited.', LOGLEVEL_DEBUG); - } - } } } diff --git a/server/plugins-available/maildrop_plugin.inc.php b/server/plugins-available/maildrop_plugin.inc.php deleted file mode 100644 index 2fefa26cfc95cfc697dc456278f136258543628b..0000000000000000000000000000000000000000 --- a/server/plugins-available/maildrop_plugin.inc.php +++ /dev/null @@ -1,270 +0,0 @@ -plugins->registerEvent('mail_user_insert', 'maildrop_plugin', 'update'); - $app->plugins->registerEvent('mail_user_update', 'maildrop_plugin', 'update'); - $app->plugins->registerEvent('mail_user_delete', 'maildrop_plugin', 'delete'); - - } - - - function update($event_name, $data) { - global $app, $conf; - - // load the server configuration options - $app->uses("getconf"); - $mail_config = $app->getconf->get_server_config($conf["server_id"], 'mail'); - if(substr($mail_config["homedir_path"], -1) == '/') { - $mail_config["homedir_path"] = substr($mail_config["homedir_path"], 0, -1); - } - $this->mailfilter_config_dir = $mail_config["homedir_path"].'/mailfilters'; - - - // Check if the config directory exists. - if(!is_dir($this->mailfilter_config_dir)) { - $app->log("Mailfilter config directory '".$this->mailfilter_config_dir."' does not exist. Creating it now.", LOGLEVEL_WARN); - mkdir($this->mailfilter_config_dir); - chown($this->mailfilter_config_dir, 'vmail'); - chmod($this->mailfilter_config_dir, 0770); - } - - if(isset($data["new"]["email"])) { - $email_parts = explode("@", $data["new"]["email"]); - } else { - $email_parts = explode("@", $data["old"]["email"]); - } - - // make sure that the config directories exist - if(!is_dir($this->mailfilter_config_dir.'/'.$email_parts[1])) { - mkdir($this->mailfilter_config_dir.'/'.$email_parts[1]); - chown($this->mailfilter_config_dir.'/'.$email_parts[1], 'vmail'); - chmod($this->mailfilter_config_dir.'/'.$email_parts[1], 0770); - } - if(!is_dir($this->mailfilter_config_dir.'/'.$email_parts[1].'/'.$email_parts[0])) { - mkdir($this->mailfilter_config_dir.'/'.$email_parts[1].'/'.$email_parts[0]); - chown($this->mailfilter_config_dir.'/'.$email_parts[1].'/'.$email_parts[0], 'vmail'); - chmod($this->mailfilter_config_dir.'/'.$email_parts[1].'/'.$email_parts[0], 0770); - } - - // Check if something has been changed regarding the autoresponders - if($data["old"]["autoresponder_text"] != $data["new"]["autoresponder_text"] - or $data["old"]["autoresponder"] != $data["new"]["autoresponder"] - or (isset($data["new"]["email"]) and $data["old"]["email"] != $data["new"]["email"]) - or $data["old"]["autoresponder_start_date"] != $data["new"]["autoresponder_start_date"] - or $data["old"]["autoresponder_end_date"] != $data["new"]["autoresponder_end_date"]) { - - // We delete the old autoresponder, if it exists - $email_parts = explode("@", $data["old"]["email"]); - $file = $this->mailfilter_config_dir.'/'.$email_parts[1].'/'.$email_parts[0].'/.vacation.lock'; - if(is_file($file)) unlink($file) or $app->log("Unable to delete file: $file", LOGLEVEL_WARN); - $file = $this->mailfilter_config_dir.'/'.$email_parts[1].'/'.$email_parts[0].'/.vacation.lst'; - if(is_file($file)) unlink($file) or $app->log("Unable to delete file: $file", LOGLEVEL_WARN); - $file = $this->mailfilter_config_dir.'/'.$email_parts[1].'/'.$email_parts[0].'/.vacation.lst.gdbm'; - if(is_file($file)) unlink($file) or $app->log("Unable to delete file: $file", LOGLEVEL_WARN); - $file = $this->mailfilter_config_dir.'/'.$email_parts[1].'/'.$email_parts[0].'/.vacation.lst.lock'; - if(is_file($file)) unlink($file) or $app->log("Unable to delete file: $file", LOGLEVEL_WARN); - $file = $this->mailfilter_config_dir.'/'.$email_parts[1].'/'.$email_parts[0].'/.vacation.msg'; - if(is_file($file)) unlink($file) or $app->log("Unable to delete file: $file", LOGLEVEL_WARN); - $file = $this->mailfilter_config_dir.'/'.$email_parts[1].'/'.$email_parts[0].'/.autoresponder'; - if(is_file($file)) unlink($file) or $app->log("Unable to delete file: $file", LOGLEVEL_WARN); - - - //Now we create the new autoresponder, if it is enabled - if($data["new"]["autoresponder"] == 'y') { - if(isset($data["new"]["email"])) { - $email_parts = explode("@", $data["new"]["email"]); - } else { - $email_parts = explode("@", $data["old"]["email"]); - } - - // Load the master template - if(file_exists($conf["rootpath"].'/conf-custom/autoresponder.master')) { - $tpl = file_get_contents($conf["rootpath"].'/conf-custom/autoresponder.master'); - } else { - $tpl = file_get_contents($conf["rootpath"].'/conf/autoresponder.master'); - } - $tpl = str_replace('{vmail_mailbox_base}', $mail_config["homedir_path"], $tpl); - - if ($data['new']['autoresponder_start_date'] && $data["new"]["autoresponder_start_date"] != '0000-00-00 00:00:00') { // Dates have been set - $tpl = str_replace('{start_date}', strtotime($data["new"]["autoresponder_start_date"]), $tpl); - $tpl = str_replace('{end_date}', strtotime($data["new"]["autoresponder_end_date"]), $tpl); - } else { - $tpl = str_replace('{start_date}', -7200, $tpl); - $tpl = str_replace('{end_date}', 2147464800, $tpl); - } - - // Write the config file. - $config_file_path = $this->mailfilter_config_dir.'/'.$email_parts[1].'/'.$email_parts[0].'/.autoresponder'; - file_put_contents($config_file_path, $tpl); - $app->log("Writing Autoresponder mailfilter file: $config_file_path", LOGLEVEL_DEBUG); - chmod($config_file_path, 0770); - chown($config_file_path, 'vmail'); - unset($tpl); - unset($config_file_path); - - // Write the autoresponder message file - $config_file_path = $this->mailfilter_config_dir.'/'.$email_parts[1].'/'.$email_parts[0].'/.vacation.msg'; - file_put_contents($config_file_path, $data["new"]["autoresponder_text"]); - chmod($config_file_path, 0770); - chown($config_file_path, 'vmail'); - $app->log("Writing Autoresponder message file: $config_file_path", LOGLEVEL_DEBUG); - } - } - - // Write the custom mailfilter script, if mailfilter recipe has changed - if($data["old"]["custom_mailfilter"] != $data["new"]["custom_mailfilter"] - or $data["old"]["move_junk"] != $data["new"]["move_junk"] - or $data["old"]["cc"] != $data["new"]["cc"]) { - - $app->log("Mailfilter config has been changed", LOGLEVEL_DEBUG); - if(trim($data["new"]["custom_mailfilter"]) != '' - or $data["new"]["move_junk"] != 'n' - or $data["new"]["cc"] != '') { - - // Delete the old filter recipe - $email_parts = explode("@", $data["old"]["email"]); - $file = $this->mailfilter_config_dir.'/'.$email_parts[1].'/'.$email_parts[0].'/.mailfilter'; - if(is_file($file)) unlink($file) or $app->log("Unable to delete file: $file", LOGLEVEL_WARN); - - // write the new recipe - if(isset($data["new"]["email"])) { - $email_parts = explode("@", $data["new"]["email"]); - } else { - $email_parts = explode("@", $data["old"]["email"]); - } - $config_file_path = $this->mailfilter_config_dir.'/'.$email_parts[1].'/'.$email_parts[0].'/.mailfilter'; - - $mailfilter_content = ''; - - if($data["new"]["cc"] != '') { - $tmp_mails_arr = explode(',',$data["new"]["cc"]); - foreach($tmp_mails_arr as $address) { - if(trim($address) != '') $mailfilter_content .= "cc \"!".trim($address)."\"\n"; - } - //$mailfilter_content .= "cc \"!".$data["new"]["cc"]."\"\n"; - $app->log("Added CC address ".$data["new"]["cc"].' to mailfilter file.', LOGLEVEL_DEBUG); - } - - if($data["new"]["move_junk"] == 'y') { - if(file_exists($conf["rootpath"].'/conf-custom/mailfilter_move_junk.master')) { - $mailfilter_content .= file_get_contents($conf["rootpath"].'/conf-custom/mailfilter_move_junk.master')."\n"; - } else { - $mailfilter_content .= file_get_contents($conf["rootpath"].'/conf/mailfilter_move_junk.master')."\n"; - } - } - $mailfilter_content .= str_replace("\r\n","\n",$data["new"]["custom_mailfilter"]); - - // Replace windows linebreaks in mailfilter file - $mailfilter_content = str_replace("\r\n", "\n", $mailfilter_content); - - file_put_contents($config_file_path, $mailfilter_content); - $app->log("Writing new custom Mailfiter".$config_file_path, LOGLEVEL_DEBUG); - chmod($config_file_path, 0770); - chown($config_file_path, 'vmail'); - unset($config_file_path); - } else { - // Delete the mailfilter recipe - if(isset($data["old"]["email"])) { - $email_parts = explode("@", $data["old"]["email"]); - $file = $this->mailfilter_config_dir.'/'.$email_parts[1].'/'.$email_parts[0].'/.mailfilter'; - if(is_file($file)) { - unlink($file) or $app->log("Unable to delete file: $file", LOGLEVEL_WARN); - $app->log("Deleting custom Mailfiter".$file, LOGLEVEL_DEBUG); - } - } - } - } - } - - function delete($event_name, $data) { - global $app, $conf; - - // load the server configuration options - $app->uses("getconf"); - $mail_config = $app->getconf->get_server_config($conf["server_id"], 'mail'); - $this->mailfilter_config_dir = $mail_config["homedir_path"].'/mailfilters'; - - $email_parts = explode("@", $data["old"]["email"]); - $dir = $this->mailfilter_config_dir.'/'.$email_parts[1].'/'.$email_parts[0]; - if(is_dir($dir)) { - $file = $this->mailfilter_config_dir.'/'.$email_parts[1].'/'.$email_parts[0].'/.vacation.lock'; - if(is_file($file)) unlink($file) or $app->log("Unable to delete file: $file", LOGLEVEL_WARN); - $file = $this->mailfilter_config_dir.'/'.$email_parts[1].'/'.$email_parts[0].'/.vacation.lst'; - if(is_file($file)) unlink($file) or $app->log("Unable to delete file: $file", LOGLEVEL_WARN); - $file = $this->mailfilter_config_dir.'/'.$email_parts[1].'/'.$email_parts[0].'/.vacation.msg'; - if(is_file($file)) unlink($file) or $app->log("Unable to delete file: $file", LOGLEVEL_WARN); - $file = $this->mailfilter_config_dir.'/'.$email_parts[1].'/'.$email_parts[0].'/.autoresponder'; - if(is_file($file)) unlink($file) or $app->log("Unable to delete file: $file", LOGLEVEL_WARN); - $file = $this->mailfilter_config_dir.'/'.$email_parts[1].'/'.$email_parts[0].'/.mailfilter'; - if(is_file($file)) unlink($file) or $app->log("Unable to delete file: $file", LOGLEVEL_WARN); - $file = $this->mailfilter_config_dir.'/'.$email_parts[1].'/'.$email_parts[0].'/.vacation.lst.gdbm'; - if(is_file($file)) unlink($file) or $app->log("Unable to delete file: $file", LOGLEVEL_WARN); - $file = $this->mailfilter_config_dir.'/'.$email_parts[1].'/'.$email_parts[0].'/.vacation.lst.lock'; - if(is_file($file)) unlink($file) or $app->log("Unable to delete file: $file", LOGLEVEL_WARN); - rmdir($dir) or $app->log("Unable to delete directory: $dir", LOGLEVEL_WARN); - } - } - - -} // end class - -?> diff --git a/server/plugins-available/mailman_plugin.inc.php b/server/plugins-available/mailman_plugin.inc.php deleted file mode 100644 index 99ac9db7d23d8add4c1a0f5d94f447c265e282b9..0000000000000000000000000000000000000000 --- a/server/plugins-available/mailman_plugin.inc.php +++ /dev/null @@ -1,182 +0,0 @@ -plugins->registerEvent('mail_mailinglist_insert', 'mailman_plugin', 'insert'); - $app->plugins->registerEvent('mail_mailinglist_update', 'mailman_plugin', 'update'); - $app->plugins->registerEvent('mail_mailinglist_delete', 'mailman_plugin', 'delete'); - - - - } - - function insert($event_name, $data) { - global $app, $conf; - - $this->update_config(); - - $pid = exec("nohup /usr/lib/mailman/bin/newlist -u ".escapeshellcmd($data["new"]["domain"])." -e ".escapeshellcmd($data["new"]["domain"])." ".escapeshellcmd($data["new"]["listname"])." ".escapeshellcmd($data["new"]["email"])." ".escapeshellcmd($data["new"]["password"])." >/dev/null 2>&1 & echo $!;"); - // wait for /usr/lib/mailman/bin/newlist-call - $running = true; - do { - exec('ps -p '.intval($pid), $out); - if (count($out) ==1) $running=false; else sleep(1); - unset($out); - } while ($running); - unset($out); - if(is_file('/etc/mailman/virtual-mailman') && !is_link('/var/lib/mailman/data/virtual-mailman')) { - symlink('/etc/mailman/virtual-mailman','/var/lib/mailman/data/virtual-mailman'); - } - if(is_file('/var/lib/mailman/data/virtual-mailman')) exec('postmap /var/lib/mailman/data/virtual-mailman'); - if(is_file('/var/lib/mailman/data/transport-mailman')) exec('postmap /var/lib/mailman/data/transport-mailman'); - - exec('nohup '.$conf['init_scripts'] . '/' . 'mailman reload >/dev/null 2>&1 &'); - - // Fix list URL - exec('/usr/sbin/withlist -l -r fix_url '.escapeshellcmd($data["new"]["listname"])); - - $app->db->query("UPDATE mail_mailinglist SET password = '' WHERE mailinglist_id = ?", $data["new"]['mailinglist_id']); - - } - - // The purpose of this plugin is to rewrite the main.cf file - function update($event_name, $data) { - global $app, $conf; - - $this->update_config(); - - if($data["new"]["password"] != $data["old"]["password"] && $data["new"]["password"] != '') { - exec("nohup /usr/lib/mailman/bin/change_pw -l ".escapeshellcmd($data["new"]["listname"])." -p ".escapeshellcmd($data["new"]["password"])." >/dev/null 2>&1 &"); - exec('nohup '.$conf['init_scripts'] . '/' . 'mailman reload >/dev/null 2>&1 &'); - $app->db->query("UPDATE mail_mailinglist SET password = '' WHERE mailinglist_id = ?", $data["new"]['mailinglist_id']); - } - - if(is_file('/var/lib/mailman/data/virtual-mailman')) exec('postmap /var/lib/mailman/data/virtual-mailman'); - if(is_file('/var/lib/mailman/data/transport-mailman')) exec('postmap /var/lib/mailman/data/transport-mailman'); - } - - function delete($event_name, $data) { - global $app, $conf; - - $this->update_config(); - - exec("nohup /usr/lib/mailman/bin/rmlist -a ".escapeshellcmd($data["old"]["listname"])." >/dev/null 2>&1 &"); - - exec('nohup '.$conf['init_scripts'] . '/' . 'mailman reload >/dev/null 2>&1 &'); - - if(is_file('/var/lib/mailman/data/virtual-mailman')) exec('postmap /var/lib/mailman/data/virtual-mailman'); - if(is_file('/var/lib/mailman/data/transport-mailman')) exec('postmap /var/lib/mailman/data/transport-mailman'); - - } - - function update_config() { - global $app, $conf; - - copy($this->mailman_config_dir.'mm_cfg.py', $this->mailman_config_dir.'mm_cfg.py~'); - - // load the server configuration options - $app->uses('getconf'); - $server_config = $app->getconf->get_server_config($conf['server_id'], 'server'); - - // load files - if(file_exists($conf["rootpath"]."/conf-custom/mm_cfg.py.master")) { - $content = file_get_contents($conf["rootpath"]."/conf-custom/mm_cfg.py.master"); - } else { - $content = file_get_contents($conf["rootpath"]."/conf/mm_cfg.py.master"); - } - $old_file = file_get_contents($this->mailman_config_dir."/mm_cfg.py"); - - $old_options = array(); - $lines = explode("\n", $old_file); - foreach ($lines as $line) - { - if (strlen($line) && substr($line, 0, 1) != '#') - { - list($key, $value) = explode("=", $line); - if ($value && $value !== '') - { - $key = rtrim($key); - $old_options[$key] = trim($value); - } - } - } - - // create virtual_domains list - $domainAll = $app->db->queryAllRecords("SELECT domain FROM mail_mailinglist GROUP BY domain"); - $virtual_domains = ''; - foreach($domainAll as $domain) - { - if ($domainAll[0]['domain'] == $domain['domain']) - $virtual_domains .= "'".$domain['domain']."'"; - else - $virtual_domains .= ", '".$domain['domain']."'"; - } - - $content = str_replace('{hostname}', $server_config['hostname'], $content); - $content = str_replace('{default_language}', $old_options['DEFAULT_SERVER_LANGUAGE'], $content); - $content = str_replace('{virtual_domains}', $virtual_domains, $content); - - file_put_contents($this->mailman_config_dir."/mm_cfg.py", $content); - } - -} // end class - -?> diff --git a/server/plugins-available/mlmmj_plugin.inc.php b/server/plugins-available/mlmmj_plugin.inc.php deleted file mode 100644 index 7f1130e01c7455cbf9957ed68060109f2550326d..0000000000000000000000000000000000000000 --- a/server/plugins-available/mlmmj_plugin.inc.php +++ /dev/null @@ -1,406 +0,0 @@ - 10100 Srl -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of ISPConfig nor the names of its contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/* -templates/mail_mailinglist_list.htm -templates/mail_mailinglist_edit.htm - -list/mail_mailinglist.list.php - -form/mail_mailinglist.tform.php - -mailinglist.php -mail_mailinglist_list.php -mail_mailinglist_edit.php -mail_mailinglist_del.php -*/ - -class mlmmj_plugin { - const ML_ALIAS = 0; - const ML_TRANSPORT = 1; - const ML_VIRTUAL = 2; - const SECONDS_IN_DAY = 86400; - - private $plugin_name = 'mlmmj_plugin'; - private $class_name = 'mlmmj_plugin'; - private $mlmmj_config_dir = '/etc/mlmmj/'; - - /* - This function is called during ispconfig installation to determine - if a symlink shall be created for this plugin. - */ - function onInstall() { - global $conf; - - if($conf['services']['mail'] == true) return true; - else return false; - } - - //This function is called when the plugin is loaded - function onLoad() { - global $app; - - // Register for the events - $app->plugins->registerEvent('mail_mailinglist_insert', $this->plugin_name, 'list_insert'); - $app->plugins->registerEvent('mail_mailinglist_update', $this->plugin_name, 'list_update'); - $app->plugins->registerEvent('mail_mailinglist_delete', $this->plugin_name, 'list_delete'); - - $app->plugins->registerEvent('mail_ml_member_insert', $this->plugin_name, 'member_insert'); - $app->plugins->registerEvent('mail_ml_member_update', $this->plugin_name, 'member_update'); - $app->plugins->registerEvent('mail_ml_member_delete', $this->plugin_name, 'member_delete'); - - } - - function list_insert($event_name, $data) { - global $app, $conf; - - $mlManager = $app->getconf->get_server_config($conf['server_id'], 'mail')['mailinglist_manager']; - - if($mlManager == 'mlmmj') { - $mlConf = $this->getMlConfig(); - $rec = $data['new']; - $listDomain = $rec['domain']; - $listName = $rec['listname']; - $listDir = $mlConf['spool_dir']."/$listDomain/$listName"; - $lang = 'en'; - $owner = $rec['email']; - - // Creating ML directories structure - mkdir("$listDir/incoming", 0755, true); - mkdir("$listDir/queue/discarded", 0755, true); - mkdir("$listDir/archive", 0755, true); - mkdir("$listDir/text", 0755, true); - mkdir("$listDir/subconf", 0755, true); - mkdir("$listDir/unsubconf", 0755, true); - mkdir("$listDir/bounce", 0755, true); - mkdir("$listDir/control", 0755, true); - mkdir("$listDir/moderation", 0755, true); - mkdir("$listDir/subscribers.d", 0755, true); - mkdir("$listDir/digesters.d", 0755, true); - mkdir("$listDir/requeue", 0755, true); - mkdir("$listDir/nomailsubs.d", 0755, true); - - // Creating ML index file - touch("$listDir/index"); - - // Creating default control files - // WARNING: Edit this section if default DB values will be modified! - touch("$listDir/control/nodigestsub"); - touch("$listDir/control/noarchive"); - file_put_contents("$listDir/control/owner", $owner); - file_put_contents("$listDir/control/listaddress", "$listName@$listDomain"); - file_put_contents("$listDir/control/prefix", "[$listName]"); - - // Copying language translations - if(!is_dir("/usr/share/mlmmj/text.skel/$lang")) $lang = 'en'; - foreach (glob("/usr/share/mlmmj/text.skel/$lang/*") as $filename) - copy($filename, "$listDir/text/".basename($filename)); - - // The mailinglist directory have to be owned by the user running the mailserver - $this->changeOwnership($listDir); - - // Creating alias entry - $this->addMapEntry("$listName: \"|/usr/bin/mlmmj-recieve -L $listDir/\"", self::ML_ALIAS); - - // Creating transport entry - $this->addMapEntry("$listDomain--$listName@localhost.mlmmj mlmmj:$listDomain/$listName", self::ML_TRANSPORT); - - // Creating virtual entry - $this->addMapEntry("$listName@$listDomain $listDomain--$listName@localhost.mlmmj", self::ML_VIRTUAL); - } - } - - // The purpose of this plugin is to rewrite the main.cf file - function list_update($event_name, $data) { - global $app, $conf; - - $mlManager = $app->getconf->get_server_config($conf['server_id'], 'mail')['mailinglist_manager']; - - if($mlManager == 'mlmmj') { - $rec = $data['new']; - $mlConf = $this->getMlConfig(); - - $controlDir = "{$mlConf['spool_dir']}/{$rec['domain']}/{$rec['listname']}/control"; - - // Doesn't matter if the list is open or close, members can ALWAYS unsubscribe - if($rec['list_type'] == 'open') { - switch($rec['subscribe_policy']) { - case 'disabled': - touch("$controlDir/closedlistsub"); - @unlink("$controlDir/submod"); - @unlink("$controlDir/nosubconfirm"); - break; - case 'both': - touch("$controlDir/submod"); - case 'approval': - touch("$controlDir/nosubconfirm"); - @unlink("$controlDir/closedlistsub"); - break; - case 'none': - touch("$controlDir/nosubconfirm"); - @unlink("$controlDir/closedlistsub"); - break; - case 'confirm': - @unlink("$controlDir/nosubconfirm"); - @unlink("$controlDir/closedlistsub"); - @unlink("$controlDir/submod"); - break; - } - - switch($rec['posting_policy']) { - case 'closed': - touch("$controlDir/subonlypost"); - break; - case 'moderated': - touch("$controlDir/modnonsubposts"); - break; - case 'free': - @unlink("$controlDir/modnonsubposts"); - @unlink("$controlDir/subonlypost"); - break; - } - } elseif($rec['list_type'] == 'closed') { - touch("$controlDir/closedlistsub"); - touch("$controlDir/subonlypost"); - @unlink("$controlDir/modnonsubposts"); - @unlink("$controlDir/submod"); - @unlink("$controlDir/nosubconfirm"); - } - - if($rec['digestsub'] == 'y') { - @unlink("$controlDir/nodigestsub"); - if($rec['digesttext'] == 'y') @unlink("$controlDir/nodigesttext"); - else touch("$controlDir/nodigesttext"); - file_put_contents("$controlDir/digestinterval", $rec['digestinterval']*self::SECONDS_IN_DAY); - file_put_contents("$controlDir/digestmaxmails", $rec['digestmaxmails']); - } else { - touch("$controlDir/nodigestsub"); - @unlink("$controlDir/nodigesttext"); - @unlink("$controlDir/digestinterval"); - @unlink("$controlDir/digestmaxmails"); - } - - if($rec['subject_prefix']) - file_put_contents("$controlDir/prefix", $rec['subject_prefix']); - else @unlink("$controlDir/prefix"); - - if($rec['mail_footer']) - file_put_contents("$controlDir/footer", $rec['mail_footer']); - else @unlink("$controlDir/footer"); - - if($rec['archive'] == 'y') - @unlink("$controlDir/noarchive"); - else - touch("$controlDir/noarchive"); - - $this->changeOwnership("$controlDir/*"); - } - } - - function list_delete($event_name, $data) { - global $app, $conf; - - $mlManager = $app->getconf->get_server_config($conf['server_id'], 'mail')['mailinglist_manager']; - - if($mlManager == 'mlmmj') { - $mlConf = $this->getMlConfig(); - $rec = $data['old']; - $listDomain = $rec['domain']; - $listName = $rec['listname']; - $listDir = $mlConf['spool_dir']."/$listDomain/$listName"; - - // Remove ML directory structure - $this->rmdirR($listDir); - @rmdir($mlConf['spool_dir']."/$listDomain"); - - // Removing alias entry - $this->delMapEntry("$listName: \"|/usr/bin/mlmmj-recieve -L $listDir/\"", self::ML_ALIAS); - - // Removing transport entry - $this->delMapEntry("$listDomain--$listName@localhost.mlmmj mlmmj:$listDomain/$listName", self::ML_TRANSPORT); - - // Removing virtual entry - $this->delMapEntry("$listName@$listDomain $listDomain--$listName@localhost.mlmmj", self::ML_VIRTUAL); - } - } - - function member_insert($event_name, $data) { - global $app, $conf; - - $mlManager = $app->getconf->get_server_config($conf['server_id'], 'mail')['mailinglist_manager']; - - if($mlManager == 'mlmmj') { - $mlConf = $this->getMlConfig(); - - $rec = $data['new']; - - $sql = "SELECT * FROM mail_mailinglist WHERE mailinglist_id = ?"; - $ml = $app->db->queryOneRecord($sql, $rec['mailinglist_id']); - if($ml['mailinglist_id']) { - $listDomain = $ml['domain']; - $listName = $ml['listname']; - $listDir = $mlConf['spool_dir']."/$listDomain/$listName"; - } - - $welcome = ($rec['welcome_msg'] == 'y')?'-c':''; - $command = "/usr/bin/mlmmj-sub -q -s -L $listDir $welcome -a ".$rec['email']; - exec("nohup $command>/dev/null 2>&1"); - } - } - - function member_update($event_name, $data) { - //TODO: Implement something usefull on update event (e.g. change to digest subscription) - } - - function member_delete($event_name, $data) { - global $app, $conf; - - $mlManager = $app->getconf->get_server_config($conf['server_id'], 'mail')['mailinglist_manager']; - - if($mlManager == 'mlmmj') { - $mlConf = $this->getMlConfig(); - - $rec = $data['old']; - - $sql = "SELECT * FROM mail_mailinglist WHERE mailinglist_id = ?"; - $ml = $app->db->queryOneRecord($sql, $rec['mailinglist_id']); - if($ml['mailinglist_id']) { - $listDomain = $ml['domain']; - $listName = $ml['listname']; - $listDir = $mlConf['spool_dir']."/$listDomain/$listName"; - } - - $goodbye = ($rec['goodbye_msg'] == 'y')?'-c':''; - $command = "/usr/bin/mlmmj-unsub -q -s -L $listDir $goodbye -a ".$rec['email']; - exec("nohup $command>/dev/null 2>&1"); - } - } - - private function getMlConfig() { - $mlConfig = @parse_ini_file($this->mlmmj_config_dir.'mlmmj.conf'); - - // Force PHP7 to use # to mark comments - if(PHP_MAJOR_VERSION >= 7 && is_array($mlConfig)) - $mlConfig = array_filter($mlConfig, function($v){return(substr($v,0,1)!=='#');}, ARRAY_FILTER_USE_KEY); - - return $mlConfig; - } - - private function changeOwnership($path, $recursive=true) { - if(basename($path) == '*') $path = dirname($path); - - if(is_dir($path)) { - if($objs = glob($path."/*")) { - foreach($objs as $obj) { - chown($obj, 'mlmmj'); - chgrp($obj, 'mlmmj'); - if(is_dir($obj) && $recursive) $this->changeOwnership($obj); - } - } - } - - return chown($path, 'mlmmj') && chgrp($path, 'mlmmj'); - } - - private function rmdirR($path) { - if(is_dir($path) === true) { - $files = array_diff(scandir($path), array('.', '..')); - foreach($files as $file) $this->rmdirR(realpath($path) . '/' . $file); - - return rmdir($path); - } elseif(is_file($path) === true) return unlink($path); - - return false; - } - - private function addMapEntry($directive, $type) { - - $destFile = $this->mlmmj_config_dir; - switch($type) { - case self::ML_ALIAS: - $destFile .= 'aliases'; - $command = 'postalias'; - break; - case self::ML_TRANSPORT: - $destFile .= 'transport'; - $command = 'postmap'; - break; - case self::ML_VIRTUAL: - $destFile .= 'virtual'; - $command = 'postmap'; - break; - } - - $lines = file($destFile, FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES); - $lines[] = $directive; - - file_put_contents($destFile, implode("\n", array_unique($lines))); - exec("nohup /usr/sbin/$command $destFile >/dev/null 2>&1 &"); - } - - private function delMapEntry($directive, $type) { - - $destFile = $this->mlmmj_config_dir; - switch($type) { - case self::ML_ALIAS: - $destFile .= 'aliases'; - $command = 'postalias'; - break; - case self::ML_TRANSPORT: - $destFile .= 'transport'; - $command = 'postmap'; - break; - case self::ML_VIRTUAL: - $destFile .= 'virtual'; - $command = 'postmap'; - break; - } - - $lines = file($destFile, FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES); - - foreach(array_keys($lines, $directive) as $key) unset($lines[$key]); - - file_put_contents($destFile, implode("\n", array_unique($lines))); - exec("nohup /usr/sbin/$command $destFile >/dev/null 2>&1 &"); - } - - private function checkSys() { - if(!is_dir($this->mlmmj_config_dir)) mkdir($this->mlmmj_config_dir, 0755); - if(!file_exists($this->mlmmj_config_dir.'mlmmj.conf')) { - file_put_contents($this->mlmmj_config_dir.'mlmmj.conf', 'skel_dir = /usr/share/mlmmj/text.skel'); - file_put_contents($this->mlmmj_config_dir.'mlmmj.conf', 'spool_dir = /var/spool/mlmmj', FILE_APPEND); - } - if(!file_exists($this->mlmmj_config_dir.'aliases')) touch($this->mlmmj_config_dir.'aliases'); - if(!file_exists($this->mlmmj_config_dir.'transport')) touch($this->mlmmj_config_dir.'transport'); - if(!file_exists($this->mlmmj_config_dir.'virtual')) touch($this->mlmmj_config_dir.'virtual'); - } -} // end class - -?> diff --git a/server/plugins-available/openvz_plugin.inc.php b/server/plugins-available/openvz_plugin.inc.php deleted file mode 100644 index 5cc4bf6522aaf1a64ab8d375b96ed8b6f89de18a..0000000000000000000000000000000000000000 --- a/server/plugins-available/openvz_plugin.inc.php +++ /dev/null @@ -1,212 +0,0 @@ -plugins->registerEvent('openvz_vm_insert', $this->plugin_name, 'vm_insert'); - $app->plugins->registerEvent('openvz_vm_update', $this->plugin_name, 'vm_update'); - $app->plugins->registerEvent('openvz_vm_delete', $this->plugin_name, 'vm_delete'); - - //* Register for actions - $app->plugins->registerAction('openvz_start_vm', $this->plugin_name, 'actions'); - $app->plugins->registerAction('openvz_stop_vm', $this->plugin_name, 'actions'); - $app->plugins->registerAction('openvz_restart_vm', $this->plugin_name, 'actions'); - $app->plugins->registerAction('openvz_create_ostpl', $this->plugin_name, 'actions'); - - - - } - - - function vm_insert($event_name, $data) { - global $app, $conf; - - $veid = intval($data['new']['veid']); - - if($veid == 0) { - $app->log("VEID = 0, we stop here.", LOGLEVEL_WARN); - return; - } - - $tmp = $app->db->queryOneRecord("SELECT template_file FROM openvz_ostemplate WHERE ostemplate_id = ?", $data['new']['ostemplate_id']); - $ostemplate = escapeshellcmd($tmp['template_file']); - unset($tmp); - - //* Create the virtual machine - exec("vzctl create $veid --ostemplate $ostemplate"); - $app->log("Create OpenVZ VM: vzctl create $veid --ostemplate $ostemplate", LOGLEVEL_DEBUG); - - //* Write the configuration of the VM - file_put_contents('/etc/vz/conf/'.$veid.'.conf', $data['new']['config']); - - //* Start the VM - if($data['new']['active'] == 'y') { - exec("vzctl start $veid"); - $app->log("Starting OpenVZ VM: vzctl start $veid", LOGLEVEL_DEBUG); - } - - //* Set the root password in the virtual machine - exec("vzctl set $veid --userpasswd root:".escapeshellcmd($data['new']['vm_password'])); - - } - - function vm_update($event_name, $data) { - global $app, $conf; - - $veid = intval($data['new']['veid']); - - if($veid == 0) { - $app->log("VEID = 0, we stop here.", LOGLEVEL_WARN); - return; - } - - //* Write the configuration of the VM - file_put_contents('/etc/vz/conf/'.$veid.'.conf', $data['new']['config']); - $app->log("Writing new configuration for $veid", LOGLEVEL_DEBUG); - - //* new diskspace for ploop-containers requieres "vzctl set" - if($data['new']['diskspace'] != $data['old']['diskspace']) { - exec("vzctl set ".$veid." --diskspace ".$data['new']['diskspace']."G --save"); - } - - //* Apply config changes to the VM - if($data['new']['active'] == 'y' && $data['old']['active'] == 'y') { - exec("vzctl restart $veid"); - $app->log("Restarting OpenVZ VM: vzctl restart $veid", LOGLEVEL_DEBUG); - } elseif ($data['new']['active'] == 'y' && $data['old']['active'] == 'n') { - exec("vzctl start $veid"); - $app->log("Starting OpenVZ VM: vzctl start $veid", LOGLEVEL_DEBUG); - } elseif ($data['new']['active'] == 'n' && $data['old']['active'] == 'y') { - exec("vzctl stop $veid"); - $app->log("Stopping OpenVZ VM: vzctl stop $veid", LOGLEVEL_DEBUG); - } - - //* Set the root password in the virtual machine - if($data['new']['vm_password'] != $data['old']['vm_password']) { - exec("vzctl set $veid --userpasswd root:".escapeshellcmd($data['new']['vm_password'])); - } - - - } - - function vm_delete($event_name, $data) { - global $app, $conf; - - $veid = intval($data['old']['veid']); - - if($veid == 0) { - $app->log("VEID = 0, we stop here.", LOGLEVEL_WARN); - return; - } - - exec("vzctl stop $veid"); - exec("vzctl destroy $veid"); - $app->log("Destroying OpenVZ VM: vzctl destroy $veid", LOGLEVEL_DEBUG); - - } - - function actions($action_name, $data) { - global $app, $conf; - - if ($action_name == 'openvz_start_vm') { - $veid = intval($data); - if($veid > 0) { - exec("vzctl start $veid"); - $app->log("Start VM: vzctl start $veid", LOGLEVEL_DEBUG); - } - return 'ok'; - } - if ($action_name == 'openvz_stop_vm') { - $veid = intval($data); - if($veid > 0) { - exec("vzctl stop $veid"); - $app->log("Stop VM: vzctl stop $veid", LOGLEVEL_DEBUG); - } - return 'ok'; - } - if ($action_name == 'openvz_restart_vm') { - $veid = intval($data); - if($veid > 0) { - exec("vzctl restart $veid"); - $app->log("Restart VM: vzctl restart $veid", LOGLEVEL_DEBUG); - } - return 'ok'; - } - if ($action_name == 'openvz_create_ostpl') { - $parts = explode(':', $data); - $veid = intval($parts[0]); - $template_cache_dir = '/vz/template/cache/'; - $template_name = escapeshellcmd($parts[1]); - if($veid > 0 && $template_name != '' && is_dir($template_cache_dir)) { - $command = "vzdump --suspend --compress --stdexcludes --dumpdir $template_cache_dir $veid"; - exec($command); - exec("mv ".$template_cache_dir."vzdump-openvz-".$veid."*.tgz ".$template_cache_dir.$template_name.".tar.gz"); - exec("rm -f ".$template_cache_dir."vzdump-openvz-".$veid."*.log"); - } - $app->log("Created OpenVZ OStemplate $template_name from VM $veid", LOGLEVEL_DEBUG); - return 'ok'; - } - - } - - -} // end class - -?> diff --git a/server/plugins-available/postfix_server_plugin.inc.php b/server/plugins-available/postfix_server_plugin.inc.php index 64c557139088088f21dd35c547a9462361c6162a..1d500c8bcf6a127a90628d8c976383ef27e08dd0 100644 --- a/server/plugins-available/postfix_server_plugin.inc.php +++ b/server/plugins-available/postfix_server_plugin.inc.php @@ -60,15 +60,11 @@ class postfix_server_plugin { Register for the events */ - $app->plugins->registerEvent('server_insert', 'postfix_server_plugin', 'insert'); - $app->plugins->registerEvent('server_update', 'postfix_server_plugin', 'update'); - - - + $app->plugins->registerEvent('server_insert', $this->plugin_name, 'insert'); + $app->plugins->registerEvent('server_update', $this->plugin_name, 'update'); } function insert($event_name, $data) { - global $app, $conf; $this->update($event_name, $data); @@ -116,7 +112,7 @@ class postfix_server_plugin { if($rbl_hosts != ''){ $rbl_hosts = explode(",", $rbl_hosts); } - $options = explode(", ", exec("postconf -h smtpd_recipient_restrictions")); + $options = preg_split("/,\s*/", exec("postconf -h smtpd_recipient_restrictions")); $new_options = array(); foreach ($options as $key => $value) { if (!preg_match('/reject_rbl_client/', $value)) { @@ -162,7 +158,8 @@ class postfix_server_plugin { } if($app->system->is_installed('dovecot')) { - $temp = exec("postconf -n virtual_transport", $out); + $out = null; + exec("postconf -n virtual_transport", $out); if ($mail_config["mailbox_virtual_uidgid_maps"] == 'y') { // If dovecot switch to lmtp if($out[0] != "virtual_transport = lmtp:unix:private/dovecot-lmtp") { @@ -182,12 +179,51 @@ class postfix_server_plugin { } } - exec("postconf -e 'mailbox_size_limit = ".intval($mail_config['mailbox_size_limit']*1024*1024)."'"); //TODO : no reload? - exec("postconf -e 'message_size_limit = ".intval($mail_config['message_size_limit']*1024*1024)."'"); //TODO : no reload? + if($mail_config['content_filter'] != $old_ini_data['mail']['content_filter']) { + if($mail_config['content_filter'] == 'rspamd'){ + exec("postconf -X 'receive_override_options'"); + exec("postconf -X 'content_filter'"); + + exec("postconf -e 'smtpd_milters = inet:localhost:11332'"); + exec("postconf -e 'non_smtpd_milters = inet:localhost:11332'"); + exec("postconf -e 'milter_protocol = 6'"); + exec("postconf -e 'milter_mail_macros = i {mail_addr} {client_addr} {client_name} {auth_authen}'"); + exec("postconf -e 'milter_default_action = accept'"); + + exec("postconf -e 'smtpd_sender_restrictions = check_sender_access mysql:/etc/postfix/mysql-virtual_sender.cf, permit_mynetworks, permit_sasl_authenticated'"); + + $new_options = array(); + $options = preg_split("/,\s*/", exec("postconf -h smtpd_recipient_restrictions")); + foreach ($options as $key => $value) { + if (!preg_match('/check_policy_service\s+inet:127.0.0.1:10023/', $value)) { + $new_options[] = $value; + } + } + exec("postconf -e 'smtpd_recipient_restrictions = ".implode(", ", $new_options)."'"); + } elseif($mail_config['content_filter'] == 'amavisd'){ + exec("postconf -X 'smtpd_milters'"); + exec("postconf -X 'milter_protocol'"); + exec("postconf -X 'milter_mail_macros'"); + exec("postconf -X 'milter_default_action'"); + + exec("postconf -e 'receive_override_options = no_address_mappings'"); + exec("postconf -e 'content_filter = amavis:[127.0.0.1]:10024'"); + + exec("postconf -e 'smtpd_sender_restrictions = check_sender_access mysql:/etc/postfix/mysql-virtual_sender.cf regexp:/etc/postfix/tag_as_originating.re, permit_mynetworks, permit_sasl_authenticated, check_sender_access regexp:/etc/postfix/tag_as_foreign.re'"); + } + } + if($mail_config['content_filter'] == 'rspamd' && ($mail_config['rspamd_password'] != $old_ini_data['mail']['rspamd_password'] || $mail_config['content_filter'] != $old_ini_data['mail']['content_filter'])) { + $tpl = new tpl(); + $tpl->newTemplate('rspamd_worker-controller.inc.master'); + $tpl->setVar('rspamd_password', $mail_config['rspamd_password']); + $app->system->file_put_contents('/etc/rspamd/local.d/worker-controller.inc', $tpl->grab()); + $app->services->restartServiceDelayed('rspamd', 'reload'); + } + exec("postconf -e 'mailbox_size_limit = ".intval($mail_config['mailbox_size_limit']*1024*1024)."'"); + exec("postconf -e 'message_size_limit = ".intval($mail_config['message_size_limit']*1024*1024)."'"); + $app->services->restartServiceDelayed('postfix', 'reload'); } } // end class - -?> diff --git a/server/plugins-available/rspamd_plugin.inc.php b/server/plugins-available/rspamd_plugin.inc.php new file mode 100644 index 0000000000000000000000000000000000000000..4b60b11ea0758167352822c3727b1dbecf07d50c --- /dev/null +++ b/server/plugins-available/rspamd_plugin.inc.php @@ -0,0 +1,242 @@ +plugins->registerEvent('spamfilter_users_insert', $this->plugin_name, 'spamfilter_users_insert'); + $app->plugins->registerEvent('spamfilter_users_update', $this->plugin_name, 'spamfilter_users_update'); + $app->plugins->registerEvent('spamfilter_users_delete', $this->plugin_name, 'spamfilter_users_delete'); + + //* spamfilter_wblist + $app->plugins->registerEvent('spamfilter_wblist_insert', $this->plugin_name, 'spamfilter_wblist_insert'); + $app->plugins->registerEvent('spamfilter_wblist_update', $this->plugin_name, 'spamfilter_wblist_update'); + $app->plugins->registerEvent('spamfilter_wblist_delete', $this->plugin_name, 'spamfilter_wblist_delete'); + + //* server ip + $app->plugins->registerEvent('server_ip_insert', $this->plugin_name, 'server_ip'); + $app->plugins->registerEvent('server_ip_update', $this->plugin_name, 'server_ip'); + $app->plugins->registerEvent('server_ip_delete', $this->plugin_name, 'server_ip'); + } + + function spamfilter_users_insert($event_name, $data) { + global $app, $conf; + + $this->action = 'insert'; + // just run the spamfilter_users_update function + $this->spamfilter_users_update($event_name, $data); + } + + function spamfilter_users_update($event_name, $data) { + global $app, $conf; + + // get the config + $app->uses('getconf,system,functions'); + $mail_config = $app->getconf->get_server_config($conf['server_id'], 'mail'); + + if($mail_config['content_filter'] == 'rspamd'){ + $policy = $app->db->queryOneRecord("SELECT * FROM spamfilter_policy WHERE id = ?", intval($data['new']['policy_id'])); + + //* Create the config file + $user_file = $this->users_config_dir.'spamfilter_user_'.intval($data['new']['id']).'.conf'; + + if($data['new']['local'] == 'Y' && is_array($policy) && !empty($policy)){ + if(!is_dir($this->users_config_dir)){ + $app->system->mkdirpath($this->users_config_dir); + } + + $app->load('tpl'); + + $tpl = new tpl(); + $tpl->newTemplate('rspamd_users.inc.conf.master'); + $tpl->setVar('record_id', intval($data['new']['id'])); + $tpl->setVar('priority', intval($data['new']['priority'])); + $tpl->setVar('recipient', $app->functions->idn_encode($data['new']['email'])); + + $tpl->setVar('rspamd_greylisting', $policy['rspamd_greylisting']); + $tpl->setVar('rspamd_spam_greylisting_level', floatval($policy['rspamd_spam_greylisting_level'])); + + $tpl->setVar('rspamd_spam_tag_level', floatval($policy['rspamd_spam_tag_level'])); + $tpl->setVar('rspamd_spam_tag_method', $policy['rspamd_spam_tag_method']); + + $tpl->setVar('rspamd_spam_kill_level', floatval($policy['rspamd_spam_kill_level'])); + $tpl->setVar('rspamd_virus_kill_level', floatval($policy['rspamd_spam_kill_level']) + 1000); + + $spam_lover_virus_lover = ''; + if($policy['spam_lover'] == 'Y' && $policy['virus_lover'] == 'Y') $spam_lover_virus_lover = 'spam_lover_AND_virus_lover'; + if($policy['spam_lover'] == 'Y' && $policy['virus_lover'] != 'Y') $spam_lover_virus_lover = 'spam_lover_AND_NOTvirus_lover'; + if($policy['spam_lover'] != 'Y' && $policy['virus_lover'] == 'Y') $spam_lover_virus_lover = 'NOTspam_lover_AND_virus_lover'; + if($policy['spam_lover'] != 'Y' && $policy['virus_lover'] != 'Y') $spam_lover_virus_lover = 'NOTspam_lover_AND_NOTvirus_lover'; + + $tpl->setVar('spam_lover_virus_lover', $spam_lover_virus_lover); + + //$groups_disabled = array(); + //if($policy['virus_lover'] == 'Y') $groups_disabled[] = ''; + + $app->system->file_put_contents($user_file, $tpl->grab()); + } else { + if(is_file($user_file)) unlink($user_file); + } + //if(is_file('/etc/init.d/rspamd')) exec('/etc/init.d/rspamd reload &> /dev/null'); + if(is_file('/etc/init.d/rspamd')) $app->services->restartServiceDelayed('rspamd', 'reload'); + } + } + + function spamfilter_users_delete($event_name, $data) { + global $app, $conf; + + // get the config + $app->uses('getconf'); + $mail_config = $app->getconf->get_server_config($conf['server_id'], 'mail'); + + if($mail_config['content_filter'] == 'rspamd'){ + //* delete the config file + $user_file = $this->users_config_dir.'spamfilter_user_'.intval($data['old']['id']).'.conf'; + if(is_file($user_file)) unlink($user_file); + //if(is_file('/etc/init.d/rspamd')) exec('/etc/init.d/rspamd reload &> /dev/null'); + if(is_file('/etc/init.d/rspamd')) $app->services->restartServiceDelayed('rspamd', 'reload'); + } + } + + function spamfilter_wblist_insert($event_name, $data) { + global $app, $conf; + + $this->action = 'insert'; + // just run the spamfilter_wblist_update function + $this->spamfilter_wblist_update($event_name, $data); + } + + function spamfilter_wblist_update($event_name, $data) { + global $app, $conf; + + $app->uses('getconf,system,functions'); + $mail_config = $app->getconf->get_server_config($conf['server_id'], 'mail'); + + if($mail_config['content_filter'] == 'rspamd'){ + $recipient = $app->db->queryOneRecord("SELECT email FROM spamfilter_users WHERE id = ?", intval($data['new']['rid'])); + //* Create the config file + $wblist_file = $this->users_config_dir.'spamfilter_wblist_'.intval($data['new']['wblist_id']).'.conf'; + + if($data['new']['active'] == 'y' && is_array($recipient) && !empty($recipient)){ + if(!is_dir($this->users_config_dir)){ + $app->system->mkdirpath($this->users_config_dir); + } + + $app->load('tpl'); + + $tpl = new tpl(); + $tpl->newTemplate('rspamd_wblist.inc.conf.master'); + $tpl->setVar('record_id', intval($data['new']['wblist_id'])); + $tpl->setVar('priority', intval($data['new']['priority'])); + $tpl->setVar('from', $app->functions->idn_encode($data['new']['email'])); + $tpl->setVar('recipient', $app->functions->idn_encode($recipient['email'])); + //$tpl->setVar('action', ($data['new']['wb'] == 'W'? 'want_spam = yes;' : 'action = "reject";')); + $tpl->setVar('wblist', $data['new']['wb']); + + $app->system->file_put_contents($wblist_file, $tpl->grab()); + } else { + if(is_file($wblist_file)) unlink($wblist_file); + } + //if(is_file('/etc/init.d/rspamd')) exec('/etc/init.d/rspamd reload &> /dev/null'); + if(is_file('/etc/init.d/rspamd')) $app->services->restartServiceDelayed('rspamd', 'reload'); + } + } + + function spamfilter_wblist_delete($event_name, $data) { + global $app, $conf; + + $app->uses('getconf'); + $mail_config = $app->getconf->get_server_config($conf['server_id'], 'mail'); + + if($mail_config['content_filter'] == 'rspamd'){ + //* delete the config file + $wblist_file = $this->users_config_dir.'spamfilter_wblist_'.intval($data['old']['wblist_id']).'.conf'; + if(is_file($wblist_file)) unlink($wblist_file); + //if(is_file('/etc/init.d/rspamd')) exec('/etc/init.d/rspamd reload &> /dev/null'); + if(is_file('/etc/init.d/rspamd')) $app->services->restartServiceDelayed('rspamd', 'reload'); + } + } + + function server_ip($event_name, $data) { + global $app, $conf; + + // get the config + $app->uses("getconf,system"); + $app->load('tpl'); + + $mail_config = $app->getconf->get_server_config($conf['server_id'], 'mail'); + + if($mail_config['content_filter'] == 'rspamd'){ + $tpl = new tpl(); + $tpl->newTemplate('rspamd_users.conf.master'); + + $whitelist_ips = array(); + $ips = $app->db->queryAllRecords("SELECT * FROM server_ip WHERE server_id = ?", $conf['server_id']); + if(is_array($ips) && !empty($ips)){ + foreach($ips as $ip){ + $whitelist_ips[] = array('ip' => $ip['ip_address']); + } + } + $tpl->setLoop('whitelist_ips', $whitelist_ips); + $app->system->file_put_contents('/etc/rspamd/local.d/users.conf', $tpl->grab()); + + $app->services->restartServiceDelayed('rspamd', 'reload'); + } + } + +} // end class +?> \ No newline at end of file diff --git a/server/plugins-available/server_services_plugin.inc.php b/server/plugins-available/server_services_plugin.inc.php index 29710a72852376cf3bb0d4b34676f506787447ae..31afe58fe668d71cafa9b358bf06bb6555344f69 100644 --- a/server/plugins-available/server_services_plugin.inc.php +++ b/server/plugins-available/server_services_plugin.inc.php @@ -36,10 +36,9 @@ 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'); - 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'); + var $mail_plugins = array('getmail_plugin', 'mail_plugin', 'mail_plugin_dkim', 'postfix_filter_plugin', 'postfix_server_plugin'); var $dovecot_plugins = array('maildeliver_plugin'); var $web_plugins = array('aps_plugin', 'cron_plugin', 'cron_jailkit_plugin', 'ftpuser_base_plugin', 'shelluser_base_plugin', 'shelluser_jailkit_plugin', 'webserver_plugin'); @@ -51,10 +50,8 @@ class server_services_plugin { var $db_plugins = array('mysql_clientdb_plugin'); - var $openvz_plugins = array('openvz_plugin'); - - var $xmpp_plugins = array('xmpp_plugin'); - + /** TODO: implement plugins from addons **/ + function onInstall() { return true; @@ -97,7 +94,7 @@ class server_services_plugin { switch($service) { case 'mail_server': $config = $app->getconf->get_server_config($conf['server_id'], 'mail'); - $plugins = @($config['pop3_imap_daemon'] == 'dovecot')?$this->dovecot_plugins:$this->courier_plugins; + $plugins = $this->dovecot_plugins; $plugins = array_merge($plugins, $this->mail_plugins); $this->change_state($plugins, $value, $config); break; @@ -115,12 +112,6 @@ class server_services_plugin { case 'db_server': $this->change_state($this->db_plugins, $value, $config); break; - 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 - -?>