32 files deleted
114 files added
736 files modified
New file |
| | |
| | | <?php |
| | | |
| | | /** |
| | | Copyright (c) 2015, Florian Schaal, schaal @it |
| | | 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. |
| | | |
| | | */ |
| | | |
| | | |
| | | /* define your settings here */ |
| | | $username = 'admin'; |
| | | $password = 'admin'; |
| | | $soap_location = 'http://192.168.0.105:8080/remote/index.php'; |
| | | $soap_uri = 'http://192.168.0.105:8080/remote/'; |
| | | /* stop editing */ |
| | | |
| | | |
| | | error_reporting(E_ALL^ E_WARNING); |
| | | |
| | | exec('which amavisd-new 2> /dev/null', $tmp_output, $tmp_retval); |
| | | if ($tmp_retval != 0) { |
| | | exec('which amavisd 2> /dev/null', $tmp_output, $tmp_retval); |
| | | if ($tmp_retval == 0) $amavis = $tmp_output[0]; |
| | | } else $amavis = $tmp_output[0]; |
| | | |
| | | if (!isset($amavis)) die ("amavisd not found"); |
| | | |
| | | |
| | | echo "Importing dkim-settings from amavis.\n\nTo import the settings even when the public-key is not available, use ".$argv[0]." --force\nNOTE: In force-mode dkim will be set to 'no' if no public-key was found.\n\n"; |
| | | |
| | | if ( isset($argv) && isset ($argv[1]) && $argv[1] == '--force' ) $force = true; else $force = false; |
| | | |
| | | $client = new SoapClient(null, array('location' => $soap_location, |
| | | 'uri' => $soap_uri, |
| | | 'trace' => 1, |
| | | 'exceptions' => 1)); |
| | | |
| | | |
| | | exec($amavis.' showkeys', $tmp_output, $tmp_retval); |
| | | |
| | | foreach ( $tmp_output as $line ) { |
| | | //* get domain and private key-file |
| | | if ( preg_match('#^; key#', $line) ) { |
| | | $line_array = explode(' ', $line); |
| | | if ( $line_array[2] = 'domain' ) { |
| | | $domain = rtrim($line_array[3], ','); |
| | | $private_keyfile = $line_array[4]; |
| | | //* get the public-key from private-key |
| | | unset($public_key); |
| | | unset($pubkey); |
| | | unset($private_key); |
| | | $private_key = file_get_contents($private_keyfile); |
| | | if ( isset($private_key) && !empty($private_key)) { |
| | | exec('echo '.escapeshellarg($private_key).'|openssl rsa -pubout -outform PEM 2> /dev/null',$pubkey,$result); |
| | | $public_key=''; |
| | | foreach($pubkey as $values) $public_key=$public_key.$values."\n"; |
| | | } |
| | | } |
| | | } |
| | | |
| | | //* get selector |
| | | if ( isset($domain) ) { |
| | | if ( preg_match('/_domainkey.'.$domain.'.* TXT \(/', $line) ) { |
| | | $line_array = explode(' ', $line); |
| | | $selector = substr ( $line_array[0], 0, strpos($line_array[0], '.') ); |
| | | } |
| | | } |
| | | |
| | | if ( isset($domain) && isset($selector) && isset($private_keyfile) && isset($public_key) ) { |
| | | |
| | | try { |
| | | if ( !$session_id = $client->login($username, $password) ) { |
| | | echo 'SOAP-ERROR: Can´t login'; |
| | | } |
| | | |
| | | echo "\nprocessing ".$domain."...\n"; |
| | | |
| | | $record = $client->mail_domain_get_by_domain($session_id, $domain); |
| | | |
| | | if ( !empty($record) ) { |
| | | $record = $record[0]; |
| | | echo " OK: domain exists in the database\n"; |
| | | //* check if the public-key is available |
| | | exec($amavis.' testkeys '.escapeshellarg($domain).'', $test_output, $test_retval); |
| | | $pub_key = false; |
| | | if ( preg_match('/^TESTING.*'.$selector.'._domainkey.'.$domain.'.*pass/',$test_output[0]) ) $pub_key = true; |
| | | $client_id = $client->client_get_id($session_id, $record['sys_userid']); |
| | | unset($test_output); |
| | | if ( $pub_key ) { |
| | | $record['dkim_selector'] = $selector; |
| | | $record['dkim'] = 'y'; |
| | | if ( preg_match("/(^-----BEGIN PUBLIC KEY-----)[a-zA-Z0-9\r\n\/\+=]{1,221}(-----END PUBLIC KEY-----(\n|\r)?$)/", $record['dkim_public'] ) ) { |
| | | $record['dkim_public'] = $public_key; |
| | | echo " OK: public key\n"; |
| | | } else { |
| | | $record['dkim_public'] = ''; |
| | | $record['dkim'] = 'n'; |
| | | echo " ERROR: public key invalid\n disable dkim for ".$domain."\n"; |
| | | } |
| | | if ( preg_match("/(^-----BEGIN RSA PRIVATE KEY-----)[a-zA-Z0-9\r\n\/\+=]{1,850}(-----END RSA PRIVATE KEY-----(\n|\r)?$)/", $private_key) ) { |
| | | $record['dkim_private'] = $private_key; |
| | | echo " OK: private key\n"; |
| | | } else { |
| | | $record['dkim_private'] = ''; |
| | | $record['dkim'] = 'n'; |
| | | echo " ERROR: private key invalid\n disable dkim for ".$domain."\n"; |
| | | } |
| | | $client->mail_domain_update($session_id, $client_id, $record['domain_id'], $record); |
| | | echo " OK: updating database\n"; |
| | | } else { |
| | | echo " ERROR: no public-key available - skipping ".$domain."\n"; |
| | | } |
| | | } else { |
| | | echo " ERROR: domain not in the database - skipping ".$domain."\n"; |
| | | } |
| | | $client->logout($session_id); |
| | | } catch (SoapFault $e) { |
| | | echo $client->__getLastResponse(); |
| | | die('SOAP Error: '.$e->getMessage()); |
| | | } |
| | | unset($domain); |
| | | unset($selector); |
| | | } |
| | | } |
| | | ?> |
New file |
| | |
| | | This scripts stores all dkim-keys from the amavis-config to the ispconfig-database |
| | | |
| | | Create a remote-user with at least rights for mail_domain and clients and adjust the settings for |
| | | |
| | | $username = 'admin'; |
| | | $password = 'admin'; |
| | | $soap_location = 'http://192.168.0.105:8080/remote/index.php'; |
| | | $soap_uri = 'http://192.168.0.105:8080/remote/'; |
| | | |
| | | in import_dkim.php |
| | |
| | | //###################################################################################################### |
| | | |
| | | |
| | | $sql = "SELECT domain_id, domain, document_root FROM web_domain WHERE server_id = ".$conf["server_id"]; |
| | | $records = $app->db->queryAllRecords($sql); |
| | | $sql = "SELECT domain_id, domain, document_root FROM web_domain WHERE server_id = ?"; |
| | | $records = $app->db->queryAllRecords($sql, $conf["server_id"]); |
| | | foreach($records as $rec) { |
| | | $domain = escapeshellcmd($rec["domain"]); |
| | | $logdir = escapeshellcmd($rec["document_root"].'/log'); |
New file |
| | |
| | | #! /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 |
New file |
| | |
| | | #!/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 |
New file |
| | |
| | | <?php |
| | | ini_set('display_errors', false); |
| | | require_once('db_conf.inc.php'); |
| | | |
| | | try{ |
| | | // Connect database |
| | | $db = new mysqli($db_host, $db_user, $db_pass, $db_name); |
| | | result_false(mysqli_connect_errno()); |
| | | |
| | | // Get arguments |
| | | $arg_email = ''; |
| | | $arg_password = ''; |
| | | |
| | | result_false(count($argv) != 4); |
| | | $arg_email = $argv[1].'@'.$argv[2]; |
| | | $arg_password = $argv[3]; |
| | | |
| | | // check for existing user |
| | | $dbmail = $db->real_escape_string($arg_email); |
| | | $result = $db->query("SELECT jid, password FROM xmpp_user WHERE jid LIKE ? AND active='y' AND server_id=?", $dbmail, $isp_server_id); |
| | | result_false($result->num_rows != 1); |
| | | |
| | | $user = $result->fetch_object(); |
| | | |
| | | // check for domain autologin api key |
| | | $domain_key = 'f47kmm5Yh5hJzSws2KTS'; |
| | | |
| | | checkAuth($argv[1], $argv[2], $arg_password, $user->password, $domain_key); |
| | | }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($user, $domain, $pw_arg, $pw_db, $domain_key){ |
| | | if(crypt($pw_arg, $pw_db) == $pw_db) |
| | | result_true(); |
| | | |
| | | if($domain_key){ |
| | | $datetime = new DateTime(); |
| | | $datetime->setTimezone(new DateTimeZone("UTC")); |
| | | for($t = $datetime->getTimestamp(); $t >= $datetime->getTimestamp()-30; $t--){ |
| | | $pw_api = md5($domain.'@'.$domain_key.'@'.$user.'@'.$t); |
| | | if($pw_api == $pw_arg) |
| | | result_true(); |
| | | } |
| | | } |
| | | result_false(); |
| | | } |
| | | ?> |
New file |
| | |
| | | <?php |
| | | $db_user = '{mysql_server_ispconfig_user}'; |
| | | $db_pass = '{mysql_server_ispconfig_password}'; |
| | | $db_name = '{mysql_server_database}'; |
| | | $db_host = '{mysql_server_ip}'; |
| | | $isp_server_id = '{server_id}'; |
New file |
| | |
| | | <?php |
| | | ini_set('display_errors', false); |
| | | require_once('db_conf.inc.php'); |
| | | |
| | | try{ |
| | | // Connect database |
| | | $db = new mysqli($db_host, $db_user, $db_pass, $db_name); |
| | | result_false(mysqli_connect_errno()); |
| | | |
| | | // Get arguments |
| | | $arg_email = ''; |
| | | |
| | | result_false(count($argv) != 3); |
| | | $arg_email = $argv[1].'@'.$argv[2]; |
| | | |
| | | // check for existing user |
| | | $dbmail = $db->real_escape_string($arg_email); |
| | | $result = $db->query("SELECT jid, password FROM xmpp_user WHERE jid LIKE ? AND active='y' AND server_id=?", $dbmail, $isp_server_id); |
| | | result_false($result->num_rows != 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(); |
| | | } |
| | | |
| | | ?> |
New file |
| | |
| | | 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)); |
New file |
| | |
| | | -- * 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); |
New file |
| | |
| | | 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 = [[<!DOCTYPE html>]].. |
| | | 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 = [[<?xml version="1.0" encoding="utf-8"?>]].. |
| | | 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; |
| | | }; |
| | | }); |
| | |
| | | $conf['bind']['installed'] = false; // will be detected automatically during installation |
| | | $conf['bind']['bind_user'] = 'named'; |
| | | $conf['bind']['bind_group'] = 'named'; |
| | | $conf['bind']['bind_zonefiles_dir'] = '/var/named/chroot/var/named/'; |
| | | $conf['bind']['named_conf_path'] = '/var/named/chroot/etc/named.conf'; |
| | | $conf['bind']['named_conf_local_path'] = '/var/named/chroot/var/named/named.local'; |
| | | $conf['bind']['bind_zonefiles_dir'] = '/var/named'; |
| | | $conf['bind']['named_conf_path'] = '/etc/named.conf'; |
| | | $conf['bind']['named_conf_local_path'] = '/etc/named.conf.local'; |
| | | $conf['bind']['init_script'] = 'named'; |
| | | |
| | | //* Jailkit |
| | |
| | | $conf['jailkit']['config_dir'] = '/etc/jailkit'; |
| | | $conf['jailkit']['jk_init'] = 'jk_init.ini'; |
| | | $conf['jailkit']['jk_chrootsh'] = 'jk_chrootsh.ini'; |
| | | $conf['jailkit']['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'; |
| | | $conf['jailkit']['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'; |
| | | $conf['jailkit']['jailkit_chroot_cron_programs'] = '/usr/bin/php /usr/bin/perl /usr/share/perl /usr/share/php'; |
| | | |
| | | //* Squid |
| | |
| | | $conf['jailkit']['config_dir'] = '/etc/jailkit'; |
| | | $conf['jailkit']['jk_init'] = 'jk_init.ini'; |
| | | $conf['jailkit']['jk_chrootsh'] = 'jk_chrootsh.ini'; |
| | | $conf['jailkit']['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'; |
| | | $conf['jailkit']['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'; |
| | | $conf['jailkit']['jailkit_chroot_cron_programs'] = '/usr/bin/php /usr/bin/perl /usr/share/perl /usr/share/php'; |
| | | |
| | | //* Squid |
| | |
| | | $conf['cron']['crontab_dir'] = '/etc/cron.d'; |
| | | $conf['cron']['wget'] = '/usr/bin/wget'; |
| | | |
| | | //* Metronome XMPP |
| | | $conf['xmpp']['installed'] = false; |
| | | $conf['xmpp']['init_script'] = 'metronome'; |
| | | |
| | | |
| | | ?> |
| | |
| | | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| | | */ |
| | | |
| | | class installer extends installer_dist { |
| | | require_once realpath(dirname(__FILE__)) . '/centos_base.lib.php'; |
| | | |
| | | public function configure_mailman($status = 'insert') { |
| | | global $conf; |
| | | class installer extends installer_centos { |
| | | |
| | | $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~'); |
| | | } |
| | | protected $clamav_socket = '/tmp/clamd.socket'; |
| | | |
| | | // 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 (!empty($value)) |
| | | { |
| | | $key = rtrim($key); |
| | | $old_options[$key] = trim($value); |
| | | } |
| | | } |
| | | } |
| | | |
| | | $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_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, 'mailman'); |
| | | chmod($full_file_name, 0750); |
| | | |
| | | 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'); |
| | | |
| | | exec('/usr/lib/mailman/bin/genaliases 2>/dev/null'); |
| | | |
| | | $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'] = ''; |
| | | $content = str_replace('{default_language}', $old_options['DEFAULT_SERVER_LANGUAGE'], $content); |
| | | $content = str_replace('{virtual_domains}', $virtual_domains, $content); |
| | | |
| | | wf($full_file_name, $content); |
| | | } |
| | | |
| | | public function configure_amavis() { |
| | | global $conf; |
| | | |
| | | // amavisd user config file |
| | | $configfile = 'fedora_amavisd_conf'; |
| | | if(is_file($conf["amavis"]["config_dir"].'/amavisd.conf')) copy($conf["amavis"]["config_dir"].'/amavisd.conf', $conf["amavis"]["config_dir"].'/amavisd.conf~'); |
| | | if(is_file($conf["amavis"]["config_dir"].'/amavisd.conf~')) exec('chmod 400 '.$conf["amavis"]["config_dir"].'/amavisd.conf~'); |
| | | $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_port}', $conf["mysql"]["port"], $content); |
| | | $content = str_replace('{mysql_server_ip}', $conf['mysql']['ip'], $content); |
| | | $content = str_replace('{hostname}', $conf['hostname'], $content); |
| | | $content = str_replace('/var/spool/amavisd/clamd.sock', '/tmp/clamd.socket', $content); |
| | | wf($conf["amavis"]["config_dir"].'/amavisd.conf', $content); |
| | | |
| | | |
| | | // Adding the amavisd commands to the postfix configuration |
| | | $postconf_commands = array ( |
| | | 'content_filter = amavis:[127.0.0.1]:10024', |
| | | 'receive_override_options = no_address_mappings' |
| | | ); |
| | | |
| | | // Make a backup copy of the main.cf file |
| | | copy($conf["postfix"]["config_dir"].'/main.cf', $conf["postfix"]["config_dir"].'/main.cf~2'); |
| | | |
| | | // Executing the postconf commands |
| | | foreach($postconf_commands as $cmd) { |
| | | $command = "postconf -e '$cmd'"; |
| | | caselog($command." &> /dev/null", __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); |
| | | } |
| | | |
| | | // Append the configuration for amavisd to the master.cf file |
| | | if(is_file($conf['postfix']['config_dir'].'/master.cf')) copy($conf['postfix']['config_dir'].'/master.cf', $conf['postfix']['config_dir'].'/master.cf~'); |
| | | $content = rf($conf['postfix']['config_dir'].'/master.cf'); |
| | | // Only add the content if we had not addded it before |
| | | if(!preg_match('/^amavis\s+unix\s+/m', $content)) { |
| | | unset($content); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/master_cf_amavis.master', 'tpl/master_cf_amavis.master'); |
| | | af($conf['postfix']['config_dir'].'/master.cf', $content); |
| | | $content = rf($conf['postfix']['config_dir'].'/master.cf'); |
| | | } |
| | | if(!preg_match('/^127.0.0.1:10025\s+/m', $content)) { |
| | | unset($content); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/master_cf_amavis10025.master', 'tpl/master_cf_amavis10025.master'); |
| | | af($conf['postfix']['config_dir'].'/master.cf', $content); |
| | | $content = rf($conf['postfix']['config_dir'].'/master.cf'); |
| | | } |
| | | if(!preg_match('/^127.0.0.1:10027\s+/m', $content)) { |
| | | unset($content); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/master_cf_amavis10027.master', 'tpl/master_cf_amavis10027.master'); |
| | | af($conf['postfix']['config_dir'].'/master.cf', $content); |
| | | } |
| | | unset($content); |
| | | |
| | | removeLine('/etc/sysconfig/freshclam', 'FRESHCLAM_DELAY=disabled-warn # REMOVE ME', 1); |
| | | replaceLine('/etc/freshclam.conf', 'Example', '# Example', 1); |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | // everything else is inherited from installer_centos class |
| | | } |
| | | |
| | | ?> |
| | |
| | | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| | | */ |
| | | |
| | | class installer extends installer_dist { |
| | | require_once realpath(dirname(__FILE__)) . '/centos_base.lib.php'; |
| | | |
| | | public function configure_mailman($status = 'insert') { |
| | | global $conf; |
| | | class installer extends installer_centos { |
| | | |
| | | $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~'); |
| | | } |
| | | protected $clamav_socket = '/var/run/clamav/clamd.sock'; |
| | | |
| | | // 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 (!empty($value)) |
| | | { |
| | | $key = rtrim($key); |
| | | $old_options[$key] = trim($value); |
| | | } |
| | | } |
| | | } |
| | | |
| | | $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_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, 'mailman'); |
| | | chmod($full_file_name, 0750); |
| | | |
| | | 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'); |
| | | |
| | | exec('/usr/lib/mailman/bin/genaliases 2>/dev/null'); |
| | | |
| | | $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'] = ''; |
| | | $content = str_replace('{default_language}', $old_options['DEFAULT_SERVER_LANGUAGE'], $content); |
| | | $content = str_replace('{virtual_domains}', $virtual_domains, $content); |
| | | |
| | | wf($full_file_name, $content); |
| | | } |
| | | |
| | | public function configure_amavis() { |
| | | global $conf; |
| | | |
| | | // amavisd user config file |
| | | $configfile = 'fedora_amavisd_conf'; |
| | | if(is_file($conf["amavis"]["config_dir"].'/amavisd.conf')) copy($conf["amavis"]["config_dir"].'/amavisd.conf', $conf["amavis"]["config_dir"].'/amavisd.conf~'); |
| | | if(is_file($conf["amavis"]["config_dir"].'/amavisd.conf~')) exec('chmod 400 '.$conf["amavis"]["config_dir"].'/amavisd.conf~'); |
| | | if(!is_dir($conf["amavis"]["config_dir"])) mkdir($conf["amavis"]["config_dir"]); |
| | | $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_port}', $conf["mysql"]["port"], $content); |
| | | $content = str_replace('{mysql_server_ip}', $conf['mysql']['ip'], $content); |
| | | $content = str_replace('{hostname}', $conf['hostname'], $content); |
| | | $content = str_replace('/var/spool/amavisd/clamd.sock', '/var/run/clamav/clamd.sock', $content); |
| | | wf($conf["amavis"]["config_dir"].'/amavisd.conf', $content); |
| | | |
| | | |
| | | // Adding the amavisd commands to the postfix configuration |
| | | $postconf_commands = array ( |
| | | 'content_filter = amavis:[127.0.0.1]:10024', |
| | | 'receive_override_options = no_address_mappings' |
| | | ); |
| | | |
| | | // Make a backup copy of the main.cf file |
| | | copy($conf["postfix"]["config_dir"].'/main.cf', $conf["postfix"]["config_dir"].'/main.cf~2'); |
| | | |
| | | // Executing the postconf commands |
| | | foreach($postconf_commands as $cmd) { |
| | | $command = "postconf -e '$cmd'"; |
| | | caselog($command." &> /dev/null", __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); |
| | | } |
| | | |
| | | // Append the configuration for amavisd to the master.cf file |
| | | if(is_file($conf['postfix']['config_dir'].'/master.cf')) copy($conf['postfix']['config_dir'].'/master.cf', $conf['postfix']['config_dir'].'/master.cf~'); |
| | | $content = rf($conf['postfix']['config_dir'].'/master.cf'); |
| | | // Only add the content if we had not addded it before |
| | | if(!preg_match('/^amavis\s+unix\s+/m', $content)) { |
| | | unset($content); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/master_cf_amavis.master', 'tpl/master_cf_amavis.master'); |
| | | af($conf['postfix']['config_dir'].'/master.cf', $content); |
| | | $content = rf($conf['postfix']['config_dir'].'/master.cf'); |
| | | } |
| | | if(!preg_match('/^127.0.0.1:10025\s+/m', $content)) { |
| | | unset($content); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/master_cf_amavis10025.master', 'tpl/master_cf_amavis10025.master'); |
| | | af($conf['postfix']['config_dir'].'/master.cf', $content); |
| | | $content = rf($conf['postfix']['config_dir'].'/master.cf'); |
| | | } |
| | | if(!preg_match('/^127.0.0.1:10027\s+/m', $content)) { |
| | | unset($content); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/master_cf_amavis10027.master', 'tpl/master_cf_amavis10027.master'); |
| | | af($conf['postfix']['config_dir'].'/master.cf', $content); |
| | | } |
| | | unset($content); |
| | | |
| | | removeLine('/etc/sysconfig/freshclam', 'FRESHCLAM_DELAY=disabled-warn # REMOVE ME', 1); |
| | | replaceLine('/etc/freshclam.conf', 'Example', '# Example', 1); |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | // everything else is inherited from installer_centos class |
| | | } |
| | | |
| | | ?> |
| | |
| | | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| | | */ |
| | | |
| | | class installer extends installer_dist { |
| | | require_once realpath(dirname(__FILE__)) . '/centos_base.lib.php'; |
| | | |
| | | public function configure_mailman($status = 'insert') { |
| | | global $conf; |
| | | class installer extends installer_centos { |
| | | |
| | | $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 (!empty($value)) |
| | | { |
| | | $key = rtrim($key); |
| | | $old_options[$key] = trim($value); |
| | | } |
| | | } |
| | | } |
| | | |
| | | $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_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, 'mailman'); |
| | | chmod($full_file_name, 0750); |
| | | |
| | | 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'); |
| | | |
| | | exec('/usr/lib/mailman/bin/genaliases 2>/dev/null'); |
| | | |
| | | $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'] = ''; |
| | | $content = str_replace('{default_language}', $old_options['DEFAULT_SERVER_LANGUAGE'], $content); |
| | | $content = str_replace('{virtual_domains}', $virtual_domains, $content); |
| | | |
| | | wf($full_file_name, $content); |
| | | } |
| | | |
| | | public function configure_amavis() { |
| | | global $conf; |
| | | |
| | | // amavisd user config file |
| | | $configfile = 'fedora_amavisd_conf'; |
| | | if(is_file($conf["amavis"]["config_dir"].'/amavisd.conf')) copy($conf["amavis"]["config_dir"].'/amavisd.conf', $conf["amavis"]["config_dir"].'/amavisd.conf~'); |
| | | if(is_file($conf["amavis"]["config_dir"].'/amavisd.conf~')) exec('chmod 400 '.$conf["amavis"]["config_dir"].'/amavisd.conf~'); |
| | | if(!is_dir($conf["amavis"]["config_dir"])) mkdir($conf["amavis"]["config_dir"]); |
| | | $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_port}', $conf["mysql"]["port"], $content); |
| | | $content = str_replace('{mysql_server_ip}', $conf['mysql']['ip'], $content); |
| | | $content = str_replace('{hostname}', $conf['hostname'], $content); |
| | | $content = str_replace('/var/spool/amavisd/clamd.sock', '/var/run/clamav/clamd.sock', $content); |
| | | wf($conf["amavis"]["config_dir"].'/amavisd.conf', $content); |
| | | |
| | | |
| | | // Adding the amavisd commands to the postfix configuration |
| | | $postconf_commands = array ( |
| | | 'content_filter = amavis:[127.0.0.1]:10024', |
| | | 'receive_override_options = no_address_mappings' |
| | | ); |
| | | |
| | | // Make a backup copy of the main.cf file |
| | | copy($conf["postfix"]["config_dir"].'/main.cf', $conf["postfix"]["config_dir"].'/main.cf~2'); |
| | | |
| | | // Executing the postconf commands |
| | | foreach($postconf_commands as $cmd) { |
| | | $command = "postconf -e '$cmd'"; |
| | | caselog($command." &> /dev/null", __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); |
| | | } |
| | | |
| | | // Append the configuration for amavisd to the master.cf file |
| | | if(is_file($conf["postfix"]["config_dir"].'/master.cf')) copy($conf["postfix"]["config_dir"].'/master.cf', $conf["postfix"]["config_dir"].'/master.cf~'); |
| | | $content = rf($conf["postfix"]["config_dir"].'/master.cf'); |
| | | // Only add the content if we had not addded it before |
| | | if(!stristr($content, "127.0.0.1:10025")) { |
| | | unset($content); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/master_cf_amavis.master', "tpl/master_cf_amavis.master"); |
| | | af($conf["postfix"]["config_dir"].'/master.cf', $content); |
| | | } |
| | | unset($content); |
| | | |
| | | removeLine('/etc/sysconfig/freshclam', 'FRESHCLAM_DELAY=disabled-warn # REMOVE ME', 1); |
| | | replaceLine('/etc/freshclam.conf', 'Example', '# Example', 1); |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | protected $clamav_socket = '/var/run/clamav/clamd.sock'; |
| | | |
| | | // everything else is inherited from installer_centos class |
| | | } |
| | | |
| | | ?> |
New file |
| | |
| | | <?php |
| | | |
| | | /* |
| | | Copyright (c) 2007, Till Brehm, projektfarm Gmbh |
| | | 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. |
| | | */ |
| | | |
| | | class installer_centos extends installer_dist { |
| | | |
| | | protected $clamav_socket = '/tmp/clamd.socket'; |
| | | |
| | | public function configure_amavis() { |
| | | global $conf; |
| | | |
| | | // amavisd user config file |
| | | $configfile = 'fedora_amavisd_conf'; |
| | | if(!is_dir($conf["amavis"]["config_dir"])) mkdir($conf["amavis"]["config_dir"]); |
| | | if(is_file($conf["amavis"]["config_dir"].'/amavisd.conf')) copy($conf["amavis"]["config_dir"].'/amavisd.conf', $conf["amavis"]["config_dir"].'/amavisd.conf~'); |
| | | if(is_file($conf["amavis"]["config_dir"].'/amavisd.conf~')) exec('chmod 400 '.$conf["amavis"]["config_dir"].'/amavisd.conf~'); |
| | | $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_port}', $conf["mysql"]["port"], $content); |
| | | $content = str_replace('{mysql_server_ip}', $conf['mysql']['ip'], $content); |
| | | $content = str_replace('{hostname}', $conf['hostname'], $content); |
| | | $content = str_replace('/var/spool/amavisd/clamd.sock', $this->clamav_socket, $content); |
| | | wf($conf["amavis"]["config_dir"].'/amavisd.conf', $content); |
| | | chmod($conf['amavis']['config_dir'].'/amavisd.conf', 0640); |
| | | |
| | | |
| | | // Adding the amavisd commands to the postfix configuration |
| | | $postconf_commands = array ( |
| | | 'content_filter = amavis:[127.0.0.1]:10024', |
| | | 'receive_override_options = no_address_mappings' |
| | | ); |
| | | |
| | | // Make a backup copy of the main.cf file |
| | | copy($conf["postfix"]["config_dir"].'/main.cf', $conf["postfix"]["config_dir"].'/main.cf~2'); |
| | | |
| | | // Executing the postconf commands |
| | | foreach($postconf_commands as $cmd) { |
| | | $command = "postconf -e '$cmd'"; |
| | | caselog($command." &> /dev/null", __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); |
| | | } |
| | | |
| | | $config_dir = $conf['postfix']['config_dir']; |
| | | |
| | | // Adding amavis-services to the master.cf file if the service does not already exists |
| | | if ($this->postfix_master()) { |
| | | exec ("postconf -M amavis.unix", $out, $ret); |
| | | $add_amavis = @($out[0]=='')?true:false; |
| | | unset($out); |
| | | exec ("postconf -M 127.0.0.1:10025.inet", $out, $ret); |
| | | $add_amavis_10025 = @($out[0]=='')?true:false; |
| | | unset($out); |
| | | exec ("postconf -M 127.0.0.1:10027.inet", $out, $ret); |
| | | $add_amavis_10027 = @($out[0]=='')?true:false; |
| | | unset($out); |
| | | } else { //* fallback - postfix < 2.9 |
| | | $content = rf($conf['postfix']['config_dir'].'/master.cf'); |
| | | $add_amavis = @(!preg_match('/^amavis\s+unix\s+/m', $content))?true:false; |
| | | $add_amavis_10025 = @(!preg_match('/^127.0.0.1:10025\s+/m', $content))?true:false; |
| | | $add_amavis_10027 = @(!preg_match('/^127.0.0.1:10027\s+/m', $content))?true:false; |
| | | } |
| | | |
| | | if ($add_amavis || $add_amavis_10025 || $add_amavis_10027) { |
| | | //* backup master.cf |
| | | if(is_file($config_dir.'/master.cf')) copy($config_dir.'/master.cf', $config_dir.'/master.cf~'); |
| | | // adjust amavis-config |
| | | if($add_amavis) { |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/master_cf_amavis.master', 'tpl/master_cf_amavis.master'); |
| | | af($config_dir.'/master.cf', $content); |
| | | unset($content); |
| | | } |
| | | if ($add_amavis_10025) { |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/master_cf_amavis10025.master', 'tpl/master_cf_amavis10025.master'); |
| | | af($config_dir.'/master.cf', $content); |
| | | unset($content); |
| | | } |
| | | if ($add_amavis_10027) { |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/master_cf_amavis10027.master', 'tpl/master_cf_amavis10027.master'); |
| | | af($config_dir.'/master.cf', $content); |
| | | unset($content); |
| | | } |
| | | } |
| | | |
| | | removeLine('/etc/sysconfig/freshclam', 'FRESHCLAM_DELAY=disabled-warn # REMOVE ME', 1); |
| | | replaceLine('/etc/freshclam.conf', 'Example', '# Example', 1); |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | ?> |
| | |
| | | global $conf; |
| | | |
| | | $virtual_transport = 'dovecot'; |
| | | |
| | | $configure_lmtp = false; |
| | | |
| | | // check if virtual_transport must be changed |
| | | if ($this->is_update) { |
| | | $tmp = $this->db->queryOneRecord("SELECT * FROM ".$conf["mysql"]["database"].".server WHERE server_id = ".$conf['server_id']); |
| | | $tmp = $this->db->queryOneRecord("SELECT * FROM ?? WHERE server_id = ?", $conf["mysql"]["database"] . ".server", $conf['server_id']); |
| | | $ini_array = ini_to_array(stripslashes($tmp['config'])); |
| | | // ini_array needs not to be checked, because already done in update.php -> updateDbAndIni() |
| | | |
| | | if(isset($ini_array['mail']['mailbox_virtual_uidgid_maps']) && $ini_array['mail']['mailbox_virtual_uidgid_maps'] == 'y') { |
| | | $virtual_transport = 'lmtp:unix:private/dovecot-lmtp'; |
| | | $configure_lmtp = true; |
| | | } |
| | | } |
| | | |
| | | $config_dir = $conf['dovecot']['config_dir']; |
| | | |
| | | $config_dir = $conf['postfix']['config_dir']; |
| | | //* Configure master.cf and add a line for deliver |
| | | if(is_file($config_dir.'/master.cf')){ |
| | | copy($config_dir.'/master.cf', $config_dir.'/master.cf~2'); |
| | | if ($this->postfix_master()) { |
| | | exec ("postconf -M dovecot.unix", $out, $ret); |
| | | $add_dovecot_service = @($out[0]=='')?true:false; |
| | | } else { //* fallback - postfix < 2.9 |
| | | $content = rf($config_dir.'/master.cf'); |
| | | $add_dovecot_service = @(!stristr($content, "dovecot/deliver"))?true:false; |
| | | } |
| | | if(is_file($config_dir.'/master.cf~')){ |
| | | chmod($config_dir.'/master.cf~2', 0400); |
| | | } |
| | | $content = rf($conf["postfix"]["config_dir"].'/master.cf'); |
| | | // Only add the content if we had not addded it before |
| | | if(!stristr($content, "dovecot/deliver")) { |
| | | if($add_dovecot_service) { |
| | | //* backup |
| | | if(is_file($config_dir.'/master.cf')){ |
| | | copy($config_dir.'/master.cf', $config_dir.'/master.cf~2'); |
| | | } |
| | | if(is_file($config_dir.'/master.cf~')){ |
| | | chmod($config_dir.'/master.cf~2', 0400); |
| | | } |
| | | //* Configure master.cf and add a line for deliver |
| | | $content = rf($conf["postfix"]["config_dir"].'/master.cf'); |
| | | $deliver_content = 'dovecot unix - n n - - pipe'."\n".' flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${user}@${nexthop}'; |
| | | af($conf["postfix"]["config_dir"].'/master.cf', $deliver_content); |
| | | af($config_dir.'/master.cf', $deliver_content); |
| | | unset($content); |
| | | unset($deliver_content); |
| | | } |
| | | unset($content); |
| | | unset($deliver_content); |
| | | |
| | | |
| | | //* Reconfigure postfix to use dovecot authentication |
| | | // Adding the amavisd commands to the postfix configuration |
| | |
| | | } |
| | | |
| | | //* copy dovecot.conf |
| | | $config_dir = $conf['dovecot']['config_dir']; |
| | | $configfile = 'dovecot.conf'; |
| | | if(is_file($config_dir.'/'.$configfile)){ |
| | | copy($config_dir.'/'.$configfile, $config_dir.'/'.$configfile.'~'); |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | //* dovecot-lmtpd |
| | | if($configure_lmtp) { |
| | | replaceLine($config_dir.'/'.$configfile, 'protocols = imap pop3', 'protocols = imap pop3 lmtp', 1, 0); |
| | | } |
| | | |
| | | //* dovecot-sql.conf |
| | | $configfile = 'dovecot-sql.conf'; |
| | |
| | | $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); |
| | | $content = str_replace('{server_id}', $conf['server_id'], $content); |
| | | wf($config_dir.'/'.$configfile, $content); |
| | | |
| | |
| | | */ |
| | | |
| | | class installer_dist extends 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~'); |
| | | protected $mailman_group = 'mailman'; |
| | | |
| | | public function __construct() { |
| | | //** check apache modules */ |
| | | $mods = getapachemodules(); |
| | | if(in_array('authz_compat', $mods, true)) { |
| | | swriteln($inst->lng(' WARNING! You are using mod_authz_compat.')); |
| | | swriteln($inst->lng(' Please make sure that your apache config uses the new auth syntax:')); |
| | | swriteln($inst->lng(' <Directory />')); |
| | | swriteln($inst->lng(' Options None')); |
| | | swriteln($inst->lng(' AllowOverride None')); |
| | | swriteln($inst->lng(' Require all denied')); |
| | | swriteln($inst->lng(' </Directory>'."\n")); |
| | | |
| | | swriteln($inst->lng(' If it uses the old syntax (deny from all) ISPConfig would fail to work.')); |
| | | } |
| | | |
| | | // 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 (!empty($value)) |
| | | { |
| | | $key = rtrim($key); |
| | | $old_options[$key] = trim($value); |
| | | } |
| | | } |
| | | } |
| | | |
| | | 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'); |
| | | |
| | | $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'] = ''; |
| | | $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, 'mailman'); |
| | | chmod($full_file_name, 0750); |
| | | } |
| | | |
| | | //* Create aliasaes |
| | | exec('/usr/lib/mailman/bin/genaliases 2>/dev/null'); |
| | | |
| | | } |
| | | |
| | | function configure_postfix($options = '') |
| | |
| | | //* mysql-virtual_sender.cf |
| | | $this->process_postfix_config('mysql-virtual_sender.cf'); |
| | | |
| | | //* mysql-virtual_sender_login_maps.cf |
| | | $this->process_postfix_config('mysql-virtual_sender_login_maps.cf'); |
| | | |
| | | //* mysql-virtual_client.cf |
| | | $this->process_postfix_config('mysql-virtual_client.cf'); |
| | | |
| | |
| | | if(!is_user($cf['vmail_username'])) caselog("$command &> /dev/null", __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); |
| | | |
| | | //* These postconf commands will be executed on installation and update |
| | | $server_ini_rec = $this->db->queryOneRecord("SELECT config FROM server WHERE server_id = ".$conf['server_id']); |
| | | $server_ini_rec = $this->db->queryOneRecord("SELECT config FROM server WHERE server_id = ?", $conf['server_id']); |
| | | $server_ini_array = ini_to_array(stripslashes($server_ini_rec['config'])); |
| | | unset($server_ini_rec); |
| | | |
| | |
| | | } |
| | | } |
| | | unset($rbl_hosts); |
| | | unset($server_ini_array); |
| | | |
| | | //* If Postgrey is installed, configure it |
| | | $greylisting = ''; |
| | | if($conf['postgrey']['installed'] == true) { |
| | | $greylisting = 'check_recipient_access mysql:/etc/postfix/mysql-virtual_policy_greylist.cf'; |
| | | $greylisting = ', check_recipient_access mysql:/etc/postfix/mysql-virtual_policy_greylist.cf'; |
| | | } |
| | | |
| | | //* These postconf commands will be executed on installation and update |
| | | $reject_sender_login_mismatch = ''; |
| | | if(isset($server_ini_array['mail']['reject_sender_login_mismatch']) && ($server_ini_array['mail']['reject_sender_login_mismatch'] == 'y')) { |
| | | $reject_sender_login_mismatch = ', reject_authenticated_sender_login_mismatch'; |
| | | } |
| | | unset($server_ini_array); |
| | | |
| | | $postconf_placeholders = array('{config_dir}' => $config_dir, |
| | | '{vmail_mailbox_base}' => $cf['vmail_mailbox_base'], |
| | | '{vmail_userid}' => $cf['vmail_userid'], |
| | | '{vmail_groupid}' => $cf['vmail_groupid'], |
| | | '{rbl_list}' => $rbl_list, |
| | | '{greylisting}' => $greylisting, |
| | | '{reject_slm}' => $reject_sender_login_mismatch, |
| | | ); |
| | | |
| | | |
| | | $postconf_tpl = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/fedora_postfix.conf.master', 'tpl/fedora_postfix.conf.master'); |
| | | $postconf_tpl = strtr($postconf_tpl, $postconf_placeholders); |
| | | $postconf_commands = array_filter(explode("\n", $postconf_tpl)); // read and remove empty lines |
| | |
| | | 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"); |
| | | //exec("chmod 660 $pam/smtp"); |
| | | //exec("chown root:root $pam/smtp"); |
| | | |
| | | } |
| | | |
| | | public function configure_courier() |
| | |
| | | $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"); |
| | |
| | | global $conf; |
| | | |
| | | $virtual_transport = 'dovecot'; |
| | | |
| | | $configure_lmtp = false; |
| | | |
| | | // check if virtual_transport must be changed |
| | | if ($this->is_update) { |
| | | $tmp = $this->db->queryOneRecord("SELECT * FROM ".$conf["mysql"]["database"].".server WHERE server_id = ".$conf['server_id']); |
| | | $tmp = $this->db->queryOneRecord("SELECT * FROM ?? WHERE server_id = ?", $conf["mysql"]["database"] . ".server", $conf['server_id']); |
| | | $ini_array = ini_to_array(stripslashes($tmp['config'])); |
| | | // ini_array needs not to be checked, because already done in update.php -> updateDbAndIni() |
| | | |
| | | if(isset($ini_array['mail']['mailbox_virtual_uidgid_maps']) && $ini_array['mail']['mailbox_virtual_uidgid_maps'] == 'y') { |
| | | $virtual_transport = 'lmtp:unix:private/dovecot-lmtp'; |
| | | $configure_lmtp = true; |
| | | } |
| | | } |
| | | |
| | | $config_dir = $conf['dovecot']['config_dir']; |
| | | |
| | | //* Use /etc/dovecot as config dir if exists |
| | | if(is_dir('/etc/dovecot')) $config_dir = '/etc/dovecot'; |
| | | |
| | | $config_dir = $conf['postfix']['config_dir']; |
| | | //* Configure master.cf and add a line for deliver |
| | | if(is_file($config_dir.'/master.cf')){ |
| | | copy($config_dir.'/master.cf', $config_dir.'/master.cf~2'); |
| | | if ($this->postfix_master()) { |
| | | exec ("postconf -M dovecot.unix", $out, $ret); |
| | | $add_dovecot_service = @($out[0]=='')?true:false; |
| | | } else { //* fallback - postfix < 2.9 |
| | | $content = rf($config_dir.'/master.cf'); |
| | | $add_dovecot_service = @(!stristr($content, "dovecot/deliver"))?true:false; |
| | | } |
| | | if(is_file($config_dir.'/master.cf~')){ |
| | | exec('chmod 400 '.$config_dir.'/master.cf~2'); |
| | | } |
| | | $content = rf($conf["postfix"]["config_dir"].'/master.cf'); |
| | | // Only add the content if we had not addded it before |
| | | if(!stristr($content, "dovecot/deliver")) { |
| | | $deliver_content = 'dovecot unix - n n - - pipe'."\n".' flags=DROhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${user}@${nexthop}'; |
| | | if($add_dovecot_service) { |
| | | //* backup |
| | | if(is_file($config_dir.'/master.cf')){ |
| | | copy($config_dir.'/master.cf', $config_dir.'/master.cf~2'); |
| | | } |
| | | if(is_file($config_dir.'/master.cf~')){ |
| | | chmod($config_dir.'/master.cf~2', 0400); |
| | | } |
| | | //* Configure master.cf and add a line for deliver |
| | | $content = rf($conf["postfix"]["config_dir"].'/master.cf'); |
| | | $deliver_content = 'dovecot unix - n n - - pipe'."\n".' flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${user}@${nexthop}'; |
| | | af($conf["postfix"]["config_dir"].'/master.cf', $deliver_content); |
| | | unset($content); |
| | | unset($deliver_content); |
| | | } |
| | | unset($content); |
| | | unset($deliver_content); |
| | | |
| | | |
| | | //* Reconfigure postfix to use dovecot authentication |
| | | // Adding the amavisd commands to the postfix configuration |
| | |
| | | $command = "postconf -e '$cmd'"; |
| | | caselog($command." &> /dev/null", __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); |
| | | } |
| | | |
| | | //* Use /etc/dovecot as config dir if exists |
| | | // if(is_dir('/etc/dovecot')) $config_dir = '/etc/dovecot'; |
| | | $config_dir = $conf['dovecot']['config_dir']; |
| | | |
| | | //* backup dovecot.conf |
| | | $configfile = 'dovecot.conf'; |
| | |
| | | } |
| | | } |
| | | |
| | | //* dovecot-lmtpd |
| | | if($configure_lmtp) { |
| | | replaceLine($config_dir.'/'.$configfile, 'protocols = imap pop3', 'protocols = imap pop3 lmtp', 1, 0); |
| | | } |
| | | |
| | | //* dovecot-sql.conf |
| | | $configfile = 'dovecot-sql.conf'; |
| | | if(is_file("$config_dir/$configfile")){ |
| | |
| | | $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); |
| | | $content = str_replace('{server_id}', $conf['server_id'], $content); |
| | | wf("$config_dir/$configfile", $content); |
| | | |
| | |
| | | $content = str_replace('{mysql_server_ip}', $conf['mysql']['ip'], $content); |
| | | $content = str_replace('{hostname}', $conf['hostname'], $content); |
| | | wf($conf["amavis"]["config_dir"].'/amavisd.conf', $content); |
| | | chmod($conf['amavis']['config_dir'].'/amavisd.conf', 0640); |
| | | |
| | | |
| | | // Adding the amavisd commands to the postfix configuration |
| | |
| | | caselog($command." &> /dev/null", __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); |
| | | } |
| | | |
| | | // Append the configuration for amavisd to the master.cf file |
| | | if(is_file($conf['postfix']['config_dir'].'/master.cf')) copy($conf['postfix']['config_dir'].'/master.cf', $conf['postfix']['config_dir'].'/master.cf~'); |
| | | $content = rf($conf['postfix']['config_dir'].'/master.cf'); |
| | | // Only add the content if we had not addded it before |
| | | if(!preg_match('/^amavis\s+unix\s+/m', $content)) { |
| | | unset($content); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/master_cf_amavis.master', 'tpl/master_cf_amavis.master'); |
| | | af($conf['postfix']['config_dir'].'/master.cf', $content); |
| | | $config_dir = $conf['postfix']['config_dir']; |
| | | |
| | | // Adding amavis-services to the master.cf file if the service does not already exists |
| | | if ($this->postfix_master()) { |
| | | exec ("postconf -M amavis.unix", $out, $ret); |
| | | $add_amavis = @($out[0]=='')?true:false; |
| | | unset($out); |
| | | exec ("postconf -M 127.0.0.1:10025.inet", $out, $ret); |
| | | $add_amavis_10025 = @($out[0]=='')?true:false; |
| | | unset($out); |
| | | exec ("postconf -M 127.0.0.1:10027.inet", $out, $ret); |
| | | $add_amavis_10027 = @($out[0]=='')?true:false; |
| | | unset($out); |
| | | } else { //* fallback - postfix < 2.9 |
| | | $content = rf($conf['postfix']['config_dir'].'/master.cf'); |
| | | $add_amavis = @(!preg_match('/^amavis\s+unix\s+/m', $content))?true:false; |
| | | $add_amavis_10025 = @(!preg_match('/^127.0.0.1:10025\s+/m', $content))?true:false; |
| | | $add_amavis_10027 = @(!preg_match('/^127.0.0.1:10027\s+/m', $content))?true:false; |
| | | } |
| | | if(!preg_match('/^127.0.0.1:10025\s+/m', $content)) { |
| | | unset($content); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/master_cf_amavis10025.master', 'tpl/master_cf_amavis10025.master'); |
| | | af($conf['postfix']['config_dir'].'/master.cf', $content); |
| | | $content = rf($conf['postfix']['config_dir'].'/master.cf'); |
| | | |
| | | if ($add_amavis || $add_amavis_10025 || $add_amavis_10027) { |
| | | //* backup master.cf |
| | | if(is_file($config_dir.'/master.cf')) copy($config_dir.'/master.cf', $config_dir.'/master.cf~'); |
| | | // adjust amavis-config |
| | | if($add_amavis) { |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/master_cf_amavis.master', 'tpl/master_cf_amavis.master'); |
| | | af($config_dir.'/master.cf', $content); |
| | | unset($content); |
| | | } |
| | | if ($add_amavis_10025) { |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/master_cf_amavis10025.master', 'tpl/master_cf_amavis10025.master'); |
| | | af($config_dir.'/master.cf', $content); |
| | | unset($content); |
| | | } |
| | | if ($add_amavis_10027) { |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/master_cf_amavis10027.master', 'tpl/master_cf_amavis10027.master'); |
| | | af($config_dir.'/master.cf', $content); |
| | | unset($content); |
| | | } |
| | | } |
| | | if(!preg_match('/^127.0.0.1:10027\s+/m', $content)) { |
| | | unset($content); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/master_cf_amavis10027.master', 'tpl/master_cf_amavis10027.master'); |
| | | af($conf['postfix']['config_dir'].'/master.cf', $content); |
| | | } |
| | | unset($content); |
| | | |
| | | removeLine('/etc/sysconfig/freshclam', 'FRESHCLAM_DELAY=disabled-warn # REMOVE ME', 1); |
| | | replaceLine('/etc/freshclam.conf', 'Example', '# Example', 1); |
| | |
| | | $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); |
| | | $content = str_replace('{server_id}', $conf["server_id"], $content); |
| | | wf($conf["mydns"]["config_dir"].'/'.$configfile, $content); |
| | | exec('chmod 600 '.$conf["mydns"]["config_dir"].'/'.$configfile); |
| | |
| | | |
| | | //* Chown the slave subdirectory to $conf['bind']['bind_user'] |
| | | exec('chown '.$conf['bind']['bind_user'].':'.$conf['bind']['bind_group'].' '.$content); |
| | | exec('chmod 770 '.$content); |
| | | exec('chmod 2770 '.$content); |
| | | |
| | | } |
| | | |
| | |
| | | $tpl = new tpl('apache_ispconfig.conf.master'); |
| | | $tpl->setVar('apache_version',getapacheversion()); |
| | | |
| | | $records = $this->db->queryAllRecords('SELECT * FROM '.$conf['mysql']['master_database'].'.server_ip WHERE server_id = '.$conf['server_id']." AND virtualhost = 'y'"); |
| | | $records = $this->db->queryAllRecords("SELECT * FROM ?? WHERE server_id = ? AND virtualhost = 'y'", $conf['mysql']['master_database'] . '.server_ip', $conf['server_id']); |
| | | $ip_addresses = array(); |
| | | |
| | | if(is_array($records) && count($records) > 0) { |
| | |
| | | if(!is_group('sshusers')) caselog($command.' &> /dev/null 2> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); |
| | | } |
| | | |
| | | public function configure_firewall() |
| | | public function configure_bastille_firewall() |
| | | { |
| | | global $conf; |
| | | |
| | |
| | | $tcp_public_services = ''; |
| | | $udp_public_services = ''; |
| | | |
| | | $row = $this->db->queryOneRecord('SELECT * FROM '.$conf["mysql"]["database"].'.firewall WHERE server_id = '.intval($conf['server_id'])); |
| | | $row = $this->db->queryOneRecord('SELECT * FROM ?? WHERE server_id = ?', $conf["mysql"]["database"] . '.firewall', $conf['server_id']); |
| | | |
| | | if(trim($row["tcp_port"]) != '' || trim($row["udp_port"]) != ''){ |
| | | $tcp_public_services = trim(str_replace(',', ' ', $row["tcp_port"])); |
| | |
| | | } |
| | | if(!stristr($tcp_public_services, $conf['apache']['vhost_port'])) { |
| | | $tcp_public_services .= ' '.intval($conf['apache']['vhost_port']); |
| | | if($row["tcp_port"] != '') $this->db->query("UPDATE firewall SET tcp_port = tcp_port + ',".intval($conf['apache']['vhost_port'])."' WHERE server_id = ".intval($conf['server_id'])); |
| | | if($row["tcp_port"] != '') $this->db->query("UPDATE firewall SET tcp_port = tcp_port + ? WHERE server_id = ?", ',' . intval($conf['apache']['vhost_port']), $conf['server_id']); |
| | | } |
| | | |
| | | $content = str_replace("{TCP_PUBLIC_SERVICES}", $tcp_public_services, $content); |
| | |
| | | unset($iptables_location); |
| | | |
| | | } |
| | | |
| | | |
| | | public function install_ispconfig() |
| | | { |
| | |
| | | $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); |
| | | |
| | | $content = str_replace('{mysql_master_server_ispconfig_user}', $conf['mysql']['master_ispconfig_user'], $content); |
| | | $content = str_replace('{mysql_master_server_ispconfig_password}', $conf['mysql']['master_ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_master_server_database}', $conf['mysql']['master_database'], $content); |
| | | $content = str_replace('{mysql_master_server_host}', $conf['mysql']['master_host'], $content); |
| | | $content = str_replace('{mysql_master_server_port}', $conf['mysql']['master_port'], $content); |
| | | |
| | | $content = str_replace('{server_id}', $conf['server_id'], $content); |
| | | $content = str_replace('{ispconfig_log_priority}', $conf['ispconfig_log_priority'], $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); |
| | | |
| | | $content = str_replace('{mysql_master_server_ispconfig_user}', $conf['mysql']['master_ispconfig_user'], $content); |
| | | $content = str_replace('{mysql_master_server_ispconfig_password}', $conf['mysql']['master_ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_master_server_database}', $conf['mysql']['master_database'], $content); |
| | | $content = str_replace('{mysql_master_server_host}', $conf['mysql']['master_host'], $content); |
| | | $content = str_replace('{mysql_master_server_port}', $conf['mysql']['master_port'], $content); |
| | | |
| | | $content = str_replace('{server_id}', $conf['server_id'], $content); |
| | | $content = str_replace('{ispconfig_log_priority}', $conf['ispconfig_log_priority'], $content); |
| | |
| | | $content = '<?php' . "\n" . '$maxid_remote_action = 0;' . "\n" . '?>'; |
| | | wf($install_dir.'/server/lib/remote_action.inc.php', $content); |
| | | } |
| | | |
| | | |
| | | //* Enable the server modules and plugins. |
| | | // TODO: Implement a selector which modules and plugins shall be enabled. |
| | |
| | | $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 = '$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' WHERE server_id = ".intval($conf['server_id']); |
| | | $sql = "UPDATE `server` SET mail_server = ?, web_server = ?, dns_server = ?, file_server = ?, db_server = ?, vserver_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']); |
| | | if($conf['mysql']['master_slave_setup'] == 'y') { |
| | | $this->dbmaster->query($sql); |
| | | $this->db->query($sql); |
| | | } else { |
| | | $this->db->query($sql); |
| | | $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']); |
| | | } |
| | | |
| | | // chown install dir to root and chmod 755 |
| | |
| | | if($conf['nginx']['installed'] == true){ |
| | | $command = 'usermod -a -G ispconfig '.$conf['nginx']['user']; |
| | | caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); |
| | | //if(is_user('ispapps')){ |
| | | // Allow the ispapps vhost access to /etc/squirrelmail |
| | | //$command = 'usermod -a -G '.$conf['apache']['group'].' ispapps'; |
| | | //caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); |
| | | //} |
| | | if(is_group('ispapps')){ |
| | | $command = 'usermod -a -G ispapps '.$conf['nginx']['user']; |
| | | caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); |
| | |
| | | |
| | | // Add symlink for patch tool |
| | | if(!is_link('/usr/local/bin/ispconfig_patch')) exec('ln -s /usr/local/ispconfig/server/scripts/ispconfig_patch /usr/local/bin/ispconfig_patch'); |
| | | |
| | | |
| | | // Change mode of a few files from amavisd |
| | | if(is_file($conf['amavis']['config_dir'].'/conf.d/50-user')) chmod($conf['amavis']['config_dir'].'/conf.d/50-user', 0640); |
| | | if(is_file($conf['amavis']['config_dir'].'/50-user~')) chmod($conf['amavis']['config_dir'].'/50-user~', 0400); |
| | | if(is_file($conf['amavis']['config_dir'].'/amavisd.conf')) chmod($conf['amavis']['config_dir'].'/amavisd.conf', 0640); |
| | | if(is_file($conf['amavis']['config_dir'].'/amavisd.conf~')) chmod($conf['amavis']['config_dir'].'/amavisd.conf~', 0400); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | //* 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); |
| | | |
| | | //* If there are RBL's defined, format the list and add them to smtp_recipient_restrictions to prevent removeal after an update |
| | | $rbl_list = ''; |
| | | if (@isset($server_ini_array['mail']['realtime_blackhole_list']) && $server_ini_array['mail']['realtime_blackhole_list'] != '') { |
| | | $rbl_hosts = explode(",", str_replace(" ", "", $server_ini_array['mail']['realtime_blackhole_list'])); |
| | | foreach ($rbl_hosts as $key => $value) { |
| | | $rbl_list .= ", reject_rbl_client ". $value; |
| | | } |
| | | } |
| | | unset($rbl_hosts); |
| | | |
| | | //* If Postgrey is installed, configure it |
| | | $greylisting = ''; |
| | | if($conf['postgrey']['installed'] == true) { |
| | | $greylisting = ', check_recipient_access mysql:/etc/postfix/mysql-virtual_policy_greylist.cf'; |
| | | } |
| | | |
| | | $reject_sender_login_mismatch = ''; |
| | | if(isset($server_ini_array['mail']['reject_sender_login_mismatch']) && ($server_ini_array['mail']['reject_sender_login_mismatch'] == 'y')) { |
| | | $reject_sender_login_mismatch = ', reject_authenticated_sender_login_mismatch'; |
| | | } |
| | | unset($server_ini_array); |
| | | |
| | | $postconf_placeholders = array('{config_dir}' => $config_dir, |
| | | '{vmail_mailbox_base}' => $cf['vmail_mailbox_base'], |
| | | '{vmail_userid}' => $cf['vmail_userid'], |
| | | '{vmail_groupid}' => $cf['vmail_groupid'], |
| | | '{rbl_list}' => $rbl_list); |
| | | '{rbl_list}' => $rbl_list, |
| | | '{greylisting}' => $greylisting, |
| | | '{reject_slm}' => $reject_sender_login_mismatch, |
| | | ); |
| | | |
| | | $postconf_tpl = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/gentoo_postfix.conf.master', 'tpl/gentoo_postfix.conf.master'); |
| | | $postconf_tpl = strtr($postconf_tpl, $postconf_placeholders); |
| | |
| | | global $conf; |
| | | |
| | | $virtual_transport = 'dovecot'; |
| | | |
| | | $configure_lmtp = false; |
| | | |
| | | // check if virtual_transport must be changed |
| | | if ($this->is_update) { |
| | | $tmp = $this->db->queryOneRecord("SELECT * FROM ".$conf["mysql"]["database"].".server WHERE server_id = ".$conf['server_id']); |
| | | $tmp = $this->db->queryOneRecord("SELECT * FROM ?? WHERE server_id = ?", $conf["mysql"]["database"].".server", $conf['server_id']); |
| | | $ini_array = ini_to_array(stripslashes($tmp['config'])); |
| | | // ini_array needs not to be checked, because already done in update.php -> updateDbAndIni() |
| | | |
| | | if(isset($ini_array['mail']['mailbox_virtual_uidgid_maps']) && $ini_array['mail']['mailbox_virtual_uidgid_maps'] == 'y') { |
| | | $virtual_transport = 'lmtp:unix:private/dovecot-lmtp'; |
| | | $configure_lmtp = true; |
| | | } |
| | | } |
| | | |
| | | $config_dir = $conf['dovecot']['config_dir']; |
| | | |
| | | $configfile = $conf['postfix']['config_dir'].'/master.cf'; |
| | | |
| | | if(is_file($configfile)) { |
| | | copy($configfile, $configfile.'~2'); |
| | | } |
| | | if(is_file($configfile.'~2')) { |
| | | chmod($configfile.'~2', 0400); |
| | | } |
| | | |
| | | $config_dir = $conf['postfix']['config_dir']; |
| | | //* Configure master.cf and add a line for deliver |
| | | $content = rf($configfile); |
| | | |
| | | if(!stristr($content, 'dovecot/deliver')) { |
| | | $deliver_content = 'dovecot unix - n n - - pipe'."\n".' flags=DROhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${user}@${nexthop}'; |
| | | af($conf['postfix']['config_dir'].'/master.cf', $deliver_content); |
| | | if ($this->postfix_master()) { |
| | | exec ("postconf -M dovecot.unix", $out, $ret); |
| | | $add_dovecot_service = @($out[0]=='')?true:false; |
| | | } else { //* fallback - postfix < 2.9 |
| | | $content = rf($config_dir.'/master.cf'); |
| | | $add_dovecot_service = @(!stristr($content, "dovecot/deliver"))?true:false; |
| | | } |
| | | unset($content); |
| | | unset($deliver_content); |
| | | unset($configfile); |
| | | if($add_dovecot_service) { |
| | | //* backup |
| | | if(is_file($config_dir.'/master.cf')){ |
| | | copy($config_dir.'/master.cf', $config_dir.'/master.cf~2'); |
| | | } |
| | | if(is_file($config_dir.'/master.cf~')){ |
| | | chmod($config_dir.'/master.cf~2', 0400); |
| | | } |
| | | //* Configure master.cf and add a line for deliver |
| | | $content = rf($conf["postfix"]["config_dir"].'/master.cf'); |
| | | $deliver_content = 'dovecot unix - n n - - pipe'."\n".' flags=DROhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${user}@${nexthop}'; |
| | | af($config_dir.'/master.cf', $deliver_content); |
| | | unset($content); |
| | | unset($deliver_content); |
| | | } |
| | | |
| | | //* Reconfigure postfix to use dovecot authentication |
| | | $postconf_commands = array ( |
| | |
| | | caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); |
| | | } |
| | | |
| | | $config_dir = $conf['dovecot']['config_dir']; |
| | | //* copy dovecot.conf |
| | | $configfile = $config_dir.'/dovecot.conf'; |
| | | $content = $this->get_template_file('dovecot.conf', true); |
| | | $this->write_config_file($configfile, $content); |
| | | |
| | | //* dovecot-lmtpd |
| | | if($configure_lmtp) { |
| | | replaceLine($config_dir.'/'.$configfile, 'protocols = imap pop3', 'protocols = imap pop3 lmtp', 1, 0); |
| | | } |
| | | |
| | | //* dovecot-sql.conf |
| | | $configfile = $config_dir.'/dovecot-sql.conf'; |
| | |
| | | caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); |
| | | } |
| | | |
| | | // Append the configuration for amavisd to the master.cf file |
| | | $content = rf($conf['postfix']['config_dir'].'/master.cf'); |
| | | // Only add the content if we had not addded it before |
| | | if(!preg_match('/^amavis\s+unix\s+/m', $content)) { |
| | | unset($content); |
| | | $content = $this->get_template_file('master_cf_amavis', true); |
| | | af($conf['postfix']['config_dir'].'/master.cf', $content); |
| | | $config_dir = $conf['postfix']['config_dir']; |
| | | |
| | | // Adding amavis-services to the master.cf file if the service does not already exists |
| | | if ($this->postfix_master()) { |
| | | exec ("postconf -M amavis.unix", $out, $ret); |
| | | $add_amavis = @($out[0]=='')?true:false; |
| | | unset($out); |
| | | exec ("postconf -M 127.0.0.1:10025.inet", $out, $ret); |
| | | $add_amavis_10025 = @($out[0]=='')?true:false; |
| | | unset($out); |
| | | exec ("postconf -M 127.0.0.1:10027.inet", $out, $ret); |
| | | $add_amavis_10027 = @($out[0]=='')?true:false; |
| | | unset($out); |
| | | } else { //* fallback - postfix < 2.9 |
| | | $content = rf($conf['postfix']['config_dir'].'/master.cf'); |
| | | $add_amavis = @(!preg_match('/^amavis\s+unix\s+/m', $content))?true:false; |
| | | $add_amavis_10025 = @(!preg_match('/^127.0.0.1:10025\s+/m', $content))?true:false; |
| | | $add_amavis_10027 = @(!preg_match('/^127.0.0.1:10027\s+/m', $content))?true:false; |
| | | } |
| | | if(!preg_match('/^127.0.0.1:10025\s+/m', $content)) { |
| | | unset($content); |
| | | $content = $this->get_template_file('master_cf_amavis10025', true); |
| | | af($conf['postfix']['config_dir'].'/master.cf', $content); |
| | | $content = rf($conf['postfix']['config_dir'].'/master.cf'); |
| | | |
| | | if ($add_amavis || $add_amavis_10025 || $add_amavis_10027) { |
| | | //* backup master.cf |
| | | if(is_file($config_dir.'/master.cf')) copy($config_dir.'/master.cf', $config_dir.'/master.cf~'); |
| | | // adjust amavis-config |
| | | if($add_amavis) { |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/master_cf_amavis.master', 'tpl/master_cf_amavis.master'); |
| | | af($config_dir.'/master.cf', $content); |
| | | unset($content); |
| | | } |
| | | if ($add_amavis_10025) { |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/master_cf_amavis10025.master', 'tpl/master_cf_amavis10025.master'); |
| | | af($config_dir.'/master.cf', $content); |
| | | unset($content); |
| | | } |
| | | if ($add_amavis_10027) { |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/master_cf_amavis10027.master', 'tpl/master_cf_amavis10027.master'); |
| | | af($config_dir.'/master.cf', $content); |
| | | unset($content); |
| | | } |
| | | } |
| | | if(!preg_match('/^127.0.0.1:10027\s+/m', $content)) { |
| | | unset($content); |
| | | $content = $this->get_template_file('master_cf_amavis10027', true); |
| | | af($conf['postfix']['config_dir'].'/master.cf', $content); |
| | | } |
| | | unset($content); |
| | | |
| | | //* Add the clamav user to the amavis group |
| | | exec('usermod -a -G amavis clamav'); |
| | |
| | | global $conf; |
| | | |
| | | //* Create the database |
| | | if(!$this->db->query('CREATE DATABASE IF NOT EXISTS '.$conf['powerdns']['database'].' DEFAULT CHARACTER SET '.$conf['mysql']['charset'])) { |
| | | if(!$this->db->query('CREATE DATABASE IF NOT EXISTS ?? DEFAULT CHARACTER SET ?', $conf['powerdns']['database'], $conf['mysql']['charset'])) { |
| | | $this->error('Unable to create MySQL database: '.$conf['powerdns']['database'].'.'); |
| | | } |
| | | |
| | | //* Create the ISPConfig database user in the local database |
| | | $query = 'GRANT ALL ON `'.$conf['powerdns']['database'].'` . * TO \''.$conf['mysql']['ispconfig_user'].'\'@\'localhost\';'; |
| | | if(!$this->db->query($query)) { |
| | | $query = 'GRANT ALL ON ??.* TO ?@?'; |
| | | if(!$this->db->query($query, $conf['powerdns']['database'], $conf['mysql']['ispconfig_user'], 'localhost')) { |
| | | $this->error('Unable to create user for powerdns database Error: '.$this->db->errorMessage); |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | //* Copy the ISPConfig configuration include |
| | | /* |
| | | $content = $this->get_template_file('apache_ispconfig.conf', true); |
| | | |
| | | $records = $this->db->queryAllRecords("SELECT * FROM server_ip WHERE server_id = ".$conf["server_id"]." AND virtualhost = 'y'"); |
| | | if(is_array($records) && count($records) > 0) |
| | | { |
| | | foreach($records as $rec) { |
| | | $content .= "NameVirtualHost ".$rec["ip_address"].":80\n"; |
| | | $content .= "NameVirtualHost ".$rec["ip_address"].":443\n"; |
| | | } |
| | | } |
| | | |
| | | $this->write_config_file($conf['apache']['vhost_conf_dir'].'/000-ispconfig.conf', $content); |
| | | */ |
| | | |
| | | $tpl = new tpl('apache_ispconfig.conf.master'); |
| | | $tpl->setVar('apache_version',getapacheversion()); |
| | | |
| | | $records = $this->db->queryAllRecords('SELECT * FROM '.$conf['mysql']['master_database'].'.server_ip WHERE server_id = '.$conf['server_id']." AND virtualhost = 'y'"); |
| | | $records = $this->db->queryAllRecords("SELECT * FROM ?? WHERE server_id = ? AND virtualhost = 'y'", $conf['mysql']['master_database'] . '.server_ip', $conf['server_id']); |
| | | $ip_addresses = array(); |
| | | |
| | | if(is_array($records) && count($records) > 0) { |
| | |
| | | $content = str_replace('{mysql_master_server_ispconfig_password}', $conf['mysql']['master_ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_master_server_database}', $conf['mysql']['master_database'], $content); |
| | | $content = str_replace('{mysql_master_server_host}', $conf['mysql']['master_host'], $content); |
| | | $content = str_replace('{mysql_master_server_port}', $conf['mysql']['master_port'], $content); |
| | | |
| | | $content = str_replace('{server_id}', $conf['server_id'], $content); |
| | | $content = str_replace('{ispconfig_log_priority}', $conf['ispconfig_log_priority'], $content); |
| | |
| | | $db_server_enabled = ($conf['services']['db'])?1:0; |
| | | $vserver_server_enabled = ($conf['services']['vserver'])?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' WHERE server_id = ".intval($conf['server_id']); |
| | | $sql = "UPDATE `server` SET mail_server = ?, web_server = ?, dns_server = ?, file_server = ?, db_server = ?, vserver_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']); |
| | | if($conf['mysql']['master_slave_setup'] == 'y') { |
| | | $this->dbmaster->query($sql); |
| | | $this->db->query($sql); |
| | | } else { |
| | | $this->db->query($sql); |
| | | $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']); |
| | | } |
| | | |
| | | // chown install dir to root and chmod 755 |
| | |
| | | |
| | | // Add symlink for patch tool |
| | | if(!is_link('/usr/local/bin/ispconfig_patch')) exec('ln -s /usr/local/ispconfig/server/scripts/ispconfig_patch /usr/local/bin/ispconfig_patch'); |
| | | |
| | | |
| | | // Change mode of a few files from amavisd |
| | | if(is_file($conf['amavis']['config_dir'].'/conf.d/50-user')) chmod($conf['amavis']['config_dir'].'/conf.d/50-user', 0640); |
| | | if(is_file($conf['amavis']['config_dir'].'/50-user~')) chmod($conf['amavis']['config_dir'].'/50-user~', 0400); |
| | | if(is_file($conf['amavis']['config_dir'].'/amavisd.conf')) chmod($conf['amavis']['config_dir'].'/amavisd.conf', 0640); |
| | | if(is_file($conf['amavis']['config_dir'].'/amavisd.conf~')) chmod($conf['amavis']['config_dir'].'/amavisd.conf~', 0400); |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | */ |
| | | |
| | | class installer_dist extends installer_base { |
| | | protected $mailman_group = 'mailman'; |
| | | |
| | | public function __construct() { |
| | | //** check apache modules */ |
| | |
| | | |
| | | swriteln($inst->lng(' If it uses the old syntax (deny from all) ISPConfig would fail to work.')); |
| | | } |
| | | } |
| | | |
| | | 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 (!empty($value)) |
| | | { |
| | | $key = rtrim($key); |
| | | $old_options[$key] = trim($value); |
| | | } |
| | | } |
| | | } |
| | | |
| | | 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'); |
| | | |
| | | $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'] = ''; |
| | | $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, 'mailman'); |
| | | chmod($full_file_name, 0750); |
| | | } |
| | | |
| | | //* Create aliasaes |
| | | exec('/usr/lib/mailman/bin/genaliases 2>/dev/null'); |
| | | if(is_file('/var/lib/mailman/data/virtual-mailman')) exec('postmap /var/lib/mailman/data/virtual-mailman'); |
| | | } |
| | | |
| | | function configure_postfix($options = '') |
| | |
| | | //* mysql-virtual_sender.cf |
| | | $this->process_postfix_config('mysql-virtual_sender.cf'); |
| | | |
| | | //* mysql-virtual_sender_login_maps.cf |
| | | $this->process_postfix_config('mysql-virtual_sender_login_maps.cf'); |
| | | |
| | | //* mysql-virtual_client.cf |
| | | $this->process_postfix_config('mysql-virtual_client.cf'); |
| | | |
| | |
| | | if($cf['vmail_mailbox_base'] != '' && strlen($cf['vmail_mailbox_base']) >= 10 && $this->is_update === false) exec('chown -R '.$cf['vmail_username'].':'.$cf['vmail_groupname'].' '.$cf['vmail_mailbox_base']); |
| | | |
| | | //* These postconf commands will be executed on installation and update |
| | | $server_ini_rec = $this->db->queryOneRecord("SELECT config FROM server WHERE server_id = ".$conf['server_id']); |
| | | $server_ini_rec = $this->db->queryOneRecord("SELECT config FROM server WHERE server_id = ?", $conf['server_id']); |
| | | $server_ini_array = ini_to_array(stripslashes($server_ini_rec['config'])); |
| | | unset($server_ini_rec); |
| | | |
| | |
| | | } |
| | | } |
| | | unset($rbl_hosts); |
| | | unset($server_ini_array); |
| | | |
| | | //* If Postgrey is installed, configure it |
| | | $greylisting = ''; |
| | | if($conf['postgrey']['installed'] == true) { |
| | | $greylisting = 'check_recipient_access mysql:/etc/postfix/mysql-virtual_policy_greylist.cf'; |
| | | $greylisting = ', check_recipient_access mysql:/etc/postfix/mysql-virtual_policy_greylist.cf'; |
| | | } |
| | | |
| | | //* These postconf commands will be executed on installation and update |
| | | $reject_sender_login_mismatch = ''; |
| | | if(isset($server_ini_array['mail']['reject_sender_login_mismatch']) && ($server_ini_array['mail']['reject_sender_login_mismatch'] == 'y')) { |
| | | $reject_sender_login_mismatch = ', reject_authenticated_sender_login_mismatch'; |
| | | } |
| | | unset($server_ini_array); |
| | | |
| | | $postconf_placeholders = array('{config_dir}' => $config_dir, |
| | | '{vmail_mailbox_base}' => $cf['vmail_mailbox_base'], |
| | | '{vmail_userid}' => $cf['vmail_userid'], |
| | | '{vmail_groupid}' => $cf['vmail_groupid'], |
| | | '{rbl_list}' => $rbl_list, |
| | | '{greylisting}' => $greylisting, |
| | | '{reject_slm}' => $reject_sender_login_mismatch, |
| | | ); |
| | | |
| | | |
| | | $postconf_tpl = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/opensuse_postfix.conf.master', 'tpl/opensuse_postfix.conf.master'); |
| | | $postconf_tpl = strtr($postconf_tpl, $postconf_placeholders); |
| | | $postconf_commands = array_filter(explode("\n", $postconf_tpl)); // read and remove empty lines |
| | |
| | | $command = 'chmod 755 /var/run/authdaemon.courier-imap'; |
| | | 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~'); |
| | | } |
| | | if(is_file($config_dir.'/master.cf~')){ |
| | | exec('chmod 400 '.$config_dir.'/master.cf~'); |
| | | } |
| | | //* 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'; |
| | | $content = rf($configfile); |
| | | |
| | | $content = str_replace(' flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}', |
| | | ' flags=DRhu user='.$cf['vmail_username'].' argv=/usr/bin/maildrop -d ${recipient} ${extension} ${recipient} ${user} ${nexthop} ${sender}', |
| | | $content); |
| | | |
| | | $content = str_replace(' flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}', |
| | | ' flags=DRhu user='.$cf['vmail_username'].' argv=/usr/bin/maildrop -d ${recipient} ${extension} ${recipient} ${user} ${nexthop} ${sender}', |
| | | $content); |
| | | |
| | | if ($this->postfix_master()) { |
| | | exec ("postconf -M maildrop.unix", $out, $ret); |
| | | $change_maildrop_flags = @(preg_match($regex, $out[0]) && $out[0] !='')?false:true; |
| | | } else { //* fallback - postfix < 2.9 |
| | | $change_maildrop_flags = @(preg_match($regex, $configfile))?false:true; |
| | | } |
| | | if ($change_maildrop_flags) { |
| | | //* Change maildrop service in posfix master.cf |
| | | if(is_file($config_dir.'/master.cf')) { |
| | | copy($config_dir.'/master.cf', $config_dir.'/master.cf~'); |
| | | } |
| | | if(is_file($config_dir.'/master.cf~')) { |
| | | chmod($config_dir.'/master.cf~', 0400); |
| | | } |
| | | $configfile = $config_dir.'/master.cf'; |
| | | $content = rf($configfile); |
| | | $content = str_replace(' flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}', |
| | | 'flags=DRhu user='.$cf['vmail_username'].' argv=/usr/bin/maildrop -d '.$cf['vmail_username'].' ${extension} ${recipient} ${user} ${nexthop} ${sender}', |
| | | $content); |
| | | $content = str_replace(' flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}', |
| | | 'flags=DRhu user='.$cf['vmail_username'].' argv=/usr/bin/maildrop -d '.$cf['vmail_username'].' ${extension} ${recipient} ${user} ${nexthop} ${sender}', |
| | | $content); |
| | | } |
| | | // enable tlsmanager |
| | | $content = str_replace('#tlsmgr unix - - n 1000? 1 tlsmgr', 'tlsmgr unix - - n 1000? 1 tlsmgr', $content); |
| | | |
| | | wf($configfile, $content); |
| | | |
| | | //* Writing the Maildrop mailfilter file |
| | |
| | | public function configure_saslauthd() { |
| | | global $conf; |
| | | |
| | | /* |
| | | $configfile = 'sasl_smtpd.conf'; |
| | | if(is_file('/etc/sasl2/smtpd.conf')) copy('/etc/sasl2/smtpd.conf','/etc/sasl2/smtpd.conf~'); |
| | | if(is_file('/etc/sasl2/smtpd.conf~')) exec('chmod 400 '.'/etc/sasl2/smtpd.conf~'); |
| | | $content = rf("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('/etc/sasl2/smtpd.conf',$content); |
| | | */ |
| | | |
| | | // TODO: Chmod and chown on the config file |
| | | |
| | | |
| | | /* |
| | | // Create the spool directory |
| | | exec('mkdir -p /var/spool/postfix/var/run/saslauthd'); |
| | | |
| | | // Edit the file /etc/default/saslauthd |
| | | $configfile = $conf["saslauthd"]["config"]; |
| | | if(is_file($configfile)) copy($configfile,$configfile.'~'); |
| | | if(is_file($configfile.'~')) exec('chmod 400 '.$configfile.'~'); |
| | | $content = rf($configfile); |
| | | $content = str_replace('START=no','START=yes',$content); |
| | | $content = str_replace('OPTIONS="-c"','OPTIONS="-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); |
| | |
| | | |
| | | |
| | | if(is_file($configfile)) wf($configfile, $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"); |
| | | //exec("chmod 660 $pam/smtp"); |
| | | //exec("chown root:root $pam/smtp"); |
| | | |
| | | } |
| | | |
| | | public function configure_courier() |
| | |
| | | $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"); |
| | |
| | | global $conf; |
| | | |
| | | $virtual_transport = 'dovecot'; |
| | | |
| | | $configure_lmtp = false; |
| | | |
| | | // check if virtual_transport must be changed |
| | | if ($this->is_update) { |
| | | $tmp = $this->db->queryOneRecord("SELECT * FROM ".$conf["mysql"]["database"].".server WHERE server_id = ".$conf['server_id']); |
| | | $tmp = $this->db->queryOneRecord("SELECT * FROM ?? WHERE server_id = ?", $conf["mysql"]["database"] . ".server", $conf['server_id']); |
| | | $ini_array = ini_to_array(stripslashes($tmp['config'])); |
| | | // ini_array needs not to be checked, because already done in update.php -> updateDbAndIni() |
| | | |
| | | if(isset($ini_array['mail']['mailbox_virtual_uidgid_maps']) && $ini_array['mail']['mailbox_virtual_uidgid_maps'] == 'y') { |
| | | $virtual_transport = 'lmtp:unix:private/dovecot-lmtp'; |
| | | $configure_lmtp = true; |
| | | } |
| | | } |
| | | |
| | | $config_dir = $conf['dovecot']['config_dir']; |
| | | |
| | | $config_dir = $conf['postfix']['config_dir']; |
| | | //* Configure master.cf and add a line for deliver |
| | | if(is_file($config_dir.'/master.cf')){ |
| | | copy($config_dir.'/master.cf', $config_dir.'/master.cf~2'); |
| | | if ($this->postfix_master()) { |
| | | exec ("postconf -M dovecot.unix", $out, $ret); |
| | | $add_dovecot_service = @($out[0]=='')?true:false; |
| | | } else { //* fallback - postfix < 2.9 |
| | | $content = rf($config_dir.'/master.cf'); |
| | | $add_dovecot_service = @(!stristr($content, "dovecot/deliver"))?true:false; |
| | | } |
| | | if(is_file($config_dir.'/master.cf~')){ |
| | | exec('chmod 400 '.$config_dir.'/master.cf~2'); |
| | | } |
| | | $content = rf($conf["postfix"]["config_dir"].'/master.cf'); |
| | | // Only add the content if we had not addded it before |
| | | if(!stristr($content, "dovecot/deliver")) { |
| | | $deliver_content = 'dovecot unix - n n - - pipe'."\n".' flags=DROhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${user}@${nexthop}'; |
| | | if($add_dovecot_service) { |
| | | //* backup |
| | | if(is_file($config_dir.'/master.cf')){ |
| | | copy($config_dir.'/master.cf', $config_dir.'/master.cf~2'); |
| | | } |
| | | if(is_file($config_dir.'/master.cf~')){ |
| | | chmod($config_dir.'/master.cf~2', 0400); |
| | | } |
| | | //* Configure master.cf and add a line for deliver |
| | | $content = rf($conf["postfix"]["config_dir"].'/master.cf'); |
| | | $deliver_content = 'dovecot unix - n n - - pipe'."\n".' flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${user}@${nexthop}'; |
| | | af($conf["postfix"]["config_dir"].'/master.cf', $deliver_content); |
| | | unset($content); |
| | | unset($deliver_content); |
| | | } |
| | | unset($content); |
| | | unset($deliver_content); |
| | | |
| | | |
| | | //* Reconfigure postfix to use dovecot authentication |
| | | // Adding the amavisd commands to the postfix configuration |
| | |
| | | $command = "postconf -e '$cmd'"; |
| | | caselog($command." &> /dev/null", __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); |
| | | } |
| | | |
| | | $config_dir = $conf['dovecot']['config_dir']; |
| | | |
| | | //* backup dovecot.conf |
| | | $configfile = 'dovecot.conf'; |
| | |
| | | } |
| | | } |
| | | |
| | | //* dovecot-lmtpd |
| | | if($configure_lmtp) { |
| | | replaceLine($config_dir.'/'.$configfile, 'protocols = imap pop3', 'protocols = imap pop3 lmtp', 1, 0); |
| | | } |
| | | |
| | | //* dovecot-sql.conf |
| | | $configfile = 'dovecot-sql.conf'; |
| | | if(is_file("$config_dir/$configfile")){ |
| | |
| | | $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); |
| | | $content = str_replace('{server_id}', $conf['server_id'], $content); |
| | | wf("$config_dir/$configfile", $content); |
| | | |
| | |
| | | $content = str_replace('{mysql_server_database}', $conf['mysql']['database'], $content); |
| | | $content = str_replace('{mysql_server_port}', $conf["mysql"]["port"], $content); |
| | | $content = str_replace('{mysql_server_ip}', $conf['mysql']['ip'], $content); |
| | | $content = str_replace('{hostname}', $conf['hostname'], $content); |
| | | wf($conf["amavis"]["config_dir"].'/amavisd.conf', $content); |
| | | chmod($conf['amavis']['config_dir'].'/amavisd.conf', 0640); |
| | | |
| | | |
| | | // Adding the amavisd commands to the postfix configuration |
| | |
| | | caselog($command." &> /dev/null", __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); |
| | | } |
| | | |
| | | // Append the configuration for amavisd to the master.cf file |
| | | if(is_file($conf["postfix"]["config_dir"].'/master.cf')) copy($conf["postfix"]["config_dir"].'/master.cf', $conf["postfix"]["config_dir"].'/master.cf~'); |
| | | $content = rf($conf["postfix"]["config_dir"].'/master.cf'); |
| | | // Only add the content if we had not addded it before |
| | | if(!preg_match('/^amavis\s+unix\s+/m', $content)) { |
| | | unset($content); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/master_cf_amavis.master', 'tpl/master_cf_amavis.master'); |
| | | af($conf['postfix']['config_dir'].'/master.cf', $content); |
| | | $config_dir = $conf['postfix']['config_dir']; |
| | | |
| | | // Adding amavis-services to the master.cf file if the service does not already exists |
| | | if ($this->postfix_master()) { |
| | | exec ("postconf -M amavis.unix", $out, $ret); |
| | | $add_amavis = @($out[0]=='')?true:false; |
| | | unset($out); |
| | | exec ("postconf -M 127.0.0.1:10025.inet", $out, $ret); |
| | | $add_amavis_10025 = @($out[0]=='')?true:false; |
| | | unset($out); |
| | | exec ("postconf -M 127.0.0.1:10027.inet", $out, $ret); |
| | | $add_amavis_10027 = @($out[0]=='')?true:false; |
| | | unset($out); |
| | | } else { //* fallback - postfix < 2.9 |
| | | $content = rf($conf['postfix']['config_dir'].'/master.cf'); |
| | | $add_amavis = @(!preg_match('/^amavis\s+unix\s+/m', $content))?true:false; |
| | | $add_amavis_10025 = @(!preg_match('/^127.0.0.1:10025\s+/m', $content))?true:false; |
| | | $add_amavis_10027 = @(!preg_match('/^127.0.0.1:10027\s+/m', $content))?true:false; |
| | | } |
| | | if(!preg_match('/^127.0.0.1:10025\s+/m', $content)) { |
| | | unset($content); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/master_cf_amavis10025.master', 'tpl/master_cf_amavis10025.master'); |
| | | af($conf['postfix']['config_dir'].'/master.cf', $content); |
| | | $content = rf($conf['postfix']['config_dir'].'/master.cf'); |
| | | |
| | | if ($add_amavis || $add_amavis_10025 || $add_amavis_10027) { |
| | | //* backup master.cf |
| | | if(is_file($config_dir.'/master.cf')) copy($config_dir.'/master.cf', $config_dir.'/master.cf~'); |
| | | // adjust amavis-config |
| | | if($add_amavis) { |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/master_cf_amavis.master', 'tpl/master_cf_amavis.master'); |
| | | af($config_dir.'/master.cf', $content); |
| | | unset($content); |
| | | } |
| | | if ($add_amavis_10025) { |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/master_cf_amavis10025.master', 'tpl/master_cf_amavis10025.master'); |
| | | af($config_dir.'/master.cf', $content); |
| | | unset($content); |
| | | } |
| | | if ($add_amavis_10027) { |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/master_cf_amavis10027.master', 'tpl/master_cf_amavis10027.master'); |
| | | af($config_dir.'/master.cf', $content); |
| | | unset($content); |
| | | } |
| | | } |
| | | if(!preg_match('/^127.0.0.1:10027\s+/m', $content)) { |
| | | unset($content); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/master_cf_amavis10027.master', 'tpl/master_cf_amavis10027.master'); |
| | | af($conf['postfix']['config_dir'].'/master.cf', $content); |
| | | } |
| | | unset($content); |
| | | |
| | | // Add the clamav user to the vscan group |
| | | //exec('groupmod --add-user clamav vscan'); |
| | |
| | | { |
| | | global $conf; |
| | | |
| | | // configure pam for SMTP authentication agains the ispconfig database |
| | | // configure mydns |
| | | $configfile = 'mydns.conf'; |
| | | if(is_file($conf["mydns"]["config_dir"].'/'.$configfile)) copy($conf["mydns"]["config_dir"].'/'.$configfile, $conf["mydns"]["config_dir"].'/'.$configfile.'~'); |
| | | if(is_file($conf["mydns"]["config_dir"].'/'.$configfile.'~')) exec('chmod 400 '.$conf["mydns"]["config_dir"].'/'.$configfile.'~'); |
| | |
| | | $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); |
| | | $content = str_replace('{server_id}', $conf["server_id"], $content); |
| | | wf($conf["mydns"]["config_dir"].'/'.$configfile, $content); |
| | | exec('chmod 600 '.$conf["mydns"]["config_dir"].'/'.$configfile); |
| | |
| | | $tpl = new tpl('apache_ispconfig.conf.master'); |
| | | $tpl->setVar('apache_version',getapacheversion()); |
| | | |
| | | $records = $this->db->queryAllRecords('SELECT * FROM '.$conf['mysql']['master_database'].'.server_ip WHERE server_id = '.$conf['server_id']." AND virtualhost = 'y'"); |
| | | $records = $this->db->queryAllRecords("SELECT * FROM ?? WHERE server_id = ? AND virtualhost = 'y'", $conf['mysql']['master_database'] . '.server_ip', $conf['server_id']); |
| | | $ip_addresses = array(); |
| | | |
| | | if(is_array($records) && count($records) > 0) { |
| | |
| | | } |
| | | |
| | | if(count($ip_addresses) > 0) $tpl->setLoop('ip_adresses',$ip_addresses); |
| | | |
| | | |
| | | wf($vhost_conf_dir.'/ispconfig.conf', $tpl->grab()); |
| | | unset($tpl); |
| | | |
| | |
| | | if(!is_group('sshusers')) caselog($command.' &> /dev/null 2> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); |
| | | } |
| | | |
| | | public function configure_firewall() |
| | | public function configure_bastille_firewall() |
| | | { |
| | | global $conf; |
| | | |
| | |
| | | $tcp_public_services = ''; |
| | | $udp_public_services = ''; |
| | | |
| | | $row = $this->db->queryOneRecord('SELECT * FROM '.$conf["mysql"]["database"].'.firewall WHERE server_id = '.intval($conf['server_id'])); |
| | | $row = $this->db->queryOneRecord('SELECT * FROM ?? WHERE server_id = ?', $conf["mysql"]["database"] . '.firewall', $conf['server_id']); |
| | | |
| | | if(trim($row["tcp_port"]) != '' || trim($row["udp_port"]) != ''){ |
| | | $tcp_public_services = trim(str_replace(',', ' ', $row["tcp_port"])); |
| | |
| | | $tcp_public_services = '21 22 25 53 80 110 443 3306 8080 10000'; |
| | | $udp_public_services = '53'; |
| | | } |
| | | |
| | | if(!stristr($tcp_public_services, $conf['apache']['vhost_port'])) { |
| | | $tcp_public_services .= ' '.intval($conf['apache']['vhost_port']); |
| | | if($row["tcp_port"] != '') $this->db->query("UPDATE firewall SET tcp_port = tcp_port + ',".intval($conf['apache']['vhost_port'])."' WHERE server_id = ".intval($conf['server_id'])); |
| | | if($row["tcp_port"] != '') $this->db->query("UPDATE firewall SET tcp_port = tcp_port + ? WHERE server_id = ?", ',' . intval($conf['apache']['vhost_port']), $conf['server_id']); |
| | | } |
| | | |
| | | $content = str_replace("{TCP_PUBLIC_SERVICES}", $tcp_public_services, $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); |
| | | |
| | | $content = str_replace('{mysql_master_server_ispconfig_user}', $conf['mysql']['master_ispconfig_user'], $content); |
| | | $content = str_replace('{mysql_master_server_ispconfig_password}', $conf['mysql']['master_ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_master_server_database}', $conf['mysql']['master_database'], $content); |
| | | $content = str_replace('{mysql_master_server_host}', $conf['mysql']['master_host'], $content); |
| | | $content = str_replace('{mysql_master_server_port}', $conf['mysql']['master_port'], $content); |
| | | |
| | | $content = str_replace('{server_id}', $conf['server_id'], $content); |
| | | $content = str_replace('{ispconfig_log_priority}', $conf['ispconfig_log_priority'], $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); |
| | | |
| | | $content = str_replace('{mysql_master_server_ispconfig_user}', $conf['mysql']['master_ispconfig_user'], $content); |
| | | $content = str_replace('{mysql_master_server_ispconfig_password}', $conf['mysql']['master_ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_master_server_database}', $conf['mysql']['master_database'], $content); |
| | | $content = str_replace('{mysql_master_server_host}', $conf['mysql']['master_host'], $content); |
| | | $content = str_replace('{mysql_master_server_port}', $conf['mysql']['master_port'], $content); |
| | | |
| | | $content = str_replace('{server_id}', $conf['server_id'], $content); |
| | | $content = str_replace('{ispconfig_log_priority}', $conf['ispconfig_log_priority'], $content); |
| | |
| | | $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 = '$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' WHERE server_id = ".intval($conf['server_id']); |
| | | $sql = "UPDATE `server` SET mail_server = ?, web_server = ?, dns_server = ?, file_server = ?, db_server = ?, vserver_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']); |
| | | if($conf['mysql']['master_slave_setup'] == 'y') { |
| | | $this->dbmaster->query($sql); |
| | | $this->db->query($sql); |
| | | } else { |
| | | $this->db->query($sql); |
| | | $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']); |
| | | } |
| | | |
| | | // chown install dir to root and chmod 755 |
| | |
| | | // and must be fixed as this will allow the apache user to read the ispconfig files. |
| | | // Later this must run as own apache server or via suexec! |
| | | if($conf['apache']['installed'] == true){ |
| | | //$command = 'groupmod --add-user '.$conf['apache']['user'].' ispconfig'; |
| | | $command = 'usermod -a -G ispconfig '.$conf['apache']['user']; |
| | | caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); |
| | | if(is_group('ispapps')){ |
| | | //$command = 'groupmod --add-user '.$conf['apache']['user'].' ispapps'; |
| | | $command = 'usermod -a -G ispapps '.$conf['apache']['user']; |
| | | caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); |
| | | } |
| | | } |
| | | if($conf['nginx']['installed'] == true){ |
| | | //$command = 'groupmod --add-user '.$conf['nginx']['user'].' ispconfig'; |
| | | $command = 'usermod -a -G ispconfig '.$conf['nginx']['user']; |
| | | $command = 'usermod -a -G ispconfig '.$conf['nginx']['user']; |
| | | caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); |
| | | if(is_group('ispapps')){ |
| | | //$command = 'groupmod --add-user '.$conf['nginx']['user'].' ispapps'; |
| | | $command = 'usermod -a -G ispapps '.$conf['nginx']['user']; |
| | | caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); |
| | | } |
| | |
| | | //* Make the shell scripts executable |
| | | $command = "chmod +x $install_dir/server/scripts/*.sh"; |
| | | caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); |
| | | |
| | | |
| | | if($conf['apache']['installed'] == true && $this->install_ispconfig_interface == true){ |
| | | //* Copy the ISPConfig vhost for the controlpanel |
| | |
| | | if(!@file_exists('/usr/share/squirrelmail') && @is_dir('/srv/www/htdocs/squirrelmail')) symlink('/srv/www/htdocs/squirrelmail/', '/usr/share/squirrelmail'); |
| | | } |
| | | |
| | | |
| | | // Make the Clamav log files readable by ISPConfig |
| | | //exec('chmod +r /var/log/clamav/clamav.log'); |
| | | //exec('chmod +r /var/log/clamav/freshclam.log'); |
| | |
| | | |
| | | // Add symlink for patch tool |
| | | if(!is_link('/usr/local/bin/ispconfig_patch')) exec('ln -s /usr/local/ispconfig/server/scripts/ispconfig_patch /usr/local/bin/ispconfig_patch'); |
| | | |
| | | |
| | | |
| | | // Change mode of a few files from amavisd |
| | | if(is_file($conf['amavis']['config_dir'].'/conf.d/50-user')) chmod($conf['amavis']['config_dir'].'/conf.d/50-user', 0640); |
| | | if(is_file($conf['amavis']['config_dir'].'/50-user~')) chmod($conf['amavis']['config_dir'].'/50-user~', 0400); |
| | | if(is_file($conf['amavis']['config_dir'].'/amavisd.conf')) chmod($conf['amavis']['config_dir'].'/amavisd.conf', 0640); |
| | | if(is_file($conf['amavis']['config_dir'].'/amavisd.conf~')) chmod($conf['amavis']['config_dir'].'/amavisd.conf~', 0400); |
| | | } |
| | | |
| | | } |
| | | |
| | | ?> |
| | |
| | | //** Get the hostname |
| | | $tmp_out = array(); |
| | | exec('hostname -f', $tmp_out); |
| | | $conf['hostname'] = $inst->free_query('Full qualified hostname (FQDN) of the server, eg server1.domain.tld ', @$tmp_out[0],'hostname'); |
| | | $conf['hostname'] = @$tmp_out[0]; |
| | | unset($tmp_out); |
| | | //** Prevent empty hostname |
| | | $check = false; |
| | | do { |
| | | $conf['hostname'] = $inst->free_query('Full qualified hostname (FQDN) of the server, eg server1.domain.tld ', $conf['hostname'], 'hostname'); |
| | | $conf['hostname']=trim($conf['hostname']); |
| | | $check = @($conf['hostname'] !== '')?true:false; |
| | | if(!$check) swriteln('Hostname may not be empty.'); |
| | | } while (!$check); |
| | | |
| | | // Check if the mysql functions are loaded in PHP |
| | | if(!function_exists('mysql_connect')) die('No PHP MySQL functions available. Please ensure that the PHP MySQL module is loaded.'); |
| | |
| | | $finished = false; |
| | | do { |
| | | $tmp_mysql_server_host = $inst->free_query('MySQL server hostname', $conf['mysql']['host'],'mysql_hostname'); |
| | | $tmp_mysql_server_port = $inst->free_query('MySQL server port', $conf['mysql']['port'],'mysql_port'); |
| | | $tmp_mysql_server_admin_user = $inst->free_query('MySQL root username', $conf['mysql']['admin_user'],'mysql_root_user'); |
| | | $tmp_mysql_server_admin_password = $inst->free_query('MySQL root password', $conf['mysql']['admin_password'],'mysql_root_password'); |
| | | $tmp_mysql_server_database = $inst->free_query('MySQL database to create', $conf['mysql']['database'],'mysql_database'); |
| | |
| | | } |
| | | |
| | | //* Initialize the MySQL server connection |
| | | if(@mysql_connect($tmp_mysql_server_host, $tmp_mysql_server_admin_user, $tmp_mysql_server_admin_password)) { |
| | | if(@mysql_connect($tmp_mysql_server_host . ':' . (int)$tmp_mysql_server_port, $tmp_mysql_server_admin_user, $tmp_mysql_server_admin_password)) { |
| | | $conf['mysql']['host'] = $tmp_mysql_server_host; |
| | | $conf['mysql']['port'] = $tmp_mysql_server_port; |
| | | $conf['mysql']['admin_user'] = $tmp_mysql_server_admin_user; |
| | | $conf['mysql']['admin_password'] = $tmp_mysql_server_admin_password; |
| | | $conf['mysql']['database'] = $tmp_mysql_server_database; |
| | |
| | | $inst->db = new db(); |
| | | |
| | | //** Begin with standard or expert installation |
| | | |
| | | $conf['services']['mail'] = false; |
| | | $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; |
| | | |
| | | if($install_mode == 'standard') { |
| | | |
| | | //* Create the MySQL database |
| | | $inst->configure_database(); |
| | | |
| | | //* Insert the Server record into the database |
| | | $inst->add_database_server_record(); |
| | | |
| | | //* Configure Postgrey |
| | | $force = @($conf['postgrey']['installed']) ? true : $inst->force_configure_app('Postgrey', false); |
| | | if($force) swriteln('Configuring Postgrey'); |
| | | |
| | | //* Configure Postfix |
| | | $force = @($conf['postfix']['installed']) ? true : $inst->force_configure_app('Postfix', false); |
| | | if($force) { |
| | | swriteln('Configuring Postfix'); |
| | | $inst->configure_postfix(); |
| | | $conf['services']['mail'] = true; |
| | | } |
| | | |
| | | if($conf['services']['mail']) { |
| | | |
| | | //* Configure Mailman |
| | | $force = @($conf['mailman']['installed']) ? true : $inst->force_configure_app('Mailman', false); |
| | | if($force) { |
| | | swriteln('Configuring Mailman'); |
| | | $inst->configure_mailman(); |
| | | } |
| | | |
| | | //* Check for Dovecot and Courier |
| | | if(!$conf['dovecot']['installed'] && !$conf['courier']['installed']) { |
| | | $conf['dovecot']['installed'] = $inst->force_configure_app('Dovecot', false); |
| | | $conf['courier']['installed'] = $inst->force_configure_app('Courier', false); |
| | | } |
| | | //* 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', false); |
| | | if($force) { |
| | | swriteln('Configuring Spamassassin'); |
| | | $inst->configure_spamassassin(); |
| | | } |
| | | |
| | | //* Configure Amavis |
| | | $force = @($conf['amavis']['installed']) ? true : $inst->force_configure_app('Amavisd', false); |
| | | if($force) { |
| | | swriteln('Configuring Amavisd'); |
| | | $inst->configure_amavis(); |
| | | } |
| | | |
| | | //* Configure Getmail |
| | | $force = @($conf['getmail']['installed']) ? true : $inst->force_configure_app('Getmail', false); |
| | | if($force) { |
| | | swriteln('Configuring Getmail'); |
| | | $inst->configure_getmail(); |
| | | } |
| | | |
| | | } else swriteln('[ERROR] Postfix not installed - skipping Mail'); |
| | | |
| | | //* Check for DNS |
| | | if(!$conf['powerdns']['installed'] && !$conf['bind']['installed'] && !$conf['mydns']['installed']) { |
| | | $conf['powerdns']['installed'] = $inst->force_configure_app('PowerDNS', false); |
| | | $conf['bind']['installed'] = $inst->force_configure_app('BIND', false); |
| | | $conf['mydns']['installed'] = $inst->force_configure_app('MyDNS', false); |
| | | } |
| | | //* Configure PowerDNS |
| | | if($conf['powerdns']['installed']) { |
| | | swriteln('Configuring PowerDNS'); |
| | | $inst->configure_powerdns(); |
| | | $conf['services']['dns'] = true; |
| | | } |
| | | //* Configure Bind |
| | | if($conf['bind']['installed']) { |
| | | swriteln('Configuring BIND'); |
| | | $inst->configure_bind(); |
| | | $conf['services']['dns'] = true; |
| | | } |
| | | //* Configure MyDNS |
| | | if($conf['mydns']['installed']) { |
| | | swriteln('Configuring MyDNS'); |
| | | $inst->configure_mydns(); |
| | | $conf['services']['dns'] = true; |
| | | } |
| | | |
| | | //* Configure Jailkit |
| | | $force = @($conf['jailkit']['installed']) ? true : $inst->force_configure_app('Jailkit', false); |
| | | if($force) { |
| | | swriteln('Configuring Jailkit'); |
| | | $inst->configure_jailkit(); |
| | | } |
| | | |
| | | //* Configure Pureftpd |
| | | $force = @($conf['pureftpd']['installed']) ? true : $inst->force_configure_app('pureftpd', false); |
| | | if($force) { |
| | | swriteln('Configuring Pureftpd'); |
| | | $inst->configure_pureftpd(); |
| | | } |
| | | |
| | | //* Check for Web-Server |
| | | if(!$conf['apache']['installed'] && !$conf['nginx']['installed']) { |
| | | $conf['apache']['installed'] = $inst->force_configure_app('Apache', false); |
| | | $conf['nginx']['installed'] = $inst->force_configure_app('nginx', false); |
| | | } |
| | | |
| | | //* Configure Webserver - Apache or nginx |
| | | if($conf['apache']['installed'] == true && $conf['nginx']['installed'] == true) { |
| | | if($conf['apache']['installed'] && $conf['nginx']['installed']) { |
| | | $http_server_to_use = $inst->simple_query('Apache and nginx detected. Select server to use for ISPConfig:', array('apache', 'nginx'), 'apache','http_server'); |
| | | if($http_server_to_use == 'apache'){ |
| | | $conf['nginx']['installed'] = false; |
| | |
| | | } |
| | | } |
| | | |
| | | //* Insert the Server record into the database |
| | | $inst->add_database_server_record(); |
| | | |
| | | //* Configure Postfix |
| | | $inst->configure_postfix(); |
| | | |
| | | //* Configure Mailman |
| | | if($conf['mailman']['installed'] == true) { |
| | | $inst->configure_mailman('install'); |
| | | } |
| | | |
| | | //* Configure jailkit |
| | | swriteln('Configuring Jailkit'); |
| | | $inst->configure_jailkit(); |
| | | |
| | | if($conf['dovecot']['installed'] == true) { |
| | | //* Configure Dovecot |
| | | swriteln('Configuring Dovecot'); |
| | | $inst->configure_dovecot(); |
| | | } else { |
| | | //* 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 Spamasassin |
| | | swriteln('Configuring Spamassassin'); |
| | | $inst->configure_spamassassin(); |
| | | |
| | | //* Configure Amavis |
| | | if($conf['amavis']['installed'] == true) { |
| | | swriteln('Configuring Amavisd'); |
| | | $inst->configure_amavis(); |
| | | } |
| | | |
| | | //* Configure Getmail |
| | | swriteln('Configuring Getmail'); |
| | | $inst->configure_getmail(); |
| | | |
| | | //* Configure Pureftpd |
| | | swriteln('Configuring Pureftpd'); |
| | | $inst->configure_pureftpd(); |
| | | |
| | | //* Configure DNS |
| | | if($conf['powerdns']['installed'] == true) { |
| | | swriteln('Configuring PowerDNS'); |
| | | $inst->configure_powerdns(); |
| | | } elseif($conf['bind']['installed'] == true) { |
| | | swriteln('Configuring BIND'); |
| | | $inst->configure_bind(); |
| | | } else { |
| | | swriteln('Configuring MyDNS'); |
| | | $inst->configure_mydns(); |
| | | } |
| | | |
| | | //* Configure Apache |
| | | if($conf['apache']['installed'] == true){ |
| | | if($conf['apache']['installed']){ |
| | | swriteln('Configuring Apache'); |
| | | $inst->configure_apache(); |
| | | $conf['services']['web'] = true; |
| | | $conf['services']['file'] = true; |
| | | //* Configure Vlogger |
| | | $force = @($conf['vlogger']['installed']) ? true : $inst->force_configure_app('vlogger', false); |
| | | if($force) { |
| | | swriteln('Configuring vlogger'); |
| | | $inst->configure_vlogger(); |
| | | } |
| | | //* Configure squid |
| | | /* |
| | | $force = @($conf['squid']['installed']) ? true : $inst->force_configure_app('squid'); |
| | | if($force) { |
| | | swriteln('Configuring Squid'); |
| | | $inst->configure_squid(); |
| | | $conf['services']['proxy'] = true; |
| | | } |
| | | */ |
| | | } |
| | | |
| | | //* Configure nginx |
| | | if($conf['nginx']['installed'] == true){ |
| | | if($conf['nginx']['installed']){ |
| | | swriteln('Configuring nginx'); |
| | | $inst->configure_nginx(); |
| | | $conf['services']['web'] = true; |
| | | } |
| | | |
| | | //** Configure Vlogger |
| | | swriteln('Configuring Vlogger'); |
| | | $inst->configure_vlogger(); |
| | | //* Configure XMPP |
| | | $force = @($conf['xmpp']['installed']) ? true : $inst->force_configure_app('Metronome XMPP Server', false); |
| | | if($force) { |
| | | swriteln('Configuring Metronome XMPP Server'); |
| | | $inst->configure_xmpp(); |
| | | $conf['services']['xmpp'] = true; |
| | | } |
| | | |
| | | //** Configure apps vhost |
| | | swriteln('Configuring Apps vhost'); |
| | | $inst->configure_apps_vhost(); |
| | | |
| | | //* Configure Firewall |
| | | if($conf['ufw']['installed'] == true) { |
| | | //* Configure Ubuntu Firewall |
| | | $conf['services']['firewall'] = true; |
| | | //* Check for Firewall |
| | | if(!$conf['ufw']['installed'] && !$conf['firewall']['installed']) { |
| | | $conf['ufw']['installed'] = $inst->force_configure_app('Ubuntu Firewall', false); |
| | | $conf['firewall']['installed'] = $inst->force_configure_app('Bastille Firewall', false); |
| | | } |
| | | //* Configure Firewall - Ubuntu or Bastille |
| | | if($conf['ufw']['installed'] && $conf['firewall']['installed']) { |
| | | $firewall_to_use = $inst->simple_query('Ubuntu and Bastille Firewall detected. Select firewall to use with ISPConfig:', array('bastille', 'ubuntu'), 'bastille','firewall_server'); |
| | | if($firewall_to_use == 'bastille'){ |
| | | $conf['ufw']['installed'] = false; |
| | | } else { |
| | | $conf['firewall']['installed'] = false; |
| | | } |
| | | } |
| | | //* Configure Ubuntu Firewall |
| | | if($conf['ufw']['installed']){ |
| | | swriteln('Configuring Ubuntu Firewall'); |
| | | $inst->configure_ufw_firewall(); |
| | | } else { |
| | | //* Configure Bastille Firewall |
| | | $conf['services']['firewall'] = true; |
| | | } |
| | | //* Configure Bastille Firewall |
| | | if($conf['firewall']['installed']){ |
| | | swriteln('Configuring Bastille Firewall'); |
| | | $inst->configure_bastille_firewall(); |
| | | $conf['services']['firewall'] = true; |
| | | } |
| | | |
| | | //* Configure Fail2ban |
| | | if($conf['fail2ban']['installed'] == true) { |
| | | $force = @($conf['fail2ban']['installed']) ? true : $inst->force_configure_app('Fail2ban', false); |
| | | if($force) { |
| | | swriteln('Configuring Fail2ban'); |
| | | $inst->configure_fail2ban(); |
| | | } |
| | | |
| | | /* |
| | | if($conf['squid']['installed'] == true) { |
| | | $conf['services']['proxy'] = true; |
| | | swriteln('Configuring Squid'); |
| | | $inst->configure_squid(); |
| | | } else if($conf['nginx']['installed'] == true) { |
| | | $conf['services']['proxy'] = true; |
| | | swriteln('Configuring Nginx'); |
| | | $inst->configure_nginx(); |
| | | //* Configure OpenVZ |
| | | $force = @($conf['openvz']['installed']) ? true : $inst->force_configure_app('OpenVZ', false); |
| | | if($force) { |
| | | $conf['services']['vserver'] = true; |
| | | swriteln('Configuring OpenVZ'); |
| | | } |
| | | */ |
| | | |
| | | //** Configure apps vhost |
| | | swriteln('Configuring Apps vhost'); |
| | | $inst->configure_apps_vhost(); |
| | | |
| | | //* Configure ISPConfig |
| | | swriteln('Installing ISPConfig'); |
| | | |
| | | //** Customize the port ISPConfig runs on |
| | | $ispconfig_vhost_port = $inst->free_query('ISPConfig Port', '8080','ispconfig_port'); |
| | | $conf['interface_password'] = $inst->free_query('Admin password', 'admin'); |
| | | if($conf['interface_password'] != 'admin') { |
| | | $check = false; |
| | | do { |
| | | unset($temp_password); |
| | | $temp_password = $inst->free_query('Re-enter admin password', ''); |
| | | $check = @($temp_password == $conf['interface_password'])?true:false; |
| | | if(!$check) swriteln('Passwords do not match.'); |
| | | } while (!$check); |
| | | } |
| | | unset($check); |
| | | unset($temp_password); |
| | | if($conf['apache']['installed'] == true) $conf['apache']['vhost_port'] = $ispconfig_vhost_port; |
| | | if($conf['nginx']['installed'] == true) $conf['nginx']['vhost_port'] = $ispconfig_vhost_port; |
| | | unset($ispconfig_vhost_port); |
| | |
| | | $inst->configure_dbserver(); |
| | | |
| | | //* Configure ISPConfig |
| | | swriteln('Installing ISPConfig crontab'); |
| | | $inst->install_crontab(); |
| | | if($conf['cron']['installed']) { |
| | | swriteln('Installing ISPConfig crontab'); |
| | | $inst->install_crontab(); |
| | | } else swriteln('[ERROR] Cron not found'); |
| | | |
| | | 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['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['xmpp']['installed'] == true && $conf['xmpp']['init_script'] != '') system($inst->getinitcommand($conf['xmpp']['init_script'], 'restart').' &> /dev/null'); |
| | | |
| | | } else { |
| | | |
| | | //* In expert mode, we select the services in the following steps, only db is always available |
| | | $conf['services']['mail'] = false; |
| | | $conf['services']['web'] = false; |
| | | $conf['services']['dns'] = false; |
| | | $conf['services']['db'] = true; |
| | | $conf['services']['firewall'] = false; |
| | | $conf['services']['proxy'] = false; |
| | | |
| | | } else { //* expert mode |
| | | |
| | | //** Get Server ID |
| | | // $conf['server_id'] = $inst->free_query('Unique Numeric ID of the server','1'); |
| | |
| | | $finished = false; |
| | | do { |
| | | $tmp_mysql_server_host = $inst->free_query('MySQL master server hostname', $conf['mysql']['master_host'],'mysql_master_hostname'); |
| | | $tmp_mysql_server_port = $inst->free_query('MySQL master server port', $conf['mysql']['master_port'],'mysql_master_port'); |
| | | $tmp_mysql_server_admin_user = $inst->free_query('MySQL master server root username', $conf['mysql']['master_admin_user'],'mysql_master_root_user'); |
| | | $tmp_mysql_server_admin_password = $inst->free_query('MySQL master server root password', $conf['mysql']['master_admin_password'],'mysql_master_root_password'); |
| | | $tmp_mysql_server_database = $inst->free_query('MySQL master server database name', $conf['mysql']['master_database'],'mysql_master_database'); |
| | | |
| | | //* Initialize the MySQL server connection |
| | | if(@mysql_connect($tmp_mysql_server_host, $tmp_mysql_server_admin_user, $tmp_mysql_server_admin_password)) { |
| | | if(@mysql_connect($tmp_mysql_server_host . ':' . (int)$tmp_mysql_server_port, $tmp_mysql_server_admin_user, $tmp_mysql_server_admin_password)) { |
| | | $conf['mysql']['master_host'] = $tmp_mysql_server_host; |
| | | $conf['mysql']['master_port'] = $tmp_mysql_server_port; |
| | | $conf['mysql']['master_admin_user'] = $tmp_mysql_server_admin_user; |
| | | $conf['mysql']['master_admin_password'] = $tmp_mysql_server_admin_password; |
| | | $conf['mysql']['master_database'] = $tmp_mysql_server_database; |
| | |
| | | // initialize the connection to the master database |
| | | $inst->dbmaster = new db(); |
| | | if($inst->dbmaster->linkId) $inst->dbmaster->closeConn(); |
| | | $inst->dbmaster->dbHost = $conf['mysql']["master_host"]; |
| | | $inst->dbmaster->dbName = $conf['mysql']["master_database"]; |
| | | $inst->dbmaster->dbUser = $conf['mysql']["master_admin_user"]; |
| | | $inst->dbmaster->dbPass = $conf['mysql']["master_admin_password"]; |
| | | $inst->dbmaster->setDBData($conf['mysql']["master_host"], $conf['mysql']["master_admin_user"], $conf['mysql']["master_admin_password"]); |
| | | $inst->dbmaster->setDBName($conf['mysql']["master_database"]); |
| | | |
| | | } else { |
| | | // the master DB is the same then the slave DB |
| | |
| | | //* Create the mysql database |
| | | $inst->configure_database(); |
| | | |
| | | //* Check for Web-Server |
| | | if($conf['apache']['installed'] != true && $conf['nginx']['installed'] != true) { |
| | | $conf['apache']['installed'] = $inst->force_configure_app('Apache'); |
| | | $conf['nginx']['installed'] = $inst->force_configure_app('nginx'); |
| | | } |
| | | //* Configure Webserver - Apache or nginx |
| | | if($conf['apache']['installed'] == true && $conf['nginx']['installed'] == true) { |
| | | $http_server_to_use = $inst->simple_query('Apache and nginx detected. Select server to use for ISPConfig:', array('apache', 'nginx'), 'apache','http_server'); |
| | | if($http_server_to_use == 'apache'){ |
| | | $conf['nginx']['installed'] = false; |
| | | $conf['services']['file'] = true; |
| | | } else { |
| | | $conf['apache']['installed'] = false; |
| | | } |
| | |
| | | |
| | | $conf['services']['mail'] = true; |
| | | |
| | | //* Configure Postgrey |
| | | $force = @($conf['postgrey']['installed']) ? true : $inst->force_configure_app('Postgrey'); |
| | | if($force) swriteln('Configuring Postgrey'); |
| | | |
| | | //* Configure Postfix |
| | | swriteln('Configuring Postfix'); |
| | | $inst->configure_postfix(); |
| | | $force = @($conf['postfix']['installed']) ? true : $inst->force_configure_app('Postfix'); |
| | | if($force) { |
| | | swriteln('Configuring Postfix'); |
| | | $inst->configure_postfix(); |
| | | } |
| | | |
| | | //* Configure Mailman |
| | | swriteln('Configuring Mailman'); |
| | | $inst->configure_mailman(); |
| | | $force = @($conf['mailman']['installed']) ? true : $inst->force_configure_app('Mailman'); |
| | | if($force) { |
| | | swriteln('Configuring Mailman'); |
| | | $inst->configure_mailman(); |
| | | } |
| | | |
| | | if($conf['dovecot']['installed'] == true) { |
| | | //* Configure dovecot |
| | | //* Check for Dovecot and Courier |
| | | if(!$conf['dovecot']['installed'] && !$conf['courier']['installed']) { |
| | | $conf['dovecot']['installed'] = $inst->force_configure_app('Dovecot'); |
| | | $conf['courier']['installed'] = $inst->force_configure_app('Courier'); |
| | | } |
| | | //* 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(); |
| | | } else { |
| | | |
| | | //* Configure saslauthd |
| | | swriteln('Configuring SASL'); |
| | | $inst->configure_saslauthd(); |
| | | |
| | | //* Configure PAM |
| | | swriteln('Configuring PAM'); |
| | | $inst->configure_pam(); |
| | | |
| | | //* Configure courier |
| | | } |
| | | //* 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 |
| | | swriteln('Configuring Spamassassin'); |
| | | $inst->configure_spamassassin(); |
| | | |
| | | $force = @($conf['spamassassin']['installed']) ? true : $inst->force_configure_app('Spamassassin'); |
| | | if($force) { |
| | | swriteln('Configuring Spamassassin'); |
| | | $inst->configure_spamassassin(); |
| | | } |
| | | |
| | | //* Configure Amavis |
| | | swriteln('Configuring Amavisd'); |
| | | $inst->configure_amavis(); |
| | | $force = @($conf['amavis']['installed']) ? true : $inst->force_configure_app('Amavisd'); |
| | | if($force) { |
| | | swriteln('Configuring Amavisd'); |
| | | $inst->configure_amavis(); |
| | | } |
| | | |
| | | //* Configure Getmail |
| | | swriteln('Configuring Getmail'); |
| | | $inst->configure_getmail(); |
| | | $force = @($conf['getmail']['installed']) ? true : $inst->force_configure_app('Getmail'); |
| | | if($force) { |
| | | swriteln('Configuring Getmail'); |
| | | $inst->configure_getmail(); |
| | | } |
| | | |
| | | 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['mailman']['installed'] == true && $conf['mailman']['init_script'] != '') system('nohup '.$inst->getinitcommand($conf['mailman']['init_script'], 'restart').' >/dev/null 2>&1 &'); |
| | | } |
| | | |
| | | //** Configure Jailkit |
| | | if(strtolower($inst->simple_query('Configure Jailkit', array('y', 'n'), 'y','configure_jailkit') ) == 'y') { |
| | | //* Configure Jailkit |
| | | $force = @($conf['jailkit']['installed']) ? true : $inst->force_configure_app('Jailkit'); |
| | | if($force) { |
| | | swriteln('Configuring Jailkit'); |
| | | $inst->configure_jailkit(); |
| | | } |
| | | |
| | | //** Configure Pureftpd |
| | | if(strtolower($inst->simple_query('Configure FTP Server', array('y', 'n'), 'y','configure_ftp') ) == 'y') { |
| | | //* Configure Pureftpd |
| | | $force = @($conf['pureftpd']['installed']) ? true : $inst->force_configure_app('pureftpd'); |
| | | if($force) { |
| | | swriteln('Configuring Pureftpd'); |
| | | $inst->configure_pureftpd(); |
| | | if($conf['pureftpd']['installed'] == true && $conf['pureftpd']['init_script'] != '') system($inst->getinitcommand($conf['pureftpd']['init_script'], 'restart')); |
| | | } |
| | | |
| | | //** Configure DNS |
| | | if(strtolower($inst->simple_query('Configure DNS Server', array('y', 'n'), 'y','configure_dns')) == 'y') { |
| | | $conf['services']['dns'] = true; |
| | | //* Configure DNS |
| | | if($conf['powerdns']['installed'] == true) { |
| | | |
| | | //* Check for DNS |
| | | if(!$conf['powerdns']['installed'] && !$conf['bind']['installed'] && !$conf['mydns']['installed']) { |
| | | $conf['powerdns']['installed'] = $inst->force_configure_app('PowerDNS'); |
| | | $conf['bind']['installed'] = $inst->force_configure_app('BIND'); |
| | | $conf['mydns']['installed'] = $inst->force_configure_app('MyDNS'); |
| | | } |
| | | //* Configure PowerDNS |
| | | if($conf['powerdns']['installed']) { |
| | | swriteln('Configuring PowerDNS'); |
| | | $inst->configure_powerdns(); |
| | | if($conf['powerdns']['init_script'] != '') system($inst->getinitcommand($conf['powerdns']['init_script'], 'restart').' &> /dev/null'); |
| | | } elseif($conf['bind']['installed'] == true) { |
| | | $conf['services']['dns'] = true; |
| | | } |
| | | //* Configure Bind |
| | | if($conf['bind']['installed']) { |
| | | swriteln('Configuring BIND'); |
| | | $inst->configure_bind(); |
| | | if($conf['bind']['init_script'] != '') system($inst->getinitcommand($conf['bind']['init_script'], 'restart').' &> /dev/null'); |
| | | } else { |
| | | $conf['services']['dns'] = true; |
| | | } |
| | | //* Configure MyDNS |
| | | if($conf['mydns']['installed']) { |
| | | swriteln('Configuring MyDNS'); |
| | | $inst->configure_mydns(); |
| | | if($conf['mydns']['init_script'] != '') system($inst->getinitcommand($conf['mydns']['init_script'], 'restart').' &> /dev/null'); |
| | | $conf['services']['dns'] = true; |
| | | } |
| | | |
| | | } |
| | | |
| | | /* |
| | | //** Configure Squid |
| | | if(strtolower($inst->simple_query('Configure Proxy Server', array('y','n'),'y') ) == 'y') { |
| | | if($conf['squid']['installed'] == true) { |
| | | $conf['services']['proxy'] = true; |
| | | swriteln('Configuring Squid'); |
| | | $inst->configure_squid(); |
| | | if($conf['squid']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['squid']['init_script']))system($conf['init_scripts'].'/'.$conf['squid']['init_script'].' restart &> /dev/null'); |
| | | } else if($conf['nginx']['installed'] == true) { |
| | | $conf['services']['proxy'] = true; |
| | | swriteln('Configuring Nginx'); |
| | | $inst->configure_nginx(); |
| | | if($conf['nginx']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['nginx']['init_script']))system($conf['init_scripts'].'/'.$conf['nginx']['init_script'].' restart &> /dev/null'); |
| | | } |
| | | } |
| | | */ |
| | | if(strtolower($inst->simple_query('Configure Web Server', array('y', 'n'), 'y','configure_webserver')) == 'y') { |
| | | $conf['services']['web'] = true; |
| | | |
| | | //** Configure Apache |
| | | if($conf['apache']['installed'] == true){ |
| | | swriteln("\nHint: If this server shall run the ISPConfig interface, select 'y' in the 'Configure Apache Server' option.\n"); |
| | | if(strtolower($inst->simple_query('Configure Apache Server', array('y', 'n'), 'y','configure_apache')) == 'y') { |
| | | $conf['services']['web'] = true; |
| | | //* Configure Apache |
| | | if($conf['apache']['installed']){ |
| | | swriteln('Configuring Apache'); |
| | | $inst->configure_apache(); |
| | | |
| | | //** Configure Vlogger |
| | | swriteln('Configuring Vlogger'); |
| | | $inst->configure_vlogger(); |
| | | |
| | | //** Configure apps vhost |
| | | swriteln('Configuring Apps vhost'); |
| | | $inst->configure_apps_vhost(); |
| | | $conf['services']['file'] = true; |
| | | //* Configure Vlogger |
| | | $force = @($conf['vlogger']['installed']) ? true : $inst->force_configure_app('vlogger'); |
| | | if($force) { |
| | | swriteln('Configuring vlogger'); |
| | | $inst->configure_vlogger(); |
| | | } |
| | | //* Configure squid |
| | | /* |
| | | $force = @($conf['squid']['installed']) ? true : $inst->force_configure_app('squid'); |
| | | if($force) { |
| | | swriteln('Configuring Squid'); |
| | | $inst->configure_squid(); |
| | | $conf['services']['proxy'] = true; |
| | | if($conf['squid']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['squid']['init_script']))system($conf['init_scripts'].'/'.$conf['squid']['init_script'].' restart &> /dev/null'); |
| | | } |
| | | */ |
| | | } |
| | | } |
| | | |
| | | //** Configure nginx |
| | | if($conf['nginx']['installed'] == true){ |
| | | swriteln("\nHint: If this server shall run the ISPConfig interface, select 'y' in the 'Configure nginx Server' option.\n"); |
| | | if(strtolower($inst->simple_query('Configure nginx Server', array('y', 'n'), 'y','configure_nginx')) == 'y') { |
| | | $conf['services']['web'] = true; |
| | | //* Configure nginx |
| | | if($conf['nginx']['installed']){ |
| | | swriteln('Configuring nginx'); |
| | | $inst->configure_nginx(); |
| | | |
| | | //** Configure Vlogger |
| | | //swriteln('Configuring Vlogger'); |
| | | //$inst->configure_vlogger(); |
| | | |
| | | //** Configure apps vhost |
| | | swriteln('Configuring Apps vhost'); |
| | | $inst->configure_apps_vhost(); |
| | | } |
| | | } |
| | | |
| | | //** Configure Firewall |
| | | if($conf['openvz']['installed'] = true && strtolower($inst->simple_query('Enable Openvz-Server', array('y', 'n'), 'y','configure_openvz')) == 'y') |
| | | $conf['services']['vserver'] = true; |
| | | |
| | | if(strtolower($inst->simple_query('Configure Firewall Server', array('y', 'n'), 'y','configure_firewall')) == 'y') { |
| | | //if($conf['bastille']['installed'] == true) { |
| | | //* Configure Bastille Firewall |
| | | $conf['services']['firewall'] = true; |
| | | swriteln('Configuring Bastille Firewall'); |
| | | $inst->configure_firewall(); |
| | | /*} elseif($conf['ufw']['installed'] == true) { |
| | | //* Configure Ubuntu Firewall |
| | | $conf['services']['firewall'] = true; |
| | | //* Check for Firewall |
| | | if(!$conf['ufw']['installed'] && !$conf['firewall']['installed']) { |
| | | $conf['ufw']['installed'] = $inst->force_configure_app('Ubuntu Firewall'); |
| | | $conf['firewall']['installed'] = $inst->force_configure_app('Bastille Firewall'); |
| | | } |
| | | //* Configure Firewall - Ubuntu or Bastille |
| | | if($conf['ufw']['installed'] && $conf['firewall']['installed']) { |
| | | $firewall_to_use = $inst->simple_query('Ubuntu and Bastille Firewall detected. Select firewall to use with ISPConfig:', array('bastille', 'ubuntu'), 'bastille','firewall_server'); |
| | | if($firewall_to_use == 'bastille'){ |
| | | $conf['ufw']['installed'] = false; |
| | | } else { |
| | | $conf['firewall']['installed'] = false; |
| | | } |
| | | } |
| | | //* Configure Ubuntu Firewall |
| | | if($conf['ufw']['installed']){ |
| | | swriteln('Configuring Ubuntu Firewall'); |
| | | $inst->configure_ufw_firewall(); |
| | | } else { |
| | | //* Configure Bastille Firewall |
| | | $conf['services']['firewall'] = true; |
| | | } |
| | | //* Configure Bastille Firewall |
| | | if($conf['firewall']['installed']){ |
| | | swriteln('Configuring Bastille Firewall'); |
| | | $inst->configure_bastille_firewall(); |
| | | $conf['services']['firewall'] = true; |
| | | } |
| | | */ |
| | | } |
| | | |
| | | //** Configure Firewall |
| | | /*if(strtolower($inst->simple_query('Configure Firewall Server',array('y','n'),'y')) == 'y') { |
| | | swriteln('Configuring Firewall'); |
| | | $inst->configure_firewall(); |
| | | }*/ |
| | | //* Configure XMPP |
| | | $force = @($conf['xmpp']['installed']) ? true : $inst->force_configure_app('Metronome XMPP Server'); |
| | | if($force) { |
| | | swriteln('Configuring Metronome XMPP Server'); |
| | | $inst->configure_xmpp(); |
| | | $conf['services']['xmpp'] = true; |
| | | } |
| | | |
| | | //** Configure ISPConfig :-) |
| | | $install_ispconfig_interface_default = ($conf['mysql']['master_slave_setup'] == 'y')?'n':'y'; |
| | |
| | | |
| | | //** Customise the port ISPConfig runs on |
| | | $ispconfig_vhost_port = $inst->free_query('ISPConfig Port', '8080','ispconfig_port'); |
| | | $conf['interface_password'] = $inst->free_query('Admin password', 'admin'); |
| | | if($conf['interface_password'] != 'admin') { |
| | | $check = false; |
| | | do { |
| | | unset($temp_password); |
| | | $temp_password = $inst->free_query('Re-enter admin password', ''); |
| | | $check = @($temp_password == $conf['interface_password'])?true:false; |
| | | if(!$check) swriteln('Passwords do not match.'); |
| | | } while (!$check); |
| | | } |
| | | unset($check); |
| | | unset($temp_password); |
| | | if($conf['apache']['installed'] == true) $conf['apache']['vhost_port'] = $ispconfig_vhost_port; |
| | | if($conf['nginx']['installed'] == true) $conf['nginx']['vhost_port'] = $ispconfig_vhost_port; |
| | | unset($ispconfig_vhost_port); |
| | |
| | | |
| | | } //* << $install_mode / 'Standard' or Genius |
| | | |
| | | $inst->create_mount_script(); |
| | | |
| | | //* Create md5 filelist |
| | | $md5_filename = '/usr/local/ispconfig/security/data/file_checksums_'.date('Y-m-d_h-i').'.md5'; |
| | | exec('find /usr/local/ispconfig -type f -print0 | xargs -0 md5sum > '.$md5_filename); |
| | |
| | | $mainver = array_filter($mainver); |
| | | $mainver = current($mainver).'.'.next($mainver); |
| | | switch ($mainver){ |
| | | case "15.04": |
| | | $relname = "(Vivid Vervet)"; |
| | | break; |
| | | case "14.10": |
| | | $relname = "(Utopic Unicorn)"; |
| | | break; |
| | |
| | | $distid = 'debian60'; |
| | | $distbaseid = 'debian'; |
| | | swriteln("Operating System: Debian 7.0 (Wheezy/Sid) or compatible\n"); |
| | | } 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'; |
| | | swriteln("Operating System: Debian 8.0 (Jessie) or compatible\n"); |
| | | } else { |
| | | $distname = 'Debian'; |
| | | $distver = 'Unknown'; |
| | |
| | | public $conf; |
| | | public $install_ispconfig_interface = true; |
| | | public $is_update = false; // true if it is an update, falsi if it is a new install |
| | | protected $mailman_group = 'list'; |
| | | |
| | | |
| | | public function __construct() { |
| | |
| | | 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')) $conf['mailman']['installed'] = true; |
| | | if(is_installed('mailman') || is_installed('mmsitepass')) $conf['mailman']['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('iptables') && is_installed('ufw')) $conf['ufw']['installed'] = true; |
| | | if(is_installed('fail2ban-server')) $conf['fail2ban']['installed'] = true; |
| | | if(is_installed('vzctl')) $conf['openvz']['installed'] = true; |
| | | if(is_dir("/etc/Bastille")) $conf['bastille']['installed'] = true; |
| | | if(is_installed('iptables') && is_installed('bastille-netfilter')) $conf['bastille']['installed'] = true; |
| | | if(is_installed('metronome') && is_installed('metronomectl')) $conf['xmpp']['installed'] = true; |
| | | if(is_installed('spamassassin')) $conf['spamassassin']['installed'] = true; |
| | | if(is_installed('vlogger')) $conf['vlogger']['installed'] = true; |
| | | if(is_installed('cron')) $conf['cron']['installed'] = true; |
| | | |
| | | if ($conf['services']['web'] && (($conf['apache']['installed'] && is_file($conf['apache']["vhost_conf_enabled_dir"]."/000-ispconfig.vhost")) || ($conf['nginx']['installed'] && is_file($conf['nginx']["vhost_conf_enabled_dir"]."/000-ispconfig.vhost")))) $this->ispconfig_interface_installed = true; |
| | | } |
| | | |
| | | public function force_configure_app($service, $enable_force=true) { |
| | | $force = false; |
| | | swriteln("[WARN] autodetect for $service failed"); |
| | | if($enable_force) { |
| | | if(strtolower($this->simple_query("Force configure $service", array('y', 'n'), 'n') ) == 'y') { |
| | | $force = true; |
| | | } else swriteln("Skipping $service\n"); |
| | | } |
| | | return $force; |
| | | } |
| | | |
| | | |
| | | /** Create the database for ISPConfig */ |
| | | |
| | |
| | | public function configure_database() { |
| | | global $conf; |
| | | |
| | | //* check sql-mode |
| | | $check_sql_mode = $this->db->queryOneRecord("SELECT @@sql_mode"); |
| | | |
| | | if ($check_sql_mode['@@sql_mode'] != '' && $check_sql_mode['@@sql_mode'] != 'NO_ENGINE_SUBSTITUTION') die('Wrong SQL-mode. You should use NO_ENGINE_SUBSTITUTION'); |
| | | |
| | | //** Create the database |
| | | if(!$this->db->query('CREATE DATABASE IF NOT EXISTS '.$conf['mysql']['database'].' DEFAULT CHARACTER SET '.$conf['mysql']['charset'])) { |
| | | if(!$this->db->query('CREATE DATABASE IF NOT EXISTS ?? DEFAULT CHARACTER SET ?', $conf['mysql']['database'], $conf['mysql']['charset'])) { |
| | | $this->error('Unable to create MySQL database: '.$conf['mysql']['database'].'.'); |
| | | } |
| | | |
| | | //* Set the database name in the DB library |
| | | $this->db->dbName = $conf['mysql']['database']; |
| | | $this->db->setDBName($conf['mysql']['database']); |
| | | |
| | | //* Load the database dump into the database, if database contains no tables |
| | | $db_tables = $this->db->getTables(); |
| | |
| | | } |
| | | |
| | | //* Load system.ini into the sys_ini table |
| | | $system_ini = $this->db->quote(rf('tpl/system.ini.master')); |
| | | $this->db->query("UPDATE sys_ini SET config = '$system_ini' WHERE sysini_id = 1"); |
| | | $system_ini = rf('tpl/system.ini.master'); |
| | | $this->db->query("UPDATE sys_ini SET config = ? WHERE sysini_id = 1", $system_ini); |
| | | |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | // Delete ISPConfig user in the local database, in case that it exists |
| | | $this->db->query("DELETE FROM mysql.user WHERE User = '".$conf['mysql']['ispconfig_user']."' AND Host = '".$from_host."';"); |
| | | $this->db->query("DELETE FROM mysql.db WHERE Db = '".$conf['mysql']['database']."' AND Host = '".$from_host."';"); |
| | | $this->db->query('FLUSH PRIVILEGES;'); |
| | | $this->db->query("DELETE FROM mysql.user WHERE User = ? AND Host = ?", $conf['mysql']['ispconfig_user'], $from_host); |
| | | $this->db->query("DELETE FROM mysql.db WHERE Db = ? AND Host = ?", $conf['mysql']['database'], $from_host); |
| | | $this->db->query('FLUSH PRIVILEGES'); |
| | | |
| | | //* Create the ISPConfig database user in the local database |
| | | $query = 'GRANT SELECT, INSERT, UPDATE, DELETE ON '.$conf['mysql']['database'].".* " |
| | | ."TO '".$conf['mysql']['ispconfig_user']."'@'".$from_host."' " |
| | | ."IDENTIFIED BY '".$conf['mysql']['ispconfig_password']."';"; |
| | | if(!$this->db->query($query)) { |
| | | $query = 'GRANT SELECT, INSERT, UPDATE, DELETE ON ?? TO ?@? IDENTIFIED BY ?'; |
| | | if(!$this->db->query($query, $conf['mysql']['database'] . ".*", $conf['mysql']['ispconfig_user'], $from_host, $conf['mysql']['ispconfig_password'])) { |
| | | $this->error('Unable to create database user: '.$conf['mysql']['ispconfig_user'].' Error: '.$this->db->errorMessage); |
| | | } |
| | | |
| | |
| | | $this->db->query('FLUSH PRIVILEGES;'); |
| | | |
| | | //* Set the database name in the DB library |
| | | $this->db->dbName = $conf['mysql']['database']; |
| | | $this->db->setDBName($conf['mysql']['database']); |
| | | |
| | | $tpl_ini_array = ini_to_array(rf('tpl/server.ini.master')); |
| | | |
| | |
| | | } |
| | | |
| | | $server_ini_content = array_to_ini($tpl_ini_array); |
| | | $server_ini_content = mysql_real_escape_string($server_ini_content); |
| | | |
| | | |
| | | $mail_server_enabled = ($conf['services']['mail'])?1:0; |
| | | $web_server_enabled = ($conf['services']['web'])?1:0; |
| | | $dns_server_enabled = ($conf['services']['dns'])?1:0; |
| | |
| | | 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', '".$conf['hostname']."', '$mail_server_enabled', '$web_server_enabled', '$dns_server_enabled', '$file_server_enabled', '$db_server_enabled', '$vserver_server_enabled', '$server_ini_content', 0, 1, $current_db_version, $proxy_server_enabled, $firewall_server_enabled);"; |
| | | $this->dbmaster->query($sql); |
| | | $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); |
| | | $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 ('".$conf['server_id']."',1, 1, 'riud', 'riud', 'r', '".$conf['hostname']."', '$mail_server_enabled', '$web_server_enabled', '$dns_server_enabled', '$file_server_enabled', '$db_server_enabled', '$vserver_server_enabled', '$server_ini_content', 0, 1, $current_db_version, $proxy_server_enabled, $firewall_server_enabled);"; |
| | | $this->db->query($sql); |
| | | $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); |
| | | |
| | | //* username for the ispconfig user |
| | | $conf['mysql']['master_ispconfig_user'] = 'ispcsrv'.$conf['server_id']; |
| | |
| | | |
| | | } 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', '".$conf['hostname']."', '$mail_server_enabled', '$web_server_enabled', '$dns_server_enabled', '$file_server_enabled', '$db_server_enabled', '$vserver_server_enabled', '$server_ini_content', 0, 1, $current_db_version, $proxy_server_enabled, $firewall_server_enabled);"; |
| | | $this->db->query($sql); |
| | | $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); |
| | | $conf['server_id'] = $this->db->insertID(); |
| | | $conf['server_id'] = $conf['server_id']; |
| | | } |
| | |
| | | * if not, the user already exists and we do not need the pwd |
| | | */ |
| | | if ($value['pwd'] != ''){ |
| | | $query = "CREATE USER '".$value['user']."'@'".$host."' IDENTIFIED BY '" . $value['pwd'] . "'"; |
| | | $query = "CREATE USER ?@? IDENTIFIED BY ?"; |
| | | if ($verbose){ |
| | | echo "\n\n" . $query ."\n"; |
| | | } |
| | | $this->dbmaster->query($query); // ignore the error |
| | | $this->dbmaster->query($query, $value['user'], $host, $value['pwd']); // ignore the error |
| | | } |
| | | |
| | | /* |
| | | * Try to delete all rights of the user in case that it exists. |
| | | * In Case that it will not exist, do nothing (ignore the error!) |
| | | */ |
| | | $query = "REVOKE ALL PRIVILEGES, GRANT OPTION FROM '".$value['user']."'@'".$host."' "; |
| | | $query = "REVOKE ALL PRIVILEGES, GRANT OPTION FROM ?@?"; |
| | | if ($verbose){ |
| | | echo "\n\n" . $query ."\n"; |
| | | } |
| | | $this->dbmaster->query($query); // ignore the error |
| | | $this->dbmaster->query($query, $value['user'], $host); // ignore the error |
| | | |
| | | //* Create the ISPConfig database user in the remote database |
| | | $query = "GRANT SELECT ON ".$value['db'].".`server` TO '".$value['user']."'@'".$host."' "; |
| | | $query = "GRANT SELECT ON ?? TO ?@?"; |
| | | if ($verbose){ |
| | | echo $query ."\n"; |
| | | } |
| | | if(!$this->dbmaster->query($query)) { |
| | | if(!$this->dbmaster->query($query, $value['db'] . '.server', $value['user'], $host)) { |
| | | $this->warning('Unable to set rights of user in master database: '.$value['db']."\n Query: ".$query."\n Error: ".$this->dbmaster->errorMessage); |
| | | } |
| | | |
| | | $query = "GRANT SELECT, INSERT ON ".$value['db'].".`sys_log` TO '".$value['user']."'@'".$host."' "; |
| | | $query = "GRANT SELECT, INSERT ON ?? TO ?@?"; |
| | | if ($verbose){ |
| | | echo $query ."\n"; |
| | | } |
| | | if(!$this->dbmaster->query($query)) { |
| | | if(!$this->dbmaster->query($query, $value['db'] . '.sys_log', $value['user'], $host)) { |
| | | $this->warning('Unable to set rights of user in master database: '.$value['db']."\n Query: ".$query."\n Error: ".$this->dbmaster->errorMessage); |
| | | } |
| | | |
| | | $query = "GRANT SELECT, UPDATE(`status`, `error`) ON ".$value['db'].".`sys_datalog` TO '".$value['user']."'@'".$host."' "; |
| | | $query = "GRANT SELECT, UPDATE(`status`, `error`) ON ?? TO ?@?"; |
| | | if ($verbose){ |
| | | echo $query ."\n"; |
| | | } |
| | | if(!$this->dbmaster->query($query)) { |
| | | if(!$this->dbmaster->query($query, $value['db'] . '.sys_datalog', $value['user'], $host)) { |
| | | $this->warning('Unable to set rights of user in master database: '.$value['db']."\n Query: ".$query."\n Error: ".$this->dbmaster->errorMessage); |
| | | } |
| | | |
| | | $query = "GRANT SELECT, UPDATE(`status`) ON ".$value['db'].".`software_update_inst` TO '".$value['user']."'@'".$host."' "; |
| | | $query = "GRANT SELECT, UPDATE(`status`) ON ?? TO ?@?"; |
| | | if ($verbose){ |
| | | echo $query ."\n"; |
| | | } |
| | | if(!$this->dbmaster->query($query)) { |
| | | if(!$this->dbmaster->query($query, $value['db'] . '.software_update_inst', $value['user'], $host)) { |
| | | $this->warning('Unable to set rights of user in master database: '.$value['db']."\n Query: ".$query."\n Error: ".$this->dbmaster->errorMessage); |
| | | } |
| | | |
| | | $query = "GRANT SELECT, UPDATE(`updated`) ON ".$value['db'].".`server` TO '".$value['user']."'@'".$host."' "; |
| | | $query = "GRANT SELECT, UPDATE(`updated`) ON ?? TO ?@?"; |
| | | if ($verbose){ |
| | | echo $query ."\n"; |
| | | } |
| | | if(!$this->dbmaster->query($query)) { |
| | | if(!$this->dbmaster->query($query, $value['db'] . '.server', $value['user'], $host)) { |
| | | $this->warning('Unable to set rights of user in master database: '.$value['db']."\n Query: ".$query."\n Error: ".$this->dbmaster->errorMessage); |
| | | } |
| | | |
| | | $query = "GRANT SELECT, UPDATE (`ssl_request`, `ssl_cert`, `ssl_action`, `ssl_key`) ON ".$value['db'].".`web_domain` TO '".$value['user']."'@'".$host."' "; |
| | | $query = "GRANT SELECT, UPDATE (`ssl_request`, `ssl_cert`, `ssl_action`, `ssl_key`) ON ?? TO ?@?"; |
| | | if ($verbose){ |
| | | echo $query ."\n"; |
| | | } |
| | | if(!$this->dbmaster->query($query)) { |
| | | if(!$this->dbmaster->query($query, $value['db'] . '.web_domain', $value['user'], $host)) { |
| | | $this->warning('Unable to set rights of user in master database: '.$value['db']."\n Query: ".$query."\n Error: ".$this->dbmaster->errorMessage); |
| | | } |
| | | |
| | | $query = "GRANT SELECT ON ".$value['db'].".`sys_group` TO '".$value['user']."'@'".$host."' "; |
| | | $query = "GRANT SELECT ON ?? TO ?@?"; |
| | | if ($verbose){ |
| | | echo $query ."\n"; |
| | | } |
| | | if(!$this->dbmaster->query($query)) { |
| | | if(!$this->dbmaster->query($query, $value['db'] . '.sys_group', $value['user'], $host)) { |
| | | $this->warning('Unable to set rights of user in master database: '.$value['db']."\n Query: ".$query."\n Error: ".$this->dbmaster->errorMessage); |
| | | } |
| | | |
| | | $query = "GRANT SELECT, UPDATE (`action_state`, `response`) ON ".$value['db'].".`sys_remoteaction` TO '".$value['user']."'@'".$host."' "; |
| | | $query = "GRANT SELECT, UPDATE (`action_state`, `response`) ON ?? TO ?@?"; |
| | | if ($verbose){ |
| | | echo $query ."\n"; |
| | | } |
| | | if(!$this->dbmaster->query($query)) { |
| | | if(!$this->dbmaster->query($query, $value['db'] . '.sys_remoteaction', $value['user'], $host)) { |
| | | $this->warning('Unable to set rights of user in master database: '.$value['db']."\n Query: ".$query."\n Error: ".$this->dbmaster->errorMessage); |
| | | } |
| | | |
| | | $query = "GRANT SELECT, INSERT , DELETE ON ".$value['db'].".`monitor_data` TO '".$value['user']."'@'".$host."' "; |
| | | $query = "GRANT SELECT, INSERT , DELETE ON ?? TO ?@?"; |
| | | if ($verbose){ |
| | | echo $query ."\n"; |
| | | } |
| | | if(!$this->dbmaster->query($query)) { |
| | | if(!$this->dbmaster->query($query, $value['db'] . '.monitor_data', $value['user'], $host)) { |
| | | $this->warning('Unable to set rights of user in master database: '.$value['db']."\n Query: ".$query."\n Error: ".$this->dbmaster->errorMessage); |
| | | } |
| | | |
| | | $query = "GRANT SELECT, INSERT, UPDATE ON ".$value['db'].".`mail_traffic` TO '".$value['user']."'@'".$host."' "; |
| | | $query = "GRANT SELECT, INSERT, UPDATE ON ?? TO ?@?"; |
| | | if ($verbose){ |
| | | echo $query ."\n"; |
| | | } |
| | | if(!$this->dbmaster->query($query)) { |
| | | if(!$this->dbmaster->query($query, $value['db'] . '.mail_traffic', $value['user'], $host)) { |
| | | $this->warning('Unable to set rights of user in master database: '.$value['db']."\n Query: ".$query."\n Error: ".$this->dbmaster->errorMessage); |
| | | } |
| | | |
| | | $query = "GRANT SELECT, INSERT, UPDATE ON ".$value['db'].".`web_traffic` TO '".$value['user']."'@'".$host."' "; |
| | | $query = "GRANT SELECT, INSERT, UPDATE ON ?? TO ?@?"; |
| | | if ($verbose){ |
| | | echo $query ."\n"; |
| | | } |
| | | if(!$this->dbmaster->query($query)) { |
| | | if(!$this->dbmaster->query($query, $value['db'] . '.web_traffic', $value['user'], $host)) { |
| | | $this->warning('Unable to set rights of user in master database: '.$value['db']."\n Query: ".$query."\n Error: ".$this->dbmaster->errorMessage); |
| | | } |
| | | |
| | | $query = "GRANT SELECT, UPDATE, DELETE ON ".$value['db'].".`aps_instances` TO '".$value['user']."'@'".$host."' "; |
| | | $query = "GRANT SELECT, UPDATE, DELETE ON ?? TO ?@?"; |
| | | if ($verbose){ |
| | | echo $query ."\n"; |
| | | } |
| | | if(!$this->dbmaster->query($query)) { |
| | | if(!$this->dbmaster->query($query, $value['db'] . '.aps_instances', $value['user'], $host)) { |
| | | $this->warning('Unable to set rights of user in master database: '.$value['db']."\n Query: ".$query."\n Error: ".$this->dbmaster->errorMessage); |
| | | } |
| | | |
| | | $query = "GRANT SELECT, DELETE ON ".$value['db'].".`aps_instances_settings` TO '".$value['user']."'@'".$host."' "; |
| | | $query = "GRANT SELECT, DELETE ON ?? TO ?@?"; |
| | | if ($verbose){ |
| | | echo $query ."\n"; |
| | | } |
| | | if(!$this->dbmaster->query($query)) { |
| | | if(!$this->dbmaster->query($query, $value['db'] . '.aps_instances_settings', $value['user'], $host)) { |
| | | $this->warning('Unable to set rights of user in master database: '.$value['db']."\n Query: ".$query."\n Error: ".$this->dbmaster->errorMessage); |
| | | } |
| | | |
| | | $query = "GRANT SELECT, INSERT, DELETE ON ".$value['db'].".`web_backup` TO '".$value['user']."'@'".$host."' "; |
| | | $query = "GRANT SELECT, INSERT, DELETE ON ?? TO ?@?"; |
| | | if ($verbose){ |
| | | echo $query ."\n"; |
| | | } |
| | | if(!$this->dbmaster->query($query)) { |
| | | if(!$this->dbmaster->query($query, $value['db'] . '.web_backup', $value['user'], $host)) { |
| | | $this->warning('Unable to set rights of user in master database: '.$value['db']."\n Query: ".$query."\n Error: ".$this->dbmaster->errorMessage); |
| | | } |
| | | |
| | | $query = "GRANT SELECT, INSERT, DELETE ON ".$value['db'].".`mail_backup` TO '".$value['user']."'@'".$host."' "; |
| | | $query = "GRANT SELECT, INSERT, DELETE ON ?? TO ?@?"; |
| | | if ($verbose){ |
| | | echo $query ."\n"; |
| | | } |
| | | if(!$this->dbmaster->query($query)) { |
| | | if(!$this->dbmaster->query($query, $value['db'] . '.mail_backup', $value['user'], $host)) { |
| | | $this->warning('Unable to set rights of user in master database: '.$value['db']."\n Query: ".$query."\n Error: ".$this->dbmaster->errorMessage); |
| | | } |
| | | } |
| | |
| | | /* |
| | | * It is all done. Relod the rights... |
| | | */ |
| | | $this->dbmaster->query('FLUSH PRIVILEGES;'); |
| | | $this->dbmaster->query('FLUSH PRIVILEGES'); |
| | | } |
| | | |
| | | } |
| | |
| | | if (trim($line) != '' && substr($line, 0, 1) != '#') |
| | | { |
| | | @list($key, $value) = @explode("=", $line); |
| | | if (!empty($value)) |
| | | if (isset($value) && $value !== '') |
| | | { |
| | | $key = rtrim($key); |
| | | $old_options[$key] = trim($value); |
| | |
| | | } else { |
| | | copy('tpl/mailman-virtual_to_transport.sh', $full_file_name); |
| | | } |
| | | chgrp($full_file_name, 'list'); |
| | | chgrp($full_file_name, $this->mailman_group); |
| | | chmod($full_file_name, 0755); |
| | | } |
| | | |
| | | //* Create aliasaes |
| | | exec('/usr/lib/mailman/bin/genaliases 2>/dev/null'); |
| | | 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')) touch('/var/lib/mailman/data/transport-mailman'); |
| | | exec('/usr/sbin/postmap /var/lib/mailman/data/transport-mailman'); |
| | | } |
| | | |
| | | //* with postfix >= 2.9 we can detect configured services with postconf |
| | | public function postfix_master() { |
| | | exec("postconf -M", $out, $ret); |
| | | return $ret===0?true:false; |
| | | } |
| | | |
| | | public function configure_postfix($options = '') { |
| | |
| | | |
| | | //* mysql-virtual_sender.cf |
| | | $this->process_postfix_config('mysql-virtual_sender.cf'); |
| | | |
| | | //* mysql-virtual_sender_login_maps.cf |
| | | $this->process_postfix_config('mysql-virtual_sender_login_maps.cf'); |
| | | |
| | | //* mysql-virtual_client.cf |
| | | $this->process_postfix_config('mysql-virtual_client.cf'); |
| | |
| | | if(!is_user($cf['vmail_username'])) caselog("$command &> /dev/null", __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); |
| | | |
| | | //* These postconf commands will be executed on installation and update |
| | | $server_ini_rec = $this->db->queryOneRecord("SELECT config FROM `" . $this->db->quote($conf["mysql"]["database"]) . "`.`server` WHERE server_id = ".$conf['server_id']); |
| | | $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); |
| | | |
| | |
| | | } |
| | | } |
| | | unset($rbl_hosts); |
| | | unset($server_ini_array); |
| | | |
| | | //* If Postgrey is installed, configure it |
| | | $greylisting = ''; |
| | | if($conf['postgrey']['installed'] == true) { |
| | | $greylisting = 'check_recipient_access mysql:/etc/postfix/mysql-virtual_policy_greylist.cf'; |
| | | $greylisting = ', check_recipient_access mysql:/etc/postfix/mysql-virtual_policy_greylist.cf'; |
| | | } |
| | | |
| | | $reject_sender_login_mismatch = ''; |
| | | if(isset($server_ini_array['mail']['reject_sender_login_mismatch']) && ($server_ini_array['mail']['reject_sender_login_mismatch'] == 'y')) { |
| | | $reject_sender_login_mismatch = ', reject_authenticated_sender_login_mismatch'; |
| | | } |
| | | unset($server_ini_array); |
| | | |
| | | $postconf_placeholders = array('{config_dir}' => $config_dir, |
| | | '{vmail_mailbox_base}' => $cf['vmail_mailbox_base'], |
| | |
| | | '{vmail_groupid}' => $cf['vmail_groupid'], |
| | | '{rbl_list}' => $rbl_list, |
| | | '{greylisting}' => $greylisting, |
| | | '{reject_slm}' => $reject_sender_login_mismatch, |
| | | ); |
| | | |
| | | $postconf_tpl = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/debian_postfix.conf.master', 'tpl/debian_postfix.conf.master'); |
| | |
| | | $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); |
| | | |
| | | //* Changing maildrop lines in posfix master.cf |
| | | if(is_file($config_dir.'/master.cf')) { |
| | | copy($config_dir.'/master.cf', $config_dir.'/master.cf~'); |
| | | } |
| | | if(is_file($config_dir.'/master.cf~')) { |
| | | chmod($config_dir.'/master.cf~', 0400); |
| | | } |
| | | //* 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'; |
| | | $content = rf($configfile); |
| | | $content = str_replace('flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}', |
| | | 'flags=DRhu user='.$cf['vmail_username'].' argv=/usr/bin/maildrop -d '.$cf['vmail_username'].' ${extension} ${recipient} ${user} ${nexthop} ${sender}', |
| | | $content); |
| | | wf($configfile, $content); |
| | | if ($this->postfix_master()) { |
| | | exec ("postconf -M maildrop.unix", $out, $ret); |
| | | $change_maildrop_flags = @(preg_match($regex, $out[0]) && $out[0] !='')?false:true; |
| | | } else { //* fallback - postfix < 2.9 |
| | | $change_maildrop_flags = @(preg_match($regex, $configfile))?false:true; |
| | | } |
| | | if ($change_maildrop_flags) { |
| | | //* Change maildrop service in posfix master.cf |
| | | if(is_file($config_dir.'/master.cf')) { |
| | | copy($config_dir.'/master.cf', $config_dir.'/master.cf~'); |
| | | } |
| | | if(is_file($config_dir.'/master.cf~')) { |
| | | chmod($config_dir.'/master.cf~', 0400); |
| | | } |
| | | $configfile = $config_dir.'/master.cf'; |
| | | $content = rf($configfile); |
| | | $content = str_replace('flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}', |
| | | 'flags=DRhu user='.$cf['vmail_username'].' argv=/usr/bin/maildrop -d '.$cf['vmail_username'].' ${extension} ${recipient} ${user} ${nexthop} ${sender}', |
| | | $content); |
| | | wf($configfile, $content); |
| | | } |
| | | |
| | | //* Writing the Maildrop mailfilter file |
| | | $configfile = 'mailfilter'; |
| | |
| | | unset($parts); |
| | | unset($out); |
| | | |
| | | if(version_compare($saslversion , '2.1.23') > 0) { |
| | | //* Configfile for saslauthd versions 2.1.24 and newer |
| | | $configfile = 'sasl_smtpd2.conf'; |
| | | } else { |
| | | 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~'); |
| | |
| | | $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); |
| | |
| | | global $conf; |
| | | |
| | | $virtual_transport = 'dovecot'; |
| | | |
| | | $configure_lmtp = false; |
| | | |
| | | // check if virtual_transport must be changed |
| | | if ($this->is_update) { |
| | | $tmp = $this->db->queryOneRecord("SELECT * FROM ".$conf["mysql"]["database"].".server WHERE server_id = ".$conf['server_id']); |
| | | $tmp = $this->db->queryOneRecord("SELECT * FROM ?? WHERE server_id = ?", $conf["mysql"]["database"] . ".server", $conf['server_id']); |
| | | $ini_array = ini_to_array(stripslashes($tmp['config'])); |
| | | // ini_array needs not to be checked, because already done in update.php -> updateDbAndIni() |
| | | |
| | | if(isset($ini_array['mail']['mailbox_virtual_uidgid_maps']) && $ini_array['mail']['mailbox_virtual_uidgid_maps'] == 'y') { |
| | | $virtual_transport = 'lmtp:unix:private/dovecot-lmtp'; |
| | | $configure_lmtp = true; |
| | | } |
| | | } |
| | | |
| | | $config_dir = $conf['dovecot']['config_dir']; |
| | | |
| | | $config_dir = $conf['postfix']['config_dir']; |
| | | //* Configure master.cf and add a line for deliver |
| | | if(is_file($conf['postfix']['config_dir'].'/master.cf')) { |
| | | copy($conf['postfix']['config_dir'].'/master.cf', $conf['postfix']['config_dir'].'/master.cf~2'); |
| | | if ($this->postfix_master()) { |
| | | exec ("postconf -M dovecot.unix", $out, $ret); |
| | | $add_dovecot_service = @($out[0]=='')?true:false; |
| | | } else { //* fallback - postfix < 2.9 |
| | | $content = rf($config_dir.'/master.cf'); |
| | | $add_dovecot_service = @(!stristr($content, "dovecot/deliver"))?true:false; |
| | | } |
| | | if($add_dovecot_service) { |
| | | //* backup |
| | | if(is_file($config_dir.'/master.cf')){ |
| | | copy($config_dir.'/master.cf', $config_dir.'/master.cf~2'); |
| | | } |
| | | if(is_file($config_dir.'/master.cf~')){ |
| | | chmod($config_dir.'/master.cf~2', 0400); |
| | | } |
| | | //* Configure master.cf and add a line for deliver |
| | | $content = rf($conf["postfix"]["config_dir"].'/master.cf'); |
| | | $deliver_content = 'dovecot unix - n n - - pipe'."\n".' flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${user}@${nexthop}'; |
| | | af($config_dir.'/master.cf', $deliver_content); |
| | | unset($content); |
| | | unset($deliver_content); |
| | | } |
| | | if(is_file($conf['postfix']['config_dir'].'/master.cf~')) { |
| | | chmod($conf['postfix']['config_dir'].'/master.cf~2', 0400); |
| | | } |
| | | $content = rf($conf['postfix']['config_dir'].'/master.cf'); |
| | | // Only add the content if we had not addded it before |
| | | if(!stristr($content, 'dovecot/deliver')) { |
| | | $deliver_content = 'dovecot unix - n n - - pipe'."\n".' flags=DROhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${user}@${nexthop}'; |
| | | af($conf['postfix']['config_dir'].'/master.cf', $deliver_content); |
| | | } |
| | | unset($content); |
| | | unset($deliver_content); |
| | | |
| | | |
| | | //* Reconfigure postfix to use dovecot authentication |
| | | // Adding the amavisd commands to the postfix configuration |
| | |
| | | } |
| | | |
| | | //* backup dovecot.conf |
| | | $config_dir = $conf['dovecot']['config_dir']; |
| | | $configfile = 'dovecot.conf'; |
| | | if(is_file($config_dir.'/'.$configfile)) { |
| | | copy($config_dir.'/'.$configfile, $config_dir.'/'.$configfile.'~'); |
| | |
| | | unset($tmp); |
| | | |
| | | //* Copy dovecot configuration file |
| | | if(version_compare($dovecot_version,2) >= 0) { |
| | | if(version_compare($dovecot_version,1, '<=')) { //* Dovecot 1.x |
| | | if(is_file($conf['ispconfig_install_dir'].'/server/conf-custom/install/debian_dovecot.conf.master')) { |
| | | copy($conf['ispconfig_install_dir'].'/server/conf-custom/install/debian_dovecot.conf.master', $config_dir.'/'.$configfile); |
| | | } else { |
| | | copy('tpl/debian_dovecot.conf.master', $config_dir.'/'.$configfile); |
| | | } |
| | | } else { //* Dovecot 2.x |
| | | if(is_file($conf['ispconfig_install_dir'].'/server/conf-custom/install/debian_dovecot2.conf.master')) { |
| | | copy($conf['ispconfig_install_dir'].'/server/conf-custom/install/debian_dovecot2.conf.master', $config_dir.'/'.$configfile); |
| | | } else { |
| | | copy('tpl/debian_dovecot2.conf.master', $config_dir.'/'.$configfile); |
| | | } |
| | | replaceLine($config_dir.'/'.$configfile, 'postmaster_address = postmaster@example.com', 'postmaster_address = postmaster@'.$conf['hostname'], 1, 0); |
| | | if(version_compare($dovecot_version,2.1) < 0) { |
| | | if(version_compare($dovecot_version, 2.1, '<')) { |
| | | removeLine($config_dir.'/'.$configfile, 'ssl_protocols ='); |
| | | } |
| | | } else { |
| | | if(is_file($conf['ispconfig_install_dir'].'/server/conf-custom/install/debian_dovecot.conf.master')) { |
| | | copy($conf['ispconfig_install_dir'].'/server/conf-custom/install/debian_dovecot.conf.master', $config_dir.'/'.$configfile); |
| | | } else { |
| | | copy('tpl/debian_dovecot.conf.master', $config_dir.'/'.$configfile); |
| | | } |
| | | } |
| | | |
| | | //* dovecot-lmtpd |
| | | if($configure_lmtp) { |
| | | replaceLine($config_dir.'/'.$configfile, 'protocols = imap pop3', 'protocols = imap pop3 lmtp', 1, 0); |
| | | } |
| | | |
| | | //* dovecot-sql.conf |
| | |
| | | $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); |
| | | $content = str_replace('{server_id}', $conf['server_id'], $content); |
| | | wf($config_dir.'/'.$configfile, $content); |
| | | |
| | |
| | | // amavisd user config file |
| | | $configfile = 'amavisd_user_config'; |
| | | if(is_file($conf['amavis']['config_dir'].'/conf.d/50-user')) copy($conf['amavis']['config_dir'].'/conf.d/50-user', $conf['amavis']['config_dir'].'/50-user~'); |
| | | if(is_file($conf['amavis']['config_dir'].'/conf.d/50-user~')) chmod($conf['amavis']['config_dir'].'/conf.d/50-user~', 0400); |
| | | if(is_file($conf['amavis']['config_dir'].'/conf.d/50-user~')) chmod($conf['amavis']['config_dir'].'/50-user~', 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_port}', $conf['mysql']['port'], $content); |
| | | $content = str_replace('{mysql_server_ip}', $conf['mysql']['ip'], $content); |
| | | wf($conf['amavis']['config_dir'].'/conf.d/50-user', $content); |
| | | chmod($conf['amavis']['config_dir'].'/conf.d/50-user', 0640); |
| | | |
| | | // TODO: chmod and chown on the config file |
| | | |
| | |
| | | caselog($command." &> /dev/null", __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); |
| | | } |
| | | |
| | | // Append the configuration for amavisd to the master.cf file |
| | | if(is_file($conf['postfix']['config_dir'].'/master.cf')) copy($conf['postfix']['config_dir'].'/master.cf', $conf['postfix']['config_dir'].'/master.cf~'); |
| | | $content = rf($conf['postfix']['config_dir'].'/master.cf'); |
| | | // Only add the content if we had not addded it before |
| | | if(!preg_match('/^amavis\s+unix\s+/m', $content)) { |
| | | unset($content); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/master_cf_amavis.master', 'tpl/master_cf_amavis.master'); |
| | | af($conf['postfix']['config_dir'].'/master.cf', $content); |
| | | $content = rf($conf['postfix']['config_dir'].'/master.cf'); |
| | | $config_dir = $conf['postfix']; |
| | | |
| | | // Adding amavis-services to the master.cf file if the service does not already exists |
| | | if ($this->postfix_master()) { |
| | | exec ("postconf -M amavis.unix", $out, $ret); |
| | | $add_amavis = @($out[0]=='')?true:false; |
| | | unset($out); |
| | | exec ("postconf -M 127.0.0.1:10025.inet", $out, $ret); |
| | | $add_amavis_10025 = @($out[0]=='')?true:false; |
| | | unset($out); |
| | | exec ("postconf -M 127.0.0.1:10027.inet", $out, $ret); |
| | | $add_amavis_10027 = @($out[0]=='')?true:false; |
| | | unset($out); |
| | | } else { //* fallback - postfix < 2.9 |
| | | $content = rf($conf['postfix']['config_dir'].'/master.cf'); |
| | | $add_amavis = @(!preg_match('/^amavis\s+unix\s+/m', $content))?true:false; |
| | | $add_amavis_10025 = @(!preg_match('/^127.0.0.1:10025\s+/m', $content))?true:false; |
| | | $add_amavis_10027 = @(!preg_match('/^127.0.0.1:10027\s+/m', $content))?true:false; |
| | | } |
| | | if(!preg_match('/^127.0.0.1:10025\s+/m', $content)) { |
| | | unset($content); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/master_cf_amavis10025.master', 'tpl/master_cf_amavis10025.master'); |
| | | af($conf['postfix']['config_dir'].'/master.cf', $content); |
| | | $content = rf($conf['postfix']['config_dir'].'/master.cf'); |
| | | |
| | | if ($add_amavis || $add_amavis_10025 || $add_amavis_10027) { |
| | | //* backup master.cf |
| | | if(is_file($config_dir.'/master.cf')) copy($config_dir.'/master.cf', $config_dir.'/master.cf~'); |
| | | // adjust amavis-config |
| | | if($add_amavis) { |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/master_cf_amavis.master', 'tpl/master_cf_amavis.master'); |
| | | af($config_dir.'/master.cf', $content); |
| | | unset($content); |
| | | } |
| | | if ($add_amavis_10025) { |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/master_cf_amavis10025.master', 'tpl/master_cf_amavis10025.master'); |
| | | af($config_dir.'/master.cf', $content); |
| | | unset($content); |
| | | } |
| | | if ($add_amavis_10027) { |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/master_cf_amavis10027.master', 'tpl/master_cf_amavis10027.master'); |
| | | af($config_dir.'/master.cf', $content); |
| | | unset($content); |
| | | } |
| | | } |
| | | if(!preg_match('/^127.0.0.1:10027\s+/m', $content)) { |
| | | unset($content); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/master_cf_amavis10027.master', 'tpl/master_cf_amavis10027.master'); |
| | | af($conf['postfix']['config_dir'].'/master.cf', $content); |
| | | } |
| | | unset($content); |
| | | |
| | | // Add the clamav user to the amavis group |
| | | exec('adduser clamav amavis'); |
| | |
| | | $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); |
| | | $content = str_replace('{server_id}', $conf['server_id'], $content); |
| | | wf($conf['mydns']['config_dir'].'/'.$configfile, $content); |
| | | chmod($conf['mydns']['config_dir'].'/'.$configfile, 0600); |
| | |
| | | global $conf; |
| | | |
| | | //* Create the database |
| | | if(!$this->db->query('CREATE DATABASE IF NOT EXISTS '.$conf['powerdns']['database'].' DEFAULT CHARACTER SET '.$conf['mysql']['charset'])) { |
| | | if(!$this->db->query('CREATE DATABASE IF NOT EXISTS ?? DEFAULT CHARACTER SET ?', $conf['powerdns']['database'], $conf['mysql']['charset'])) { |
| | | $this->error('Unable to create MySQL database: '.$conf['powerdns']['database'].'.'); |
| | | } |
| | | |
| | | //* Create the ISPConfig database user in the local database |
| | | $query = "GRANT ALL ON `".$conf['powerdns']['database']."` . * TO '".$conf['mysql']['ispconfig_user']."'@'localhost';"; |
| | | if(!$this->db->query($query)) { |
| | | $query = "GRANT ALL ON ?? TO ?@'localhost'"; |
| | | if(!$this->db->query($query, $conf['powerdns']['database'] . '.*', $conf['mysql']['ispconfig_user'])) { |
| | | $this->error('Unable to create user for powerdns database Error: '.$this->db->errorMessage); |
| | | } |
| | | |
| | | //* Reload database privelages |
| | | $this->db->query('FLUSH PRIVILEGES;'); |
| | | $this->db->query('FLUSH PRIVILEGES'); |
| | | |
| | | //* load the powerdns databse dump |
| | | if($conf['mysql']['admin_password'] == '') { |
| | |
| | | $content = str_replace('{mysql_server_ispconfig_password}', $conf['mysql']['ispconfig_password'], $content); |
| | | $content = str_replace('{powerdns_database}', $conf['powerdns']['database'], $content); |
| | | $content = str_replace('{mysql_server_host}', $conf['mysql']['host'], $content); |
| | | $content = str_replace('{mysql_server_port}', $conf['mysql']['port'], $content); |
| | | wf($conf['powerdns']['config_dir'].'/'.$configfile, $content); |
| | | chmod($conf['powerdns']['config_dir'].'/'.$configfile, 0600); |
| | | chown($conf['powerdns']['config_dir'].'/'.$configfile, 'root'); |
| | |
| | | |
| | | //* Create the slave subdirectory |
| | | $content .= 'slave'; |
| | | if(!@is_dir($content)) mkdir($content, 0770, true); |
| | | if(!@is_dir($content)) mkdir($content, 2770, true); |
| | | |
| | | //* Chown the slave subdirectory to $conf['bind']['bind_user'] |
| | | chown($content, $conf['bind']['bind_user']); |
| | | chgrp($content, $conf['bind']['bind_group']); |
| | | chmod($content, 2770); |
| | | |
| | | } |
| | | |
| | | |
| | | public function configure_xmpp($options = '') { |
| | | global $conf; |
| | | |
| | | if($conf['xmpp']['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('metronome_conf_main.master'); |
| | | wf('/etc/metronome/metronome.cfg.lua', $tpl->grab()); |
| | | unset($tpl); |
| | | |
| | | $tpl = new tpl('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/metronome_libs/* /usr/lib/metronome/isp-modules/', __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 |
| | | echo "writing new private key to 'localhost.key'\n-----\n"; |
| | | $ssl_country = $this->free_query('Country Name (2 letter code)', 'AU'); |
| | | $ssl_locality = $this->free_query('Locality Name (eg, city)', ''); |
| | | $ssl_organisation = $this->free_query('Organization Name (eg, company)', 'Internet Widgits Pty Ltd'); |
| | | $ssl_organisation_unit = $this->free_query('Organizational Unit Name (eg, section)', ''); |
| | | $ssl_domain = $this->free_query('Common Name (e.g. server FQDN or YOUR name)', $conf['hostname']); |
| | | $ssl_email = $this->free_query('Email Address', ''); |
| | | |
| | | $tpl = new tpl('metronome_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'); |
| | | }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('xmpp', 'restart')); |
| | | |
| | | /* |
| | | writing new private key to 'smtpd.key' |
| | | ----- |
| | | You are about to be asked to enter information that will be incorporated |
| | | into your certificate request. |
| | | What you are about to enter is what is called a Distinguished Name or a DN. |
| | | There are quite a few fields but you can leave some blank |
| | | For some fields there will be a default value, |
| | | If you enter '.', the field will be left blank. |
| | | ----- |
| | | Country Name (2 letter code) [AU]: |
| | | State or Province Name (full name) [Some-State]: |
| | | Locality Name (eg, city) []: |
| | | Organization Name (eg, company) [Internet Widgits Pty Ltd]: |
| | | Organizational Unit Name (eg, section) []: |
| | | Common Name (e.g. server FQDN or YOUR name) []: |
| | | Email Address []: |
| | | * */ |
| | | |
| | | /*// Dont just copy over the virtualhost template but add some custom settings |
| | | $tpl = new tpl('apache_apps.vhost.master'); |
| | | |
| | | $tpl->setVar('apps_vhost_port',$conf['web']['apps_vhost_port']); |
| | | $tpl->setVar('apps_vhost_dir',$conf['web']['website_basedir'].'/apps'); |
| | | $tpl->setVar('apps_vhost_basedir',$conf['web']['website_basedir']); |
| | | $tpl->setVar('apps_vhost_servername',$apps_vhost_servername); |
| | | $tpl->setVar('apache_version',getapacheversion()); |
| | | |
| | | |
| | | // comment out the listen directive if port is 80 or 443 |
| | | if($conf['web']['apps_vhost_ip'] == 80 or $conf['web']['apps_vhost_ip'] == 443) { |
| | | $tpl->setVar('vhost_port_listen','#'); |
| | | } else { |
| | | $tpl->setVar('vhost_port_listen',''); |
| | | } |
| | | |
| | | wf($vhost_conf_dir.'/apps.vhost', $tpl->grab()); |
| | | unset($tpl);*/ |
| | | } |
| | | |
| | | |
| | | public function configure_apache() { |
| | |
| | | $tpl = new tpl('apache_ispconfig.conf.master'); |
| | | $tpl->setVar('apache_version',getapacheversion()); |
| | | |
| | | $records = $this->db->queryAllRecords('SELECT * FROM '.$conf['mysql']['master_database'].'.server_ip WHERE server_id = '.$conf['server_id']." AND virtualhost = 'y'"); |
| | | $records = $this->db->queryAllRecords("SELECT * FROM ?? WHERE server_id = ? AND virtualhost = 'y'", $conf['mysql']['master_database'] . '.server_ip', $conf['server_id']); |
| | | $ip_addresses = array(); |
| | | |
| | | if(is_array($records) && count($records) > 0) { |
| | |
| | | //* add a sshusers group |
| | | $command = 'groupadd sshusers'; |
| | | if(!is_group('sshusers')) caselog($command.' &> /dev/null 2> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); |
| | | |
| | | /* |
| | | $row = $this->db->queryOneRecord("SELECT server_name FROM server WHERE server_id = ".$conf["server_id"].""); |
| | | $ip_address = gethostbyname($row["server_name"]); |
| | | $server_name = $row["server_name"]; |
| | | |
| | | //setup proxy.conf |
| | | $configfile = 'proxy.conf'; |
| | | if(is_file($conf["nginx"]["config_dir"].'/'.$configfile)) copy($conf["nginx"]["config_dir"].'/'.$configfile,$conf["nginx"]["config_dir"].'/'.$configfile.'~'); |
| | | if(is_file($conf["nginx"]["config_dir"].'/'.$configfile.'~')) exec('chmod 400 '.$conf["nginx"]["config_dir"].'/'.$configfile.'~'); |
| | | $content = rf("tpl/nginx_".$configfile.".master"); |
| | | wf($conf["nginx"]["config_dir"].'/'.$configfile,$content); |
| | | exec('chmod 600 '.$conf["nginx"]["config_dir"].'/'.$configfile); |
| | | exec('chown root:root '.$conf["nginx"]["config_dir"].'/'.$configfile); |
| | | |
| | | //setup conf.d/cache.conf |
| | | $configfile = 'cache.conf'; |
| | | if(is_file($conf["nginx"]["config_dir"].'/conf.d/'.$configfile)) copy($conf["nginx"]["config_dir"].'/conf.d/'.$configfile,$conf["nginx"]["config_dir"].'/conf.d/'.$configfile.'~'); |
| | | if(is_file($conf["nginx"]["config_dir"].'/conf.d/'.$configfile.'~')) exec('chmod 400 '.$conf["nginx"]["config_dir"].'/conf.d/'.$configfile.'~'); |
| | | $content = rf("tpl/nginx_".$configfile.".master"); |
| | | wf($conf["nginx"]["config_dir"].'/conf.d/'.$configfile,$content); |
| | | exec('chmod 600 '.$conf["nginx"]["config_dir"].'/conf.d/'.$configfile); |
| | | exec('chown root:root '.$conf["nginx"]["config_dir"].'/conf.d/'.$configfile); |
| | | |
| | | //setup cache directories |
| | | mkdir('/var/cache/nginx/cache'); |
| | | exec('chown www-data:www-data /var/cache/nginx/cache'); |
| | | mkdir('/var/cache/nginx/temp'); |
| | | exec('chown www-data:www-data /var/cache/nginx/temp'); |
| | | */ |
| | | } |
| | | |
| | | public function configure_fail2ban() { |
| | |
| | | public function configure_squid() |
| | | { |
| | | global $conf; |
| | | $row = $this->db->queryOneRecord("SELECT server_name FROM server WHERE server_id = ".$conf["server_id"].""); |
| | | $row = $this->db->queryOneRecord("SELECT server_name FROM server WHERE server_id = ?", $conf["server_id"]); |
| | | $ip_address = gethostbyname($row["server_name"]); |
| | | $server_name = $row["server_name"]; |
| | | |
| | |
| | | $tcp_public_services = ''; |
| | | $udp_public_services = ''; |
| | | |
| | | $row = $this->db->queryOneRecord('SELECT * FROM '.$conf["mysql"]["database"].'.firewall WHERE server_id = '.intval($conf['server_id'])); |
| | | $row = $this->db->queryOneRecord('SELECT * FROM ?? WHERE server_id = ?', $conf["mysql"]["database"] . '.firewall', $conf['server_id']); |
| | | |
| | | if(trim($row['tcp_port']) != '' || trim($row['udp_port']) != '') { |
| | | $tcp_public_services = trim(str_replace(',', ' ', $row['tcp_port'])); |
| | |
| | | |
| | | if(!stristr($tcp_public_services, $conf['apache']['vhost_port'])) { |
| | | $tcp_public_services .= ' '.intval($conf['apache']['vhost_port']); |
| | | if($row['tcp_port'] != '') $this->db->query("UPDATE firewall SET tcp_port = tcp_port + ',".intval($conf['apache']['vhost_port'])."' WHERE server_id = ".intval($conf['server_id'])); |
| | | if($row['tcp_port'] != '') $this->db->query("UPDATE firewall SET tcp_port = tcp_port + ? WHERE server_id = ?", ',' . intval($conf['apache']['vhost_port']), $conf['server_id']); |
| | | } |
| | | |
| | | $content = str_replace('{TCP_PUBLIC_SERVICES}', $tcp_public_services, $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); |
| | | |
| | | $content = str_replace('{mysql_master_server_ispconfig_user}', $conf['mysql']['master_ispconfig_user'], $content); |
| | | $content = str_replace('{mysql_master_server_ispconfig_password}', $conf['mysql']['master_ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_master_server_database}', $conf['mysql']['master_database'], $content); |
| | | $content = str_replace('{mysql_master_server_host}', $conf['mysql']['master_host'], $content); |
| | | $content = str_replace('{mysql_master_server_port}', $conf['mysql']['master_port'], $content); |
| | | |
| | | $content = str_replace('{server_id}', $conf['server_id'], $content); |
| | | $content = str_replace('{ispconfig_log_priority}', $conf['ispconfig_log_priority'], $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); |
| | | |
| | | $content = str_replace('{mysql_master_server_ispconfig_user}', $conf['mysql']['master_ispconfig_user'], $content); |
| | | $content = str_replace('{mysql_master_server_ispconfig_password}', $conf['mysql']['master_ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_master_server_database}', $conf['mysql']['master_database'], $content); |
| | | $content = str_replace('{mysql_master_server_host}', $conf['mysql']['master_host'], $content); |
| | | $content = str_replace('{mysql_master_server_port}', $conf['mysql']['master_port'], $content); |
| | | |
| | | $content = str_replace('{server_id}', $conf['server_id'], $content); |
| | | $content = str_replace('{ispconfig_log_priority}', $conf['ispconfig_log_priority'], $content); |
| | |
| | | $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' WHERE server_id = ".intval($conf['server_id']); |
| | | $sql = "UPDATE `server` SET mail_server = '$mail_server_enabled', web_server = '$web_server_enabled', dns_server = '$dns_server_enabled', file_server = '$file_server_enabled', db_server = '$db_server_enabled', vserver_server = '$vserver_server_enabled', proxy_server = '$proxy_server_enabled', firewall_server = '$firewall_server_enabled', xmpp_server = '.$xmpp_server_enabled.' WHERE server_id = ?"; |
| | | |
| | | $this->db->query($sql, $conf['server_id']); |
| | | if($conf['mysql']['master_slave_setup'] == 'y') { |
| | | $this->dbmaster->query($sql); |
| | | $this->db->query($sql); |
| | | } else { |
| | | $this->db->query($sql); |
| | | $this->dbmaster->query($sql, $conf['server_id']); |
| | | } |
| | | |
| | | |
| | |
| | | //* Make the shell scripts executable |
| | | $command = "chmod +x $install_dir/server/scripts/*.sh"; |
| | | caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); |
| | | |
| | | if ($this->install_ispconfig_interface == true && isset($conf['interface_password']) && $conf['interface_password']!='admin') { |
| | | $sql = "UPDATE sys_user SET passwort = md5(?) WHERE username = 'admin';"; |
| | | $this->db->query($sql, $conf['interface_password']); |
| | | } |
| | | |
| | | if($conf['apache']['installed'] == true && $this->install_ispconfig_interface == true){ |
| | | //* Copy the ISPConfig vhost for the controlpanel |
| | |
| | | // Add symlink for patch tool |
| | | if(!is_link('/usr/local/bin/ispconfig_patch')) exec('ln -s /usr/local/ispconfig/server/scripts/ispconfig_patch /usr/local/bin/ispconfig_patch'); |
| | | |
| | | // Change mode of a few files from amavisd |
| | | if(is_file($conf['amavis']['config_dir'].'/conf.d/50-user')) chmod($conf['amavis']['config_dir'].'/conf.d/50-user', 0640); |
| | | if(is_file($conf['amavis']['config_dir'].'/50-user~')) chmod($conf['amavis']['config_dir'].'/50-user~', 0400); |
| | | if(is_file($conf['amavis']['config_dir'].'/amavisd.conf')) chmod($conf['amavis']['config_dir'].'/amavisd.conf', 0640); |
| | | if(is_file($conf['amavis']['config_dir'].'/amavisd.conf~')) chmod($conf['amavis']['config_dir'].'/amavisd.conf~', 0400); |
| | | } |
| | | |
| | | public function configure_dbserver() { |
| | |
| | | |
| | | } |
| | | |
| | | public function create_mount_script(){ |
| | | global $app, $conf; |
| | | $mount_script = '/usr/local/ispconfig/server/scripts/backup_dir_mount.sh'; |
| | | $mount_command = ''; |
| | | |
| | | if(is_file($mount_script)) return; |
| | | if(is_file('/etc/rc.local')){ |
| | | $rc_local = file('/etc/rc.local'); |
| | | if(is_array($rc_local) && !empty($rc_local)){ |
| | | foreach($rc_local as $line){ |
| | | $line = trim($line); |
| | | if(substr($line, 0, 1) == '#') continue; |
| | | if(strpos($line, 'sshfs') !== false && strpos($line, '/var/backup') !== false){ |
| | | $mount_command = "#!/bin/sh\n\n"; |
| | | $mount_command .= $line."\n\n"; |
| | | file_put_contents($mount_script, $mount_command); |
| | | chmod($mount_script, 0755); |
| | | chown($mount_script, 'root'); |
| | | chgrp($mount_script, 'root'); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | // This function is called at the end of the update process and contains code to clean up parts of old ISPCONfig releases |
| | | public function cleanup_ispconfig() { |
| | | global $app,$conf; |
| | |
| | | if(is_file('/usr/local/ispconfig/interface/lib/classes/db_firebird.inc.php')) unlink('/usr/local/ispconfig/interface/lib/classes/db_firebird.inc.php'); |
| | | if(is_file('/usr/local/ispconfig/interface/lib/classes/form.inc.php')) unlink('/usr/local/ispconfig/interface/lib/classes/form.inc.php'); |
| | | |
| | | |
| | | // Change mode of a few files from amavisd |
| | | if(is_file($conf['amavis']['config_dir'].'/conf.d/50-user')) chmod($conf['amavis']['config_dir'].'/conf.d/50-user', 0640); |
| | | if(is_file($conf['amavis']['config_dir'].'/50-user~')) chmod($conf['amavis']['config_dir'].'/50-user~', 0400); |
| | | if(is_file($conf['amavis']['config_dir'].'/amavisd.conf')) chmod($conf['amavis']['config_dir'].'/amavisd.conf', 0640); |
| | | if(is_file($conf['amavis']['config_dir'].'/amavisd.conf~')) chmod($conf['amavis']['config_dir'].'/amavisd.conf~', 0400); |
| | | |
| | | } |
| | | |
| | |
| | | $tContents = str_replace('{mysql_server_database}', $conf["mysql"]["database"], $tContents); |
| | | $tContents = str_replace('{mysql_server_ip}', $conf["mysql"]["ip"], $tContents); |
| | | $tContents = str_replace('{mysql_server_host}', $conf['mysql']['host'], $tContents); |
| | | $tContents = str_replace('{mysql_server_port}', $conf['mysql']['port'], $tContents); |
| | | $tContents = str_replace('{mysql_server_port}', $conf["mysql"]["port"], $tContents); |
| | | |
| | | return $tContents; |
| | |
| | | <?php |
| | | |
| | | /* |
| | | Copyright (c) 2007, Till Brehm, projektfarm Gmbh |
| | | All rights reserved. |
| | | Copyright (c) 2005, Till Brehm, projektfarm Gmbh |
| | | All rights reserved. |
| | | |
| | | Redistribution and use in source and binary forms, with or without modification, |
| | | are permitted provided that the following conditions are met: |
| | | 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. |
| | | * 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. |
| | | */ |
| | | 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. |
| | | */ |
| | | |
| | | class db |
| | | class db extends mysqli |
| | | { |
| | | var $dbHost = ""; // hostname of the MySQL server |
| | | var $dbName = ""; // logical database name on that server |
| | | var $dbUser = ""; // database authorized user |
| | | var $dbPass = ""; // user's password |
| | | var $dbCharset = ""; // what charset comes and goes to mysql: utf8 / latin1 |
| | | var $linkId = false; // last result of mysql_connect() |
| | | var $queryId = 0; // last result of mysql_query() |
| | | var $record = array(); // last record fetched |
| | | var $autoCommit = 1; // Autocommit Transactions |
| | | var $currentRow; // current row number |
| | | var $errorNumber = 0; // last error number |
| | | var $errorMessage = ""; // last error message |
| | | var $errorLocation = ""; // last error location |
| | | var $show_error_messages = false; |
| | | /**#@+ |
| | | * @access private |
| | | */ |
| | | private $_iQueryId; |
| | | private $_iConnId; |
| | | |
| | | // constructor |
| | | function db() |
| | | { |
| | | private $dbHost = ''; // hostname of the MySQL server |
| | | private $dbName = ''; // logical database name on that server |
| | | private $dbUser = ''; // database authorized user |
| | | private $dbPass = ''; // user's password |
| | | private $dbCharset = 'utf8';// Database charset |
| | | private $dbNewLink = false; // Return a new linkID when connect is called again |
| | | private $dbClientFlags = 0; // MySQL Client falgs |
| | | /**#@-*/ |
| | | |
| | | public $show_error_messages = false; // false in server, true in interface |
| | | |
| | | |
| | | /* old things - unused now //// |
| | | private $linkId = 0; // last result of mysqli_connect() |
| | | private $queryId = 0; // last result of mysqli_query() |
| | | private $record = array(); // last record fetched |
| | | private $autoCommit = 1; // Autocommit Transactions |
| | | private $currentRow; // current row number |
| | | public $errorNumber = 0; // last error number |
| | | public $errorMessage = ''; // last error message |
| | | private $errorLocation = '';// last error location |
| | | private $isConnected = false; // needed to know if we have a valid mysqli object from the constructor |
| | | //// |
| | | */ |
| | | |
| | | public function __destruct() { |
| | | if($this->_iConnId) mysqli_close($this->_iConnId); |
| | | } |
| | | |
| | | private function do_connect() { |
| | | global $conf; |
| | | |
| | | if($this->_iConnId) return true; |
| | | $this->dbHost = $conf["mysql"]["host"]; |
| | | //$this->dbName = $conf["mysql"]["database"]; |
| | | $this->dbName = false;//$conf["mysql"]["database"]; |
| | | $this->dbUser = $conf["mysql"]["admin_user"]; |
| | | $this->dbPass = $conf["mysql"]["admin_password"]; |
| | | $this->dbCharset = $conf["mysql"]["charset"]; |
| | | //$this->connect(); |
| | | } |
| | | $this->dbNewLink = false; |
| | | $this->dbClientFlags = null; |
| | | |
| | | $this->_iConnId = mysqli_connect($this->dbHost, $this->dbUser, $this->dbPass); |
| | | $try = 0; |
| | | while((!is_object($this->_iConnId) || mysqli_connect_error()) && $try < 5) { |
| | | if($try > 0) sleep(1); |
| | | |
| | | // error handler |
| | | function updateError($location) |
| | | { |
| | | $this->errorNumber = mysqli_errno($this->linkId); |
| | | $this->errorMessage = mysqli_error($this->linkId); |
| | | $this->errorLocation = $location; |
| | | if($this->errorNumber && $this->show_error_messages) |
| | | { |
| | | echo '<br /><b>'.$this->errorLocation.'</b><br />'.$this->errorMessage; |
| | | flush(); |
| | | $try++; |
| | | $this->_iConnId = mysqli_connect($this->dbHost, $this->dbUser, $this->dbPass); |
| | | } |
| | | |
| | | if(!is_object($this->_iConnId) || mysqli_connect_error()) { |
| | | $this->_iConnId = null; |
| | | $this->_sqlerror('Zugriff auf Datenbankserver fehlgeschlagen! / Database server not accessible!'); |
| | | return false; |
| | | } |
| | | |
| | | if($this->dbName) $this->setDBName($this->dbName); |
| | | |
| | | $this->_setCharset(); |
| | | } |
| | | |
| | | public function setDBData($host, $user, $password) { |
| | | $this->dbHost = $host; |
| | | $this->dbUser = $user; |
| | | $this->dbPass = $password; |
| | | } |
| | | |
| | | public function setDBName($name) { |
| | | $this->dbName = $name; |
| | | if(!((bool)mysqli_query( $this->_iConnId, 'USE `' . $this->dbName . '`'))) { |
| | | $this->close(); |
| | | $this->_sqlerror('Datenbank nicht gefunden / Database not found'); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | public function close() { |
| | | if($this->_iConnId) mysqli_close($this->_iConnId); |
| | | $this->_iConnId = null; |
| | | } |
| | | |
| | | function connect() |
| | | { |
| | | if(!$this->linkId) |
| | | { |
| | | $this->linkId = mysqli_connect($this->dbHost, $this->dbUser, $this->dbPass); |
| | | /* This allows our private variables to be "read" out side of the class */ |
| | | public function __get($var) { |
| | | return isset($this->$var) ? $this->$var : NULL; |
| | | } |
| | | |
| | | if(!$this->linkId) |
| | | { |
| | | $this->updateError('DB::connect()<br />mysqli_connect'); |
| | | return false; |
| | | public function _build_query_string($sQuery = '') { |
| | | $iArgs = func_num_args(); |
| | | if($iArgs > 1) { |
| | | $aArgs = func_get_args(); |
| | | |
| | | if($iArgs == 3 && $aArgs[1] === true && is_array($aArgs[2])) { |
| | | $aArgs = $aArgs[2]; |
| | | $iArgs = count($aArgs); |
| | | } else { |
| | | array_shift($aArgs); // delete the query string that is the first arg! |
| | | } |
| | | $this->queryId = @mysqli_query($this->linkId, 'SET NAMES '.$this->dbCharset); |
| | | |
| | | $iPos = 0; |
| | | $iPos2 = 0; |
| | | foreach($aArgs as $sKey => $sValue) { |
| | | $iPos2 = strpos($sQuery, '??', $iPos2); |
| | | $iPos = strpos($sQuery, '?', $iPos); |
| | | |
| | | if($iPos === false && $iPos2 === false) break; |
| | | |
| | | if($iPos2 !== false && ($iPos === false || $iPos2 <= $iPos)) { |
| | | $sTxt = $this->escape($sValue); |
| | | |
| | | if(strpos($sTxt, '.') !== false) { |
| | | $sTxt = preg_replace('/^(.+)\.(.+)$/', '`$1`.`$2`', $sTxt); |
| | | $sTxt = str_replace('.`*`', '.*', $sTxt); |
| | | } else $sTxt = '`' . $sTxt . '`'; |
| | | |
| | | $sQuery = substr_replace($sQuery, $sTxt, $iPos2, 2); |
| | | $iPos2 += strlen($sTxt); |
| | | $iPos = $iPos2; |
| | | } else { |
| | | if(is_int($sValue) || is_float($sValue)) { |
| | | $sTxt = $sValue; |
| | | } elseif(is_string($sValue) && (strcmp($sValue, '#NULL#') == 0)) { |
| | | $sTxt = 'NULL'; |
| | | } elseif(is_array($sValue)) { |
| | | $sTxt = ''; |
| | | foreach($sValue as $sVal) $sTxt .= ',\'' . $this->escape($sVal) . '\''; |
| | | $sTxt = '(' . substr($sTxt, 1) . ')'; |
| | | if($sTxt == '()') $sTxt = '(0)'; |
| | | } else { |
| | | $sTxt = '\'' . $this->escape($sValue) . '\''; |
| | | } |
| | | |
| | | $sQuery = substr_replace($sQuery, $sTxt, $iPos, 1); |
| | | $iPos += strlen($sTxt); |
| | | $iPos2 = $iPos; |
| | | } |
| | | } |
| | | } |
| | | |
| | | return $sQuery; |
| | | } |
| | | |
| | | /**#@-*/ |
| | | |
| | | |
| | | /**#@+ |
| | | * @access private |
| | | */ |
| | | private function _setCharset() { |
| | | mysqli_query($this->_iConnId, 'SET NAMES '.$this->dbCharset); |
| | | mysqli_query($this->_iConnId, "SET character_set_results = '".$this->dbCharset."', character_set_client = '".$this->dbCharset."', character_set_connection = '".$this->dbCharset."', character_set_database = '".$this->dbCharset."', character_set_server = '".$this->dbCharset."'"); |
| | | } |
| | | |
| | | private function _query($sQuery = '') { |
| | | $this->do_connect(); |
| | | |
| | | if ($sQuery == '') { |
| | | $this->_sqlerror('Keine Anfrage angegeben / No query given'); |
| | | return false; |
| | | } |
| | | |
| | | $try = 0; |
| | | do { |
| | | $try++; |
| | | $ok = mysqli_ping($this->_iConnId); |
| | | if(!$ok) { |
| | | if(!mysqli_connect($this->dbHost, $this->dbUser, $this->dbPass, $this->dbName)) { |
| | | if($this->errorNumber == '111') { |
| | | // server is not available |
| | | if($try > 9) { |
| | | $this->_sqlerror('DB::query -> error connecting'); |
| | | exit; |
| | | } |
| | | sleep(30); // additional seconds, please! |
| | | } |
| | | |
| | | if($try > 9) { |
| | | $this->_sqlerror('DB::query -> reconnect'); |
| | | return false; |
| | | } else { |
| | | sleep(($try > 7 ? 5 : 1)); |
| | | } |
| | | } else { |
| | | $this->_setCharset(); |
| | | $ok = true; |
| | | } |
| | | } |
| | | } while($ok == false); |
| | | |
| | | $aArgs = func_get_args(); |
| | | $sQuery = call_user_func_array(array(&$this, '_build_query_string'), $aArgs); |
| | | |
| | | $this->_iQueryId = mysqli_query($this->_iConnId, $sQuery); |
| | | if (!$this->_iQueryId) { |
| | | $this->_sqlerror('Falsche Anfrage / Wrong Query', false, 'SQL-Query = ' . $sQuery); |
| | | return false; |
| | | } |
| | | |
| | | return is_bool($this->_iQueryId) ? $this->_iQueryId : new db_result($this->_iQueryId, $this->_iConnId); |
| | | } |
| | | |
| | | /**#@-*/ |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * Executes a query |
| | | * |
| | | * Executes a given query string, has a variable amount of parameters: |
| | | * - 1 parameter |
| | | * executes the given query |
| | | * - 2 parameters |
| | | * executes the given query, replaces the first ? in the query with the second parameter |
| | | * - 3 parameters |
| | | * if the 2nd parameter is a boolean true, the 3rd parameter has to be an array containing all the replacements for every occuring ? in the query, otherwise the second parameter replaces the first ?, the third parameter replaces the second ? in the query |
| | | * - 4 or more parameters |
| | | * all ? in the query are replaced from left to right by the parameters 2 to x |
| | | * |
| | | * @access public |
| | | * @param string $sQuery query string |
| | | * @param mixed ... one or more parameters |
| | | * @return db_result the result object of the query |
| | | */ |
| | | |
| | | |
| | | public function query($sQuery = '') { |
| | | $aArgs = func_get_args(); |
| | | return call_user_func_array(array(&$this, '_query'), $aArgs); |
| | | } |
| | | |
| | | /** |
| | | * Execute a query and get first result array |
| | | * |
| | | * Executes a query and returns the first result row as an array |
| | | * This is like calling $result = $db->query(), $result->get(), $result->free() |
| | | * Use of this function @see query |
| | | * |
| | | * @access public |
| | | * @param string $sQuery query to execute |
| | | * @param ... further params (see query()) |
| | | * @return array result row or NULL if none found |
| | | */ |
| | | public function queryOneRecord($sQuery = '') { |
| | | if(!preg_match('/limit \d+\s*,\s*\d+$/i', $sQuery)) $sQuery .= ' LIMIT 0,1'; |
| | | |
| | | $aArgs = func_get_args(); |
| | | $oResult = call_user_func_array(array(&$this, 'query'), $aArgs); |
| | | if(!$oResult) return null; |
| | | |
| | | $aReturn = $oResult->get(); |
| | | $oResult->free(); |
| | | |
| | | return $aReturn; |
| | | } |
| | | |
| | | public function queryOne($sQuery = '') { |
| | | return call_user_func_array(array(&$this, 'queryOneRecord'), func_get_args()); |
| | | } |
| | | |
| | | public function query_one($sQuery = '') { |
| | | return call_user_func_array(array(&$this, 'queryOneRecord'), func_get_args()); |
| | | } |
| | | |
| | | /** |
| | | * Execute a query and return all rows |
| | | * |
| | | * Executes a query and returns all result rows in an array |
| | | * <strong>Use this with extreme care!!!</strong> Uses lots of memory on big result sets. |
| | | * |
| | | * @access public |
| | | * @param string $sQuery query to execute |
| | | * @param ... further params (see query()) |
| | | * @return array all the rows in the result set |
| | | */ |
| | | public function queryAllRecords($sQuery = '') { |
| | | $aArgs = func_get_args(); |
| | | $oResult = call_user_func_array(array(&$this, 'query'), $aArgs); |
| | | if(!$oResult) return array(); |
| | | |
| | | $aResults = array(); |
| | | while($aRow = $oResult->get()) { |
| | | $aResults[] = $aRow; |
| | | } |
| | | $oResult->free(); |
| | | |
| | | return $aResults; |
| | | } |
| | | |
| | | public function queryAll($sQuery = '') { |
| | | return call_user_func_array(array(&$this, 'queryAllRecords'), func_get_args()); |
| | | } |
| | | |
| | | public function query_all($sQuery = '') { |
| | | return call_user_func_array(array(&$this, 'queryAllRecords'), func_get_args()); |
| | | } |
| | | |
| | | /** |
| | | * Execute a query and return all rows as simple array |
| | | * |
| | | * Executes a query and returns all result rows in an array with elements |
| | | * <strong>Only first column is returned</strong> Uses lots of memory on big result sets. |
| | | * |
| | | * @access public |
| | | * @param string $sQuery query to execute |
| | | * @param ... further params (see query()) |
| | | * @return array all the rows in the result set |
| | | */ |
| | | public function queryAllArray($sQuery = '') { |
| | | $aArgs = func_get_args(); |
| | | $oResult = call_user_func_array(array(&$this, 'query'), $aArgs); |
| | | if(!$oResult) return array(); |
| | | |
| | | $aResults = array(); |
| | | while($aRow = $oResult->get()) { |
| | | $aResults[] = reset($aRow); |
| | | } |
| | | $oResult->free(); |
| | | |
| | | return $aResults; |
| | | } |
| | | |
| | | public function query_all_array($sQuery = '') { |
| | | return call_user_func_array(array(&$this, 'queryAllArray'), func_get_args()); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Get id of last inserted row |
| | | * |
| | | * Gives you the id of the last inserted row in a table with an auto-increment primary key |
| | | * |
| | | * @access public |
| | | * @return int id of last inserted row or 0 if none |
| | | */ |
| | | public function insert_id() { |
| | | $iRes = mysqli_query($this->_iConnId, 'SELECT LAST_INSERT_ID() as `newid`'); |
| | | if(!is_object($iRes)) return false; |
| | | |
| | | $aReturn = mysqli_fetch_assoc($iRes); |
| | | mysqli_free_result($iRes); |
| | | |
| | | return $aReturn['newid']; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * get affected row count |
| | | * |
| | | * Gets the amount of rows affected by the previous query |
| | | * |
| | | * @access public |
| | | * @return int affected rows |
| | | */ |
| | | public function affected() { |
| | | if(!is_object($this->_iConnId)) return 0; |
| | | $iRows = mysqli_affected_rows($this->_iConnId); |
| | | if(!$iRows) $iRows = 0; |
| | | return $iRows; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * check if a utf8 string is valid |
| | | * |
| | | * @access public |
| | | * @param string $string the string to check |
| | | * @return bool true if it is valid utf8, false otherwise |
| | | */ |
| | | private function check_utf8($str) { |
| | | $len = strlen($str); |
| | | for($i = 0; $i < $len; $i++){ |
| | | $c = ord($str[$i]); |
| | | if ($c > 128) { |
| | | if (($c > 247)) return false; |
| | | elseif ($c > 239) $bytes = 4; |
| | | elseif ($c > 223) $bytes = 3; |
| | | elseif ($c > 191) $bytes = 2; |
| | | else return false; |
| | | if (($i + $bytes) > $len) return false; |
| | | while ($bytes > 1) { |
| | | $i++; |
| | | $b = ord($str[$i]); |
| | | if ($b < 128 || $b > 191) return false; |
| | | $bytes--; |
| | | } |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | } // end of check_utf8 |
| | | |
| | | function query($queryString) |
| | | { |
| | | if(!$this->connect()) |
| | | { |
| | | return false; |
| | | /** |
| | | * Escape a string for usage in a query |
| | | * |
| | | * @access public |
| | | * @param string $sString query string to escape |
| | | * @return string escaped string |
| | | */ |
| | | public function escape($sString) { |
| | | if(!is_string($sString) && !is_numeric($sString)) { |
| | | $sString = ''; |
| | | } |
| | | if($this->dbName != '') { |
| | | if(!mysqli_select_db($this->linkId, $this->dbName)) |
| | | { |
| | | $this->updateError('DB::connect()<br />mysqli_select_db'); |
| | | return false; |
| | | |
| | | $cur_encoding = mb_detect_encoding($sString); |
| | | if($cur_encoding != "UTF-8") { |
| | | if($cur_encoding != 'ASCII') { |
| | | if($cur_encoding) $sString = mb_convert_encoding($sString, 'UTF-8', $cur_encoding); |
| | | else $sString = mb_convert_encoding($sString, 'UTF-8'); |
| | | } |
| | | } elseif(!$this->check_utf8($sString)) { |
| | | $sString = utf8_encode($sString); |
| | | } |
| | | $this->queryId = @mysqli_query($this->linkId, $queryString); |
| | | $this->updateError('DB::query('.$queryString.')<br />mysqli_query'); |
| | | if(!$this->queryId) |
| | | { |
| | | return false; |
| | | } |
| | | $this->currentRow = 0; |
| | | return $this->queryId; |
| | | |
| | | if($this->_iConnId) return mysqli_real_escape_string($this->_iConnId, $sString); |
| | | else return addslashes($sString); |
| | | } |
| | | |
| | | // returns all records in an array |
| | | function queryAllRecords($queryString) |
| | | { |
| | | if(!$this->query($queryString)) |
| | | { |
| | | return false; |
| | | /** |
| | | * |
| | | * |
| | | * @access private |
| | | */ |
| | | private function _sqlerror($sErrormsg = 'Unbekannter Fehler', $sAddMsg = '') { |
| | | global $conf; |
| | | |
| | | $mysql_error = (is_object($this->_iConnId) ? mysqli_error($this->_iConnId) : mysqli_connect_error()); |
| | | $mysql_errno = (is_object($this->_iConnId) ? mysqli_errno($this->_iConnId) : mysqli_connect_errno()); |
| | | |
| | | //$sAddMsg .= getDebugBacktrace(); |
| | | |
| | | if($this->show_error_messages && $conf['demo_mode'] === false) { |
| | | echo $sErrormsg . $sAddMsg; |
| | | } |
| | | $ret = array(); |
| | | while($line = $this->nextRecord()) |
| | | { |
| | | $ret[] = $line; |
| | | } |
| | | return $ret; |
| | | } |
| | | |
| | | // returns one record in an array |
| | | function queryOneRecord($queryString) |
| | | { |
| | | if(!$this->query($queryString) || $this->numRows() == 0) |
| | | { |
| | | return false; |
| | | } |
| | | return $this->nextRecord(); |
| | | } |
| | | |
| | | // returns the next record in an array |
| | | function nextRecord() |
| | | { |
| | | $this->record = mysqli_fetch_assoc($this->queryId); |
| | | $this->updateError('DB::nextRecord()<br />mysqli_fetch_array'); |
| | | if(!$this->record || !is_array($this->record)) |
| | | { |
| | | return false; |
| | | } |
| | | $this->currentRow++; |
| | | return $this->record; |
| | | } |
| | | |
| | | // returns number of rows returned by the last select query |
| | | function numRows() |
| | | { |
| | | return mysqli_num_rows($this->queryId); |
| | | } |
| | | |
| | | function affectedRows() |
| | | { |
| | | return mysqli_affected_rows($this->linkId); |
| | | public function affectedRows() { |
| | | return $this->affected(); |
| | | } |
| | | |
| | | // returns mySQL insert id |
| | | function insertID() |
| | | { |
| | | return mysqli_insert_id($this->linkId); |
| | | public function insertID() { |
| | | return $this->insert_id(); |
| | | } |
| | | |
| | | // Check der variablen |
| | | // deprecated, now use quote |
| | | function check($formfield) |
| | | { |
| | | return $this->quote($formfield); |
| | | |
| | | //* Function to quote strings |
| | | public function quote($formfield) { |
| | | return $this->escape($formfield); |
| | | } |
| | | |
| | | // Check der variablen |
| | | function quote($formfield) |
| | | { |
| | | return mysqli_real_escape_string($this->linkId, $formfield); |
| | | } |
| | | |
| | | // Check der variablen |
| | | function unquote($formfield) |
| | | { |
| | | //* Function to unquotae strings |
| | | public function unquote($formfield) { |
| | | return stripslashes($formfield); |
| | | } |
| | | |
| | | function toLower($record) { |
| | | public function toLower($record) { |
| | | if(is_array($record)) { |
| | | foreach($record as $key => $val) { |
| | | $key = strtolower($key); |
| | |
| | | return $out; |
| | | } |
| | | |
| | | |
| | | /* TODO: rewrite SQL */ |
| | | function insert($tablename, $form, $debug = 0) |
| | | { |
| | | if(is_array($form)){ |
| | |
| | | if($debug == 1) echo "mySQL Error Message: ".$this->errorMessage; |
| | | } |
| | | } |
| | | |
| | | |
| | | /* TODO: rewrite SQL */ |
| | | function update($tablename, $form, $bedingung, $debug = 0) |
| | | { |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | function closeConn() { |
| | | |
| | | } |
| | | |
| | | function freeResult() { |
| | | |
| | | |
| | | } |
| | | |
| | | function delete() { |
| | | |
| | | } |
| | | |
| | | function Transaction($action) { |
| | | //action = begin, commit oder rollback |
| | | |
| | | } |
| | | |
| | | /* |
| | | $columns = array(action => add | alter | drop |
| | | name => Spaltenname |
| | | name_new => neuer Spaltenname, nur bei 'alter' belegt |
| | | type => 42go-Meta-Type: int16, int32, int64, double, char, varchar, text, blob |
| | | typeValue => Wert z.B. bei Varchar |
| | | defaultValue => Default Wert |
| | | notNull => true | false |
| | | autoInc => true | false |
| | | option => unique | primary | index) |
| | | $columns = array(action => add | alter | drop |
| | | name => Spaltenname |
| | | name_new => neuer Spaltenname, nur bei 'alter' belegt |
| | | type => 42go-Meta-Type: int16, int32, int64, double, char, varchar, text, blob |
| | | typeValue => Wert z.B. bei Varchar |
| | | defaultValue => Default Wert |
| | | notNull => true | false |
| | | autoInc => true | false |
| | | option => unique | primary | index) |
| | | |
| | | |
| | | */ |
| | | |
| | | function createTable($table_name, $columns) { |
| | | $index = ""; |
| | | $sql = "CREATE TABLE $table_name ("; |
| | | */ |
| | | /* TODO: rewrite SQL */ |
| | | public function createTable($table_name, $columns) { |
| | | $index = ''; |
| | | $sql = "CREATE TABLE ?? ("; |
| | | foreach($columns as $col){ |
| | | $sql .= $col["name"]." ".$this->mapType($col["type"], $col["typeValue"])." "; |
| | | $sql .= $col['name'].' '.$this->mapType($col['type'], $col['typeValue']).' '; |
| | | |
| | | if($col["defaultValue"] != "") { |
| | | if($col["defaultValue"] == "NULL" or $col["defaultValue"] == "NOT NULL") { |
| | | $sql .= "DEFAULT ".$col["defaultValue"]." "; |
| | | } else { |
| | | $sql .= "DEFAULT '".$col["defaultValue"]."' "; |
| | | } |
| | | |
| | | } elseif($col["defaultValue"] != false) { |
| | | $sql .= "DEFAULT '' "; |
| | | if($col['defaultValue'] != '') $sql .= "DEFAULT '".$col['defaultValue']."' "; |
| | | if($col['notNull'] == true) { |
| | | $sql .= 'NOT NULL '; |
| | | } else { |
| | | $sql .= 'NULL '; |
| | | } |
| | | if($col["defaultValue"] != "NULL" && $col["defaultValue"] != "NOT NULL") { |
| | | if($col["notNull"] == true) { |
| | | $sql .= "NOT NULL "; |
| | | } else { |
| | | $sql .= "NULL "; |
| | | } |
| | | } |
| | | if($col["autoInc"] == true) $sql .= "auto_increment "; |
| | | $sql.= ","; |
| | | if($col['autoInc'] == true) $sql .= 'auto_increment '; |
| | | $sql.= ','; |
| | | // key Definitionen |
| | | if($col["option"] == "primary") $index .= "PRIMARY KEY (".$col["name"]."),"; |
| | | if($col["option"] == "index") $index .= "INDEX (".$col["name"]."),"; |
| | | if($col["option"] == "unique") $index .= "UNIQUE (".$col["name"]."),"; |
| | | if($col['option'] == 'primary') $index .= 'PRIMARY KEY ('.$col['name'].'),'; |
| | | if($col['option'] == 'index') $index .= 'INDEX ('.$col['name'].'),'; |
| | | if($col['option'] == 'unique') $index .= 'UNIQUE ('.$col['name'].'),'; |
| | | } |
| | | $sql .= $index; |
| | | $sql = substr($sql, 0, -1); |
| | | $sql .= ")"; |
| | | |
| | | $this->query($sql); |
| | | $sql .= ')'; |
| | | /* TODO: secure parameters */ |
| | | $this->query($sql, $table_name); |
| | | return true; |
| | | } |
| | | |
| | | /* |
| | | $columns = array(action => add | alter | drop |
| | | name => Spaltenname |
| | | name_new => neuer Spaltenname, nur bei 'alter' belegt |
| | | type => 42go-Meta-Type: int16, int32, int64, double, char, varchar, text, blob |
| | | typeValue => Wert z.B. bei Varchar |
| | | defaultValue => Default Wert |
| | | notNull => true | false |
| | | autoInc => true | false |
| | | option => unique | primary | index) |
| | | $columns = array(action => add | alter | drop |
| | | name => Spaltenname |
| | | name_new => neuer Spaltenname, nur bei 'alter' belegt |
| | | type => 42go-Meta-Type: int16, int32, int64, double, char, varchar, text, blob |
| | | typeValue => Wert z.B. bei Varchar |
| | | defaultValue => Default Wert |
| | | notNull => true | false |
| | | autoInc => true | false |
| | | option => unique | primary | index) |
| | | |
| | | |
| | | */ |
| | | function alterTable($table_name, $columns) { |
| | | $index = ""; |
| | | $sql = "ALTER TABLE $table_name "; |
| | | */ |
| | | /* TODO: rewrite SQL */ |
| | | public function alterTable($table_name, $columns) { |
| | | $index = ''; |
| | | $sql = "ALTER TABLE ?? "; |
| | | foreach($columns as $col){ |
| | | if($col["action"] == 'add') { |
| | | $sql .= "ADD ".$col["name"]." ".$this->mapType($col["type"], $col["typeValue"])." "; |
| | | } elseif ($col["action"] == 'alter') { |
| | | $sql .= "CHANGE ".$col["name"]." ".$col["name_new"]." ".$this->mapType($col["type"], $col["typeValue"])." "; |
| | | } elseif ($col["action"] == 'drop') { |
| | | $sql .= "DROP ".$col["name"]." "; |
| | | if($col['action'] == 'add') { |
| | | $sql .= 'ADD '.$col['name'].' '.$this->mapType($col['type'], $col['typeValue']).' '; |
| | | } elseif ($col['action'] == 'alter') { |
| | | $sql .= 'CHANGE '.$col['name'].' '.$col['name_new'].' '.$this->mapType($col['type'], $col['typeValue']).' '; |
| | | } elseif ($col['action'] == 'drop') { |
| | | $sql .= 'DROP '.$col['name'].' '; |
| | | } |
| | | if($col["action"] != 'drop') { |
| | | if($col["defaultValue"] != "") $sql .= "DEFAULT '".$col["defaultValue"]."' "; |
| | | if($col["notNull"] == true) { |
| | | $sql .= "NOT NULL "; |
| | | if($col['action'] != 'drop') { |
| | | if($col['defaultValue'] != '') $sql .= "DEFAULT '".$col['defaultValue']."' "; |
| | | if($col['notNull'] == true) { |
| | | $sql .= 'NOT NULL '; |
| | | } else { |
| | | $sql .= "NULL "; |
| | | $sql .= 'NULL '; |
| | | } |
| | | if($col["autoInc"] == true) $sql .= "auto_increment "; |
| | | $sql.= ","; |
| | | // key Definitionen |
| | | if($col["option"] == "primary") $index .= "PRIMARY KEY (".$col["name"]."),"; |
| | | if($col["option"] == "index") $index .= "INDEX (".$col["name"]."),"; |
| | | if($col["option"] == "unique") $index .= "UNIQUE (".$col["name"]."),"; |
| | | if($col['autoInc'] == true) $sql .= 'auto_increment '; |
| | | $sql.= ','; |
| | | // Index definitions |
| | | if($col['option'] == 'primary') $index .= 'PRIMARY KEY ('.$col['name'].'),'; |
| | | if($col['option'] == 'index') $index .= 'INDEX ('.$col['name'].'),'; |
| | | if($col['option'] == 'unique') $index .= 'UNIQUE ('.$col['name'].'),'; |
| | | } |
| | | } |
| | | $sql .= $index; |
| | | $sql = substr($sql, 0, -1); |
| | | |
| | | /* TODO: secure parameters */ |
| | | //die($sql); |
| | | $this->query($sql); |
| | | $this->query($sql, $table_name); |
| | | return true; |
| | | } |
| | | |
| | | function dropTable($table_name) { |
| | | public function dropTable($table_name) { |
| | | $this->check($table_name); |
| | | $sql = "DROP TABLE '". $table_name."'"; |
| | | return $this->query($sql); |
| | | $sql = "DROP TABLE ??"; |
| | | return $this->query($sql, $table_name); |
| | | } |
| | | |
| | | // gibt Array mit Tabellennamen zur�ck |
| | | function getTables($database_name = '') { |
| | | |
| | | if($database_name == ''){ |
| | | $database_name = $this->dbName; |
| | | } |
| | | |
| | | $tables = $this->queryAllRecords("SHOW TABLES FROM `$database_name`"); |
| | | $tb_names = array(); |
| | | if(is_array($tables) && !empty($tables)){ |
| | | for($i = 0; $i < sizeof($tables); $i++){ |
| | | $tb_names[$i] = $tables[$i]['Tables_in_'.$database_name]; |
| | | } |
| | | } |
| | | |
| | | /* |
| | | $result = mysqli_query("SHOW TABLES FROM `$database_name`"); |
| | | $tb_names = array(); |
| | | for ($i = 0; $i < mysqli_num_rows($result); $i++) { |
| | | $tb_names[$i] = mysql_tablename($result, $i); |
| | | } |
| | | */ |
| | | public function getTables($database_name = '') { |
| | | if(!is_object($this->_iConnId)) return false; |
| | | if($database_name == '') $database_name = $this->dbName; |
| | | $tb_names = $this->queryAllArray("SHOW TABLES FROM ??", $database_name); |
| | | return $tb_names; |
| | | } |
| | | |
| | | // gibt Feldinformationen zur Tabelle zur�ck |
| | | /* |
| | | $columns = array(action => add | alter | drop |
| | | name => Spaltenname |
| | | name_new => neuer Spaltenname, nur bei 'alter' belegt |
| | | type => 42go-Meta-Type: int16, int32, int64, double, char, varchar, text, blob |
| | | typeValue => Wert z.B. bei Varchar |
| | | defaultValue => Default Wert |
| | | notNull => true | false |
| | | autoInc => true | false |
| | | option => unique | primary | index) |
| | | $columns = array(action => add | alter | drop |
| | | name => Spaltenname |
| | | name_new => neuer Spaltenname, nur bei 'alter' belegt |
| | | type => 42go-Meta-Type: int16, int32, int64, double, char, varchar, text, blob |
| | | typeValue => Wert z.B. bei Varchar |
| | | defaultValue => Default Wert |
| | | notNull => true | false |
| | | autoInc => true | false |
| | | option => unique | primary | index) |
| | | |
| | | |
| | | */ |
| | | |
| | | */ |
| | | /* TODO: rewrite SQL */ |
| | | function tableInfo($table_name) { |
| | | |
| | | global $go_api, $go_info; |
| | | // Tabellenfelder einlesen |
| | | |
| | | if($rows = $go_api->db->queryAllRecords("SHOW FIELDS FROM ".$table_name)){ |
| | | if($rows = $go_api->db->queryAllRecords('SHOW FIELDS FROM ??', $table_name)){ |
| | | foreach($rows as $row) { |
| | | $name = $row[0]; |
| | | $default = $row[4]; |
| | | $key = $row[3]; |
| | | $extra = $row[5]; |
| | | $isnull = $row[2]; |
| | | $type = $row[1]; |
| | | $name = $row['Field']; |
| | | $default = $row['Default']; |
| | | $key = $row['Key']; |
| | | $extra = $row['Extra']; |
| | | $isnull = $row['Null']; |
| | | $type = $row['Type']; |
| | | |
| | | |
| | | $column = array(); |
| | | |
| | | $column["name"] = $name; |
| | | //$column["type"] = $type; |
| | | $column["defaultValue"] = $default; |
| | | if(stristr($key, "PRI")) $column["option"] = "primary"; |
| | | if(stristr($isnull, "YES")) { |
| | | $column["notNull"] = false; |
| | | $column['name'] = $name; |
| | | //$column['type'] = $type; |
| | | $column['defaultValue'] = $default; |
| | | if(stristr($key, 'PRI')) $column['option'] = 'primary'; |
| | | if(stristr($isnull, 'YES')) { |
| | | $column['notNull'] = false; |
| | | } else { |
| | | $column["notNull"] = true; |
| | | $column['notNull'] = true; |
| | | } |
| | | if($extra == 'auto_increment') $column["autoInc"] = true; |
| | | if($extra == 'auto_increment') $column['autoInc'] = true; |
| | | |
| | | |
| | | // Type in Metatype umsetzen |
| | | |
| | | if(stristr($type, "int(")) $metaType = 'int32'; |
| | | if(stristr($type, "bigint")) $metaType = 'int64'; |
| | | if(stristr($type, "char")) { |
| | | if(stristr($type, 'int(')) $metaType = 'int32'; |
| | | if(stristr($type, 'bigint')) $metaType = 'int64'; |
| | | if(stristr($type, 'char')) { |
| | | $metaType = 'char'; |
| | | $tmp_typeValue = explode('(', $type); |
| | | $column["typeValue"] = substr($tmp_typeValue[1], 0, -1); |
| | | $column['typeValue'] = substr($tmp_typeValue[1], 0, -1); |
| | | } |
| | | if(stristr($type, "varchar")) { |
| | | if(stristr($type, 'varchar')) { |
| | | $metaType = 'varchar'; |
| | | $tmp_typeValue = explode('(', $type); |
| | | $column["typeValue"] = substr($tmp_typeValue[1], 0, -1); |
| | | $column['typeValue'] = substr($tmp_typeValue[1], 0, -1); |
| | | } |
| | | if(stristr($type, "text")) $metaType = 'text'; |
| | | if(stristr($type, "double")) $metaType = 'double'; |
| | | if(stristr($type, "blob")) $metaType = 'blob'; |
| | | if(stristr($type, 'text')) $metaType = 'text'; |
| | | if(stristr($type, 'double')) $metaType = 'double'; |
| | | if(stristr($type, 'blob')) $metaType = 'blob'; |
| | | |
| | | |
| | | $column["type"] = $metaType; |
| | | $column['type'] = $metaType; |
| | | |
| | | $columns[] = $column; |
| | | } |
| | |
| | | |
| | | } |
| | | |
| | | function mapType($metaType, $typeValue) { |
| | | public function mapType($metaType, $typeValue) { |
| | | global $go_api; |
| | | $metaType = strtolower($metaType); |
| | | switch ($metaType) { |
| | |
| | | return 'char'; |
| | | break; |
| | | case 'varchar': |
| | | if($typeValue < 1) die("Datenbank Fehler: F�r diesen Datentyp ist eine L�ngenangabe notwendig."); |
| | | if($typeValue < 1) die('Database failure: Lenght required for these data types.'); |
| | | return 'varchar('.$typeValue.')'; |
| | | break; |
| | | case 'text': |
| | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * database query result class |
| | | * |
| | | * @package pxFramework |
| | | * |
| | | */ |
| | | class db_result { |
| | | |
| | | /** |
| | | * |
| | | * |
| | | * @access private |
| | | */ |
| | | private $_iResId = null; |
| | | private $_iConnection = null; |
| | | |
| | | |
| | | |
| | | /** |
| | | * |
| | | * |
| | | * @access private |
| | | */ |
| | | public function db_result($iResId, $iConnection) { |
| | | $this->_iResId = $iResId; |
| | | $this->_iConnection = $iConnection; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * get count of result rows |
| | | * |
| | | * Returns the amount of rows in the result set |
| | | * |
| | | * @access public |
| | | * @return int amount of rows |
| | | */ |
| | | public function rows() { |
| | | if(!is_object($this->_iResId)) return 0; |
| | | $iRows = mysqli_num_rows($this->_iResId); |
| | | if(!$iRows) $iRows = 0; |
| | | return $iRows; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Get number of affected rows |
| | | * |
| | | * Returns the amount of rows affected by the previous query |
| | | * |
| | | * @access public |
| | | * @return int amount of affected rows |
| | | */ |
| | | public function affected() { |
| | | if(!is_object($this->_iConnection)) return 0; |
| | | $iRows = mysqli_affected_rows($this->_iConnection); |
| | | if(!$iRows) $iRows = 0; |
| | | return $iRows; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Frees the result set |
| | | * |
| | | * @access public |
| | | */ |
| | | public function free() { |
| | | if(!is_object($this->_iResId)) return; |
| | | |
| | | mysqli_free_result($this->_iResId); |
| | | return; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Get a result row (associative) |
| | | * |
| | | * Returns the next row in the result set. To be used in a while loop like while($currow = $result->get()) { do something ... } |
| | | * |
| | | * @access public |
| | | * @return array result row |
| | | */ |
| | | public function get() { |
| | | $aItem = null; |
| | | |
| | | if(is_object($this->_iResId)) { |
| | | $aItem = mysqli_fetch_assoc($this->_iResId); |
| | | if(!$aItem) $aItem = null; |
| | | } |
| | | return $aItem; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Get a result row (array with numeric index) |
| | | * |
| | | * @access public |
| | | * @return array result row |
| | | */ |
| | | public function getAsRow() { |
| | | $aItem = null; |
| | | |
| | | if(is_object($this->_iResId)) { |
| | | $aItem = mysqli_fetch_row($this->_iResId); |
| | | if(!$aItem) $aItem = null; |
| | | } |
| | | return $aItem; |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * database query result class |
| | | * |
| | | * emulates a db result set out of an array so you can use array results and db results the same way |
| | | * |
| | | * @package pxFramework |
| | | * @see db_result |
| | | * |
| | | * |
| | | */ |
| | | class fakedb_result { |
| | | |
| | | /** |
| | | * |
| | | * |
| | | * @access private |
| | | */ |
| | | private $aResultData = array(); |
| | | |
| | | /** |
| | | * |
| | | * |
| | | * @access private |
| | | */ |
| | | private $aLimitedData = array(); |
| | | |
| | | |
| | | |
| | | /** |
| | | * |
| | | * |
| | | * @access private |
| | | */ |
| | | public function fakedb_result($aData) { |
| | | $this->aResultData = $aData; |
| | | $this->aLimitedData = $aData; |
| | | reset($this->aLimitedData); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * get count of result rows |
| | | * |
| | | * Returns the amount of rows in the result set |
| | | * |
| | | * @access public |
| | | * @return int amount of rows |
| | | */ |
| | | // Gibt die Anzahl Zeilen zurück |
| | | public function rows() { |
| | | return count($this->aLimitedData); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Frees the result set |
| | | * |
| | | * @access public |
| | | */ |
| | | // Gibt ein Ergebnisset frei |
| | | public function free() { |
| | | $this->aResultData = array(); |
| | | $this->aLimitedData = array(); |
| | | return; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Get a result row (associative) |
| | | * |
| | | * Returns the next row in the result set. To be used in a while loop like while($currow = $result->get()) { do something ... } |
| | | * |
| | | * @access public |
| | | * @return array result row |
| | | */ |
| | | // Gibt eine Ergebniszeile zurück |
| | | public function get() { |
| | | $aItem = null; |
| | | |
| | | if(!is_array($this->aLimitedData)) return $aItem; |
| | | |
| | | if(list($vKey, $aItem) = each($this->aLimitedData)) { |
| | | if(!$aItem) $aItem = null; |
| | | } |
| | | return $aItem; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Get a result row (array with numeric index) |
| | | * |
| | | * @access public |
| | | * @return array result row |
| | | */ |
| | | public function getAsRow() { |
| | | return $this->get(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Limit the result (like a LIMIT x,y in a SQL query) |
| | | * |
| | | * @access public |
| | | * @param int $iStart offset to start read |
| | | * @param int iLength amount of datasets to read |
| | | */ |
| | | public function limit_result($iStart, $iLength) { |
| | | $this->aLimitedData = array_slice($this->aResultData, $iStart, $iLength, true); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | ?> |
| | |
| | | function updateDbAndIni() { |
| | | global $inst, $conf; |
| | | |
| | | //* check sql-mode |
| | | $check_sql_mode = $inst->db->queryOneRecord("SELECT @@sql_mode"); |
| | | if ($check_sql_mode['@@sql_mode'] != '' && $check_sql_mode['@@sql_mode'] != 'NO_ENGINE_SUBSTITUTION') die('Wrong SQL-mode. You should use NO_ENGINE_SUBSTITUTION'); |
| | | |
| | | //* Update $conf array with values from the server.ini that shall be preserved |
| | | $tmp = $inst->db->queryOneRecord("SELECT * FROM ".$conf["mysql"]["database"].".server WHERE server_id = ".$conf['server_id']); |
| | | $tmp = $inst->db->queryOneRecord("SELECT * FROM ?? WHERE server_id = ?", $conf["mysql"]["database"] . '.server', $conf['server_id']); |
| | | $ini_array = ini_to_array(stripslashes($tmp['config'])); |
| | | $current_db_version = (isset($tmp['dbversion']))?intval($tmp['dbversion']):0; |
| | | |
| | |
| | | } |
| | | |
| | | //* update the database version in server table |
| | | $inst->db->query("UPDATE ".$conf["mysql"]["database"].".server SET dbversion = '".$current_db_version."' WHERE server_id = ".$conf['server_id']); |
| | | if($inst->db->dbHost != $inst->dbmaster->dbHost) $inst->dbmaster->query("UPDATE ".$conf["mysql"]["master_database"].".server SET dbversion = '".$current_db_version."' WHERE server_id = ".$conf['server_id']); |
| | | $inst->db->query("UPDATE ?? SET dbversion = ? WHERE server_id = ?", $conf["mysql"]["database"] . ".server", $current_db_version, $conf['server_id']); |
| | | if($inst->db->dbHost != $inst->dbmaster->dbHost) $inst->dbmaster->query("UPDATE ?? SET dbversion = ? WHERE server_id = ?", $conf["mysql"]["master_database"] . ".server", $current_db_version, $conf['server_id']); |
| | | |
| | | |
| | | //* If ISPConfig Version < 3.0.3, we will do a full db update |
| | |
| | | swriteln($inst->lng('Starting full database update.')); |
| | | |
| | | //** Delete the old database |
| | | if( !$inst->db->query('DROP DATABASE IF EXISTS '.$conf['mysql']['database']) ) { |
| | | if( !$inst->db->query('DROP DATABASE IF EXISTS ??', $conf['mysql']['database']) ) { |
| | | $inst->error('Unable to drop MySQL database: '.$conf['mysql']['database'].'.'); |
| | | } |
| | | |
| | |
| | | $db_tables = $inst->db->getTables(); |
| | | |
| | | foreach($db_tables as $table) { |
| | | $inst->db->query("TRUNCATE $table"); |
| | | $inst->db->query("TRUNCATE ??", $table); |
| | | } |
| | | |
| | | //** load old data back into database |
| | |
| | | } |
| | | |
| | | //* update the database version in server table |
| | | $inst->db->query("UPDATE ".$conf["mysql"]["database"].".server SET dbversion = '".$current_db_version."' WHERE server_id = ".$conf['server_id']); |
| | | if($inst->db->dbHost != $inst->dbmaster->dbHost) $inst->dbmaster->query("UPDATE ".$conf["mysql"]["master_database"].".server SET dbversion = '".$current_db_version."' WHERE server_id = ".$conf['server_id']); |
| | | $inst->db->query("UPDATE ?? SET dbversion = ? WHERE server_id = ?", $conf["mysql"]["database"] . ".server", $current_db_version, $conf['server_id']); |
| | | if($inst->db->dbHost != $inst->dbmaster->dbHost) $inst->dbmaster->query("UPDATE ?? SET dbversion = ? WHERE server_id = ?", $conf["mysql"]["master_database"] . ".server", $current_db_version, $conf['server_id']); |
| | | |
| | | if ($conf['powerdns']['installed']) { |
| | | |
| | | swriteln($inst->lng('Starting full PowerDNS database update.')); |
| | | |
| | | //** Delete the old PowerDNS database |
| | | if( !$inst->db->query('DROP DATABASE IF EXISTS '.$conf['powerdns']['database']) ) { |
| | | if( !$inst->db->query('DROP DATABASE IF EXISTS ??', $conf['powerdns']['database']) ) { |
| | | $inst->error('Unable to drop MySQL database: '.$conf['powerdns']['database'].'.'); |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | //** Update server ini |
| | | $tmp_server_rec = $inst->db->queryOneRecord("SELECT config FROM ".$conf["mysql"]["database"].".server WHERE server_id = ".$conf['server_id']); |
| | | $tmp_server_rec = $inst->db->queryOneRecord("SELECT config FROM ?? WHERE server_id = ?", $conf["mysql"]["database"] . ".server", $conf['server_id']); |
| | | $old_ini_array = ini_to_array(stripslashes($tmp_server_rec['config'])); |
| | | unset($tmp_server_rec); |
| | | $tpl_ini_array = ini_to_array(rf('tpl/server.ini.master')); |
| | |
| | | } |
| | | |
| | | $new_ini = array_to_ini($tpl_ini_array); |
| | | $sql = "UPDATE ".$conf["mysql"]["database"].".server SET config = '".mysql_real_escape_string($new_ini)."' WHERE server_id = ".$conf['server_id']; |
| | | $inst->db->query($sql); |
| | | $sql = "UPDATE ?? SET config = ? WHERE server_id = ?"; |
| | | $inst->db->query($sql, $conf["mysql"]["database"] . ".server", $new_ini, $conf['server_id']); |
| | | |
| | | if($inst->db->dbHost != $inst->dbmaster->dbHost) { |
| | | $sql = "UPDATE ".$conf["mysql"]["master_database"].".server SET config = '".mysql_real_escape_string($new_ini)."' WHERE server_id = ".$conf['server_id']; |
| | | $inst->dbmaster->query($sql); |
| | | $sql = "UPDATE ?? SET config = ? WHERE server_id = ?"; |
| | | $inst->dbmaster->query($sql, $conf["mysql"]["master_database"].".server", $new_ini, $conf['server_id']); |
| | | } |
| | | unset($old_ini_array); |
| | | unset($tpl_ini_array); |
| | |
| | | |
| | | |
| | | //** Update system ini |
| | | $tmp_server_rec = $inst->db->queryOneRecord("SELECT config FROM ".$conf["mysql"]["database"].".sys_ini WHERE sysini_id = 1"); |
| | | $tmp_server_rec = $inst->db->queryOneRecord("SELECT config FROM ?? WHERE sysini_id = 1", $conf["mysql"]["database"] . ".sys_ini"); |
| | | $old_ini_array = ini_to_array(stripslashes($tmp_server_rec['config'])); |
| | | unset($tmp_server_rec); |
| | | $tpl_ini_array = ini_to_array(rf('tpl/system.ini.master')); |
| | |
| | | } |
| | | |
| | | $new_ini = array_to_ini($tpl_ini_array); |
| | | $tmp = $inst->db->queryOneRecord('SELECT count(sysini_id) as number FROM '.$conf["mysql"]["database"].'.sys_ini WHERE 1'); |
| | | $tmp = $inst->db->queryOneRecord('SELECT count(sysini_id) as number FROM ?? WHERE 1', $conf["mysql"]["database"] . '.sys_ini'); |
| | | if($tmp['number'] == 0) { |
| | | $inst->db->query("INSERT INTO ".$conf["mysql"]["database"].".sys_ini (sysini_id, config) VALUES (1,'".mysql_real_escape_string($new_ini)."')"); |
| | | $inst->db->query("INSERT INTO ?? (sysini_id, config) VALUES (1,?)", $conf["mysql"]["database"] . ".sys_ini", $new_ini); |
| | | } else { |
| | | $inst->db->query("UPDATE ".$conf["mysql"]["database"].".sys_ini SET config = '".mysql_real_escape_string($new_ini)."' WHERE sysini_id = 1"); |
| | | $inst->db->query("UPDATE ?? SET config = ? WHERE sysini_id = 1", $conf["mysql"]["database"] . ".sys_ini", $new_ini); |
| | | } |
| | | unset($old_ini_array); |
| | | unset($tpl_ini_array); |
| | |
| | | |
| | | |
| | | |
| | | function setDefaultServers(){ |
| | | global $inst, $conf; |
| | | |
| | | // clients |
| | | $clients = $inst->db->queryAllRecords("SELECT * FROM ".$conf["mysql"]["database"].".client"); |
| | | if(is_array($clients) && !empty($clients)){ |
| | | foreach($clients as $client){ |
| | | // mailserver |
| | | if(trim($client['mail_servers']) == '') $inst->db->query("UPDATE ?? SET mail_servers = ? WHERE client_id = ?", $conf["mysql"]["database"].".client", trim($client['default_mailserver']), $client['client_id']); |
| | | // webserver |
| | | if(trim($client['web_servers']) == '') $inst->db->query("UPDATE ?? SET web_servers = ? WHERE client_id = ?", $conf["mysql"]["database"].".client", trim($client['default_webserver']), $client['client_id']); |
| | | // dns server |
| | | if(trim($client['dns_servers']) == '') $inst->db->query("UPDATE ?? SET dns_servers = ? WHERE client_id = ?", $conf["mysql"]["database"].".client", trim($client['default_dnsserver']), $client['client_id']); |
| | | // db server |
| | | if(trim($client['db_servers']) == '') $inst->db->query("UPDATE ?? SET db_servers = ? WHERE client_id = ?", $conf["mysql"]["database"].".client", trim($client['default_dbserver']), $client['client_id']); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | ?> |
| | |
| | | refresh=7200 |
| | | retry=540 |
| | | expire=604800 |
| | | minimum=86400 |
| | | minimum=3600 |
| | | ttl=3600 |
| | | |
| | | [DNS_RECORDS] |
| | |
| | | MX|{DOMAIN}.|mail.{DOMAIN}.|10|3600 |
| | | TXT|{DOMAIN}.|v=spf1 mx a ~all|0|3600' WHERE `dns_template`.`template_id` = 1; |
| | | |
| | | ALTER TABLE `sys_user` ADD `lost_password_function` TINYINT(1) NOT NULL DEFAULT '1' ; |
| | | ALTER TABLE `mail_backup` CHANGE `filesize` `filesize` VARCHAR(20) NOT NULL DEFAULT ''; |
| | | ALTER TABLE `web_backup` CHANGE `filesize` `filesize` VARCHAR(20) NOT NULL DEFAULT ''; |
| | | |
| | | ALTER TABLE `sys_datalog` ADD INDEX `dbtable` (`dbtable` (25), `dbidx` (25)), ADD INDEX (`action`); |
| | | ALTER TABLE `mail_user` ADD `greylisting` ENUM( 'n', 'y' ) NOT NULL DEFAULT 'n' AFTER `postfix`; |
| | | ALTER TABLE `mail_user` ADD `maildir_format` varchar(255) NOT NULL default 'maildir' AFTER `maildir`; |
| | | ALTER TABLE `mail_forwarding` ADD `greylisting` ENUM( 'n', 'y' ) NOT NULL DEFAULT 'n' AFTER `active`; |
| | | |
| | | ALTER TABLE `openvz_ip` CHANGE `ip_address` `ip_address` VARCHAR(39) DEFAULT NULL; |
| | | |
| | | -- XMPP Support |
| | | |
| | | ALTER TABLE `server` ADD COLUMN `xmpp_server` tinyint(1) NOT NULL default '0' AFTER `firewall_server`; |
| | | |
| | | ALTER TABLE `client` |
| | | ADD COLUMN `default_xmppserver` int(11) unsigned NOT NULL DEFAULT '1', |
| | | ADD COLUMN `xmpp_servers` blob, |
| | | ADD COLUMN `limit_xmpp_domain` int(11) NOT NULL DEFAULT '-1', |
| | | ADD COLUMN `limit_xmpp_user` int(11) NOT NULL DEFAULT '-1', |
| | | ADD COLUMN `limit_xmpp_muc` ENUM( 'n', 'y' ) NOT NULL default 'n', |
| | | ADD COLUMN `limit_xmpp_anon` ENUM( 'n', 'y' ) NOT NULL default 'n', |
| | | ADD COLUMN `limit_xmpp_auth_options` varchar(255) NOT NULL DEFAULT 'plain,hashed,isp', |
| | | ADD COLUMN `limit_xmpp_vjud` ENUM( 'n', 'y' ) NOT NULL default 'n', |
| | | ADD COLUMN `limit_xmpp_proxy` ENUM( 'n', 'y' ) NOT NULL default 'n', |
| | | ADD COLUMN `limit_xmpp_status` ENUM( 'n', 'y' ) NOT NULL default 'n', |
| | | ADD COLUMN `limit_xmpp_pastebin` ENUM( 'n', 'y' ) NOT NULL default 'n', |
| | | ADD COLUMN `limit_xmpp_httparchive` ENUM( 'n', 'y' ) NOT NULL default 'n'; |
| | | |
| | | |
| | | CREATE TABLE `xmpp_domain` ( |
| | | `domain_id` int(11) unsigned NOT NULL auto_increment, |
| | | `sys_userid` int(11) unsigned NOT NULL default '0', |
| | | `sys_groupid` int(11) unsigned NOT NULL default '0', |
| | | `sys_perm_user` varchar(5) NOT NULL default '', |
| | | `sys_perm_group` varchar(5) NOT NULL default '', |
| | | `sys_perm_other` varchar(5) NOT NULL default '', |
| | | `server_id` int(11) unsigned NOT NULL default '0', |
| | | `domain` varchar(255) NOT NULL default '', |
| | | |
| | | `management_method` ENUM( 'normal', 'maildomain' ) NOT NULL default 'normal', |
| | | `public_registration` ENUM( 'n', 'y' ) NOT NULL default 'n', |
| | | `registration_url` varchar(255) NOT NULL DEFAULT '', |
| | | `registration_message` varchar(255) NOT NULL DEFAULT '', |
| | | `domain_admins` text, |
| | | |
| | | `use_pubsub` enum('n','y') NOT NULL DEFAULT 'n', |
| | | `use_proxy` enum('n','y') NOT NULL DEFAULT 'n', |
| | | `use_anon_host` enum('n','y') NOT NULL DEFAULT 'n', |
| | | |
| | | `use_vjud` enum('n','y') NOT NULL DEFAULT 'n', |
| | | `vjud_opt_mode` enum('in', 'out') NOT NULL DEFAULT 'in', |
| | | |
| | | `use_muc_host` enum('n','y') NOT NULL DEFAULT 'n', |
| | | `muc_name` varchar(30) NOT NULL DEFAULT '' |
| | | `muc_restrict_room_creation` enum('n', 'y', 'm') NOT NULL DEFAULT 'm', |
| | | `muc_admins` text, |
| | | `use_pastebin` enum('n','y') NOT NULL DEFAULT 'n', |
| | | `pastebin_expire_after` int(3) NOT NULL DEFAULT 48, |
| | | `pastebin_trigger` varchar(10) NOT NULL DEFAULT '!paste', |
| | | `use_http_archive` enum('n','y') NOT NULL DEFAULT 'n', |
| | | `http_archive_show_join` enum('n', 'y') NOT NULL DEFAULT 'n', |
| | | `http_archive_show_status` enum('n', 'y') NOT NULL DEFAULT 'n', |
| | | `use_status_host` enum('n','y') NOT NULL DEFAULT 'n', |
| | | |
| | | `ssl_state` varchar(255) NULL, |
| | | `ssl_locality` varchar(255) NULL, |
| | | `ssl_organisation` varchar(255) NULL, |
| | | `ssl_organisation_unit` varchar(255) NULL, |
| | | `ssl_country` varchar(255) NULL, |
| | | `ssl_email` varchar(255) NULL, |
| | | `ssl_request` mediumtext NULL, |
| | | `ssl_cert` mediumtext NULL, |
| | | `ssl_bundle` mediumtext NULL, |
| | | `ssl_key` mediumtext NULL, |
| | | `ssl_action` varchar(16) NULL, |
| | | |
| | | `active` enum('n','y') NOT NULL DEFAULT 'n', |
| | | PRIMARY KEY (`domain_id`), |
| | | KEY `server_id` (`server_id`,`domain`), |
| | | KEY `domain_active` (`domain`,`active`) |
| | | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; |
| | | |
| | | -- |
| | | -- Table structure for table `xmpp_user` |
| | | -- |
| | | |
| | | CREATE TABLE `xmpp_user` ( |
| | | `xmppuser_id` int(11) unsigned NOT NULL auto_increment, |
| | | `sys_userid` int(11) unsigned NOT NULL default '0', |
| | | `sys_groupid` int(11) unsigned NOT NULL default '0', |
| | | `sys_perm_user` varchar(5) NOT NULL default '', |
| | | `sys_perm_group` varchar(5) NOT NULL default '', |
| | | `sys_perm_other` varchar(5) NOT NULL default '', |
| | | `server_id` int(11) unsigned NOT NULL default '0', |
| | | `jid` varchar(255) NOT NULL default '', |
| | | `password` varchar(255) NOT NULL default '', |
| | | `active` enum('n','y') NOT NULL DEFAULT 'n', |
| | | PRIMARY KEY (`xmppuser_id`), |
| | | KEY `server_id` (`server_id`,`jid`), |
| | | KEY `jid_active` (`jid`,`active`) |
| | | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; |
| | | |
| | | -- -------------------------------------------------------- |
| | | |
| | | ALTER TABLE `sys_ini` ADD `default_logo` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL , ADD `custom_logo` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ; |
| | | UPDATE `dbispconfig`.`sys_ini` SET `default_logo` = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAABBCAYAAACU5+uOAAAItUlEQVR42u1dCWwVVRStUJZCK6HsFNAgWpaCJkKICZKApKUFhURQpEnZF4EEUJZYEEpBIamgkQpUQBZRW7YCBqQsggsQEAgKLbIGCYsSCNqyQ8D76h18Hd/MvJk/n/bXc5KT+TNz79vPzNv+/2FhAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAe++s0akTsRZxMnE6cGkKcxkwhPofaBPwWRzxxB/EO8UGI8xhxEGoV8EscY8qBKFRcgdoFAhXHC+VUHAbHo5aBQASyrZwL5DoxEjUNeBXI9XIuEMEE1DTgVSA3FA3qIDEtBLnTQiBDUNOAV4EUKhpURojmZQQEAjwKgSwK0bykWQgEU74ABAKBABAIBOIJffoNrkRsS0whDiMO5uNw4gBiSxvfGOJrbDtMOgr2JNa18HmZmETsopnGp4h9xdF0TcQRb8NEPkawTzv2qaWIoybnZYRUBoJD+difGAuBlCy0qsRM4mfERcTFfGygsBUF/xFxE/EQ8RixwIbi/j7il8R3iE8qwuxAXMJxuuFiTvNMYleb/E0gXiI+cOBaISTJrzLxcw2/+8Q5pjjfNNkM0RDILLadpbimw+bsc4DPkxRpuqkZ1orisoBAiguuhkUhPSvZRBA3u6gsK94g9jDFP9aHcAV3EKNNYX8i3RcNJ4M4nTiROJCYykIzbGZKvouk68vYbyS/cUbz+RrJZpzkO5Sv3eajaJhRDvUwg21nKK4VcF5WKPgFH6PZZw/7dJXC6S6lczunfbIQLpeDkZ+lJcoCAikuvChioaLBtfD4JHPiXSFKKexBPoa9Wwr3ael6skMZDGO7K3z+uOSb5OA7mu2KiOGmPH3ADVh8/sohnDS2S1NcG+uiO/kd+8RL146YRWzj359tb0Eg+gIpsHkjFNrQqiF3DZJABDtyuCP5/FuNRlHN8Ofz9nx+XLNR3jR1c4w8TSFGSmnr4FEgU7wKhI51jAeTpv+/ZQGBOAuEu1d/Ku6LV35t9rdigkUjHuMgkHPEecQsxdjjUx4zHbMI+10OdzqfZ2o0iiqSfzgPfMXnzZqN6iTbJ5jytMTU0E97FEhaAAJ5kc/PuJjQOCoIgegJpKbUl5b5vGaBT+A+vOgn5/JYIdFBIOs1wo1kIZl93+P70/h8oUZYFXkmKInPU9h3m2YeT8lvRilPyyWbi3xt4iMWSDc+P4lp3uAIRDxdryjui6dmuujXcr91IDcMmaJv31WISfTrLeJXCUT3yb1a4Ztmalyu61MaZG/XtD9tapRGnpZKNp2lNNZ3KZARAQgk3untBYEEPgbJ92FsIAax34v1AQ2B5Go2BlW60n0QyCC/BWISdJ5LgewWU8k86DdTzMyNh0BKVyAzfB5I93YQyBGeTlW9lQbwIle2Rdgzy7BAxJT6Hb6X6EIgTrznRSCiHli02cwcPor1pbkQiL5AKvOA+ZZPAtkfxFms3j4IZHAwBGJaRPxdjH00BSImJRqKOlEwjtjUo0Dm2pWla4HMzsyqQIxSMKI8C8RkL9YXuhDf5gqcw4NweaZJiGkh8UeLwi+Utkb4KZCrYszkVSDiQRDMN4hkf5DvZ2gKZJyLPJgFkmAjEDEF3EYSWzPeklO8Q8CLQGKJhQquK+eDdLFNZBJxFLEf8XUXFTbcYv2kRhAEIq+vGNO88zTTKVaRzxPrSSvPW11O8yZqCiROSnMsX0sP0ixWops1Hfbx/AaJIz5QcFc5n+ZVNcbxmoWtEsBNB4EU8Tgk32Gv1wneEybeWG1N8RoNbplmOo2neiyxE3/eoun7G9t31hGIqXuzl8/HB0kgxhvhD03/KoEIpIWFQPLK+UJhkWpgKLZP8IKhajNhJg8A7yt8/5K6QoFM8z5mc68Ph3VWM6wTbN+a+AR/vqThV13KYyMXAgmXps9FnK8GSSA17KaXFf7R3gUyd8H/TiBss9fngfQehzfMpkDLgxcS73J4k1y85WrxtTtOjZPuVZA2O55RhLfUId5XpI2UHwZDIHxtp7HtRrVL25SfhWy7z7VAMuYvipszd0FJcfxzHspdrMctGnGcZNPTZ4F0VszqyPSlPHm8JG9f2SDtgF3Nq/rnJZssyXeUdP0CN64c9l/FDfGyZNNNkaeVGmnMM+Vdtd19los8/2e7Ow/E70lxiG7pRmkn8AaeULlcoo4sBDLfKvL0nLUxablfX0hfmfuQ01avI65fUQYEkupRIJHcAMwbDWNNdmLgupV4zeMO3stcIZ1M4aYo4vZt0oO7Locd0ndGTEQofN+QxiZ22+y7W+RpgUb66vOU7232SZXupZqvaYT3Dfu8ZLrejtc47mvkJ9FoVEWKBmW7dyc7ZXD1Nb2TH3JVn5Tqa3r1repzY6/gwWeqhUCGO/XjWSTmjYYVLOzFoP0Z/qJTks033brxrtjmxCbGtK4ivEqKuH2fNuc0tDatIYgna4yGbz2eeTL8WhJbic2aDnmqqpm2KlLeK5vWn0pc0wirGvtUtBkzNdPKDzWe24oGdZX4CzGfWCD4U93GBQdqNSw4Uiny8K9h4buOhlU2scq+Q1G1i233k63hFwBPEfcS04l1FGJoynbH+fgz8ZKFQJLDAMDjk/psCPzw20XxE6mmdLd24d8KNQ14FciUEPl1xHvEhlK6W2j65aOWgUAEUpV4NEREstyDQNqjloFARVKL/xukrAvkGjGC09zGwfYKsQdqF/BTKMnEJcTtxC3EPAU3iic5cRkfjc/ZFvZuuZm4gXjOouG35LQ2Yfutkq/4pfpN/E9TDVCjQGkJqQExho+CjYlRPseRiQE3EIriaMZTw4K3mOJv23J8jme23RsEAMqqQJrb9PnnEbPEVpUAuJD4Mf/PoCqeONQCUJYFElGKf7ojpnqjUQtAWRdJaf1t2w8ofSAUBNKulATSEaUPhIpIRj9icbyFUgdCTSRTeR0i2HwfpQ0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQBnG392D9QU+JXhxAAAAAElFTkSuQmCC' WHERE `sys_ini`.`sysini_id` = 1; |
| | | |
| | | ALTER TABLE `directive_snippets` ADD `required_php_snippets` VARCHAR(255) NOT NULL DEFAULT '' AFTER `customer_viewable`; |
| | | ALTER TABLE `dns_rr` CHANGE `ttl` `ttl` INT(11) UNSIGNED NOT NULL DEFAULT '3600'; |
| | | ALTER TABLE `dns_soa` CHANGE `minimum` `minimum` INT(11) UNSIGNED NOT NULL DEFAULT '3600', CHANGE `ttl` `ttl` INT(11) UNSIGNED NOT NULL DEFAULT '3600'; |
| | | ALTER TABLE `client` CHANGE `web_php_options` `web_php_options` VARCHAR(255) NOT NULL DEFAULT 'no,fast-cgi,cgi,mod,suphp,php-fpm,hhvm'; |
| | | ALTER TABLE `web_domain` ADD COLUMN `enable_pagespeed` ENUM('y','n') NOT NULL DEFAULT 'n' AFTER `directive_snippets_id`; |
| | | |
| | | ALTER TABLE openvz_template ADD COLUMN `features` varchar(255) DEFAULT NULL AFTER `capability`; |
| | | ALTER TABLE openvz_vm ADD COLUMN `features` TEXT DEFAULT NULL AFTER `capability`; |
| | | ALTER TABLE openvz_template ADD COLUMN `iptables` varchar(255) DEFAULT NULL AFTER `features`; |
| | | ALTER TABLE openvz_vm ADD COLUMN `iptables` TEXT DEFAULT NULL AFTER `features`; |
| | | |
| | | CREATE TABLE `server_ip_map` ( |
| | | `server_ip_map_id` int(11) unsigned NOT NULL AUTO_INCREMENT, |
| | | `sys_userid` int(11) unsigned NOT NULL DEFAULT '0', |
| | | `sys_groupid` int(11) unsigned NOT NULL DEFAULT '0', |
| | | `sys_perm_user` varchar(5) DEFAULT NULL, |
| | | `sys_perm_group` varchar(5) DEFAULT NULL, |
| | | `sys_perm_other` varchar(5) DEFAULT NULL, |
| | | `server_id` int(11) unsigned NOT NULL DEFAULT '0', |
| | | `source_ip` varchar(15) DEFAULT NULL, |
| | | `destination_ip` varchar(35) DEFAULT '', |
| | | `active` enum('n','y') NOT NULL DEFAULT 'y', |
| | | PRIMARY KEY (`server_ip_map_id`) |
| | | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; |
| | | |
| | | ALTER TABLE `web_domain` ADD COLUMN `rewrite_to_https` ENUM('y','n') NOT NULL DEFAULT 'n' AFTER `seo_redirect`; |
| | |
| | | `limit_spamfilter_wblist` int(11) NOT NULL DEFAULT '0', |
| | | `limit_spamfilter_user` int(11) NOT NULL DEFAULT '0', |
| | | `limit_spamfilter_policy` int(11) NOT NULL DEFAULT '0', |
| | | `default_xmppserver` int(11) unsigned NOT NULL DEFAULT '1', |
| | | `xmpp_servers` blob, |
| | | `limit_xmpp_domain` int(11) NOT NULL DEFAULT '-1', |
| | | `limit_xmpp_user` int(11) NOT NULL DEFAULT '-1', |
| | | `limit_xmpp_muc` ENUM( 'n', 'y' ) NOT NULL default 'n', |
| | | `limit_xmpp_anon` ENUM( 'n', 'y' ) NOT NULL default 'n', |
| | | `limit_xmpp_auth_options` varchar(255) NOT NULL DEFAULT 'plain,hashed,isp', |
| | | `limit_xmpp_vjud` ENUM( 'n', 'y' ) NOT NULL default 'n', |
| | | `limit_xmpp_proxy` ENUM( 'n', 'y' ) NOT NULL default 'n', |
| | | `limit_xmpp_status` ENUM( 'n', 'y' ) NOT NULL default 'n', |
| | | `limit_xmpp_pastebin` ENUM( 'n', 'y' ) NOT NULL default 'n', |
| | | `limit_xmpp_httparchive` ENUM( 'n', 'y' ) NOT NULL default 'n', |
| | | `default_webserver` int(11) unsigned NOT NULL DEFAULT '1', |
| | | `web_servers` blob, |
| | | `limit_web_ip` text, |
| | | `limit_web_domain` int(11) NOT NULL DEFAULT '-1', |
| | | `limit_web_quota` int(11) NOT NULL DEFAULT '-1', |
| | | `web_php_options` varchar(255) NOT NULL DEFAULT 'no,fast-cgi,cgi,mod,suphp,php-fpm', |
| | | `web_php_options` varchar(255) NOT NULL DEFAULT 'no,fast-cgi,cgi,mod,suphp,php-fpm,hhvm', |
| | | `limit_cgi` enum('n','y') NOT NULL DEFAULT 'n', |
| | | `limit_ssi` enum('n','y') NOT NULL DEFAULT 'n', |
| | | `limit_perl` enum('n','y') NOT NULL DEFAULT 'n', |
| | |
| | | `type` varchar(255) DEFAULT NULL, |
| | | `snippet` mediumtext, |
| | | `customer_viewable` ENUM('n','y') NOT NULL DEFAULT 'n', |
| | | `required_php_snippets` varchar(255) NOT NULL DEFAULT '', |
| | | `active` enum('n','y') NOT NULL DEFAULT 'y', |
| | | PRIMARY KEY (`directive_snippets_id`) |
| | | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; |
| | |
| | | `type` enum('A','AAAA','ALIAS','CNAME','HINFO','MX','NAPTR','NS','PTR','RP','SRV','TXT') default NULL, |
| | | `data` TEXT NOT NULL DEFAULT '', |
| | | `aux` int(11) unsigned NOT NULL default '0', |
| | | `ttl` int(11) unsigned NOT NULL default '86400', |
| | | `ttl` int(11) unsigned NOT NULL default '3600', |
| | | `active` enum('N','Y') NOT NULL default 'Y', |
| | | `stamp` timestamp NOT NULL default CURRENT_TIMESTAMP, |
| | | `serial` int(10) unsigned default NULL, |
| | |
| | | `refresh` int(11) unsigned NOT NULL default '28800', |
| | | `retry` int(11) unsigned NOT NULL default '7200', |
| | | `expire` int(11) unsigned NOT NULL default '604800', |
| | | `minimum` int(11) unsigned NOT NULL default '86400', |
| | | `ttl` int(11) unsigned NOT NULL default '86400', |
| | | `minimum` int(11) unsigned NOT NULL default '3600', |
| | | `ttl` int(11) unsigned NOT NULL default '3600', |
| | | `active` enum('N','Y') NOT NULL DEFAULT 'N', |
| | | `xfer` varchar(255) NOT NULL DEFAULT '', |
| | | `also_notify` varchar(255) default NULL, |
| | |
| | | `destination` text, |
| | | `type` enum('alias','aliasdomain','forward','catchall') NOT NULL default 'alias', |
| | | `active` enum('n','y') NOT NULL DEFAULT 'n', |
| | | `greylisting` enum('n','y' ) NOT NULL DEFAULT 'n', |
| | | PRIMARY KEY (`forwarding_id`), |
| | | KEY `server_id` (`server_id`,`source`), |
| | | KEY `type` (`type`) |
| | |
| | | `uid` int(11) NOT NULL default '5000', |
| | | `gid` int(11) NOT NULL default '5000', |
| | | `maildir` varchar(255) NOT NULL default '', |
| | | `maildir_format` varchar(255) NOT NULL default 'maildir', |
| | | `quota` bigint(20) NOT NULL default '-1', |
| | | `cc` varchar(255) NOT NULL default '', |
| | | `sender_cc` varchar(255) NOT NULL default '', |
| | |
| | | `move_junk` enum('n','y') NOT NULL default 'n', |
| | | `custom_mailfilter` mediumtext, |
| | | `postfix` enum('n','y') NOT NULL default 'y', |
| | | `greylisting` enum('n','y' ) NOT NULL DEFAULT 'n', |
| | | `access` enum('n','y') NOT NULL default 'y', |
| | | `disableimap` enum('n','y') NOT NULL default 'n', |
| | | `disablepop3` enum('n','y') NOT NULL default 'n', |
| | |
| | | `nameserver` varchar(255) DEFAULT NULL, |
| | | `create_dns` varchar(1) NOT NULL DEFAULT 'n', |
| | | `capability` varchar(255) DEFAULT NULL, |
| | | `features` varchar(255) DEFAULT NULL, |
| | | `iptables` varchar(255) DEFAULT NULL, |
| | | PRIMARY KEY (`template_id`) |
| | | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ; |
| | | |
| | |
| | | -- Dumping data for table `openvz_template` |
| | | -- |
| | | |
| | | INSERT INTO `openvz_template` (`template_id`, `sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `template_name`, `diskspace`, `traffic`, `bandwidth`, `ram`, `ram_burst`, `cpu_units`, `cpu_num`, `cpu_limit`, `io_priority`, `active`, `description`, `numproc`, `numtcpsock`, `numothersock`, `vmguarpages`, `kmemsize`, `tcpsndbuf`, `tcprcvbuf`, `othersockbuf`, `dgramrcvbuf`, `oomguarpages`, `privvmpages`, `lockedpages`, `shmpages`, `physpages`, `numfile`, `avnumproc`, `numflock`, `numpty`, `numsiginfo`, `dcachesize`, `numiptent`, `swappages`, `hostname`, `nameserver`, `create_dns`, `capability`) VALUES(1, 1, 1, 'riud', 'riud', '', 'small', 10, -1, -1, 256, 512, 1000, 4, 400, 4, 'y', '', '999999:999999', '7999992:7999992', '7999992:7999992', '65536:65536', '2147483646:2147483646', '214748160:396774400', '214748160:396774400', '214748160:396774400', '214748160:396774400', '65536:65536', '131072:131072', '999999:999999', '65536:65536', '0:2147483647', '23999976:23999976', '180:180', '999999:999999', '500000:500000', '999999:999999', '2147483646:2147483646', '999999:999999', '256000:256000', 'v{VEID}.test.tld', '8.8.8.8 8.8.4.4', 'n', ''); |
| | | INSERT INTO `openvz_template` (`template_id`, `sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `template_name`, `diskspace`, `traffic`, `bandwidth`, `ram`, `ram_burst`, `cpu_units`, `cpu_num`, `cpu_limit`, `io_priority`, `active`, `description`, `numproc`, `numtcpsock`, `numothersock`, `vmguarpages`, `kmemsize`, `tcpsndbuf`, `tcprcvbuf`, `othersockbuf`, `dgramrcvbuf`, `oomguarpages`, `privvmpages`, `lockedpages`, `shmpages`, `physpages`, `numfile`, `avnumproc`, `numflock`, `numpty`, `numsiginfo`, `dcachesize`, `numiptent`, `swappages`, `hostname`, `nameserver`, `create_dns`, `capability`, `features`, `iptables`) VALUES(1, 1, 1, 'riud', 'riud', '', 'small', 10, -1, -1, 256, 512, 1000, 4, 400, 4, 'y', '', '999999:999999', '7999992:7999992', '7999992:7999992', '65536:65536', '2147483646:2147483646', '214748160:396774400', '214748160:396774400', '214748160:396774400', '214748160:396774400', '65536:65536', '131072:131072', '999999:999999', '65536:65536', '0:2147483647', '23999976:23999976', '180:180', '999999:999999', '500000:500000', '999999:999999', '2147483646:2147483646', '999999:999999', '256000:256000', 'v{VEID}.test.tld', '8.8.8.8 8.8.4.4', 'n', '', '', ''); |
| | | |
| | | -- -------------------------------------------------------- |
| | | |
| | |
| | | `nameserver` varchar(255) NOT NULL DEFAULT '8.8.8.8 8.8.4.4', |
| | | `create_dns` varchar(1) NOT NULL DEFAULT 'n', |
| | | `capability` text, |
| | | `features` text, |
| | | `iptabless` text, |
| | | `config` mediumtext, |
| | | PRIMARY KEY (`vm_id`) |
| | | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ; |
| | |
| | | `vserver_server` tinyint(1) NOT NULL default '0', |
| | | `proxy_server` tinyint(1) NOT NULL default '0', |
| | | `firewall_server` tinyint(1) NOT NULL default '0', |
| | | `xmpp_server` tinyint(1) NOT NULL default '0', |
| | | `config` text, |
| | | `updated` bigint(20) unsigned NOT NULL default '0', |
| | | `mirror_server_id` int(11) unsigned NOT NULL default '0', |
| | |
| | | |
| | | -- -------------------------------------------------------- |
| | | |
| | | -- |
| | | -- Table structure for table `server_ip_map` |
| | | -- |
| | | |
| | | CREATE TABLE `server_ip_map` ( |
| | | `server_ip_map_id` int(11) unsigned NOT NULL AUTO_INCREMENT, |
| | | `sys_userid` int(11) unsigned NOT NULL DEFAULT '0', |
| | | `sys_groupid` int(11) unsigned NOT NULL DEFAULT '0', |
| | | `sys_perm_user` varchar(5) DEFAULT NULL, |
| | | `sys_perm_group` varchar(5) DEFAULT NULL, |
| | | `sys_perm_other` varchar(5) DEFAULT NULL, |
| | | `server_id` int(11) unsigned NOT NULL DEFAULT '0', |
| | | `source_ip` varchar(15) DEFAULT NULL, |
| | | `destination_ip` varchar(35) DEFAULT '', |
| | | `active` enum('n','y') NOT NULL DEFAULT 'y', |
| | | PRIMARY KEY (`server_ip_map_id`) |
| | | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; |
| | | |
| | | -- -------------------------------------------------------- |
| | | |
| | | -- |
| | | -- Table structure for table `server_php` |
| | |
| | | CREATE TABLE `sys_ini` ( |
| | | `sysini_id` int(11) unsigned NOT NULL auto_increment, |
| | | `config` longtext, |
| | | `default_logo` text NOT NULL, |
| | | `custom_logo` text NOT NULL, |
| | | PRIMARY KEY (`sysini_id`) |
| | | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; |
| | | |
| | |
| | | `client_id` int(11) unsigned NOT NULL default '0', |
| | | `id_rsa` VARCHAR( 2000 ) NOT NULL default '', |
| | | `ssh_rsa` VARCHAR( 600 ) NOT NULL default '', |
| | | `lost_password_function` tinyint(1) NOT NULL default '1', |
| | | PRIMARY KEY (`userid`) |
| | | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; |
| | | |
| | |
| | | `redirect_type` varchar(255) default NULL, |
| | | `redirect_path` varchar(255) default NULL, |
| | | `seo_redirect` varchar(255) default NULL, |
| | | `rewrite_to_https` ENUM('y','n') NOT NULL DEFAULT 'n', |
| | | `ssl` enum('n','y') NOT NULL default 'n', |
| | | `ssl_state` varchar(255) NULL, |
| | | `ssl_locality` varchar(255) NULL, |
| | |
| | | `added_date` date NOT NULL DEFAULT '0000-00-00', |
| | | `added_by` varchar(255) DEFAULT NULL, |
| | | `directive_snippets_id` int(11) unsigned NOT NULL default '0', |
| | | `enable_pagespeed` ENUM('y','n') NOT NULL DEFAULT 'n', |
| | | `http_port` int(11) unsigned NOT NULL DEFAULT '80', |
| | | `https_port` int(11) unsigned NOT NULL DEFAULT '443', |
| | | PRIMARY KEY (`domain_id`), |
| | | UNIQUE KEY `serverdomain` ( `server_id` , `ip_address`, `domain` ) |
| | | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; |
| | |
| | | `traffic_bytes` bigint(32) unsigned NOT NULL default '0', |
| | | PRIMARY KEY (`hostname`,`traffic_date`) |
| | | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ; |
| | | |
| | | -- -------------------------------------------------------- |
| | | |
| | | -- |
| | | -- Table structure for table `xmpp_domain` |
| | | -- |
| | | |
| | | CREATE TABLE `xmpp_domain` ( |
| | | `domain_id` int(11) unsigned NOT NULL auto_increment, |
| | | `sys_userid` int(11) unsigned NOT NULL default '0', |
| | | `sys_groupid` int(11) unsigned NOT NULL default '0', |
| | | `sys_perm_user` varchar(5) NOT NULL default '', |
| | | `sys_perm_group` varchar(5) NOT NULL default '', |
| | | `sys_perm_other` varchar(5) NOT NULL default '', |
| | | `server_id` int(11) unsigned NOT NULL default '0', |
| | | `domain` varchar(255) NOT NULL default '', |
| | | |
| | | `management_method` ENUM( 'normal', 'maildomain' ) NOT NULL default 'normal', |
| | | `public_registration` ENUM( 'n', 'y' ) NOT NULL default 'n', |
| | | `registration_url` varchar(255) NOT NULL DEFAULT '', |
| | | `registration_message` varchar(255) NOT NULL DEFAULT '', |
| | | `domain_admins` text, |
| | | |
| | | `use_pubsub` enum('n','y') NOT NULL DEFAULT 'n', |
| | | `use_proxy` enum('n','y') NOT NULL DEFAULT 'n', |
| | | `use_anon_host` enum('n','y') NOT NULL DEFAULT 'n', |
| | | |
| | | `use_vjud` enum('n','y') NOT NULL DEFAULT 'n', |
| | | `vjud_opt_mode` enum('in', 'out') NOT NULL DEFAULT 'in', |
| | | |
| | | `use_muc_host` enum('n','y') NOT NULL DEFAULT 'n', |
| | | `muc_name` varchar(30) NOT NULL DEFAULT '', |
| | | `muc_restrict_room_creation` enum('n', 'y', 'm') NOT NULL DEFAULT 'm', |
| | | `muc_admins` text, |
| | | `use_pastebin` enum('n','y') NOT NULL DEFAULT 'n', |
| | | `pastebin_expire_after` int(3) NOT NULL DEFAULT 48, |
| | | `pastebin_trigger` varchar(10) NOT NULL DEFAULT '!paste', |
| | | `use_http_archive` enum('n','y') NOT NULL DEFAULT 'n', |
| | | `http_archive_show_join` enum('n', 'y') NOT NULL DEFAULT 'n', |
| | | `http_archive_show_status` enum('n', 'y') NOT NULL DEFAULT 'n', |
| | | `use_status_host` enum('n','y') NOT NULL DEFAULT 'n', |
| | | |
| | | `ssl_state` varchar(255) NULL, |
| | | `ssl_locality` varchar(255) NULL, |
| | | `ssl_organisation` varchar(255) NULL, |
| | | `ssl_organisation_unit` varchar(255) NULL, |
| | | `ssl_country` varchar(255) NULL, |
| | | `ssl_email` varchar(255) NULL, |
| | | `ssl_request` mediumtext NULL, |
| | | `ssl_cert` mediumtext NULL, |
| | | `ssl_bundle` mediumtext NULL, |
| | | `ssl_key` mediumtext NULL, |
| | | `ssl_action` varchar(16) NULL, |
| | | |
| | | `active` enum('n','y') NOT NULL DEFAULT 'n', |
| | | PRIMARY KEY (`domain_id`), |
| | | KEY `server_id` (`server_id`,`domain`), |
| | | KEY `domain_active` (`domain`,`active`) |
| | | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; |
| | | |
| | | -- -------------------------------------------------------- |
| | | |
| | | -- |
| | | -- Table structure for table `xmpp_user` |
| | | -- |
| | | |
| | | CREATE TABLE `xmpp_user` ( |
| | | `xmppuser_id` int(11) unsigned NOT NULL auto_increment, |
| | | `sys_userid` int(11) unsigned NOT NULL default '0', |
| | | `sys_groupid` int(11) unsigned NOT NULL default '0', |
| | | `sys_perm_user` varchar(5) NOT NULL default '', |
| | | `sys_perm_group` varchar(5) NOT NULL default '', |
| | | `sys_perm_other` varchar(5) NOT NULL default '', |
| | | `server_id` int(11) unsigned NOT NULL default '0', |
| | | `jid` varchar(255) NOT NULL default '', |
| | | `password` varchar(255) NOT NULL default '', |
| | | `active` enum('n','y') NOT NULL DEFAULT 'n', |
| | | PRIMARY KEY (`xmppuser_id`), |
| | | KEY `server_id` (`server_id`,`jid`), |
| | | KEY `jid_active` (`jid`,`active`) |
| | | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; |
| | | |
| | | -- -------------------------------------------------------- |
| | | |
| | | -- -------------------------------------------------------- |
| | | -- -------------------------------------------------------- |
| | |
| | | -- Dumping data for table `dns_template` |
| | | -- |
| | | |
| | | INSERT INTO `dns_template` (`template_id`, `sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `name`, `fields`, `template`, `visible`) VALUES (1, 1, 1, 'riud', 'riud', '', 'Default', 'DOMAIN,IP,NS1,NS2,EMAIL,DKIM', '[ZONE]\norigin={DOMAIN}.\nns={NS1}.\nmbox={EMAIL}.\nrefresh=7200\nretry=540\nexpire=604800\nminimum=86400\nttl=3600\n\n[DNS_RECORDS]\nA|{DOMAIN}.|{IP}|0|3600\nA|www|{IP}|0|3600\nA|mail|{IP}|0|3600\nNS|{DOMAIN}.|{NS1}.|0|3600\nNS|{DOMAIN}.|{NS2}.|0|3600\nMX|{DOMAIN}.|mail.{DOMAIN}.|10|3600\nTXT|{DOMAIN}.|v=spf1 mx a ~all|0|3600', 'y'); |
| | | INSERT INTO `dns_template` (`template_id`, `sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `name`, `fields`, `template`, `visible`) VALUES (1, 1, 1, 'riud', 'riud', '', 'Default', 'DOMAIN,IP,NS1,NS2,EMAIL,DKIM', '[ZONE]\norigin={DOMAIN}.\nns={NS1}.\nmbox={EMAIL}.\nrefresh=7200\nretry=540\nexpire=604800\nminimum=3600\nttl=3600\n\n[DNS_RECORDS]\nA|{DOMAIN}.|{IP}|0|3600\nA|www|{IP}|0|3600\nA|mail|{IP}|0|3600\nNS|{DOMAIN}.|{NS1}.|0|3600\nNS|{DOMAIN}.|{NS2}.|0|3600\nMX|{DOMAIN}.|mail.{DOMAIN}.|10|3600\nTXT|{DOMAIN}.|v=spf1 mx a ~all|0|3600', 'y'); |
| | | |
| | | |
| | | -- -------------------------------------------------------- |
| | |
| | | -- Dumping data for table `sys_ini` |
| | | -- |
| | | |
| | | INSERT INTO `sys_ini` (`sysini_id`, `config`) VALUES (1, ''); |
| | | INSERT INTO `sys_ini` (`sysini_id`, `config`, `default_logo`, `custom_logo`) VALUES (1, '', 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAABBCAYAAACU5+uOAAAItUlEQVR42u1dCWwVVRStUJZCK6HsFNAgWpaCJkKICZKApKUFhURQpEnZF4EEUJZYEEpBIamgkQpUQBZRW7YCBqQsggsQEAgKLbIGCYsSCNqyQ8D76h18Hd/MvJk/n/bXc5KT+TNz79vPzNv+/2FhAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAe++s0akTsRZxMnE6cGkKcxkwhPofaBPwWRzxxB/EO8UGI8xhxEGoV8EscY8qBKFRcgdoFAhXHC+VUHAbHo5aBQASyrZwL5DoxEjUNeBXI9XIuEMEE1DTgVSA3FA3qIDEtBLnTQiBDUNOAV4EUKhpURojmZQQEAjwKgSwK0bykWQgEU74ABAKBABAIBOIJffoNrkRsS0whDiMO5uNw4gBiSxvfGOJrbDtMOgr2JNa18HmZmETsopnGp4h9xdF0TcQRb8NEPkawTzv2qaWIoybnZYRUBoJD+difGAuBlCy0qsRM4mfERcTFfGygsBUF/xFxE/EQ8RixwIbi/j7il8R3iE8qwuxAXMJxuuFiTvNMYleb/E0gXiI+cOBaISTJrzLxcw2/+8Q5pjjfNNkM0RDILLadpbimw+bsc4DPkxRpuqkZ1orisoBAiguuhkUhPSvZRBA3u6gsK94g9jDFP9aHcAV3EKNNYX8i3RcNJ4M4nTiROJCYykIzbGZKvouk68vYbyS/cUbz+RrJZpzkO5Sv3eajaJhRDvUwg21nKK4VcF5WKPgFH6PZZw/7dJXC6S6lczunfbIQLpeDkZ+lJcoCAikuvChioaLBtfD4JHPiXSFKKexBPoa9Wwr3ael6skMZDGO7K3z+uOSb5OA7mu2KiOGmPH3ADVh8/sohnDS2S1NcG+uiO/kd+8RL146YRWzj359tb0Eg+gIpsHkjFNrQqiF3DZJABDtyuCP5/FuNRlHN8Ofz9nx+XLNR3jR1c4w8TSFGSmnr4FEgU7wKhI51jAeTpv+/ZQGBOAuEu1d/Ku6LV35t9rdigkUjHuMgkHPEecQsxdjjUx4zHbMI+10OdzqfZ2o0iiqSfzgPfMXnzZqN6iTbJ5jytMTU0E97FEhaAAJ5kc/PuJjQOCoIgegJpKbUl5b5vGaBT+A+vOgn5/JYIdFBIOs1wo1kIZl93+P70/h8oUZYFXkmKInPU9h3m2YeT8lvRilPyyWbi3xt4iMWSDc+P4lp3uAIRDxdryjui6dmuujXcr91IDcMmaJv31WISfTrLeJXCUT3yb1a4Ztmalyu61MaZG/XtD9tapRGnpZKNp2lNNZ3KZARAQgk3untBYEEPgbJ92FsIAax34v1AQ2B5Go2BlW60n0QyCC/BWISdJ5LgewWU8k86DdTzMyNh0BKVyAzfB5I93YQyBGeTlW9lQbwIle2Rdgzy7BAxJT6Hb6X6EIgTrznRSCiHli02cwcPor1pbkQiL5AKvOA+ZZPAtkfxFms3j4IZHAwBGJaRPxdjH00BSImJRqKOlEwjtjUo0Dm2pWla4HMzsyqQIxSMKI8C8RkL9YXuhDf5gqcw4NweaZJiGkh8UeLwi+Utkb4KZCrYszkVSDiQRDMN4hkf5DvZ2gKZJyLPJgFkmAjEDEF3EYSWzPeklO8Q8CLQGKJhQquK+eDdLFNZBJxFLEf8XUXFTbcYv2kRhAEIq+vGNO88zTTKVaRzxPrSSvPW11O8yZqCiROSnMsX0sP0ixWops1Hfbx/AaJIz5QcFc5n+ZVNcbxmoWtEsBNB4EU8Tgk32Gv1wneEybeWG1N8RoNbplmOo2neiyxE3/eoun7G9t31hGIqXuzl8/HB0kgxhvhD03/KoEIpIWFQPLK+UJhkWpgKLZP8IKhajNhJg8A7yt8/5K6QoFM8z5mc68Ph3VWM6wTbN+a+AR/vqThV13KYyMXAgmXps9FnK8GSSA17KaXFf7R3gUyd8H/TiBss9fngfQehzfMpkDLgxcS73J4k1y85WrxtTtOjZPuVZA2O55RhLfUId5XpI2UHwZDIHxtp7HtRrVL25SfhWy7z7VAMuYvipszd0FJcfxzHspdrMctGnGcZNPTZ4F0VszqyPSlPHm8JG9f2SDtgF3Nq/rnJZssyXeUdP0CN64c9l/FDfGyZNNNkaeVGmnMM+Vdtd19los8/2e7Ow/E70lxiG7pRmkn8AaeULlcoo4sBDLfKvL0nLUxablfX0hfmfuQ01avI65fUQYEkupRIJHcAMwbDWNNdmLgupV4zeMO3stcIZ1M4aYo4vZt0oO7Locd0ndGTEQofN+QxiZ22+y7W+RpgUb66vOU7232SZXupZqvaYT3Dfu8ZLrejtc47mvkJ9FoVEWKBmW7dyc7ZXD1Nb2TH3JVn5Tqa3r1repzY6/gwWeqhUCGO/XjWSTmjYYVLOzFoP0Z/qJTks033brxrtjmxCbGtK4ivEqKuH2fNuc0tDatIYgna4yGbz2eeTL8WhJbic2aDnmqqpm2KlLeK5vWn0pc0wirGvtUtBkzNdPKDzWe24oGdZX4CzGfWCD4U93GBQdqNSw4Uiny8K9h4buOhlU2scq+Q1G1i233k63hFwBPEfcS04l1FGJoynbH+fgz8ZKFQJLDAMDjk/psCPzw20XxE6mmdLd24d8KNQ14FciUEPl1xHvEhlK6W2j65aOWgUAEUpV4NEREstyDQNqjloFARVKL/xukrAvkGjGC09zGwfYKsQdqF/BTKMnEJcTtxC3EPAU3iic5cRkfjc/ZFvZuuZm4gXjOouG35LQ2Yfutkq/4pfpN/E9TDVCjQGkJqQExho+CjYlRPseRiQE3EIriaMZTw4K3mOJv23J8jme23RsEAMqqQJrb9PnnEbPEVpUAuJD4Mf/PoCqeONQCUJYFElGKf7ojpnqjUQtAWRdJaf1t2w8ofSAUBNKulATSEaUPhIpIRj9icbyFUgdCTSRTeR0i2HwfpQ0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQBnG392D9QU+JXhxAAAAAElFTkSuQmCC', ''); |
| | | |
| | | -- -------------------------------------------------------- |
| | | |
| | |
| | | export PHPRC |
| | | export PHP_FCGI_MAX_REQUESTS=5000 |
| | | export PHP_FCGI_CHILDREN=1 |
| | | exec {fastcgi_bin} -d magic_quotes_gpc=off |
| | | exec {fastcgi_bin} -d \ |
| | | -d disable_classes= \ |
| | | -d disable_functions= \ |
| | | -d magic_quotes_gpc=off \ |
| | | -d open_basedir= |
| | |
| | | export PHPRC |
| | | export PHP_FCGI_MAX_REQUESTS=5000 |
| | | export PHP_FCGI_CHILDREN=1 |
| | | exec {fastcgi_bin} -d magic_quotes_gpc=off -d session.save_path=/usr/local/ispconfig/interface/temp |
| | | exec {fastcgi_bin} \ |
| | | -d disable_classes= \ |
| | | -d disable_functions= \ |
| | | -d magic_quotes_gpc=off \ |
| | | -d open_basedir= \ |
| | | -d session.save_path=/usr/local/ispconfig/interface/temp |
| | |
| | | MYSQL_SERVER {mysql_server_host} |
| | | MYSQL_USERNAME {mysql_server_ispconfig_user} |
| | | MYSQL_PASSWORD {mysql_server_ispconfig_password} |
| | | MYSQL_PORT 0 |
| | | MYSQL_PORT {mysql_server_port} |
| | | MYSQL_DATABASE {mysql_server_database} |
| | | MYSQL_USER_TABLE mail_user |
| | | MYSQL_CRYPT_PWFIELD password |
| | |
| | | MYSQL_QUOTA_FIELD quota |
| | | #MYSQL_QUOTA_FIELD concat(quota,'S') |
| | | #MYSQL_WHERE_CLAUSE access='y' |
| | | MYSQL_AUXOPTIONS_FIELD concat('disableimap=',disableimap,',disablepop3=',disablepop3) |
| | | #MYSQL_AUXOPTIONS_FIELD concat('disableimap=',disableimap,',disablepop3=',disablepop3) |
| | | MYSQL_AUXOPTIONS_FIELD concat('disableimap=', if(disableimap = 'y', 1, 0), ',', 'disablepop3=', if(disablepop3 = 'y', 1, 0)) |
| | |
| | | //** Database |
| | | $conf['db_type'] = 'mysql'; |
| | | $conf['db_host'] = '{mysql_server_host}'; |
| | | $conf['db_port'] = '{mysql_server_port}'; |
| | | $conf['db_database'] = '{mysql_server_database}'; |
| | | $conf['db_user'] = '{mysql_server_ispconfig_user}'; |
| | | $conf['db_password'] = '{mysql_server_ispconfig_password}'; |
| | |
| | | |
| | | define('DB_TYPE',$conf['db_type']); |
| | | define('DB_HOST',$conf['db_host']); |
| | | define('DB_PORT',$conf['db_port']); |
| | | define('DB_DATABASE',$conf['db_database']); |
| | | define('DB_USER',$conf['db_user']); |
| | | define('DB_PASSWORD',$conf['db_password']); |
| | |
| | | //** Database settings for the master DB. This setting is only used in multiserver setups |
| | | $conf['dbmaster_type'] = 'mysql'; |
| | | $conf['dbmaster_host'] = '{mysql_master_server_host}'; |
| | | $conf['dbmaster_port'] = '{mysql_master_server_port}'; |
| | | $conf['dbmaster_database'] = '{mysql_master_server_database}'; |
| | | $conf['dbmaster_user'] = '{mysql_master_server_ispconfig_user}'; |
| | | $conf['dbmaster_password'] = '{mysql_master_server_ispconfig_password}'; |
| | |
| | | # ); |
| | | |
| | | driver = mysql |
| | | connect = host={mysql_server_host} dbname={mysql_server_database} user={mysql_server_ispconfig_user} password={mysql_server_ispconfig_password} |
| | | connect = host={mysql_server_host} dbname={mysql_server_database} user={mysql_server_ispconfig_user} password={mysql_server_ispconfig_password} port={mysql_server_port} |
| | | default_pass_scheme = CRYPT |
| | | |
| | | password_query = SELECT password FROM mail_user WHERE (login = '%u' OR email = '%u') AND disable%Ls = 'n' AND server_id = '{server_id}' |
| | | user_query = SELECT email as user, maildir as home, CONCAT('maildir:', maildir, '/Maildir') as mail, uid, gid, CONCAT('*:storage=', quota, 'B') AS quota_rule, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE (login = '%u' OR email = '%u') AND `disable%Ls` = 'n' AND server_id = '{server_id}' |
| | | # password-query with prefetch |
| | | password_query = SELECT email as user, password, maildir as userdb_home, CONCAT( maildir_format, ':', maildir, '/', IF(maildir_format='maildir','Maildir',maildir_format)) as userdb_mail, uid as userdb_uid, gid as userdb_gid, CONCAT('*:storage=', quota, 'B') AS userdb_quota_rule, CONCAT(maildir, '/.sieve') as userdb_sieve FROM mail_user WHERE (login = '%u' OR email = '%u') AND `disable%Ls` = 'n' AND server_id = '{server_id}' |
| | | user_query = SELECT email as user, maildir as home, CONCAT( maildir_format, ':', maildir, '/', IF(maildir_format='maildir','Maildir',maildir_format)) as mail, uid, gid, CONCAT('*:storage=', quota, 'B') AS quota_rule, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE (login = '%u' OR email = '%u') AND `disable%Ls` = 'n' AND server_id = '{server_id}' |
| | | |
| | | # The iterate_query is required for the doveadm command only and works only on dovecot 2 servers. |
| | | # Do not enable it on Dovecot 1.x servers |
| | |
| | | listen = *,[::] |
| | | protocols = imap pop3 lmtp |
| | | protocols = imap pop3 |
| | | auth_mechanisms = plain login |
| | | disable_plaintext_auth = no |
| | | log_timestamp = "%Y-%m-%d %H:%M:%S " |
| | |
| | | ssl_cert = </etc/postfix/smtpd.cert |
| | | ssl_key = </etc/postfix/smtpd.key |
| | | ssl_protocols = !SSLv2 !SSLv3 |
| | | mail_max_userip_connections = 100 |
| | | passdb { |
| | | args = /etc/dovecot/dovecot-sql.conf |
| | | driver = sql |
| | | } |
| | | userdb { |
| | | driver = prefetch |
| | | } |
| | | userdb { |
| | | args = /etc/dovecot/dovecot-sql.conf |
| | |
| | | plugin { |
| | | quota = dict:user::file:/var/vmail/%d/%n/.quotausage |
| | | sieve=/var/vmail/%d/%n/.sieve |
| | | sieve_max_redirects = 25 |
| | | } |
| | | service auth { |
| | | unix_listener /var/spool/postfix/private/auth { |
| | |
| | | group = postfix |
| | | mode = 0600 |
| | | user = postfix |
| | | # For higher volume sites, it may be desirable to increase the number of active listener processes. |
| | | # A range of 5 to 20 is probably good for most sites |
| | | # process_min_avail = 5 |
| | | } |
| | | } |
| | | service imap-login { |
| | | client_limit = 1000 |
| | | process_limit = 500 |
| | | process_limit = 512 |
| | | } |
| | | protocol imap { |
| | | mail_plugins = quota imap_quota |
| | |
| | | protocol lmtp { |
| | | postmaster_address = webmaster@localhost |
| | | mail_plugins = quota sieve |
| | | } |
| | | } |
| | |
| | | #password_query = SELECT userid as user, password, home as userdb_home, uid as userdb_uid, gid as userdb_gid FROM users WHERE userid = '%u' |
| | | |
| | | driver = mysql |
| | | connect = host={mysql_server_host} dbname={mysql_server_database} user={mysql_server_ispconfig_user} password={mysql_server_ispconfig_password} |
| | | connect = host={mysql_server_host} dbname={mysql_server_database} user={mysql_server_ispconfig_user} password={mysql_server_ispconfig_password} port={mysql_server_port} |
| | | default_pass_scheme = CRYPT |
| | | |
| | | password_query = SELECT password FROM mail_user WHERE (login = '%u' OR email = '%u') AND disable%Ls = 'n' AND server_id = '{server_id}' |
| | | user_query = SELECT email as user, maildir as home, CONCAT('maildir:', maildir, '/Maildir') as mail, uid, gid, CONCAT('*:storage=', quota, 'B') AS quota_rule, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE (login = '%u' OR email = '%u') AND disable%Ls = 'n' AND server_id = '{server_id}' |
| | | # password-query with prefetch |
| | | password_query = SELECT email as user, password, maildir as userdb_home, CONCAT( maildir_format, ':', maildir, '/', IF(maildir_format='maildir','Maildir',maildir_format)) as userdb_mail, uid as userdb_uid, gid as userdb_gid, CONCAT('*:storage=', quota, 'B') AS userdb_quota_rule, CONCAT(maildir, '/.sieve') as userdb_sieve FROM mail_user WHERE (login = '%u' OR email = '%u') AND `disable%Ls` = 'n' AND server_id = '{server_id}' |
| | | user_query = SELECT email as user, maildir as home, CONCAT( maildir_format, ':', maildir, '/', IF(maildir_format='maildir','Maildir',maildir_format)) as mail, uid, gid, CONCAT('*:storage=', quota, 'B') AS quota_rule, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE (login = '%u' OR email = '%u') AND `disable%Ls` = 'n' AND server_id = '{server_id}' |
| | | |
| | | # The iterate_query is required for the doveadm command only and works only on dovecot 2 servers. |
| | | # Do not enable it on Dovecot 1.x servers |
| | |
| | | # This can be made to work with SQL and LDAP databases, see their example |
| | | # configuration files for more information how to do it. |
| | | # <doc/wiki/UserDatabase.Prefetch.txt> |
| | | #userdb prefetch { |
| | | #} |
| | | userdb prefetch { |
| | | } |
| | | |
| | | # User to use for the process. This user needs access to only user and |
| | | # password databases, nothing else. Only shadow and pam authentication |
| | |
| | | listen = *,[::] |
| | | protocols = imap pop3 lmtp |
| | | protocols = imap pop3 |
| | | auth_mechanisms = plain login |
| | | disable_plaintext_auth = no |
| | | log_timestamp = "%Y-%m-%d %H:%M:%S " |
| | |
| | | ssl_cert = </etc/postfix/smtpd.cert |
| | | ssl_key = </etc/postfix/smtpd.key |
| | | ssl_protocols = !SSLv2 !SSLv3 |
| | | mail_max_userip_connections = 100 |
| | | passdb { |
| | | args = /etc/dovecot/dovecot-sql.conf |
| | | driver = sql |
| | | } |
| | | userdb { |
| | | driver = prefetch |
| | | } |
| | | userdb { |
| | | args = /etc/dovecot/dovecot-sql.conf |
| | |
| | | plugin { |
| | | quota = dict:user::file:/var/vmail/%d/%n/.quotausage |
| | | sieve=/var/vmail/%d/%n/.sieve |
| | | sieve_max_redirects = 25 |
| | | } |
| | | service auth { |
| | | unix_listener /var/spool/postfix/private/auth { |
| | |
| | | } |
| | | service imap-login { |
| | | client_limit = 1000 |
| | | process_limit = 500 |
| | | process_limit = 512 |
| | | } |
| | | protocol imap { |
| | | mail_plugins = quota imap_quota |
| | |
| | | protocol lmtp { |
| | | postmaster_address = webmaster@localhost |
| | | mail_plugins = quota sieve |
| | | } |
| | | } |
| | |
| | | transport_maps = hash:/var/lib/mailman/data/transport-mailman, 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 |
| | | proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $sender_bcc_maps $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks |
| | | smtpd_sender_restrictions = check_sender_access mysql:{config_dir}/mysql-virtual_sender.cf regexp:{config_dir}/tag_as_originating.re, permit_mynetworks, check_sender_access regexp:{config_dir}/tag_as_foreign.re |
| | | smtpd_sender_login_maps = proxy:mysql:{config_dir}/mysql-virtual_sender_login_maps.cf |
| | | proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $sender_bcc_maps $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $smtpd_sender_login_maps |
| | | smtpd_sender_restrictions = check_sender_access mysql:{config_dir}/mysql-virtual_sender.cf regexp:{config_dir}/tag_as_originating.re{reject_slm}, permit_mynetworks, check_sender_access regexp:{config_dir}/tag_as_foreign.re |
| | | smtpd_client_restrictions = check_client_access mysql:{config_dir}/mysql-virtual_client.cf |
| | | smtpd_client_message_rate_limit = 100 |
| | | maildrop_destination_concurrency_limit = 1 |
| | |
| | | |
| | | @local_domains_maps = ( [".$mydomain"] ); # list of all local domains |
| | | |
| | | @mynetworks = qw( 127.0.0.0/8 [::1] [FE80::]/10 [FEC0::]/10 |
| | | @mynetworks = qw( 0.0.0.0/8 127.0.0.0/8 [::1] [FE80::]/10 [FEC0::]/10 |
| | | 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 ); |
| | | |
| | | $unix_socketname = "$MYHOME/amavisd.sock"; # amavisd-release or amavis-milter |
| | | # option(s) -p overrides $inet_socket_port and $unix_socketname |
| | | |
| | | $inet_socket_port = 10024; # listen on this local TCP port(s) |
| | | # $inet_socket_port = [10024,10026]; # listen on multiple TCP ports |
| | | # $inet_socket_port = 10024; # listen on this local TCP port(s) |
| | | $inet_socket_port = [10024,10026]; # listen on multiple TCP ports |
| | | |
| | | $policy_bank{'MYNETS'} = { # mail originating from @mynetworks |
| | | originating => 1, # is true in MYNETS by default, but let's make it explicit |
| | |
| | | |
| | | # $myhostname = 'host.example.com'; # must be a fully-qualified domain name! |
| | | |
| | | # $notify_method = 'smtp:[127.0.0.1]:10025'; |
| | | # $forward_method = 'smtp:[127.0.0.1]:10025'; # set to undef with milter! |
| | | $notify_method = 'smtp:[127.0.0.1]:10027'; |
| | | $forward_method = 'smtp:[127.0.0.1]:10025'; # set to undef with milter! |
| | | |
| | | # $os_fingerprint_method = 'p0f:127.0.0.1:2345'; # to query p0f-analyzer.pl |
| | | |
| | |
| | | $log_level = 0; # (defaults to 0) |
| | | |
| | | |
| | | $enable_dkim_verification = 1; |
| | | $enable_dkim_signing = 1; # load DKIM signing code |
| | | $signed_header_fields{'received'} = 0; # turn off signing of Received |
| | | @dkim_signature_options_bysender_maps = ( |
| | | { '.' => { ttl => 21*24*3600, c => 'relaxed/simple' } } ); |
| | | 1; # insure a defined return |
| | |
| | | # FROM users WHERE userid = '%u' |
| | | |
| | | driver = mysql |
| | | connect = host={mysql_server_host} dbname={mysql_server_database} user={mysql_server_ispconfig_user} password={mysql_server_ispconfig_password} |
| | | connect = host={mysql_server_host} dbname={mysql_server_database} user={mysql_server_ispconfig_user} password={mysql_server_ispconfig_password} port={mysql_server_port} |
| | | default_pass_scheme = CRYPT |
| | | |
| | | password_query = SELECT password FROM mail_user WHERE (login = '%u' OR email = '%u') AND disable%Ls = 'n' AND server_id = '{server_id}' |
| | | user_query = SELECT email as user, maildir as home, CONCAT('maildir:', maildir, '/Maildir') as mail, uid, gid, CONCAT('*:storage=', quota, 'B') AS quota_rule, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE (login = '%u' OR email = '%u') AND `disable%Ls` = 'n' AND server_id = '{server_id}' |
| | | # password-query with prefetch |
| | | password_query = SELECT email as user, password, maildir as userdb_home, CONCAT( maildir_format, ':', maildir, '/', IF(maildir_format='maildir','Maildir',maildir_format)) as userdb_mail, uid as userdb_uid, gid as userdb_gid, CONCAT('*:storage=', quota, 'B') AS userdb_quota_rule, CONCAT(maildir, '/.sieve') as userdb_sieve FROM mail_user WHERE (login = '%u' OR email = '%u') AND `disable%Ls` = 'n' AND server_id = '{server_id}' |
| | | user_query = SELECT email as user, maildir as home, CONCAT( maildir_format, ':', maildir, '/', IF(maildir_format='maildir','Maildir',maildir_format)) as mail, uid, gid, CONCAT('*:storage=', quota, 'B') AS quota_rule, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE (login = '%u' OR email = '%u') AND `disable%Ls` = 'n' AND server_id = '{server_id}' |
| | | |
| | | # The iterate_query is required for the doveadm command only and works only on dovecot 2 servers. |
| | | # Do not enable it on Dovecot 1.x servers |
| | |
| | | # This can be made to work with SQL and LDAP databases, see their example |
| | | # configuration files for more information how to do it. |
| | | # <doc/wiki/UserDatabase.Prefetch.txt> |
| | | #userdb prefetch { |
| | | #} |
| | | userdb prefetch { |
| | | } |
| | | |
| | | # System users (NSS, /etc/passwd, or similiar). In many systems nowadays this |
| | | # uses Name Service Switch, which is configured in /etc/nsswitch.conf. |
| | |
| | | listen = *,[::] |
| | | protocols = imap pop3 lmtp |
| | | protocols = imap pop3 |
| | | auth_mechanisms = plain login |
| | | disable_plaintext_auth = no |
| | | log_timestamp = "%Y-%m-%d %H:%M:%S " |
| | |
| | | passdb { |
| | | args = /etc/dovecot-sql.conf |
| | | driver = sql |
| | | } |
| | | userdb { |
| | | driver = prefetch |
| | | } |
| | | userdb { |
| | | args = /etc/dovecot-sql.conf |
| | |
| | | protocol lmtp { |
| | | postmaster_address = webmaster@localhost |
| | | mail_plugins = quota sieve |
| | | } |
| | | } |
| | |
| | | transport_maps = hash:/var/lib/mailman/data/transport-mailman, 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 |
| | | proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $sender_bcc_maps $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks |
| | | smtpd_sender_restrictions = check_sender_access mysql:{config_dir}/mysql-virtual_sender.cf regexp:{config_dir}/tag_as_originating.re, permit_mynetworks, check_sender_access regexp:{config_dir}/tag_as_foreign.re |
| | | smtpd_sender_login_maps = proxy:mysql:{config_dir}/mysql-virtual_sender_login_maps.cf |
| | | proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $sender_bcc_maps $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $smtpd_sender_login_maps |
| | | smtpd_sender_restrictions = check_sender_access mysql:{config_dir}/mysql-virtual_sender.cf regexp:{config_dir}/tag_as_originating.re{reject_slm}, permit_mynetworks, check_sender_access regexp:{config_dir}/tag_as_foreign.re |
| | | smtpd_client_restrictions = check_client_access mysql:{config_dir}/mysql-virtual_client.cf |
| | | smtpd_client_message_rate_limit = 100 |
| | | maildrop_destination_concurrency_limit = 1 |
| | |
| | | transport_maps = hash:/var/lib/mailman/data/transport-mailman, 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 |
| | | proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks |
| | | smtpd_sender_restrictions = check_sender_access mysql:{config_dir}/mysql-virtual_sender.cf regexp:{config_dir}/tag_as_originating.re, permit_mynetworks, check_sender_access regexp:{config_dir}/tag_as_foreign.re |
| | | smtpd_sender_login_maps = proxy:mysql:{config_dir}/mysql-virtual_sender_login_maps.cf |
| | | proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $smtpd_sender_login_maps |
| | | smtpd_sender_restrictions = check_sender_access mysql:{config_dir}/mysql-virtual_sender.cf regexp:{config_dir}/tag_as_originating.re{reject_slm}, permit_mynetworks, check_sender_access regexp:{config_dir}/tag_as_foreign.re |
| | | smtpd_client_restrictions = check_client_access mysql:{config_dir}/mysql-virtual_client.cf |
| | | smtpd_client_message_rate_limit = 100 |
| | | maildrop_destination_concurrency_limit = 1 |
New file |
| | |
| | | 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"; |
New file |
| | |
| | | Include "/etc/metronome/global.cfg.lua" |
| | | Include "/etc/metronome/hosts/*.lua" |
| | | Include "/etc/metronome/status/*.lua" |
New file |
| | |
| | | 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'} |
| | |
| | | db-user = {mysql_server_ispconfig_user} # SQL server username |
| | | db-password = {mysql_server_ispconfig_password} # SQL server password |
| | | database = {mysql_server_database} # MyDNS database name |
| | | db-port = {mysql_server_port} # SQL server port |
| | | |
| | | |
| | | # GENERAL OPTIONS |
New file |
| | |
| | | user = {mysql_server_ispconfig_user}
|
| | | password = {mysql_server_ispconfig_password}
|
| | | dbname = {mysql_server_database}
|
| | | table = mail_user
|
| | | select_field = sender_cc
|
| | | where_field = email
|
| | | additional_conditions = and postfix = 'y' and disabledeliver = 'n' and disablesmtp = 'n'
|
| | | hosts = 127.0.0.1 |
New file |
| | |
| | | user = {mysql_server_ispconfig_user} |
| | | password = {mysql_server_ispconfig_password} |
| | | dbname = {mysql_server_database} |
| | | query = SELECT destination FROM mail_forwarding WHERE source = '%s' AND active = 'y' AND type = 'alias' AND server_id = {server_id} UNION SELECT email FROM mail_user WHERE email = '%s' AND disablesmtp = 'n' AND server_id = {server_id}; |
| | | hosts = {mysql_server_ip} |
| | |
| | | } |
| | | |
| | | # 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; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | # 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; |
| | | } |
| | | |
| | |
| | | fastcgi_buffers 256 4k; |
| | | fastcgi_busy_buffers_size 256k; |
| | | fastcgi_temp_file_write_size 256k; |
| | | fastcgi_read_timeout 1200; |
| | | } |
| | | |
| | | location ~ /\. { |
| | |
| | | |
| | | @local_domains_maps = ( [".$mydomain"] ); # list of all local domains |
| | | |
| | | @mynetworks = qw( 127.0.0.0/8 [::1] [FE80::]/10 [FEC0::]/10 |
| | | @mynetworks = qw( 0.0.0.0/8 127.0.0.0/8 [::1] [FE80::]/10 [FEC0::]/10 |
| | | 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 ); |
| | | |
| | | $unix_socketname = "$MYHOME/amavisd.sock"; # amavisd-release or amavis-milter |
| | | # option(s) -p overrides $inet_socket_port and $unix_socketname |
| | | |
| | | $inet_socket_port = 10024; # listen on this local TCP port(s) |
| | | # $inet_socket_port = [10024,10026]; # listen on multiple TCP ports |
| | | #$inet_socket_port = 10024; # listen on this local TCP port(s) |
| | | $inet_socket_port = [10024,10026]; # listen on multiple TCP ports |
| | | |
| | | $policy_bank{'MYNETS'} = { # mail originating from @mynetworks |
| | | originating => 1, # is true in MYNETS by default, but let's make it explicit |
| | |
| | | |
| | | $myhostname = 'linux-jfp8.site'; |
| | | |
| | | # $notify_method = 'smtp:[127.0.0.1]:10025'; |
| | | # $forward_method = 'smtp:[127.0.0.1]:10025'; # set to undef with milter! |
| | | $notify_method = 'smtp:[127.0.0.1]:10027'; |
| | | $forward_method = 'smtp:[127.0.0.1]:10025'; # set to undef with milter! |
| | | |
| | | # $final_virus_destiny = D_DISCARD; |
| | | # $final_banned_destiny = D_BOUNCE; |
| | |
| | | # FROM users WHERE userid = '%u' |
| | | |
| | | driver = mysql |
| | | connect = host={mysql_server_host} dbname={mysql_server_database} user={mysql_server_ispconfig_user} password={mysql_server_ispconfig_password} |
| | | connect = host={mysql_server_host} dbname={mysql_server_database} user={mysql_server_ispconfig_user} password={mysql_server_ispconfig_password} port={mysql_server_port} |
| | | default_pass_scheme = CRYPT |
| | | |
| | | password_query = SELECT password FROM mail_user WHERE (login = '%u' OR email = '%u') AND disable%Ls = 'n' AND server_id = '{server_id}' |
| | | user_query = SELECT email as user, maildir as home, CONCAT('maildir:', maildir, '/Maildir') as mail, uid, gid, CONCAT('*:storage=', quota, 'B') AS quota_rule, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE (login = '%u' OR email = '%u') AND `disable%Ls` = 'n' AND server_id = '{server_id}' |
| | | # password-query with prefetch |
| | | password_query = SELECT email as user, password, maildir as userdb_home, CONCAT( maildir_format, ':', maildir, '/', IF(maildir_format='maildir','Maildir',maildir_format)) as userdb_mail, uid as userdb_uid, gid as userdb_gid, CONCAT('*:storage=', quota, 'B') AS userdb_quota_rule, CONCAT(maildir, '/.sieve') as userdb_sieve FROM mail_user WHERE (login = '%u' OR email = '%u') AND `disable%Ls` = 'n' AND server_id = '{server_id}' |
| | | user_query = SELECT email as user, maildir as home, CONCAT( maildir_format, ':', maildir, '/', IF(maildir_format='maildir','Maildir',maildir_format)) as mail, uid, gid, CONCAT('*:storage=', quota, 'B') AS quota_rule, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE (login = '%u' OR email = '%u') AND `disable%Ls` = 'n' AND server_id = '{server_id}' |
| | | |
| | | # The iterate_query is required for the doveadm command only and works only on dovecot 2 servers. |
| | | # Do not enable it on Dovecot 1.x servers |
| | |
| | | # This can be made to work with SQL and LDAP databases, see their example |
| | | # configuration files for more information how to do it. |
| | | # <doc/wiki/UserDatabase.Prefetch.txt> |
| | | #userdb prefetch { |
| | | #} |
| | | userdb prefetch { |
| | | } |
| | | |
| | | # System users (NSS, /etc/passwd, or similiar). In many systems nowadays this |
| | | # uses Name Service Switch, which is configured in /etc/nsswitch.conf. |
| | |
| | | listen = *,[::] |
| | | protocols = imap pop3 lmtp |
| | | protocols = imap pop3 |
| | | auth_mechanisms = plain login |
| | | disable_plaintext_auth = no |
| | | log_timestamp = "%Y-%m-%d %H:%M:%S " |
| | |
| | | passdb { |
| | | args = /etc/dovecot/dovecot-sql.conf |
| | | driver = sql |
| | | } |
| | | userdb { |
| | | driver = prefetch |
| | | } |
| | | userdb { |
| | | args = /etc/dovecot/dovecot-sql.conf |
| | |
| | | protocol lmtp { |
| | | postmaster_address = webmaster@localhost |
| | | mail_plugins = quota sieve |
| | | } |
| | | } |
| | |
| | | transport_maps = hash:/var/lib/mailman/data/transport-mailman, 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 |
| | | proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $sender_bcc_maps $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks |
| | | smtpd_sender_restrictions = check_sender_access mysql:{config_dir}/mysql-virtual_sender.cf regexp:{config_dir}/tag_as_originating.re, permit_mynetworks, check_sender_access regexp:{config_dir}/tag_as_foreign.re |
| | | smtpd_sender_login_maps = proxy:mysql:{config_dir}/mysql-virtual_sender_login_maps.cf |
| | | proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $sender_bcc_maps $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $smtpd_sender_login_maps |
| | | smtpd_sender_restrictions = check_sender_access mysql:{config_dir}/mysql-virtual_sender.cf regexp:{config_dir}/tag_as_originating.re{reject_slm}, permit_mynetworks, check_sender_access regexp:{config_dir}/tag_as_foreign.re |
| | | smtpd_client_restrictions = check_client_access mysql:{config_dir}/mysql-virtual_client.cf |
| | | smtpd_client_message_rate_limit = 100 |
| | | maildrop_destination_concurrency_limit = 1 |
| | |
| | | gmysql-user={mysql_server_ispconfig_user} |
| | | gmysql-password={mysql_server_ispconfig_password} |
| | | gmysql-dbname={powerdns_database} |
| | | gmysql-port={mysql_server_port} |
| | | |
| | | slave=yes |
| | | master=yes |
| | |
| | | |
| | | chdir = / |
| | | |
| | | ; php_admin_value[open_basedir] = /usr/local/ispconfig/interface:/usr/local/ispconfig/security:/usr/share |
| | | ; php_admin_value[open_basedir] = /usr/local/ispconfig/interface:/usr/local/ispconfig/security:/usr/share:/var/lib/roundcube:/etc/roundcube:/usr/share/roundcube |
| | | php_admin_value[session.save_path] = /usr/local/ispconfig/interface/temp |
| | | php_admin_flag[magic_quotes_gpc] = off |
| | | php_admin_flag[magic_quotes_gpc] = off |
| | | |
| | | php_admin_value[memory_limit] = 4096M |
| | | php_admin_value[max_execution_time] = 1200 |
| | |
| | | loglevel=2 |
| | | admin_notify_events=1 |
| | | backup_dir=/var/backup |
| | | backup_dir_is_mount=n |
| | | backup_dir_is_mount=y |
| | | backup_mode=rootgz |
| | | backup_delete=y |
| | | backup_delete=n |
| | | monit_url= |
| | | monit_user= |
| | | monit_password= |
| | |
| | | apps_vhost_servername= |
| | | php_open_basedir=[website_path]/web:[website_path]/private:[website_path]/tmp:/var/www/[website_domain]/web:/srv/www/[website_domain]/web:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin |
| | | htaccess_allow_override=All |
| | | enable_spdy=y |
| | | awstats_conf_dir=/etc/awstats |
| | | awstats_data_dir=/var/lib/awstats |
| | | awstats_pl=/usr/lib/cgi-bin/awstats.pl |
| | |
| | | bind_zonefiles_dir=/etc/bind |
| | | named_conf_path=/etc/bind/named.conf |
| | | named_conf_local_path=/etc/bind/named.conf.local |
| | | disable_bind_log=n |
| | | |
| | | [fastcgi] |
| | | fastcgi_starter_path=/var/www/php-fcgi-scripts/[system_user]/ |
| | |
| | | [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 |
| | | 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 |
| | | jailkit_chroot_cron_programs=/usr/bin/php /usr/bin/perl /usr/share/perl /usr/share/php |
| | | |
| | | [vlogger] |
| | |
| | | do_not_try_rescue_mysql=n |
| | | do_not_try_rescue_mail=n |
| | | |
| | | [xmpp] |
| | | xmpp_use_ispv6=n |
| | | xmpp_bosh_max_inactivity=30 |
| | | xmpp_server_admins=admin@service.com, superuser@service.com |
| | | xmpp_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 |
| | | xmpp_port_http=5290 |
| | | xmpp_port_https=5291 |
| | | xmpp_port_pastebin=5292 |
| | | xmpp_port_bosh=5280 |
| | |
| | | |
| | | [mail] |
| | | enable_custom_login=n |
| | | mailbox_show_autoresponder_tab=y |
| | | mailbox_show_mail_filter_tab=y |
| | | mailbox_show_custom_rules_tab=y |
| | | mailboxlist_webmail_link=y |
| | | webmail_url=/webmail |
| | | dkim_path=/var/lib/amavis/dkim |
| | |
| | | new_domain_html=Please contact our support to create a new domain for you. |
| | | |
| | | [misc] |
| | | company_name= |
| | | dashboard_atom_url_admin=http://www.ispconfig.org/atom |
| | | dashboard_atom_url_reseller=http://www.ispconfig.org/atom |
| | | dashboard_atom_url_client=http://www.ispconfig.org/atom |
| | |
| | | |
| | | echo "\n\n>> Uninstalling ISPConfig 3... \n\n"; |
| | | |
| | | // Delete the ISPConfig database |
| | | // $app->db->query("DROP DATABASE '".$conf["db_database"]."'"); |
| | | // $app->db->query("DELETE FROM mysql.user WHERE User = 'ispconfig'"); |
| | | |
| | | // exec("/etc/init.d/mysql stop"); |
| | | // exec("rm -rf /var/lib/mysql/".$conf["db_database"]); |
| | | // exec("/etc/init.d/mysql start"); |
| | | |
| | | $link = mysql_connect($clientdb_host, $clientdb_user, $clientdb_password); |
| | | if (!$link) { |
| | | echo "Unable to connect to the database'.mysql_error($link)"; |
| | |
| | | $finished = false; |
| | | do { |
| | | $tmp_mysql_server_host = $inst->free_query('MySQL master server hostname', $conf['mysql']['master_host'],'mysql_master_hostname'); |
| | | $tmp_mysql_server_port = $inst->free_query('MySQL master server port', $conf['mysql']['master_port'],'mysql_master_port'); |
| | | $tmp_mysql_server_admin_user = $inst->free_query('MySQL master server root username', $conf['mysql']['master_admin_user'],'mysql_master_root_user'); |
| | | $tmp_mysql_server_admin_password = $inst->free_query('MySQL master server root password', $conf['mysql']['master_admin_password'],'mysql_master_root_password'); |
| | | $tmp_mysql_server_database = $inst->free_query('MySQL master server database name', $conf['mysql']['master_database'],'mysql_master_database'); |
| | | |
| | | //* Initialize the MySQL server connection |
| | | if(@mysql_connect($tmp_mysql_server_host, $tmp_mysql_server_admin_user, $tmp_mysql_server_admin_password)) { |
| | | if(@mysql_connect($tmp_mysql_server_host . ':' . (int)$tmp_mysql_server_port, $tmp_mysql_server_admin_user, $tmp_mysql_server_admin_password)) { |
| | | $conf['mysql']['master_host'] = $tmp_mysql_server_host; |
| | | $conf['mysql']['master_port'] = $tmp_mysql_server_port; |
| | | $conf['mysql']['master_admin_user'] = $tmp_mysql_server_admin_user; |
| | | $conf['mysql']['master_admin_password'] = $tmp_mysql_server_admin_password; |
| | | $conf['mysql']['master_database'] = $tmp_mysql_server_database; |
| | |
| | | // initialize the connection to the master database |
| | | $inst->dbmaster = new db(); |
| | | if($inst->dbmaster->linkId) $inst->dbmaster->closeConn(); |
| | | $inst->dbmaster->dbHost = $conf['mysql']["master_host"]; |
| | | $inst->dbmaster->dbName = $conf['mysql']["master_database"]; |
| | | $inst->dbmaster->dbUser = $conf['mysql']["master_admin_user"]; |
| | | $inst->dbmaster->dbPass = $conf['mysql']["master_admin_password"]; |
| | | $inst->dbmaster->setDBData($conf['mysql']["master_host"], $conf['mysql']["master_admin_user"], $conf['mysql']["master_admin_password"]); |
| | | $inst->dbmaster->setDBName($conf['mysql']["master_database"]); |
| | | } else { |
| | | $inst->dbmaster = $inst->db; |
| | | } |
| | |
| | | $inst->configure_apps_vhost(); |
| | | } |
| | | |
| | | if($conf['services']['xmpp']) { |
| | | //** Configure Metronome XMPP |
| | | $inst->configure_xmpp('dont-create-certs'); |
| | | } |
| | | |
| | | |
| | | //* Configure DBServer |
| | | swriteln('Configuring Database'); |
| | |
| | | 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['xmpp']['installed'] == true && $conf['xmpp']['init_script'] != '') system($inst->getinitcommand($conf['xmpp']['init_script'], 'restart').' &> /dev/null'); |
| | | } |
| | | |
| | | 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'); |
| | |
| | | } |
| | | } |
| | | |
| | | //* Set default servers |
| | | setDefaultServers(); |
| | | |
| | | $inst->create_mount_script(); |
| | | |
| | | //* Create md5 filelist |
| | | $md5_filename = '/usr/local/ispconfig/security/data/file_checksums_'.date('Y-m-d_h-i').'.md5'; |
| | | exec('find /usr/local/ispconfig -type f -print0 | xargs -0 md5sum > '.$md5_filename); |
| | |
| | | |
| | | $this->uses('session'); |
| | | $sess_timeout = $this->conf('interface', 'session_timeout'); |
| | | $cookie_domain = (isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : $_SERVER['HTTP_HOST']); |
| | | $cookie_secure = ($_SERVER["HTTPS"] == 'on')?true:false; |
| | | if($sess_timeout) { |
| | | /* check if user wants to stay logged in */ |
| | | if(isset($_POST['s_mod']) && isset($_POST['s_pg']) && $_POST['s_mod'] == 'login' && $_POST['s_pg'] == 'index' && isset($_POST['stay']) && $_POST['stay'] == '1') { |
| | |
| | | $tmp = $this->ini_parser->parse_ini_string(stripslashes($tmp['config'])); |
| | | if(!isset($tmp['misc']['session_allow_endless']) || $tmp['misc']['session_allow_endless'] != 'y') { |
| | | $this->session->set_timeout($sess_timeout); |
| | | session_set_cookie_params(3600 * 24 * 365); // cookie timeout is never updated, so it must not be short |
| | | session_set_cookie_params(3600 * 24 * 365,'/',$cookie_domain,$cookie_secure,true); // cookie timeout is never updated, so it must not be short |
| | | } else { |
| | | // we are doing login here, so we need to set the session data |
| | | $this->session->set_permanent(true); |
| | | $this->session->set_timeout(365 * 24 * 3600); // one year |
| | | session_set_cookie_params(3600 * 24 * 365); // cookie timeout is never updated, so it must not be short |
| | | $this->session->set_timeout(365 * 24 * 3600,'/',$cookie_domain,$cookie_secure,true); // one year |
| | | session_set_cookie_params(3600 * 24 * 365,'/',$cookie_domain,$cookie_secure,true); // cookie timeout is never updated, so it must not be short |
| | | } |
| | | } else { |
| | | $this->session->set_timeout($sess_timeout); |
| | | session_set_cookie_params(3600 * 24 * 365); // cookie timeout is never updated, so it must not be short |
| | | session_set_cookie_params(3600 * 24 * 365,'/',$cookie_domain,$cookie_secure,true); // cookie timeout is never updated, so it must not be short |
| | | } |
| | | } else { |
| | | session_set_cookie_params(0); // until browser is closed |
| | | session_set_cookie_params(0,'/',$cookie_domain,$cookie_secure,true); // until browser is closed |
| | | } |
| | | |
| | | session_set_save_handler( array($this->session, 'open'), |
| | |
| | | |
| | | public function conf($plugin, $key, $value = null) { |
| | | if(is_null($value)) { |
| | | $tmpconf = $this->db->queryOneRecord("SELECT `value` FROM `sys_config` WHERE `group` = '" . $this->db->quote($plugin) . "' AND `name` = '" . $this->db->quote($key) . "'"); |
| | | $tmpconf = $this->db->queryOneRecord("SELECT `value` FROM `sys_config` WHERE `group` = ? AND `name` = ?", $plugin, $key); |
| | | if($tmpconf) return $tmpconf['value']; |
| | | else return null; |
| | | } else { |
| | | if($value === false) { |
| | | $this->db->query("DELETE FROM `sys_config` WHERE `group` = '" . $this->db->quote($plugin) . "' AND `name` = '" . $this->db->quote($key) . "'"); |
| | | $this->db->query("DELETE FROM `sys_config` WHERE `group` = ? AND `name` = ?", $plugin, $key); |
| | | return null; |
| | | } else { |
| | | $this->db->query("REPLACE INTO `sys_config` (`group`, `name`, `value`) VALUES ('" . $this->db->quote($plugin) . "', '" . $this->db->quote($key) . "', '" . $this->db->quote($value) . "')"); |
| | | $this->db->query("REPLACE INTO `sys_config` (`group`, `name`, `value`) VALUES (?, ?, ?)", $plugin, $key, $value); |
| | | return $value; |
| | | } |
| | | } |
| | |
| | | $server_id = 0; |
| | | $priority = $this->functions->intval($priority); |
| | | $tstamp = time(); |
| | | $msg = $this->db->quote('[INTERFACE]: '.$msg); |
| | | $this->db->query("INSERT INTO sys_log (server_id,datalog_id,loglevel,tstamp,message) VALUES ($server_id,0,$priority,$tstamp,'$msg')"); |
| | | $msg = '[INTERFACE]: '.$msg; |
| | | $this->db->query("INSERT INTO sys_log (server_id,datalog_id,loglevel,tstamp,message) VALUES (?, 0, ?, ?, ?)", $server_id, $priority,$tstamp,$msg); |
| | | /* |
| | | if (is_writable($this->_conf['log_file'])) { |
| | | if (!$fp = fopen ($this->_conf['log_file'], 'a')) { |
| | |
| | | } |
| | | $this->_language_inc = 1; |
| | | } |
| | | if(!empty($this->_wb[$text])) { |
| | | if(isset($this->_wb[$text]) && $this->wb[$text] !== '') { |
| | | $text = $this->_wb[$text]; |
| | | } else { |
| | | if($this->_conf['debug_language']) { |
| | |
| | | curl_setopt($conn[$i], CURLOPT_TIMEOUT, 0); |
| | | curl_setopt($conn[$i], CURLOPT_FAILONERROR, 1); |
| | | curl_setopt($conn[$i], CURLOPT_FOLLOWLOCATION, 1); |
| | | curl_setopt($conn[$i], CURLOPT_SSL_VERIFYPEER, 0); |
| | | curl_setopt($conn[$i], CURLOPT_SSL_VERIFYHOST, 1); |
| | | curl_setopt($conn[$i], CURLOPT_SSL_VERIFYPEER, false); |
| | | |
| | | curl_multi_add_handle($mh, $conn[$i]); |
| | | } |
| | |
| | | $apps_count = substr_count($apps[$j], '<opensearch:totalResults>0</opensearch:totalResults>'); |
| | | if($apps_count == 0) // obviously this vendor provides one or more apps |
| | | { |
| | | // Rename namespaces and register them |
| | | $xml = str_replace("xmlns=", "ns=", $apps[$j]); |
| | | $sxe = new SimpleXMLElement($xml); |
| | | $namespaces = $sxe->getDocNamespaces(true); |
| | | foreach($namespaces as $ns => $url) $sxe->registerXPathNamespace($ns, $url); |
| | | try { |
| | | // Rename namespaces and register them |
| | | $xml = str_replace("xmlns=", "ns=", $apps[$j]); |
| | | $sxe = new SimpleXMLElement($xml); |
| | | $namespaces = $sxe->getDocNamespaces(true); |
| | | foreach($namespaces as $ns => $url) $sxe->registerXPathNamespace($ns, $url); |
| | | |
| | | //Find highest version |
| | | $app_version = "0.0.0"; |
| | | $entry_pos = 1; |
| | | for ($p = 1; ; $p++) { |
| | | $app_version_tmp = parent::getXPathValue($sxe, 'entry[position()=' . $p . ']/a:version'); |
| | | if (strlen($app_version_tmp) < 1) break; |
| | | if (version_compare($app_version_tmp, $app_version) >= 0) { |
| | | $app_version = $app_version_tmp; |
| | | $entry_pos = $p; |
| | | //Find highest version |
| | | $app_version = "0.0.0"; |
| | | $entry_pos = 1; |
| | | for ($p = 1; ; $p++) { |
| | | $app_version_tmp = parent::getXPathValue($sxe, 'entry[position()=' . $p . ']/a:version'); |
| | | if (strlen($app_version_tmp) < 1) break; |
| | | if (version_compare($app_version_tmp, $app_version) >= 0) { |
| | | $app_version = $app_version_tmp; |
| | | $entry_pos = $p; |
| | | } |
| | | } |
| | | } |
| | | |
| | | // Fetching values of interest |
| | | //$app_name = parent::getXPathValue($sxe, 'entry[position()=1]/a:name'); |
| | | //$app_version = parent::getXPathValue($sxe, 'entry[position()=1]/a:version'); |
| | | //$app_release = parent::getXPathValue($sxe, 'entry[position()=1]/a:release'); |
| | | $app_name = parent::getXPathValue($sxe, "entry[position()=" . $entry_pos . "]/a:name"); |
| | | $app_version = parent::getXPathValue($sxe, "entry[position()=" . $entry_pos . "]/a:version"); |
| | | $app_release = parent::getXPathValue($sxe, "entry[position()=" . $entry_pos . "]/a:release"); |
| | | // Fetching values of interest |
| | | //$app_name = parent::getXPathValue($sxe, 'entry[position()=1]/a:name'); |
| | | //$app_version = parent::getXPathValue($sxe, 'entry[position()=1]/a:version'); |
| | | //$app_release = parent::getXPathValue($sxe, 'entry[position()=1]/a:release'); |
| | | $app_name = parent::getXPathValue($sxe, "entry[position()=" . $entry_pos . "]/a:name"); |
| | | $app_version = parent::getXPathValue($sxe, "entry[position()=" . $entry_pos . "]/a:version"); |
| | | $app_release = parent::getXPathValue($sxe, "entry[position()=" . $entry_pos . "]/a:release"); |
| | | |
| | | // Find out a (possibly) existing package version |
| | | $ex_ver = ''; |
| | | /* |
| | | array_walk($existing_apps, |
| | | create_function('$v, $k, $ex_ver', 'if($v["Name"] == "'.$app_name.'") $ex_ver = $v["CurrentVersion"];'), &$ex_ver); |
| | | */ |
| | | if(is_array($existing_apps)) { |
| | | foreach($existing_apps as $k => $v) { |
| | | if($v["Name"] == $app_name) $ex_ver = $v["CurrentVersion"]; |
| | | // Find out a (possibly) existing package version |
| | | $ex_ver = ''; |
| | | /* |
| | | array_walk($existing_apps, |
| | | create_function('$v, $k, $ex_ver', 'if($v["Name"] == "'.$app_name.'") $ex_ver = $v["CurrentVersion"];'), &$ex_ver); |
| | | */ |
| | | if(is_array($existing_apps)) { |
| | | foreach($existing_apps as $k => $v) { |
| | | if($v["Name"] == $app_name) $ex_ver = $v["CurrentVersion"]; |
| | | } |
| | | } |
| | | } |
| | | |
| | | $new_ver = $app_version.'-'.$app_release; |
| | | $local_intf_folder = $this->interface_pkg_dir.'/'.$app_name.'-'.$new_ver.'.app.zip/'; |
| | | $new_ver = $app_version.'-'.$app_release; |
| | | $local_intf_folder = $this->interface_pkg_dir.'/'.$app_name.'-'.$new_ver.'.app.zip/'; |
| | | |
| | | // Proceed if a newer or at least equal version has been found with server mode or |
| | | // interface mode is activated and there are no valid APP-META.xml and PKG_URL existing yet |
| | | if((!$this->interface_mode && version_compare($new_ver, $ex_ver) >= 0) || ($this->interface_mode && (!file_exists($local_intf_folder.'APP-META.xml') || filesize($local_intf_folder.'APP-META.xml') == 0 || !file_exists($local_intf_folder.'PKG_URL') || filesize($local_intf_folder.'PKG_URL') == 0))){ |
| | | // Check if we already have an old version of this app |
| | | if(!empty($ex_ver) && version_compare($new_ver, $ex_ver) == 1) $apps_updated++; |
| | | // Proceed if a newer or at least equal version has been found with server mode or |
| | | // interface mode is activated and there are no valid APP-META.xml and PKG_URL existing yet |
| | | if((!$this->interface_mode && version_compare($new_ver, $ex_ver) >= 0) || ($this->interface_mode && (!file_exists($local_intf_folder.'APP-META.xml') || filesize($local_intf_folder.'APP-META.xml') == 0 || !file_exists($local_intf_folder.'PKG_URL') || filesize($local_intf_folder.'PKG_URL') == 0))){ |
| | | // Check if we already have an old version of this app |
| | | if(!empty($ex_ver) && version_compare($new_ver, $ex_ver) == 1) $apps_updated++; |
| | | |
| | | //$app_dl = parent::getXPathValue($sxe, "entry[position()=1]/link[@a:type='aps']/@href"); |
| | | //$app_filesize = parent::getXPathValue($sxe, "entry[position()=1]/link[@a:type='aps']/@length"); |
| | | //$app_metafile = parent::getXPathValue($sxe, "entry[position()=1]/link[@a:type='meta']/@href"); |
| | | $app_dl = parent::getXPathValue($sxe, "entry[position()=" . $entry_pos . "]/link[@a:type='aps']/@href"); |
| | | $app_filesize = parent::getXPathValue($sxe, "entry[position()=" . $entry_pos . "]/link[@a:type='aps']/@length"); |
| | | $app_metafile = parent::getXPathValue($sxe, "entry[position()=" . $entry_pos . "]/link[@a:type='meta']/@href"); |
| | | //$app_dl = parent::getXPathValue($sxe, "entry[position()=1]/link[@a:type='aps']/@href"); |
| | | //$app_filesize = parent::getXPathValue($sxe, "entry[position()=1]/link[@a:type='aps']/@length"); |
| | | //$app_metafile = parent::getXPathValue($sxe, "entry[position()=1]/link[@a:type='meta']/@href"); |
| | | $app_dl = parent::getXPathValue($sxe, "entry[position()=" . $entry_pos . "]/link[@a:type='aps']/@href"); |
| | | $app_filesize = parent::getXPathValue($sxe, "entry[position()=" . $entry_pos . "]/link[@a:type='aps']/@length"); |
| | | $app_metafile = parent::getXPathValue($sxe, "entry[position()=" . $entry_pos . "]/link[@a:type='meta']/@href"); |
| | | |
| | | //$this->app_download_url_list[$app_name.'-'.$new_ver.'.app.zip'] = $app_dl; |
| | | // Skip ASP.net packages because they can't be used at all |
| | | $asp_handler = parent::getXPathValue($sxe, '//aspnet:handler'); |
| | | $asp_permissions = parent::getXPathValue($sxe, '//aspnet:permissions'); |
| | | $asp_version = parent::getXPathValue($sxe, '//aspnet:version'); |
| | | if(!empty($asp_handler) || !empty($asp_permissions) || !empty($asp_version)) continue; |
| | | //$this->app_download_url_list[$app_name.'-'.$new_ver.'.app.zip'] = $app_dl; |
| | | // Skip ASP.net packages because they can't be used at all |
| | | $asp_handler = parent::getXPathValue($sxe, '//aspnet:handler'); |
| | | $asp_permissions = parent::getXPathValue($sxe, '//aspnet:permissions'); |
| | | $asp_version = parent::getXPathValue($sxe, '//aspnet:version'); |
| | | if(!empty($asp_handler) || !empty($asp_permissions) || !empty($asp_version)) continue; |
| | | |
| | | // Interface mode (download only parts) |
| | | if($this->interface_mode) |
| | | { |
| | | // Delete an obviously out-dated version from the system and DB |
| | | if(!empty($ex_ver) && version_compare($new_ver, $ex_ver) == 1) |
| | | // Interface mode (download only parts) |
| | | if($this->interface_mode) |
| | | { |
| | | $old_folder = $this->interface_pkg_dir.'/'.$app_name.'-'.$ex_ver.'.app.zip'; |
| | | if(file_exists($old_folder)) $this->removeDirectory($old_folder); |
| | | |
| | | /* |
| | | $app->db->query("UPDATE aps_packages SET package_status = '".PACKAGE_OUTDATED."' WHERE name = '". |
| | | $app->db->quote($app_name)."' AND CONCAT(version, '-', CAST(`release` AS CHAR)) = '". |
| | | $app->db->quote($ex_ver)."';"); |
| | | */ |
| | | $tmp = $app->db->queryOneRecord("SELECT id FROM aps_packages WHERE name = '". |
| | | $app->db->quote($app_name)."' AND CONCAT(version, '-', CAST(`release` AS CHAR)) = '". |
| | | $app->db->quote($ex_ver)."';"); |
| | | $app->db->datalogUpdate('aps_packages', "package_status = ".PACKAGE_OUTDATED, 'id', $tmp['id']); |
| | | unset($tmp); |
| | | } |
| | | |
| | | // Create the local folder if not yet existing |
| | | if(!file_exists($local_intf_folder)) @mkdir($local_intf_folder, 0777, true); |
| | | |
| | | // Save the package URL in an extra file because it's not part of the APP-META.xml file |
| | | @file_put_contents($local_intf_folder.'PKG_URL', $app_dl); |
| | | |
| | | // Download the meta file |
| | | $local_metafile = $local_intf_folder.'APP-META.xml'; |
| | | if(!file_exists($local_metafile) || filesize($local_metafile) == 0) |
| | | { |
| | | $apps_to_dl[] = array('name' => 'APP-META.xml', |
| | | 'url' => $app_metafile, |
| | | 'filesize' => 0, |
| | | 'localtarget' => $local_metafile); |
| | | $apps_downloaded++; |
| | | } |
| | | |
| | | // Download package license |
| | | //$license = parent::getXPathValue($sxe, "entry[position()=1]/link[@a:type='eula']/@href"); |
| | | $license = parent::getXPathValue($sxe, "entry[position()=" . $entry_pos . "]/link[@a:type='eula']/@href"); |
| | | if($license != '') |
| | | { |
| | | $local_license = $local_intf_folder.'LICENSE'; |
| | | if(!file_exists($local_license) || filesize($local_license) == 0) |
| | | // Delete an obviously out-dated version from the system and DB |
| | | if(!empty($ex_ver) && version_compare($new_ver, $ex_ver) == 1) |
| | | { |
| | | $apps_to_dl[] = array('name' => basename($license), |
| | | 'url' => $license, |
| | | 'filesize' => 0, |
| | | 'localtarget' => $local_license); |
| | | $old_folder = $this->interface_pkg_dir.'/'.$app_name.'-'.$ex_ver.'.app.zip'; |
| | | if(file_exists($old_folder)) $this->removeDirectory($old_folder); |
| | | |
| | | $tmp = $app->db->queryOneRecord("SELECT id FROM aps_packages WHERE name = ? AND CONCAT(version, '-', CAST(`release` AS CHAR)) = ?", $app_name, $ex_ver); |
| | | $app->db->datalogUpdate('aps_packages', array("package_status" => PACKAGE_OUTDATED), 'id', $tmp['id']); |
| | | unset($tmp); |
| | | } |
| | | } |
| | | |
| | | // Download package icon |
| | | //$icon = parent::getXPathValue($sxe, "entry[position()=1]/link[@a:type='icon']/@href"); |
| | | $icon = parent::getXPathValue($sxe, "entry[position()=" . $entry_pos . "]/link[@a:type='icon']/@href"); |
| | | if($icon != '') |
| | | { |
| | | $local_icon = $local_intf_folder.basename($icon); |
| | | if(!file_exists($local_icon) || filesize($local_icon) == 0) |
| | | // Create the local folder if not yet existing |
| | | if(!file_exists($local_intf_folder)) @mkdir($local_intf_folder, 0777, true); |
| | | |
| | | // Save the package URL in an extra file because it's not part of the APP-META.xml file |
| | | @file_put_contents($local_intf_folder.'PKG_URL', $app_dl); |
| | | |
| | | // Download the meta file |
| | | $local_metafile = $local_intf_folder.'APP-META.xml'; |
| | | if(!file_exists($local_metafile) || filesize($local_metafile) == 0) |
| | | { |
| | | $apps_to_dl[] = array('name' => basename($icon), |
| | | 'url' => $icon, |
| | | $apps_to_dl[] = array('name' => 'APP-META.xml', |
| | | 'url' => $app_metafile, |
| | | 'filesize' => 0, |
| | | 'localtarget' => $local_icon); |
| | | 'localtarget' => $local_metafile); |
| | | $apps_downloaded++; |
| | | } |
| | | } |
| | | |
| | | // Download available screenshots |
| | | //$screenshots = parent::getXPathValue($sxe, "entry[position()=1]/link[@a:type='screenshot']", true); |
| | | $screenshots = parent::getXPathValue($sxe, "entry[position()=" . $entry_pos . "]/link[@a:type='screenshot']", true); |
| | | if(!empty($screenshots)) |
| | | { |
| | | foreach($screenshots as $screen) |
| | | // Download package license |
| | | //$license = parent::getXPathValue($sxe, "entry[position()=1]/link[@a:type='eula']/@href"); |
| | | $license = parent::getXPathValue($sxe, "entry[position()=" . $entry_pos . "]/link[@a:type='eula']/@href"); |
| | | if($license != '') |
| | | { |
| | | $local_screen = $local_intf_folder.basename($screen['href']); |
| | | if(!file_exists($local_screen) || filesize($local_screen) == 0) |
| | | $local_license = $local_intf_folder.'LICENSE'; |
| | | if(!file_exists($local_license) || filesize($local_license) == 0) |
| | | { |
| | | $apps_to_dl[] = array('name' => basename($screen['href']), |
| | | 'url' => $screen['href'], |
| | | $apps_to_dl[] = array('name' => basename($license), |
| | | 'url' => $license, |
| | | 'filesize' => 0, |
| | | 'localtarget' => $local_screen); |
| | | 'localtarget' => $local_license); |
| | | } |
| | | } |
| | | |
| | | // Download package icon |
| | | //$icon = parent::getXPathValue($sxe, "entry[position()=1]/link[@a:type='icon']/@href"); |
| | | $icon = parent::getXPathValue($sxe, "entry[position()=" . $entry_pos . "]/link[@a:type='icon']/@href"); |
| | | if($icon != '') |
| | | { |
| | | $local_icon = $local_intf_folder.basename($icon); |
| | | if(!file_exists($local_icon) || filesize($local_icon) == 0) |
| | | { |
| | | $apps_to_dl[] = array('name' => basename($icon), |
| | | 'url' => $icon, |
| | | 'filesize' => 0, |
| | | 'localtarget' => $local_icon); |
| | | } |
| | | } |
| | | |
| | | // Download available screenshots |
| | | //$screenshots = parent::getXPathValue($sxe, "entry[position()=1]/link[@a:type='screenshot']", true); |
| | | $screenshots = parent::getXPathValue($sxe, "entry[position()=" . $entry_pos . "]/link[@a:type='screenshot']", true); |
| | | if(!empty($screenshots)) |
| | | { |
| | | foreach($screenshots as $screen) |
| | | { |
| | | $local_screen = $local_intf_folder.basename($screen['href']); |
| | | if(!file_exists($local_screen) || filesize($local_screen) == 0) |
| | | { |
| | | $apps_to_dl[] = array('name' => basename($screen['href']), |
| | | 'url' => $screen['href'], |
| | | 'filesize' => 0, |
| | | 'localtarget' => $local_screen); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | else // Server mode (download whole ZIP archive) |
| | | { |
| | | // Delete an obviously out-dated version from the system |
| | | if(!empty($ex_ver) && version_compare($new_ver, $ex_ver) == 1) |
| | | { |
| | | $old_file = $this->packages_dir.'/'.$app_name.'-'.$ex_ver.'.app.zip'; |
| | | if(file_exists($old_file)) $this->removeDirectory($old_file); |
| | | } |
| | | else // Server mode (download whole ZIP archive) |
| | | { |
| | | // Delete an obviously out-dated version from the system |
| | | if(!empty($ex_ver) && version_compare($new_ver, $ex_ver) == 1) |
| | | { |
| | | $old_file = $this->packages_dir.'/'.$app_name.'-'.$ex_ver.'.app.zip'; |
| | | if(file_exists($old_file)) $this->removeDirectory($old_file); |
| | | } |
| | | |
| | | // Attention: $new_ver can also be == $ex_ver (according to version_compare >= 0) |
| | | $local_zip = $this->packages_dir.'/'.$app_name.'-'.$new_ver.'.app.zip'; |
| | | // Attention: $new_ver can also be == $ex_ver (according to version_compare >= 0) |
| | | $local_zip = $this->packages_dir.'/'.$app_name.'-'.$new_ver.'.app.zip'; |
| | | |
| | | // Before re-downloading a file, make sure it's not yet existing on HDD (due to DB inconsistency) |
| | | if((file_exists($local_zip) && (filesize($local_zip) == $app_filesize)) === false) |
| | | { |
| | | $apps_to_dl[] = array('name' => $app_name, |
| | | 'url' => $app_dl, |
| | | 'filesize' => $app_filesize, |
| | | 'localtarget' => $local_zip); |
| | | $apps_downloaded++; |
| | | // Before re-downloading a file, make sure it's not yet existing on HDD (due to DB inconsistency) |
| | | if((file_exists($local_zip) && (filesize($local_zip) == $app_filesize)) === false) |
| | | { |
| | | $apps_to_dl[] = array('name' => $app_name, |
| | | 'url' => $app_dl, |
| | | 'filesize' => $app_filesize, |
| | | 'localtarget' => $local_zip); |
| | | $apps_downloaded++; |
| | | } |
| | | } |
| | | } |
| | | |
| | | unset($sxe); |
| | | $apps_in_repo++; |
| | | } catch (Exception $e) { |
| | | // We dont want the crawler to fail on xml parse errors |
| | | $app->log($this->log_prefix.$e->getMessage(), LOGLEVEL_WARN); |
| | | //echo 'Caught exception: ', $e->getMessage(), "\n"; |
| | | } |
| | | |
| | | unset($sxe); |
| | | $apps_in_repo++; |
| | | } |
| | | } |
| | | //var_dump($apps); |
| | | //echo print_r($apps_to_dl).'<br>-------------------<br>'; |
| | | |
| | | // For memory reasons, unset the current vendor and his apps |
| | | unset($apps); |
| | |
| | | |
| | | // Get registered packages and mark non-existant packages with an error code to omit the install |
| | | $existing_packages = array(); |
| | | $path_query = $app->db->queryAllRecords('SELECT path AS Path FROM aps_packages;'); |
| | | $path_query = $app->db->queryAllRecords('SELECT path AS Path FROM aps_packages'); |
| | | foreach($path_query as $path) $existing_packages[] = $path['Path']; |
| | | $diff = array_diff($existing_packages, $pkg_list); |
| | | foreach($diff as $todelete) { |
| | | /*$app->db->query("UPDATE aps_packages SET package_status = '".PACKAGE_ERROR_NOMETA."' |
| | | WHERE path = '".$app->db->quote($todelete)."';");*/ |
| | | $tmp = $app->db->queryOneRecord("SELECT id FROM aps_packages WHERE path = '".$app->db->quote($todelete)."';"); |
| | | $app->db->datalogUpdate('aps_packages', "package_status = ".PACKAGE_ERROR_NOMETA, 'id', $tmp['id']); |
| | | $tmp = $app->db->queryOneRecord("SELECT id FROM aps_packages WHERE path = ?", $todelete); |
| | | $app->db->datalogUpdate('aps_packages', array("package_status" => PACKAGE_ERROR_NOMETA), 'id', $tmp['id']); |
| | | unset($tmp); |
| | | } |
| | | |
| | |
| | | //$pkg_url = $this->app_download_url_list[$pkg]; |
| | | $pkg_url = @file_get_contents($this->interface_pkg_dir.'/'.$pkg.'/PKG_URL'); |
| | | |
| | | /* |
| | | $app->db->query("INSERT INTO `aps_packages` |
| | | (`path`, `name`, `category`, `version`, `release`, `package_status`) VALUES |
| | | ('".$app->db->quote($pkg)."', '".$app->db->quote($pkg_name)."', |
| | | '".$app->db->quote($pkg_category)."', '".$app->db->quote($pkg_version)."', |
| | | ".$app->db->quote($pkg_release).", ".PACKAGE_ENABLED.");"); |
| | | */ |
| | | // Insert only if data is complete |
| | | if($pkg != '' && $pkg_name != '' && $pkg_category != '' && $pkg_version != '' && $pkg_release != '' && $pkg_url){ |
| | | $insert_data = "(`path`, `name`, `category`, `version`, `release`, `package_url`, `package_status`) VALUES |
| | | ('".$app->db->quote($pkg)."', '".$app->db->quote($pkg_name)."', |
| | | '".$app->db->quote($pkg_category)."', '".$app->db->quote($pkg_version)."', |
| | | ".$app->db->quote($pkg_release).", '".$app->db->quote($pkg_url)."', ".PACKAGE_ENABLED.");"; |
| | | |
| | | $insert_data = array( |
| | | "path" => $pkg, |
| | | "name" => $pkg_name, |
| | | "category" => $pkg_category, |
| | | "version" => $pkg_version, |
| | | "release" => $pkg_release, |
| | | "package_url" => $pkg_url, |
| | | "package_status" => PACKAGE_ENABLED |
| | | ); |
| | | $app->db->datalogInsert('aps_packages', $insert_data, 'id'); |
| | | } else { |
| | | if(file_exists($this->interface_pkg_dir.'/'.$pkg)) $this->removeDirectory($this->interface_pkg_dir.'/'.$pkg); |
| | |
| | | // This method must be used in interface mode |
| | | if(!$this->interface_mode) return false; |
| | | |
| | | $incomplete_pkgs = $app->db->queryAllRecords("SELECT * FROM aps_packages WHERE package_url = ''"); |
| | | $incomplete_pkgs = $app->db->queryAllRecords("SELECT * FROM aps_packages WHERE package_url = ?", ''); |
| | | if(is_array($incomplete_pkgs) && !empty($incomplete_pkgs)){ |
| | | foreach($incomplete_pkgs as $incomplete_pkg){ |
| | | $pkg_url = @file_get_contents($this->interface_pkg_dir.'/'.$incomplete_pkg['path'].'/PKG_URL'); |
| | | if($pkg_url != ''){ |
| | | $app->db->datalogUpdate('aps_packages', "package_url = '".$app->db->quote($pkg_url)."'", 'id', $incomplete_pkg['id']); |
| | | $app->db->datalogUpdate('aps_packages', array("package_url" => $pkg_url), 'id', $incomplete_pkg['id']); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | $customerdata = $app->db->queryOneRecord("SELECT client_id FROM sys_group, web_domain |
| | | WHERE web_domain.sys_groupid = sys_group.groupid |
| | | AND web_domain.domain = '".$app->db->quote($domain)."';"); |
| | | AND web_domain.domain = ?", $domain); |
| | | if(!empty($customerdata)) $customerid = $customerdata['client_id']; |
| | | |
| | | return $customerid; |
| | |
| | | |
| | | $websrv = $app->db->queryOneRecord("SELECT server_id FROM web_domain |
| | | WHERE domain = (SELECT value FROM aps_instances_settings |
| | | WHERE name = 'main_domain' AND instance_id = ".$app->db->quote($instanceid).");"); |
| | | WHERE name = 'main_domain' AND instance_id = ?)", $instanceid); |
| | | |
| | | // If $websrv is empty, an error has occured. Domain no longer existing? Settings table damaged? |
| | | // Anyhow, remove this instance record because it's not useful at all |
| | | if(empty($websrv)) |
| | | { |
| | | $app->db->query("DELETE FROM aps_instances WHERE id = ".$app->db->quote($instanceid).";"); |
| | | $app->db->query("DELETE FROM aps_instances_settings WHERE instance_id = ".$app->db->quote($instanceid).";"); |
| | | $app->db->query("DELETE FROM aps_instances WHERE id = ?", $instanceid); |
| | | $app->db->query("DELETE FROM aps_instances_settings WHERE instance_id = ?", $instanceid); |
| | | } |
| | | else $webserver_id = $websrv['server_id']; |
| | | |
| | |
| | | $result = $app->db->queryOneRecord("SELECT id, name, |
| | | CONCAT(version, '-', CAST(`release` AS CHAR)) AS current_version |
| | | FROM aps_packages |
| | | WHERE name = (SELECT name FROM aps_packages WHERE id = ".$app->db->quote($id).") |
| | | WHERE name = (SELECT name FROM aps_packages WHERE id = ?) |
| | | AND package_status = 2 |
| | | ORDER BY REPLACE(version, '.', '')+0 DESC, `release` DESC"); |
| | | ORDER BY REPLACE(version, '.', '')+0 DESC, `release` DESC", $id); |
| | | |
| | | if(!empty($result) && ($id != $result['id'])) return $result['id']; |
| | | |
| | |
| | | 'package_status = '.PACKAGE_ENABLED.' AND' : |
| | | '(package_status = '.PACKAGE_ENABLED.' OR package_status = '.PACKAGE_LOCKED.') AND'; |
| | | |
| | | $result = $app->db->queryOneRecord("SELECT id FROM aps_packages WHERE ".$sql_ext." id = ".$app->db->quote($id).";"); |
| | | $result = $app->db->queryOneRecord("SELECT id FROM aps_packages WHERE ".$sql_ext." id = ?", $id); |
| | | if(!$result) return false; |
| | | |
| | | return true; |
| | |
| | | if(preg_match('/^[0-9]+$/', $id) != 1) return false; |
| | | |
| | | // Only filter if not admin |
| | | $sql_ext = (!$is_admin) ? 'customer_id = '.$app->db->quote($client_id).' AND' : ''; |
| | | |
| | | $result = $app->db->queryOneRecord('SELECT id FROM aps_instances WHERE '.$sql_ext.' id = '.$app->db->quote($id).';'); |
| | | $params = array(); |
| | | $sql_ext = ''; |
| | | if(!$is_admin) { |
| | | $sql_ext = 'customer_id = ? AND '; |
| | | $params[] = $client_id; |
| | | } |
| | | $params[] = $id; |
| | | |
| | | $result = $app->db->queryOneRecord('SELECT id FROM aps_instances WHERE '.$sql_ext.' id = ?', true, $params); |
| | | if(!$result) return false; |
| | | |
| | | return true; |
| | |
| | | unset($tmp); |
| | | |
| | | // get information if the webserver is a db server, too |
| | | $web_server = $app->db->queryOneRecord("SELECT server_id,server_name,db_server FROM server WHERE server_id = ".$app->functions->intval($websrv['server_id'])); |
| | | $web_server = $app->db->queryOneRecord("SELECT server_id,server_name,db_server FROM server WHERE server_id = ?", $websrv['server_id']); |
| | | if($web_server['db_server'] == 1) { |
| | | // create database on "localhost" (webserver) |
| | | $mysql_db_server_id = $app->functions->intval($websrv['server_id']); |
| | |
| | | $mysql_db_remote_ips = ''; |
| | | } else { |
| | | //* get the default database server of the client |
| | | $client = $app->db->queryOneRecord("SELECT default_dbserver FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ".$app->functions->intval($websrv['sys_groupid'])); |
| | | $client = $app->db->queryOneRecord("SELECT default_dbserver FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $websrv['sys_groupid']); |
| | | if(is_array($client) && $client['default_dbserver'] > 0 && $client['default_dbserver'] != $websrv['server_id']) { |
| | | $mysql_db_server_id = $app->functions->intval($client['default_dbserver']); |
| | | $dbserver_config = $web_config = $app->getconf->get_server_config($app->functions->intval($mysql_db_server_id), 'server'); |
| | |
| | | if (empty($settings['main_database_name'])) { |
| | | //* Find a free db name for the app |
| | | for($n = 1; $n <= 1000; $n++) { |
| | | $mysql_db_name = $app->db->quote(($dbname_prefix != '' ? $dbname_prefix.'aps'.$n : uniqid('aps'))); |
| | | $tmp = $app->db->queryOneRecord("SELECT count(database_id) as number FROM web_database WHERE database_name = '".$app->db->quote($mysql_db_name)."'"); |
| | | $mysql_db_name = ($dbname_prefix != '' ? $dbname_prefix.'aps'.$n : uniqid('aps')); |
| | | $tmp = $app->db->queryOneRecord("SELECT count(database_id) as number FROM web_database WHERE database_name = ?", $mysql_db_name); |
| | | if($tmp['number'] == 0) break; |
| | | } |
| | | $settings['main_database_name'] = $mysql_db_name; |
| | |
| | | if (empty($settings['main_database_login'])) { |
| | | //* Find a free db username for the app |
| | | for($n = 1; $n <= 1000; $n++) { |
| | | $mysql_db_user = $app->db->quote(($dbuser_prefix != '' ? $dbuser_prefix.'aps'.$n : uniqid('aps'))); |
| | | $tmp = $app->db->queryOneRecord("SELECT count(database_user_id) as number FROM web_database_user WHERE database_user = '".$app->db->quote($mysql_db_user)."'"); |
| | | $mysql_db_user = ($dbuser_prefix != '' ? $dbuser_prefix.'aps'.$n : uniqid('aps')); |
| | | $tmp = $app->db->queryOneRecord("SELECT count(database_user_id) as number FROM web_database_user WHERE database_user = ?", $mysql_db_user); |
| | | if($tmp['number'] == 0) break; |
| | | } |
| | | $settings['main_database_login'] = $mysql_db_user; |
| | | } |
| | | |
| | | //* Create the mysql database user if not existing |
| | | $tmp = $app->db->queryOneRecord("SELECT database_user_id FROM web_database_user WHERE database_user = '".$app->db->quote($settings['main_database_login'])."'"); |
| | | $tmp = $app->db->queryOneRecord("SELECT database_user_id FROM web_database_user WHERE database_user = ?", $settings['main_database_login']); |
| | | if(!$tmp) { |
| | | $insert_data = "(`sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `server_id`, `database_user`, `database_user_prefix`, `database_password`) |
| | | VALUES( ".$app->functions->intval($websrv['sys_userid']).", ".$app->functions->intval($websrv['sys_groupid']).", 'riud', '".$app->functions->intval($websrv['sys_perm_group'])."', '', 0, '".$settings['main_database_login']."', '".$app->db->quote($dbuser_prefix) . "', PASSWORD('".$settings['main_database_password']."'))"; |
| | | $insert_data = array("sys_userid" => $websrv['sys_userid'], |
| | | "sys_groupid" => $websrv['sys_groupid'], |
| | | "sys_perm_user" => 'riud', |
| | | "sys_perm_group" => $websrv['sys_perm_group'], |
| | | "sys_perm_other" => '', |
| | | "server_id" => 0, |
| | | "database_user" => $settings['main_database_login'], |
| | | "database_user_prefix" => $dbuser_prefix, |
| | | "database_password" => "PASSWORD('" . $settings['main_database_password'] . "')" |
| | | ); |
| | | $mysql_db_user_id = $app->db->datalogInsert('web_database_user', $insert_data, 'database_user_id'); |
| | | } |
| | | else $mysql_db_user_id = $tmp['database_user_id']; |
| | | |
| | | //* Create the mysql database if not existing |
| | | $tmp = $app->db->queryOneRecord("SELECT count(database_id) as number FROM web_database WHERE database_name = '".$app->db->quote($settings['main_database_name'])."'"); |
| | | $tmp = $app->db->queryOneRecord("SELECT count(database_id) as number FROM web_database WHERE database_name = ?", $settings['main_database_name']); |
| | | if($tmp['number'] == 0) { |
| | | $insert_data = "(`sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `server_id`, `parent_domain_id`, `type`, `database_name`, `database_name_prefix`, `database_user_id`, `database_ro_user_id`, `database_charset`, `remote_access`, `remote_ips`, `backup_copies`, `active`, `backup_interval`) |
| | | VALUES( ".$app->functions->intval($websrv['sys_userid']).", ".$app->functions->intval($websrv['sys_groupid']).", 'riud', '".$app->functions->intval($websrv['sys_perm_group'])."', '', $mysql_db_server_id, ".$app->functions->intval($websrv['domain_id']).", 'mysql', '".$settings['main_database_name']."', '" . $app->db->quote($dbname_prefix) . "', '$mysql_db_user_id', 0, '', '$mysql_db_remote_access', '$mysql_db_remote_ips', ".$app->functions->intval($websrv['backup_copies']).", 'y', '".$app->functions->intval($websrv['backup_interval'])."')"; |
| | | $insert_data = array("sys_userid" => $websrv['sys_userid'], |
| | | "sys_groupid" => $websrv['sys_groupid'], |
| | | "sys_perm_user" => 'riud', |
| | | "sys_perm_group" => $websrv['sys_perm_group'], |
| | | "sys_perm_other" => '', |
| | | "server_id" => $mysql_db_server_id, |
| | | "parent_domain_id" => $websrv['domain_id'], |
| | | "type" => 'mysql', |
| | | "database_name" => $settings['main_database_name'], |
| | | "database_name_prefix" => $dbname_prefix, |
| | | "database_user_id" => $mysql_db_user_id, |
| | | "database_ro_user_id" => 0, |
| | | "database_charset" => '', |
| | | "remote_access" => $mysql_db_remote_access, |
| | | "remote_ips" => $mysql_db_remote_ips, |
| | | "backup_copies" => $websrv['backup_copies'], |
| | | "active" => 'y', |
| | | "backup_interval" => $websrv['backup_interval'] |
| | | ); |
| | | $app->db->datalogInsert('web_database', $insert_data, 'database_id'); |
| | | } |
| | | |
| | |
| | | $app->uses('tools_sites'); |
| | | |
| | | $webserver_id = 0; |
| | | $websrv = $app->db->queryOneRecord("SELECT * FROM web_domain WHERE domain = '".$app->db->quote($settings['main_domain'])."';"); |
| | | $websrv = $app->db->queryOneRecord("SELECT * FROM web_domain WHERE domain = ?", $settings['main_domain']); |
| | | if(!empty($websrv)) $webserver_id = $websrv['server_id']; |
| | | $customerid = $this->getCustomerIDFromDomain($settings['main_domain']); |
| | | |
| | |
| | | //* Set PHP mode to php-fcgi and enable suexec in website on apache servers / set PHP mode to PHP-FPM on nginx servers |
| | | if($web_config['server_type'] == 'apache') { |
| | | if(($websrv['php'] != 'fast-cgi' || $websrv['suexec'] != 'y') && $websrv['php'] != 'php-fpm') { |
| | | $app->db->datalogUpdate('web_domain', "php = 'fast-cgi', suexec = 'y'", 'domain_id', $websrv['domain_id']); |
| | | $app->db->datalogUpdate('web_domain', array("php" => 'fast-cgi', "suexec" => 'y'), 'domain_id', $websrv['domain_id']); |
| | | } |
| | | } else { |
| | | // nginx |
| | | if($websrv['php'] != 'php-fpm' && $websrv['php'] != 'fast-cgi') { |
| | | $app->db->datalogUpdate('web_domain', "php = 'php-fpm'", 'domain_id', $websrv['domain_id']); |
| | | $app->db->datalogUpdate('web_domain', array("php" => 'php-fpm'), 'domain_id', $websrv['domain_id']); |
| | | } |
| | | } |
| | | |
| | | |
| | | //* Create the MySQL database for the application if necessary |
| | | $pkg = $app->db->queryOneRecord('SELECT * FROM aps_packages WHERE id = '.$app->db->quote($packageid).';'); |
| | | $pkg = $app->db->queryOneRecord('SELECT * FROM aps_packages WHERE id = ?', $packageid); |
| | | $metafile = $this->interface_pkg_dir.'/'.$pkg['path'].'/APP-META.xml'; |
| | | $sxe = $this->readInMetaFile($metafile); |
| | | |
| | |
| | | // mysql-database-name is updated inside if not set already |
| | | if (!$this->createDatabaseForPackageInstance($settings, $websrv)) return false; |
| | | } |
| | | |
| | | |
| | | //* Insert new package instance |
| | | $insert_data = "(`sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `server_id`, `customer_id`, `package_id`, `instance_status`) VALUES (".$app->functions->intval($websrv['sys_userid']).", ".$app->functions->intval($websrv['sys_groupid']).", 'riud', '".$app->db->quote($websrv['sys_perm_group'])."', '', ".$app->db->quote($webserver_id).",".$app->db->quote($customerid).", ".$app->db->quote($packageid).", ".INSTANCE_PENDING.")"; |
| | | $insert_data = array( |
| | | "sys_userid" => $websrv['sys_userid'], |
| | | "sys_groupid" => $websrv['sys_groupid'], |
| | | "sys_perm_user" => 'riud', |
| | | "sys_perm_group" => $websrv['sys_perm_group'], |
| | | "sys_perm_other" => '', |
| | | "server_id" => $webserver_id, |
| | | "customer_id" => $customerid, |
| | | "package_id" => $packageid, |
| | | "instance_status" => INSTANCE_PENDING |
| | | ); |
| | | $InstanceID = $app->db->datalogInsert('aps_instances', $insert_data, 'id'); |
| | | |
| | | //* Insert all package settings |
| | | if(is_array($settings)) { |
| | | foreach($settings as $key => $value) { |
| | | $insert_data = "(server_id, instance_id, name, value) VALUES (".$app->db->quote($webserver_id).",".$app->db->quote($InstanceID).", '".$app->db->quote($key)."', '".$app->db->quote($value)."')"; |
| | | $insert_data = array( |
| | | "server_id" => $webserver_id, |
| | | "instance_id" => $InstanceID, |
| | | "name" => $key, |
| | | "value" => $value |
| | | ); |
| | | $app->db->datalogInsert('aps_instances_settings', $insert_data, 'id'); |
| | | } |
| | | } |
| | | |
| | | //* Set package status to install afetr we inserted the settings |
| | | $app->db->datalogUpdate('aps_instances', "instance_status = ".INSTANCE_INSTALL, 'id', $InstanceID); |
| | | $app->db->datalogUpdate('aps_instances', array("instance_status" => INSTANCE_INSTALL), 'id', $InstanceID); |
| | | } |
| | | |
| | | /** |
| | |
| | | public function deleteInstance($instanceid, $keepdatabase = false) |
| | | { |
| | | global $app; |
| | | /* |
| | | $app->db->query("UPDATE aps_instances SET instance_status = ".INSTANCE_REMOVE." WHERE id = ".$instanceid.";"); |
| | | |
| | | $webserver_id = $this->getInstanceDataForDatalog($instanceid); |
| | | if($webserver_id == '') return; |
| | | |
| | | // Create a sys_datalog entry for deletion |
| | | $datalog = array('Instance_id' => $instanceid, 'server_id' => $webserver_id); |
| | | $app->db->datalogSave('aps', 'DELETE', 'id', $instanceid, array(), $datalog); |
| | | */ |
| | | |
| | | if (!$keepdatabase) { |
| | | $sql = "SELECT web_database.database_id as database_id, web_database.database_user_id as `database_user_id` FROM aps_instances_settings, web_database WHERE aps_instances_settings.value = web_database.database_name AND aps_instances_settings.name = 'main_database_name' AND aps_instances_settings.instance_id = ".$instanceid." LIMIT 0,1"; |
| | | $tmp = $app->db->queryOneRecord($sql); |
| | | $sql = "SELECT web_database.database_id as database_id, web_database.database_user_id as `database_user_id` FROM aps_instances_settings, web_database WHERE aps_instances_settings.value = web_database.database_name AND aps_instances_settings.name = 'main_database_name' AND aps_instances_settings.instance_id = ? LIMIT 0,1"; |
| | | $tmp = $app->db->queryOneRecord($sql, $instanceid); |
| | | if($tmp['database_id'] > 0) $app->db->datalogDelete('web_database', 'database_id', $tmp['database_id']); |
| | | |
| | | $database_user = $tmp['database_user_id']; |
| | | $tmp = $app->db->queryOneRecord("SELECT COUNT(*) as `cnt` FROM `web_database` WHERE `database_user_id` = '" . $app->functions->intval($database_user) . "' OR `database_ro_user_id` = '" . $app->functions->intval($database_user) . "'"); |
| | | $tmp = $app->db->queryOneRecord("SELECT COUNT(*) as `cnt` FROM `web_database` WHERE `database_user_id` = ? OR `database_ro_user_id` = ?", $database_user, $database_user); |
| | | if($tmp['cnt'] < 1) $app->db->datalogDelete('web_database_user', 'database_user_id', $database_user); |
| | | } |
| | | |
| | | $app->db->datalogUpdate('aps_instances', "instance_status = ".INSTANCE_REMOVE, 'id', $instanceid); |
| | | $app->db->datalogUpdate('aps_instances', array("instance_status" => INSTANCE_REMOVE), 'id', $instanceid); |
| | | |
| | | } |
| | | |
| | |
| | | { |
| | | global $app; |
| | | |
| | | $pkg = $app->db->queryOneRecord('SELECT * FROM aps_packages WHERE id = '.$app->db->quote($id).';'); |
| | | $pkg = $app->db->queryOneRecord('SELECT * FROM aps_packages WHERE id = ?', $id); |
| | | |
| | | // Load in meta file if existing and register its namespaces |
| | | $metafile = $this->interface_pkg_dir.'/'.$pkg['path'].'/APP-META.xml'; |
| | |
| | | if(in_array($postinput['main_domain'], $domains)) |
| | | { |
| | | $docroot = $app->db->queryOneRecord("SELECT document_root FROM web_domain |
| | | WHERE domain = '".$app->db->quote($postinput['main_domain'])."';"); |
| | | WHERE domain = ?", $postinput['main_domain']); |
| | | $new_path = $docroot['document_root']; |
| | | if(substr($new_path, -1) != '/') $new_path .= '/'; |
| | | $new_path .= $main_location; |
| | |
| | | $instance_domains = $app->db->queryAllRecords("SELECT instance_id, s.value AS domain |
| | | FROM aps_instances AS i, aps_instances_settings AS s |
| | | WHERE i.id = s.instance_id AND s.name = 'main_domain' |
| | | AND i.customer_id = '".$app->db->quote($customerid)."';"); |
| | | AND i.customer_id = ?", $customerid); |
| | | for($i = 0; $i < count($instance_domains); $i++) |
| | | { |
| | | $used_path = ''; |
| | | |
| | | $doc_root = $app->db->queryOneRecord("SELECT document_root FROM web_domain |
| | | WHERE domain = '".$app->db->quote($instance_domains[$i]['domain'])."';"); |
| | | WHERE domain = ?", $instance_domains[$i]['domain']); |
| | | |
| | | // Probably the domain settings were changed later, so make sure the doc_root |
| | | // is not empty for further validation |
| | |
| | | |
| | | $location_for_domain = $app->db->queryOneRecord("SELECT value |
| | | FROM aps_instances_settings WHERE name = 'main_location' |
| | | AND instance_id = '".$app->db->quote($instance_domains[$i]['instance_id'])."';"); |
| | | AND instance_id = ?", $instance_domains[$i]['instance_id']); |
| | | |
| | | // The location might be empty but the DB return must not be false! |
| | | if($location_for_domain) $used_path .= $location_for_domain['value']; |
| | |
| | | { |
| | | global $app; |
| | | |
| | | $pkg = $app->db->queryOneRecord('SELECT * FROM aps_packages WHERE id = '.$app->db->quote($id).';'); |
| | | $pkg = $app->db->queryOneRecord('SELECT * FROM aps_packages WHERE id = ?', $id); |
| | | |
| | | // Load in meta file if existing and register its namespaces |
| | | $metafile = $this->interface_pkg_dir.'/'.$pkg['path'].'/APP-META.xml'; |
| | |
| | | global $app, $conf; |
| | | |
| | | $userid = $app->functions->intval($userid); |
| | | $client = $app->db->queryOneRecord("SELECT client.limit_client FROM sys_user, client WHERE sys_user.userid = $userid AND sys_user.client_id = client.client_id"); |
| | | $client = $app->db->queryOneRecord("SELECT client.limit_client FROM sys_user, client WHERE sys_user.userid = ? AND sys_user.client_id = client.client_id", $userid); |
| | | if($client['limit_client'] != 0) { |
| | | return true; |
| | | } else { |
| | |
| | | $groupid = $app->functions->intval($groupid); |
| | | |
| | | if($userid > 0 && $groupid > 0) { |
| | | $user = $app->db->queryOneRecord("SELECT * FROM sys_user WHERE userid = $userid"); |
| | | $user = $app->db->queryOneRecord("SELECT * FROM sys_user WHERE userid = ?", $userid); |
| | | $groups = explode(',', $user['groups']); |
| | | if(!in_array($groupid, $groups)) $groups[] = $groupid; |
| | | $groups_string = implode(',', $groups); |
| | | $sql = "UPDATE sys_user SET groups = '$groups_string' WHERE userid = $userid"; |
| | | $app->db->query($sql); |
| | | $sql = "UPDATE sys_user SET groups = ? WHERE userid = ?"; |
| | | $app->db->query($sql, $groups_string, $userid); |
| | | return true; |
| | | } else { |
| | | return false; |
| | |
| | | |
| | | // simple query cache |
| | | if($this->client_limits===null) |
| | | $this->client_limits = $app->db->queryOneRecord("SELECT client.* FROM sys_user, client WHERE sys_user.userid = $userid AND sys_user.client_id = client.client_id"); |
| | | $this->client_limits = $app->db->queryOneRecord("SELECT client.* FROM sys_user, client WHERE sys_user.userid = ? AND sys_user.client_id = client.client_id", $userid); |
| | | |
| | | // isn't client -> no limit |
| | | if(!$this->client_limits) |
| | |
| | | $groupid = $app->functions->intval($groupid); |
| | | |
| | | if($userid > 0 && $groupid > 0) { |
| | | $user = $app->db->queryOneRecord("SELECT * FROM sys_user WHERE userid = $userid"); |
| | | $user = $app->db->queryOneRecord("SELECT * FROM sys_user WHERE userid = ?", $userid); |
| | | $groups = explode(',', $user['groups']); |
| | | $key = array_search($groupid, $groups); |
| | | unset($groups[$key]); |
| | | $groups_string = implode(',', $groups); |
| | | $sql = "UPDATE sys_user SET groups = '$groups_string' WHERE userid = $userid"; |
| | | $app->db->query($sql); |
| | | $sql = "UPDATE sys_user SET groups = ? WHERE userid = ?"; |
| | | $app->db->query($sql, $groups_string, $userid); |
| | | return true; |
| | | } else { |
| | | return false; |
| | |
| | | |
| | | public function check_module_permissions($module) { |
| | | // Check if the current user has the permissions to access this module |
| | | $module = trim(preg_replace('@\s+@', '', $module)); |
| | | $user_modules = explode(',',$_SESSION["s"]["user"]["modules"]); |
| | | if(!in_array($module,$user_modules)) { |
| | | // echo "LOGIN_REDIRECT:/index.php"; |
| | | header("Location: /index.php"); |
| | | exit; |
| | | if(strpos($module, ',') !== false){ |
| | | $can_use_module = false; |
| | | $tmp_modules = explode(',', $module); |
| | | if(is_array($tmp_modules) && !empty($tmp_modules)){ |
| | | foreach($tmp_modules as $tmp_module){ |
| | | if($tmp_module != ''){ |
| | | if(in_array($tmp_module,$user_modules)) { |
| | | $can_use_module = true; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if(!$can_use_module){ |
| | | // echo "LOGIN_REDIRECT:/index.php"; |
| | | header("Location: /index.php"); |
| | | exit; |
| | | } |
| | | } else { |
| | | if(!in_array($module,$user_modules)) { |
| | | // echo "LOGIN_REDIRECT:/index.php"; |
| | | header("Location: /index.php"); |
| | | exit; |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | public function get_random_password($length = 8) { |
| | | $base64_alphabet='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; |
| | | $password = ''; |
| | | for ($n=0;$n<$length;$n++) { |
| | | $password.=$base64_alphabet[mt_rand(0, 63)]; |
| | | public function get_random_password($minLength = 8, $special = false) { |
| | | if($minLength < 8) $minLength = 8; |
| | | $maxLength = $minLength + 5; |
| | | $length = mt_rand($minLength, $maxLength); |
| | | |
| | | $alphachars = "abcdefghijklmnopqrstuvwxyz"; |
| | | $upperchars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; |
| | | $numchars = "1234567890"; |
| | | $specialchars = "!@#_"; |
| | | |
| | | $num_special = 0; |
| | | if($special == true) { |
| | | $num_special = intval(mt_rand(0, round($length / 4))) + 1; |
| | | } |
| | | return $password; |
| | | $numericlen = mt_rand(1, 2); |
| | | $alphalen = $length - $num_special - $numericlen; |
| | | $upperlen = intval($alphalen / 2); |
| | | $alphalen = $alphalen - $upperlen; |
| | | $password = ''; |
| | | |
| | | for($i = 0; $i < $alphalen; $i++) { |
| | | $password .= substr($alphachars, mt_rand(0, strlen($alphachars) - 1), 1); |
| | | } |
| | | |
| | | for($i = 0; $i < $upperlen; $i++) { |
| | | $password .= substr($upperchars, mt_rand(0, strlen($upperchars) - 1), 1); |
| | | } |
| | | |
| | | for($i = 0; $i < $num_special; $i++) { |
| | | $password .= substr($specialchars, mt_rand(0, strlen($specialchars) - 1), 1); |
| | | } |
| | | |
| | | for($i = 0; $i < $numericlen; $i++) { |
| | | $password .= substr($numchars, mt_rand(0, strlen($numchars) - 1), 1); |
| | | } |
| | | |
| | | return str_shuffle($password); |
| | | } |
| | | |
| | | public function crypt_password($cleartext_password) { |
| | |
| | | $salt.="$"; |
| | | return crypt($cleartext_password, $salt); |
| | | } |
| | | |
| | | public function csrf_token_get($form_name) { |
| | | /* CSRF PROTECTION */ |
| | | // generate csrf protection id and key |
| | | $_csrf_id = uniqid($form_name . '_'); // form id |
| | | $_csrf_key = sha1(uniqid(microtime(true), true)); // the key |
| | | if(!isset($_SESSION['_csrf'])) $_SESSION['_csrf'] = array(); |
| | | if(!isset($_SESSION['_csrf_timeout'])) $_SESSION['_csrf_timeout'] = array(); |
| | | $_SESSION['_csrf'][$_csrf_id] = $_csrf_key; |
| | | $_SESSION['_csrf_timeout'][$_csrf_id] = time() + 3600; // timeout hash in 1 hour |
| | | |
| | | return array('csrf_id' => $_csrf_id,'csrf_key' => $_csrf_key); |
| | | } |
| | | |
| | | public function csrf_token_check() { |
| | | global $app; |
| | | |
| | | if(isset($_POST) && is_array($_POST)) { |
| | | $_csrf_valid = false; |
| | | if(isset($_POST['_csrf_id']) && isset($_POST['_csrf_key'])) { |
| | | $_csrf_id = trim($_POST['_csrf_id']); |
| | | $_csrf_key = trim($_POST['_csrf_key']); |
| | | if(isset($_SESSION['_csrf']) && isset($_SESSION['_csrf'][$_csrf_id]) && isset($_SESSION['_csrf_timeout']) && isset($_SESSION['_csrf_timeout'][$_csrf_id])) { |
| | | if($_SESSION['_csrf'][$_csrf_id] === $_csrf_key && $_SESSION['_csrf_timeout'] >= time()) $_csrf_valid = true; |
| | | } |
| | | } |
| | | if($_csrf_valid !== true) { |
| | | $app->log('CSRF attempt blocked. Referer: ' . (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : 'unknown'), LOGLEVEL_WARN); |
| | | $app->error($app->lng('err_csrf_attempt_blocked')); |
| | | } |
| | | $_SESSION['_csrf'][$_csrf_id] = null; |
| | | $_SESSION['_csrf_timeout'][$_csrf_id] = null; |
| | | unset($_SESSION['_csrf'][$_csrf_id]); |
| | | unset($_SESSION['_csrf_timeout'][$_csrf_id]); |
| | | |
| | | if(isset($_SESSION['_csrf_timeout']) && is_array($_SESSION['_csrf_timeout'])) { |
| | | $to_unset = array(); |
| | | foreach($_SESSION['_csrf_timeout'] as $_csrf_id => $timeout) { |
| | | if($timeout < time()) $to_unset[] = $_csrf_id; |
| | | } |
| | | foreach($to_unset as $_csrf_id) { |
| | | $_SESSION['_csrf'][$_csrf_id] = null; |
| | | $_SESSION['_csrf_timeout'][$_csrf_id] = null; |
| | | unset($_SESSION['_csrf'][$_csrf_id]); |
| | | unset($_SESSION['_csrf_timeout'][$_csrf_id]); |
| | | } |
| | | unset($to_unset); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | if($old_style == true) { |
| | | // we have to take care of this in an other way |
| | | $in_db = $app->db->queryAllRecords('SELECT `assigned_template_id`, `client_template_id` FROM `client_template_assigned` WHERE `client_id` = ' . $app->functions->intval($clientId)); |
| | | $in_db = $app->db->queryAllRecords('SELECT `assigned_template_id`, `client_template_id` FROM `client_template_assigned` WHERE `client_id` = ?', $clientId); |
| | | if(is_array($in_db) && count($in_db) > 0) { |
| | | foreach($in_db as $item) { |
| | | if(array_key_exists($item['client_template_id'], $needed_types) == false) $needed_types[$item['client_template_id']] = 0; |
| | |
| | | if($count > 0) { |
| | | // add new template to client (includes those from old-style without assigned_template_id) |
| | | for($i = $count; $i > 0; $i--) { |
| | | $app->db->query('INSERT INTO `client_template_assigned` (`client_id`, `client_template_id`) VALUES (' . $app->functions->intval($clientId) . ', ' . $app->functions->intval($tpl_id) . ')'); |
| | | $app->db->query('INSERT INTO `client_template_assigned` (`client_id`, `client_template_id`) VALUES (?, ?)', $clientId, $tpl_id); |
| | | } |
| | | } elseif($count < 0) { |
| | | // remove old ones |
| | | for($i = $count; $i < 0; $i++) { |
| | | $app->db->query('DELETE FROM `client_template_assigned` WHERE client_id = ' . $app->functions->intval($clientId) . ' AND client_template_id = ' . $app->functions->intval($tpl_id) . ' LIMIT 1'); |
| | | $app->db->query('DELETE FROM `client_template_assigned` WHERE client_id = ? AND client_template_id = ? LIMIT 1', $clientId, $tpl_id); |
| | | } |
| | | } |
| | | } |
| | | } else { |
| | | // we have to take care of this in an other way |
| | | $in_db = $app->db->queryAllRecords('SELECT `assigned_template_id`, `client_template_id` FROM `client_template_assigned` WHERE `client_id` = ' . $app->functions->intval($clientId)); |
| | | $in_db = $app->db->queryAllRecords('SELECT `assigned_template_id`, `client_template_id` FROM `client_template_assigned` WHERE `client_id` = ?', $clientId); |
| | | if(is_array($in_db) && count($in_db) > 0) { |
| | | // check which templates were removed from this client |
| | | foreach($in_db as $item) { |
| | | if(in_array($item['assigned_template_id'], $used_assigned) == false) { |
| | | // delete this one |
| | | $app->db->query('DELETE FROM `client_template_assigned` WHERE `assigned_template_id` = ' . $app->functions->intval($item['assigned_template_id'])); |
| | | $app->db->query('DELETE FROM `client_template_assigned` WHERE `assigned_template_id` = ?', $item['assigned_template_id']); |
| | | } |
| | | } |
| | | } |
| | |
| | | if(count($new_tpl) > 0) { |
| | | foreach($new_tpl as $item) { |
| | | // add new template to client (includes those from old-style without assigned_template_id) |
| | | $app->db->query('INSERT INTO `client_template_assigned` (`client_id`, `client_template_id`) VALUES (' . $app->functions->intval($clientId) . ', ' . $app->functions->intval($item) . ')'); |
| | | $app->db->query('INSERT INTO `client_template_assigned` (`client_id`, `client_template_id`) VALUES (?, ?)', $clientId, $item); |
| | | } |
| | | } |
| | | } |
| | |
| | | /* |
| | | * Get the master-template for the client |
| | | */ |
| | | $sql = "SELECT template_master, template_additional,limit_client FROM client WHERE client_id = " . $app->functions->intval($clientId); |
| | | $record = $app->db->queryOneRecord($sql); |
| | | $sql = "SELECT template_master, template_additional,limit_client FROM client WHERE client_id = ?"; |
| | | $record = $app->db->queryOneRecord($sql, $clientId); |
| | | $masterTemplateId = $record['template_master']; |
| | | $is_reseller = ($record['limit_client'] != 0)?true:false; |
| | | |
| | |
| | | // we have to call the update_client_templates function |
| | | $templates = explode('/', $record['template_additional']); |
| | | $this->update_client_templates($clientId, $templates); |
| | | $app->db->query('UPDATE `client` SET `template_additional` = \'\' WHERE `client_id` = ' . $app->functions->intval($clientId)); |
| | | $app->db->query('UPDATE `client` SET `template_additional` = \'\' WHERE `client_id` = ?', $clientId); |
| | | } |
| | | |
| | | /* |
| | | * if the master-Template is custom there is NO changing |
| | | */ |
| | | if ($masterTemplateId > 0){ |
| | | $sql = "SELECT * FROM client_template WHERE template_id = " . $app->functions->intval($masterTemplateId); |
| | | $limits = $app->db->queryOneRecord($sql); |
| | | $sql = "SELECT * FROM client_template WHERE template_id = ?"; |
| | | $limits = $app->db->queryOneRecord($sql, $masterTemplateId); |
| | | } else { |
| | | // if there is no master template it makes NO SENSE adding sub templates. |
| | | // adding subtemplates are stored in client limits, so they would add up |
| | |
| | | * if != -1) |
| | | */ |
| | | $addTpl = explode('/', $additionalTemplateStr); |
| | | $addTpls = $app->db->queryAllRecords('SELECT `client_template_id` FROM `client_template_assigned` WHERE `client_id` = ' . $app->functions->intval($clientId)); |
| | | $addTpls = $app->db->queryAllRecords('SELECT `client_template_id` FROM `client_template_assigned` WHERE `client_id` = ?', $clientId); |
| | | foreach ($addTpls as $addTpl){ |
| | | $item = $addTpl['client_template_id']; |
| | | $sql = "SELECT * FROM client_template WHERE template_id = " . $app->functions->intval($item); |
| | | $addLimits = $app->db->queryOneRecord($sql); |
| | | $sql = "SELECT * FROM client_template WHERE template_id = ?"; |
| | | $addLimits = $app->db->queryOneRecord($sql, $item); |
| | | $app->log('Template processing subtemplate ' . $item . ' for client ' . $clientId, LOGLEVEL_DEBUG); |
| | | /* maybe the template is deleted in the meantime */ |
| | | if (is_array($addLimits)){ |
| | |
| | | * Write all back to the database |
| | | */ |
| | | $update = ''; |
| | | $update_values = array(); |
| | | if(!$is_reseller) unset($limits['limit_client']); // Only Resellers may have limit_client set in template to ensure that we do not convert a client to reseller accidently. |
| | | foreach($limits as $k => $v){ |
| | | if (strpos($k, 'default') !== false and $v == 0) { |
| | |
| | | } |
| | | if ((strpos($k, 'limit') !== false or strpos($k, 'default') !== false or $k == 'ssh_chroot' or $k == 'web_php_options' or $k == 'force_suexec') && !is_array($v)){ |
| | | if ($update != '') $update .= ', '; |
| | | $update .= '`' . $k . "`='" . $v . "'"; |
| | | $update .= '?? = ?'; |
| | | $update_values[] = $k; |
| | | $update_values[] = $v; |
| | | } |
| | | } |
| | | $update_values[] = $clientId; |
| | | $app->log('Template processed for client ' . $clientId . ', update string: ' . $update, LOGLEVEL_DEBUG); |
| | | if($update != '') { |
| | | $sql = 'UPDATE client SET ' . $update . " WHERE client_id = " . $app->functions->intval($clientId); |
| | | $app->db->query($sql); |
| | | $sql = 'UPDATE client SET ' . $update . " WHERE client_id = ?"; |
| | | $app->db->query($sql, true, $update_values); |
| | | } |
| | | unset($form); |
| | | } |
| | |
| | | if($_SESSION["s"]["user"]["typ"] == 'user') { |
| | | // Get the limits of the client |
| | | $client_group_id = $app->functions->intval($_SESSION["s"]["user"]["default_group"]); |
| | | $client = $app->db->queryOneRecord("SELECT default_dnsserver FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); |
| | | $sql = "SELECT server_id,server_name FROM server WHERE server_id = ".$app->functions->intval($client['default_dnsserver']); |
| | | $client = $app->db->queryOneRecord("SELECT default_dnsserver FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id); |
| | | $sql = "SELECT server_id,server_name FROM server WHERE server_id = ?"; |
| | | } else { |
| | | $sql = "SELECT server_id,server_name FROM server WHERE dns_server = 1 ORDER BY server_name"; |
| | | } |
| | | $records = $app->db->queryAllRecords($sql); |
| | | $records = $app->db->queryAllRecords($sql, $client['default_dnsserver']); |
| | | $records_new = array(); |
| | | if(is_array($records)) { |
| | | foreach($records as $rec) { |
| | |
| | | if($_SESSION["s"]["user"]["typ"] == 'user') { |
| | | // Get the limits of the client |
| | | $client_group_id = $app->functions->intval($_SESSION["s"]["user"]["default_group"]); |
| | | $client = $app->db->queryOneRecord("SELECT default_slave_dnsserver FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); |
| | | $sql = "SELECT server_id,server_name FROM server WHERE server_id = ".$app->functions->intval($client['default_slave_dnsserver']); |
| | | $client = $app->db->queryOneRecord("SELECT default_slave_dnsserver FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id); |
| | | $sql = "SELECT server_id,server_name FROM server WHERE server_id = ?"; |
| | | } else { |
| | | $sql = "SELECT server_id,server_name FROM server WHERE dns_server = 1 ORDER BY server_name"; |
| | | } |
| | | $records = $app->db->queryAllRecords($sql); |
| | | $records = $app->db->queryAllRecords($sql, $client['default_slave_dnsserver']); |
| | | $records_new = array(); |
| | | if(is_array($records)) { |
| | | foreach($records as $rec) { |
| | |
| | | } |
| | | if(count($server_ids) == 0) return array(); |
| | | $server_ids = implode(',', $server_ids); |
| | | $records = $app->db->queryAllRecords("SELECT web_domain.domain_id, CONCAT(web_domain.domain, ' :: ', server.server_name) AS parent_domain FROM web_domain, server WHERE web_domain.type = 'vhost' AND web_domain.server_id IN (".$app->db->quote($server_ids).") AND web_domain.server_id = server.server_id AND ".$app->tform->getAuthSQL('r', 'web_domain')." ORDER BY web_domain.domain"); |
| | | $records = $app->db->queryAllRecords("SELECT web_domain.domain_id, CONCAT(web_domain.domain, ' :: ', server.server_name) AS parent_domain FROM web_domain, server WHERE web_domain.type = 'vhost' AND web_domain.server_id IN ? AND web_domain.server_id = server.server_id AND ".$app->tform->getAuthSQL('r', 'web_domain')." ORDER BY web_domain.domain", $server_ids); |
| | | |
| | | $records_new = array(); |
| | | if(is_array($records)) { |
| | |
| | | if($_SESSION["s"]["user"]["typ"] == 'user') { |
| | | // Get the limits of the client |
| | | $client_group_id = $app->functions->intval($_SESSION["s"]["user"]["default_group"]); |
| | | $sql = "SELECT $server_type as server_id FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"; |
| | | $client = $app->db->queryOneRecord($sql); |
| | | $sql = "SELECT $server_type as server_id FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?"; |
| | | $client = $app->db->queryOneRecord($sql, $client_group_id); |
| | | if($client['server_id'] > 0) { |
| | | //* Select the default server for the client |
| | | $sql = "SELECT server_id,server_name FROM server WHERE server_id = ".$app->functions->intval($client['server_id']); |
| | | $sql = "SELECT server_id,server_name FROM server WHERE server_id = ?"; |
| | | $records = $app->db->queryAllRecords($sql, $client['server_id']); |
| | | } else { |
| | | //* Not able to find the clients defaults, use this as fallback and add a warning message to the log |
| | | $app->log('Unable to find default server for client in custom_datasource.inc.php', 1); |
| | | $sql = "SELECT server_id,server_name FROM server WHERE $field = 1 ORDER BY server_name"; |
| | | $sql = "SELECT server_id,server_name FROM server WHERE ?? = 1 ORDER BY server_name"; |
| | | $records = $app->db->queryAllRecords($sql, $field); |
| | | } |
| | | } else { |
| | | //* The logged in user is admin, so we show him all available servers of a specific type. |
| | | $sql = "SELECT server_id,server_name FROM server WHERE $field = 1 ORDER BY server_name"; |
| | | $sql = "SELECT server_id,server_name FROM server WHERE ?? = 1 ORDER BY server_name"; |
| | | $records = $app->db->queryAllRecords($sql, $field); |
| | | } |
| | | |
| | | $records = $app->db->queryAllRecords($sql); |
| | | |
| | | $records_new = array(); |
| | | if(is_array($records)) { |
| | | foreach($records as $rec) { |
| | |
| | | private $_iConnId; |
| | | |
| | | private $dbHost = ''; // hostname of the MySQL server |
| | | private $dbPort = ''; // port of the MySQL server |
| | | private $dbName = ''; // logical database name on that server |
| | | private $dbUser = ''; // database authorized user |
| | | private $dbPass = ''; // user's password |
| | |
| | | private $autoCommit = 1; // Autocommit Transactions |
| | | private $currentRow; // current row number |
| | | private $errorNumber = 0; // last error number |
| | | */ |
| | | public $errorMessage = ''; // last error message |
| | | /* |
| | | private $errorLocation = '';// last error location |
| | | private $isConnected = false; // needed to know if we have a valid mysqli object from the constructor |
| | | //// |
| | |
| | | global $conf; |
| | | if($prefix != '') $prefix .= '_'; |
| | | $this->dbHost = $conf[$prefix.'db_host']; |
| | | $this->dbPort = $conf[$prefix.'db_port']; |
| | | $this->dbName = $conf[$prefix.'db_database']; |
| | | $this->dbUser = $conf[$prefix.'db_user']; |
| | | $this->dbPass = $conf[$prefix.'db_password']; |
| | |
| | | $this->dbNewLink = $conf[$prefix.'db_new_link']; |
| | | $this->dbClientFlags = $conf[$prefix.'db_client_flags']; |
| | | |
| | | $this->_iConnId = mysqli_connect($this->dbHost, $this->dbUser, $this->dbPass); |
| | | $this->_iConnId = mysqli_connect($this->dbHost, $this->dbUser, $this->dbPass, '', (int)$this->dbPort); |
| | | $try = 0; |
| | | while((!is_object($this->_iConnId) || mysqli_connect_error()) && $try < 5) { |
| | | if($try > 0) sleep(1); |
| | | |
| | | $try++; |
| | | $this->_iConnId = mysqli_connect($this->dbHost, $this->dbUser, $this->dbPass); |
| | | $this->_iConnId = mysqli_connect($this->dbHost, $this->dbUser, $this->dbPass, '', (int)$this->dbPort); |
| | | } |
| | | |
| | | if(!is_object($this->_iConnId) || mysqli_connect_error()) { |
| | |
| | | $sTxt = $this->escape($sValue); |
| | | |
| | | $sTxt = str_replace('`', '', $sTxt); |
| | | if(strpos($sTxt, '.') !== false) $sTxt = preg_replace('/^(.+)\.(.+)$/', '`$1`.`$2`', $sTxt); |
| | | else $sTxt = '`' . $sTxt . '`'; |
| | | if(strpos($sTxt, '.') !== false) { |
| | | $sTxt = preg_replace('/^(.+)\.(.+)$/', '`$1`.`$2`', $sTxt); |
| | | $sTxt = str_replace('.`*`', '.*', $sTxt); |
| | | } else $sTxt = '`' . $sTxt . '`'; |
| | | |
| | | $sQuery = substr_replace($sQuery, $sTxt, $iPos2, 2); |
| | | $iPos2 += strlen($sTxt); |
| | |
| | | } else { |
| | | if(is_int($sValue) || is_float($sValue)) { |
| | | $sTxt = $sValue; |
| | | } elseif(is_string($sValue) && (strcmp($sValue, '#NULL#') == 0)) { |
| | | } elseif(is_null($sValue) || (is_string($sValue) && (strcmp($sValue, '#NULL#') == 0))) { |
| | | $sTxt = 'NULL'; |
| | | } elseif(is_array($sValue)) { |
| | | $sTxt = ''; |
| | | foreach($sValue as $sVal) $sTxt .= ',\'' . $this->escape($sVal) . '\''; |
| | | $sTxt = '(' . substr($sTxt, 1) . ')'; |
| | | if($sTxt == '()') $sTxt = '(0)'; |
| | | if(isset($sValue['SQL'])) { |
| | | $sTxt = $sValue['SQL']; |
| | | } else { |
| | | $sTxt = ''; |
| | | foreach($sValue as $sVal) $sTxt .= ',\'' . $this->escape($sVal) . '\''; |
| | | $sTxt = '(' . substr($sTxt, 1) . ')'; |
| | | if($sTxt == '()') $sTxt = '(0)'; |
| | | } |
| | | } else { |
| | | $sTxt = '\'' . $this->escape($sValue) . '\''; |
| | | } |
| | |
| | | $try++; |
| | | $ok = mysqli_ping($this->_iConnId); |
| | | if(!$ok) { |
| | | if(!mysqli_connect($this->dbHost, $this->dbUser, $this->dbPass, $this->dbName)) { |
| | | if(!mysqli_connect($this->dbHost, $this->dbUser, $this->dbPass, $this->dbName, (int)$this->dbPort)) { |
| | | if($try > 4) { |
| | | $this->_sqlerror('DB::query -> reconnect'); |
| | | return false; |
| | |
| | | |
| | | $this->_iQueryId = @mysqli_query($this->_iConnId, $sQuery); |
| | | if (!$this->_iQueryId) { |
| | | $this->_sqlerror('Falsche Anfrage / Wrong Query', false, 'SQL-Query = ' . $sQuery); |
| | | $this->_sqlerror('Falsche Anfrage / Wrong Query', 'SQL-Query = ' . $sQuery); |
| | | return false; |
| | | } |
| | | |
| | |
| | | $cur_encoding = mb_detect_encoding($sString); |
| | | if($cur_encoding != "UTF-8") { |
| | | if($cur_encoding != 'ASCII') { |
| | | $app->log('String ' . substr($sString, 0, 25) . '... is ' . $cur_encoding . '.', LOGLEVEL_INFO); |
| | | if(is_object($app) && method_exists($app, 'log')) $app->log('String ' . substr($sString, 0, 25) . '... is ' . $cur_encoding . '.', LOGLEVEL_INFO); |
| | | if($cur_encoding) $sString = mb_convert_encoding($sString, 'UTF-8', $cur_encoding); |
| | | else $sString = mb_convert_encoding($sString, 'UTF-8'); |
| | | } |
| | |
| | | |
| | | $mysql_error = (is_object($this->_iConnId) ? mysqli_error($this->_iConnId) : mysqli_connect_error()); |
| | | $mysql_errno = (is_object($this->_iConnId) ? mysqli_errno($this->_iConnId) : mysqli_connect_errno()); |
| | | $this->errorMessage = $mysql_error; |
| | | |
| | | //$sAddMsg .= getDebugBacktrace(); |
| | | |
| | |
| | | } |
| | | return $out; |
| | | } |
| | | |
| | | |
| | | public function insertFromArray($tablename, $data) { |
| | | if(!is_array($data)) return false; |
| | | |
| | | $k_query = ''; |
| | | $v_query = ''; |
| | | |
| | | $params = array($tablename); |
| | | $v_params = array(); |
| | | |
| | | foreach($data as $key => $value) { |
| | | $k_query .= ($k_query != '' ? ', ' : '') . '??'; |
| | | $v_query .= ($v_query != '' ? ', ' : '') . '?'; |
| | | $params[] = $key; |
| | | $v_params[] = $value; |
| | | } |
| | | |
| | | $query = 'INSERT INTO ?? (' . $k_query . ') VALUES (' . $v_query . ')'; |
| | | return $this->query($query, true, $params + $v_params); |
| | | } |
| | | |
| | | public function diffrec($record_old, $record_new) { |
| | | $diffrec_full = array(); |
| | | $diff_num = 0; |
| | |
| | | if(!preg_match('/^[a-zA-Z0-9\-\_\.]{1,64}$/',$db_table)) $app->error('Invalid table name '.$db_table); |
| | | if(!preg_match('/^[a-zA-Z0-9\-\_]{1,64}$/',$primary_field)) $app->error('Invalid primary field '.$primary_field.' in table '.$db_table); |
| | | |
| | | $primary_field = $this->quote($primary_field); |
| | | $primary_id = intval($primary_id); |
| | | |
| | | if($force_update == true) { |
| | |
| | | if(is_array($insert_data)) { |
| | | $key_str = ''; |
| | | $val_str = ''; |
| | | $params = array($tablename); |
| | | $v_params = array(); |
| | | foreach($insert_data as $key => $val) { |
| | | $key_str .= "`".$key ."`,"; |
| | | $val_str .= "'".$this->escape($val)."',"; |
| | | $key_str .= '??,'; |
| | | $params[] = $key; |
| | | |
| | | $val_str .= '?,'; |
| | | $v_params[] = $val; |
| | | } |
| | | $key_str = substr($key_str, 0, -1); |
| | | $val_str = substr($val_str, 0, -1); |
| | | $insert_data_str = '('.$key_str.') VALUES ('.$val_str.')'; |
| | | $this->query("INSERT INTO ?? $insert_data_str", true, array_merge($params, $v_params)); |
| | | } else { |
| | | /* TODO: deprecate this method! */ |
| | | $insert_data_str = $insert_data; |
| | | $this->query("INSERT INTO ?? $insert_data_str", $tablename); |
| | | $app->log("deprecated use of passing values to datalogInsert() - table " . $tablename, 1); |
| | | } |
| | | /* TODO: reduce risk of insert_data_str! */ |
| | | |
| | | |
| | | $old_rec = array(); |
| | | $this->query("INSERT INTO ?? $insert_data_str", $tablename); |
| | | $index_value = $this->insertID(); |
| | | $new_rec = $this->queryOneRecord("SELECT * FROM ?? WHERE ? = ?", $tablename, $index_field, $index_value); |
| | | $this->datalogSave($tablename, 'INSERT', $index_field, $index_value, $old_rec, $new_rec); |
| | |
| | | $old_rec = $this->queryOneRecord("SELECT * FROM ?? WHERE ?? = ?", $tablename, $index_field, $index_value); |
| | | |
| | | if(is_array($update_data)) { |
| | | $params = array($tablename); |
| | | $update_data_str = ''; |
| | | foreach($update_data as $key => $val) { |
| | | $update_data_str .= "`".$key ."` = '".$this->escape($val)."',"; |
| | | $update_data_str .= '?? = ?,'; |
| | | $params[] = $key; |
| | | $params[] = $val; |
| | | } |
| | | $params[] = $index_field; |
| | | $params[] = $index_value; |
| | | $update_data_str = substr($update_data_str, 0, -1); |
| | | $this->query("UPDATE ?? SET $update_data_str WHERE ?? = ?", true, $params); |
| | | } else { |
| | | /* TODO: deprecate this method! */ |
| | | $update_data_str = $update_data; |
| | | $this->query("UPDATE ?? SET $update_data_str WHERE ?? = ?", $tablename, $index_field, $index_value); |
| | | $app->log("deprecated use of passing values to datalogUpdate() - table " . $tablename, 1); |
| | | } |
| | | /* TODO: reduce risk of update_data_str */ |
| | | |
| | | $this->query("UPDATE ?? SET $update_data_str WHERE ?? = ?", $tablename, $index_field, $index_value); |
| | | $new_rec = $this->queryOneRecord("SELECT * FROM ?? WHERE ?? = ?", $tablename, $index_field, $index_value); |
| | | $this->datalogSave($tablename, 'UPDATE', $index_field, $index_value, $old_rec, $new_rec, $force_update); |
| | | |
| | |
| | | } |
| | | |
| | | $ips = array(); |
| | | $results = $app->db->queryAllRecords("SELECT ip_address AS ip, server_id FROM server_ip WHERE ip_type = '".$app->db->quote($type)."'"); |
| | | $results = $app->db->queryAllRecords("SELECT ip_address AS ip, server_id FROM server_ip WHERE ip_type = ?", $type); |
| | | if(!empty($results) && is_array($results)){ |
| | | foreach($results as $result){ |
| | | if(preg_match($regex, $result['ip'])){ |
| | |
| | | if(preg_match($regex, $result['ip'])) $ips[] = $result['ip']; |
| | | } |
| | | } |
| | | |
| | | /* |
| | | $results = $app->db->queryAllRecords("SELECT xfer FROM dns_slave WHERE xfer != ''"); |
| | | if(!empty($results) && is_array($results)){ |
| | | foreach($results as $result){ |
| | | $tmp_ips = explode(',', $result['xfer']); |
| | | foreach($tmp_ips as $tmp_ip){ |
| | | $tmp_ip = trim($tmp_ip); |
| | | if(preg_match($regex, $tmp_ip)) $ips[] = $tmp_ip; |
| | | } |
| | | } |
| | | } |
| | | $results = $app->db->queryAllRecords("SELECT xfer FROM dns_soa WHERE xfer != ''"); |
| | | if(!empty($results) && is_array($results)){ |
| | | foreach($results as $result){ |
| | | $tmp_ips = explode(',', $result['xfer']); |
| | | foreach($tmp_ips as $tmp_ip){ |
| | | $tmp_ip = trim($tmp_ip); |
| | | if(preg_match($regex, $tmp_ip)) $ips[] = $tmp_ip; |
| | | } |
| | | } |
| | | } |
| | | $results = $app->db->queryAllRecords("SELECT also_notify FROM dns_soa WHERE also_notify != ''"); |
| | | if(!empty($results) && is_array($results)){ |
| | | foreach($results as $result){ |
| | | $tmp_ips = explode(',', $result['also_notify']); |
| | | foreach($tmp_ips as $tmp_ip){ |
| | | $tmp_ip = trim($tmp_ip); |
| | | if(preg_match($regex, $tmp_ip)) $ips[] = $tmp_ip; |
| | | } |
| | | } |
| | | } |
| | | */ |
| | | |
| | | $results = $app->db->queryAllRecords("SELECT remote_ips FROM web_database WHERE remote_ips != ''"); |
| | | if(!empty($results) && is_array($results)){ |
| | |
| | | |
| | | if($encode == true) { |
| | | if(function_exists('idn_to_ascii')) { |
| | | $domain = idn_to_ascii($domain); |
| | | $domain = idn_to_ascii($domain, IDNA_NONTRANSITIONAL_TO_ASCII, INTL_IDNA_VARIANT_UTS46); |
| | | } elseif(file_exists(ISPC_CLASS_PATH.'/idn/idna_convert.class.php')) { |
| | | /* use idna class: |
| | | * @author Matthias Sommerfeld <mso@phlylabs.de> |
| | |
| | | } |
| | | } else { |
| | | if(function_exists('idn_to_utf8')) { |
| | | $domain = idn_to_utf8($domain); |
| | | $domain = idn_to_utf8($domain, IDNA_NONTRANSITIONAL_TO_ASCII, INTL_IDNA_VARIANT_UTS46); |
| | | } elseif(file_exists(ISPC_CLASS_PATH.'/idn/idna_convert.class.php')) { |
| | | /* use idna class: |
| | | * @author Matthias Sommerfeld <mso@phlylabs.de> |
| | |
| | | |
| | | return true; |
| | | } |
| | | |
| | | public function getimagesizefromstring($string){ |
| | | if (!function_exists('getimagesizefromstring')) { |
| | | $uri = 'data://application/octet-stream;base64,' . base64_encode($string); |
| | | return getimagesize($uri); |
| | | } else { |
| | | return getimagesizefromstring($string); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | if(!isset($this->config[$server_id])) { |
| | | $app->uses('ini_parser'); |
| | | $server_id = $app->functions->intval($server_id); |
| | | $server = $app->db->queryOneRecord('SELECT config FROM server WHERE server_id = '.$server_id); |
| | | $server = $app->db->queryOneRecord('SELECT config FROM server WHERE server_id = ?', $server_id); |
| | | $this->config[$server_id] = $app->ini_parser->parse_ini_string(stripslashes($server['config'])); |
| | | } |
| | | return ($section == '') ? $this->config[$server_id] : $this->config[$server_id][$section]; |
| | |
| | | $this->errorMessage .= "Custom datasource class or function is empty<br />\r\n"; |
| | | } |
| | | } |
| | | |
| | | if($api == false && isset($field['filters']) && is_array($field['filters'])) { |
| | | $new_values = array(); |
| | | foreach($values as $index => $value) { |
| | | $new_index = $app->tform->filterField($index, $index, $field['filters'], 'SHOW'); |
| | | $new_values[$new_index] = $app->tform->filterField($index, (isset($values[$index]))?$values[$index]:'', $field['filters'], 'SHOW'); |
| | | } |
| | | $values = $new_values; |
| | | unset($new_values); |
| | | unset($new_index); |
| | | } |
| | | return $values; |
| | | } |
| | | |
| | |
| | | $table = $i['table']; |
| | | |
| | | $searchval = $_SESSION['search'][$list_name][$search_prefix.$field]; |
| | | // IDN |
| | | if($searchval != ''){ |
| | | foreach($i['filters'] as $searchval_filter) { |
| | | if($searchval_filter['event'] == 'SHOW') { |
| | | switch ($searchval_filter['type']) { |
| | | case 'IDNTOUTF8': |
| | | $searchval = $app->functions->idn_encode($searchval); |
| | | //echo $searchval; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | // format user date format to MySQL date format 0000-00-00 |
| | | if($i['datatype'] == 'DATE' && $this->lng('conf_format_dateshort') != 'Y-m-d'){ |
| | | $dateformat = preg_replace("@[^Ymd]@", "", $this->lng('conf_format_dateshort')); |
| | |
| | | return $this->pagingValues[$key]; |
| | | } |
| | | |
| | | /* TODO: maybe rewrite sql */ |
| | | public function getPagingSQL($sql_where = '1') |
| | | { |
| | | global $app, $conf; |
| | |
| | | if($this->searchChanged == 1) $_SESSION['search'][$list_name]['page'] = 0; |
| | | |
| | | $sql_von = $app->functions->intval($_SESSION['search'][$list_name]['page'] * $records_per_page); |
| | | $record_count = $app->db->queryOneRecord("SELECT count(*) AS anzahl FROM $table".($app->listform->listDef['additional_tables'] != ''? ','.$app->listform->listDef['additional_tables'] : '')." WHERE $sql_where"); |
| | | $record_count = $app->db->queryOneRecord("SELECT count(*) AS anzahl FROM ??".($app->listform->listDef['additional_tables'] != ''? ','.$app->listform->listDef['additional_tables'] : '')." WHERE $sql_where", $table); |
| | | $pages = $app->functions->intval(($record_count['anzahl'] - 1) / $records_per_page); |
| | | |
| | | |
| | |
| | | } |
| | | return $record; |
| | | } |
| | | |
| | | |
| | | /* TODO: check double quoting of SQL */ |
| | | public function encode($record) |
| | | { |
| | | global $app; |
| | |
| | | return $rec; |
| | | } |
| | | |
| | | /* TODO: maybe rewrite SQL */ |
| | | public function getQueryString($no_limit = false) { |
| | | global $app; |
| | | $sql_where = ''; |
| | |
| | | $backup_id = $app->functions->intval($_GET['backup_id']); |
| | | |
| | | //* check if the user is owner of the parent domain |
| | | $domain_backup = $app->db->queryOneRecord("SELECT parent_domain_id FROM web_backup WHERE backup_id = ".$backup_id); |
| | | $domain_backup = $app->db->queryOneRecord("SELECT parent_domain_id FROM web_backup WHERE backup_id = ?", $backup_id); |
| | | |
| | | $check_perm = 'u'; |
| | | if($_GET['backup_action'] == 'download') $check_perm = 'r'; // only check read permissions on download, not update permissions |
| | | |
| | | $get_domain = $app->db->queryOneRecord("SELECT domain_id FROM web_domain WHERE domain_id = ".$app->functions->intval($domain_backup["parent_domain_id"])." AND ".$app->tform->getAuthSQL($check_perm)); |
| | | $get_domain = $app->db->queryOneRecord("SELECT domain_id FROM web_domain WHERE domain_id = ? AND ".$app->tform->getAuthSQL($check_perm), $domain_backup["parent_domain_id"]); |
| | | if(empty($get_domain) || !$get_domain) { |
| | | $app->error($app->tform->lng('no_domain_perm')); |
| | | } |
| | | |
| | | if($_GET['backup_action'] == 'download' && $backup_id > 0) { |
| | | $server_id = $this->form->dataRecord['server_id']; |
| | | $backup = $app->db->queryOneRecord("SELECT * FROM web_backup WHERE backup_id = ".$backup_id); |
| | | $backup = $app->db->queryOneRecord("SELECT * FROM web_backup WHERE backup_id = ?", $backup_id); |
| | | if($backup['server_id'] > 0) $server_id = $backup['server_id']; |
| | | $sql = "SELECT count(action_id) as number FROM sys_remoteaction WHERE action_state = 'pending' AND action_type = 'backup_download' AND action_param = '$backup_id'"; |
| | | $tmp = $app->db->queryOneRecord($sql); |
| | | $sql = "SELECT count(action_id) as number FROM sys_remoteaction WHERE action_state = 'pending' AND action_type = 'backup_download' AND action_param = ?"; |
| | | $tmp = $app->db->queryOneRecord($sql, $backup_id); |
| | | if($tmp['number'] == 0) { |
| | | $message .= $wb['download_info_txt']; |
| | | $sql = "INSERT INTO sys_remoteaction (server_id, tstamp, action_type, action_param, action_state, response) " . |
| | | "VALUES (". |
| | | (int)$server_id . ", " . |
| | | time() . ", " . |
| | | "'backup_download', " . |
| | | "'".$backup_id."', " . |
| | | "'pending', " . |
| | | "''" . |
| | | ")"; |
| | | $app->db->query($sql); |
| | | "VALUES (?, UNIX_TIMESTAMP(), 'backup_download', ?, 'pending', '')"; |
| | | $app->db->query($sql, $server_id, $backup_id); |
| | | } else { |
| | | $error .= $wb['download_pending_txt']; |
| | | } |
| | | } |
| | | if($_GET['backup_action'] == 'restore' && $backup_id > 0) { |
| | | $server_id = $this->form->dataRecord['server_id']; |
| | | $backup = $app->db->queryOneRecord("SELECT * FROM web_backup WHERE backup_id = ".$backup_id); |
| | | $backup = $app->db->queryOneRecord("SELECT * FROM web_backup WHERE backup_id = ?", $backup_id); |
| | | if($backup['server_id'] > 0) $server_id = $backup['server_id']; |
| | | $sql = "SELECT count(action_id) as number FROM sys_remoteaction WHERE action_state = 'pending' AND action_type = 'backup_restore' AND action_param = '$backup_id'"; |
| | | $tmp = $app->db->queryOneRecord($sql); |
| | | if($tmp['number'] == 0) { |
| | | $message .= $wb['restore_info_txt']; |
| | | $sql = "INSERT INTO sys_remoteaction (server_id, tstamp, action_type, action_param, action_state, response) " . |
| | | "VALUES (". |
| | | (int)$server_id . ", " . |
| | | time() . ", " . |
| | | "'backup_restore', " . |
| | | "'".$backup_id."', " . |
| | | "'pending', " . |
| | | "''" . |
| | | ")"; |
| | | $app->db->query($sql); |
| | | "VALUES (?, UNIX_TIMESTAMP(), 'backup_restore', ?, 'pending', '')"; |
| | | $app->db->query($sql, $server_id, $backup_id); |
| | | } else { |
| | | $error .= $wb['restore_pending_txt']; |
| | | } |
| | |
| | | } |
| | | |
| | | //* Get the data |
| | | $server_ids = array_unique($server_ids); |
| | | $web = $app->db->queryOneRecord("SELECT server_id FROM web_domain WHERE domain_id = ".$app->functions->intval($this->form->id)); |
| | | $databases = $app->db->queryAllRecords("SELECT server_id FROM web_database WHERE parent_domain_id = ".$app->functions->intval($this->form->id)); |
| | | $server_ids = array(); |
| | | $web = $app->db->queryOneRecord("SELECT server_id FROM web_domain WHERE domain_id = ?", $this->form->id); |
| | | $databases = $app->db->queryAllRecords("SELECT server_id FROM web_database WHERE parent_domain_id = ?", $this->form->id); |
| | | if($app->functions->intval($web['server_id']) > 0) $server_ids[] = $app->functions->intval($web['server_id']); |
| | | if(is_array($databases) && !empty($databases)){ |
| | | foreach($databases as $database){ |
| | |
| | | } |
| | | } |
| | | $server_ids = array_unique($server_ids); |
| | | $sql = "SELECT * FROM web_backup WHERE parent_domain_id = ".$app->functions->intval($this->form->id)." AND server_id IN (".implode(',', $server_ids).") ORDER BY tstamp DESC, backup_type ASC"; |
| | | $records = $app->db->queryAllRecords($sql); |
| | | $sql = "SELECT * FROM web_backup WHERE parent_domain_id = ? AND server_id IN ? ORDER BY tstamp DESC, backup_type ASC"; |
| | | $records = $app->db->queryAllRecords($sql, $this->form->id, $server_ids); |
| | | |
| | | $bgcolor = "#FFFFFF"; |
| | | if(is_array($records)) { |
| | |
| | | |
| | | $rec['download_available'] = true; |
| | | if($rec['server_id'] != $web['server_id']) $rec['download_available'] = false; |
| | | |
| | | if($rec['filesize'] > 0){ |
| | | $rec['filesize'] = $app->functions->currency_format($rec['filesize']/(1024*1024), 'client').' MB'; |
| | | } |
| | | |
| | | $records_new[] = $rec; |
| | | } |
| | |
| | | |
| | | if(isset($_GET['backup_action'])) { |
| | | $backup_id = $app->functions->intval($_GET['backup_id']); |
| | | /* |
| | | if($_GET['backup_action'] == 'download_mail' && $backup_id > 0) { |
| | | $sql = "SELECT count(action_id) as number FROM sys_remoteaction WHERE action_state = 'pending' AND action_type = 'backup_download' AND action_param = '$backup_id'"; |
| | | $tmp = $app->db->queryOneRecord($sql); |
| | | if($tmp['number'] == 0) { |
| | | $message .= $wb['download_info_txt']; |
| | | $sql = "INSERT INTO sys_remoteaction (server_id, tstamp, action_type, action_param, action_state, response) " . |
| | | "VALUES (". |
| | | (int)$this->form->dataRecord['server_id'] . ", " . |
| | | time() . ", " . |
| | | "'backup_download', " . |
| | | "'".$backup_id."', " . |
| | | "'pending', " . |
| | | "''" . |
| | | ")"; |
| | | $app->db->query($sql); |
| | | } else { |
| | | $error .= $wb['download_pending_txt']; |
| | | } |
| | | } |
| | | */ |
| | | |
| | | if($_GET['backup_action'] == 'restore_mail' && $backup_id > 0) { |
| | | $sql = "SELECT count(action_id) as number FROM sys_remoteaction WHERE action_state = 'pending' AND action_type = 'backup_restore_mail' AND action_param = '$backup_id'"; |
| | | $tmp = $app->db->queryOneRecord($sql); |
| | | $sql = "SELECT count(action_id) as number FROM sys_remoteaction WHERE action_state = 'pending' AND action_type = 'backup_restore_mail' AND action_param = ?"; |
| | | $tmp = $app->db->queryOneRecord($sql, $backup_id); |
| | | if($tmp['number'] == 0) { |
| | | $message .= $wb['restore_info_txt']; |
| | | $sql = "INSERT INTO sys_remoteaction (server_id, tstamp, action_type, action_param, action_state, response) " . |
| | | "VALUES (". |
| | | (int)$this->form->dataRecord['server_id'] . ", " . |
| | | time() . ", " . |
| | | "'backup_restore_mail', " . |
| | | "'".$backup_id."', " . |
| | | "'pending', " . |
| | | "''" . |
| | | ")"; |
| | | $app->db->query($sql); |
| | | "VALUES (?, ? 'backup_restore_mail', ?, 'pending','')"; |
| | | $app->db->query($sql, $this->form->dataRecord['server_id'], time(), $backup_id); |
| | | } else { |
| | | $error .= $wb['restore_pending_txt']; |
| | | } |
| | |
| | | } |
| | | |
| | | //* Get the data |
| | | $sql = "SELECT * FROM mail_backup WHERE mailuser_id = ".$this->form->id." ORDER BY tstamp DESC"; |
| | | $records = $app->db->queryAllRecords($sql); |
| | | $sql = "SELECT * FROM mail_backup WHERE mailuser_id = ? ORDER BY tstamp DESC"; |
| | | $records = $app->db->queryAllRecords($sql, $this->form->id); |
| | | $bgcolor = "#FFFFFF"; |
| | | if(is_array($records)) { |
| | | foreach($records as $rec) { |
| | |
| | | $db_table_idx = $app->tform->formDef["db_table_idx"]; |
| | | $primary_id = $this->form->id; |
| | | if($_SESSION["s"]["user"]["typ"] == 'admin') { |
| | | $sql = "SELECT action, tstamp, user, data FROM sys_datalog WHERE dbtable = '".$db_table."' AND dbidx = '".$db_table_idx.":".$primary_id."'"; |
| | | $sql = "SELECT action, tstamp, user, data FROM sys_datalog WHERE dbtable = ? AND dbidx = ?"; |
| | | $records = $app->db->queryAllRecords($sql, $db_table, $db_table_idx.":".$primary_id); |
| | | } else { |
| | | $sql = "SELECT action, tstamp, user, data FROM sys_datalog WHERE user = '".$_SESSION["s"]["user"]["username"]."' dbtable = '".$db_table."' AND dbidx = '".$db_table_idx.":".$primary_id."'"; |
| | | $sql = "SELECT action, tstamp, user, data FROM sys_datalog WHERE user = ? AND dbtable = ? AND dbidx = ?"; |
| | | $records = $app->db->queryAllRecords($sql, $_SESSION["s"]["user"]["username"], $db_table, $db_table_idx.":".$primary_id); |
| | | } |
| | | |
| | | $records = $app->db->queryAllRecords($sql); |
| | | if(is_array($records)) { |
| | | $content .= '<table>'; |
| | | foreach($records as $rec) { |
| | |
| | | |
| | | |
| | | // Get the data |
| | | $records = $app->db->queryAllRecords("SELECT * FROM ".$app->listform->listDef["table"]." WHERE $sql_where $sql_order_by $limit_sql"); |
| | | $records = $app->db->queryAllRecords("SELECT * FROM ?? WHERE $sql_where $sql_order_by $limit_sql", $app->listform->listDef["table"]); |
| | | |
| | | $bgcolor = "#FFFFFF"; |
| | | if(is_array($records)) { |
| | |
| | | $_SESSION["s"]["form"]["return_to"] = $list_name; |
| | | //die(print_r($_SESSION["s"]["list"][$list_name])); |
| | | |
| | | // defaults |
| | | $listTpl->setVar('app_title', $app->_conf['app_title']); |
| | | if(isset($_SESSION['s']['user'])) { |
| | | $listTpl->setVar('app_version', $app->_conf['app_version']); |
| | | // get pending datalog changes |
| | | $datalog = $app->db->datalogStatus(); |
| | | $listTpl->setVar('datalog_changes_txt', $app->lng('datalog_changes_txt')); |
| | | $listTpl->setVar('datalog_changes_end_txt', $app->lng('datalog_changes_end_txt')); |
| | | $listTpl->setVar('datalog_changes_count', $datalog['count']); |
| | | $listTpl->setLoop('datalog_changes', $datalog['entries']); |
| | | } else { |
| | | $listTpl->setVar('app_version', ''); |
| | | } |
| | | $listTpl->setVar('app_link', $app->_conf['app_link']); |
| | | |
| | | $listTpl->setVar('app_logo', $app->_conf['logo']); |
| | | |
| | | $listTpl->setVar('phpsessid', session_id()); |
| | | |
| | | $listTpl->setVar('theme', $_SESSION['s']['theme']); |
| | | $listTpl->setVar('html_content_encoding', $app->_conf['html_content_encoding']); |
| | | |
| | | $listTpl->setVar('delete_confirmation', $app->lng('delete_confirmation')); |
| | | //print_r($_SESSION); |
| | | if(isset($_SESSION['s']['module']['name'])) { |
| | | $listTpl->setVar('app_module', $_SESSION['s']['module']['name']); |
| | | } |
| | | if(isset($_SESSION['s']['user']) && $_SESSION['s']['user']['typ'] == 'admin') { |
| | | $listTpl->setVar('is_admin', 1); |
| | | } |
| | | if(isset($_SESSION['s']['user']) && $app->auth->has_clients($_SESSION['s']['user']['userid'])) { |
| | | $listTpl->setVar('is_reseller', 1); |
| | | } |
| | | /* Show username */ |
| | | if(isset($_SESSION['s']['user'])) { |
| | | $listTpl->setVar('cpuser', $_SESSION['s']['user']['username']); |
| | | $listTpl->setVar('logout_txt', $app->lng('logout_txt')); |
| | | /* Show search field only for normal users, not mail users */ |
| | | if(stristr($_SESSION['s']['user']['username'], '@')){ |
| | | $listTpl->setVar('usertype', 'mailuser'); |
| | | } else { |
| | | $listTpl->setVar('usertype', 'normaluser'); |
| | | } |
| | | } |
| | | |
| | | /* Global Search */ |
| | | $listTpl->setVar('globalsearch_resultslimit_of_txt', $app->lng('globalsearch_resultslimit_of_txt')); |
| | | $listTpl->setVar('globalsearch_resultslimit_results_txt', $app->lng('globalsearch_resultslimit_results_txt')); |
| | | $listTpl->setVar('globalsearch_noresults_text_txt', $app->lng('globalsearch_noresults_text_txt')); |
| | | $listTpl->setVar('globalsearch_noresults_limit_txt', $app->lng('globalsearch_noresults_limit_txt')); |
| | | $listTpl->setVar('globalsearch_searchfield_watermark_txt', $app->lng('globalsearch_searchfield_watermark_txt')); |
| | | |
| | | return $listTpl->grab(); |
| | | |
| | | } |
| | |
| | | |
| | | // select vhosts (belonging to client) |
| | | if($clientid != null){ |
| | | $sql_where = " AND sys_groupid = (SELECT default_group FROM sys_user WHERE client_id=".$clientid.")"; |
| | | $sql_where = " AND sys_groupid = (SELECT default_group FROM sys_user WHERE client_id=?)"; |
| | | } |
| | | $sites = $app->db->queryAllRecords("SELECT * FROM web_domain WHERE active = 'y' AND (type = 'vhost' OR type = 'vhostsubdomain' OR type = 'vhostalias')".$sql_where); |
| | | $sites = $app->db->queryAllRecords("SELECT * FROM web_domain WHERE active = 'y' AND (type = 'vhost' OR type = 'vhostsubdomain' OR type = 'vhostalias')".$sql_where, $clientid); |
| | | |
| | | $hostnames = array(); |
| | | $traffic_data = array(); |
| | |
| | | $tmp_year = date('Y'); |
| | | $tmp_month = date('m'); |
| | | // This Month |
| | | $tmp_recs = $app->db->queryAllRecords("SELECT hostname, SUM(traffic_bytes) as t FROM web_traffic WHERE YEAR(traffic_date) = ? AND MONTH(traffic_date) = ? AND hostname IN ('".join("','",$hostnames)."') GROUP BY hostname", $tmp_year, $tmp_month); |
| | | $tmp_recs = $app->db->queryAllRecords("SELECT hostname, SUM(traffic_bytes) as t FROM web_traffic WHERE YEAR(traffic_date) = ? AND MONTH(traffic_date) = ? AND hostname IN ? GROUP BY hostname", $tmp_year, $tmp_month, $hostnames); |
| | | foreach ($tmp_recs as $tmp_rec) { |
| | | $traffic_data[$tmp_rec['hostname']]['this_month'] = $tmp_rec['t']; |
| | | } |
| | | // This Year |
| | | $tmp_recs = $app->db->queryAllRecords("SELECT hostname, SUM(traffic_bytes) as t FROM web_traffic WHERE YEAR(traffic_date) = ? AND hostname IN ('".join("','",$hostnames)."') GROUP BY hostname", $tmp_year); |
| | | $tmp_recs = $app->db->queryAllRecords("SELECT hostname, SUM(traffic_bytes) as t FROM web_traffic WHERE YEAR(traffic_date) = ? AND hostname IN ? GROUP BY hostname", $tmp_year, $hostnames); |
| | | foreach ($tmp_recs as $tmp_rec) { |
| | | $traffic_data[$tmp_rec['hostname']]['this_year'] = $tmp_rec['t']; |
| | | } |
| | |
| | | $tmp_year = date('Y', mktime(0, 0, 0, date("m")-1, date("d"), date("Y"))); |
| | | $tmp_month = date('m', mktime(0, 0, 0, date("m")-1, date("d"), date("Y"))); |
| | | // Last Month |
| | | $tmp_recs = $app->db->queryAllRecords("SELECT hostname, SUM(traffic_bytes) as t FROM web_traffic WHERE YEAR(traffic_date) = ? AND MONTH(traffic_date) = ? AND hostname IN ('".join("','",$hostnames)."') GROUP BY hostname", $tmp_year, $tmp_month); |
| | | $tmp_recs = $app->db->queryAllRecords("SELECT hostname, SUM(traffic_bytes) as t FROM web_traffic WHERE YEAR(traffic_date) = ? AND MONTH(traffic_date) = ? AND hostname IN ? GROUP BY hostname", $tmp_year, $tmp_month, $hostnames); |
| | | foreach ($tmp_recs as $tmp_rec) { |
| | | $traffic_data[$tmp_rec['hostname']]['last_month'] = $tmp_rec['t']; |
| | | } |
| | | |
| | | $tmp_year = date('Y', mktime(0, 0, 0, date("m"), date("d"), date("Y")-1)); |
| | | // Last Year |
| | | $tmp_recs = $app->db->queryAllRecords("SELECT hostname, SUM(traffic_bytes) as t FROM web_traffic WHERE YEAR(traffic_date) = ? AND hostname IN ('".join("','",$hostnames)."') GROUP BY hostname", $tmp_year); |
| | | $tmp_recs = $app->db->queryAllRecords("SELECT hostname, SUM(traffic_bytes) as t FROM web_traffic WHERE YEAR(traffic_date) = ? AND hostname IN ? GROUP BY hostname", $tmp_year, $hostnames); |
| | | foreach ($tmp_recs as $tmp_rec) { |
| | | $traffic_data[$tmp_rec['hostname']]['last_year'] = $tmp_rec['t']; |
| | | } |
| | | |
| | | if (is_int($lastdays) && ($lastdays > 0)) { |
| | | // Last xx Days |
| | | $tmp_recs = $app->db->queryAllRecords("SELECT hostname, SUM(traffic_bytes) as t FROM web_traffic WHERE (traffic_date >= DATE_SUB(NOW(), INTERVAL ".$app->db->quote($lastdays)." DAY)) AND hostname IN ('".join("','",$hostnames)."') GROUP BY hostname"); |
| | | $tmp_recs = $app->db->queryAllRecords("SELECT hostname, SUM(traffic_bytes) as t FROM web_traffic WHERE (traffic_date >= DATE_SUB(NOW(), INTERVAL ? DAY)) AND hostname IN ? GROUP BY hostname", $lastdays, $hostnames); |
| | | foreach ($tmp_recs as $tmp_rec) { |
| | | $traffic_data[$tmp_rec['hostname']]['lastdays'] = $tmp_rec['t']; |
| | | } |
| | |
| | | switch($key) { |
| | | case 'sys_userid': |
| | | // check if userid is valid |
| | | $check = $app->db->queryOneRecord('SELECT userid FROM sys_user WHERE userid = ' . $app->functions->intval($value)); |
| | | $check = $app->db->queryOneRecord('SELECT userid FROM sys_user WHERE userid = ?', $app->functions->intval($value)); |
| | | if(!$check || !$check['userid']) { |
| | | $this->server->fault('invalid parameters', $value . ' is no valid sys_userid.'); |
| | | return false; |
| | |
| | | break; |
| | | case 'sys_groupid': |
| | | // check if groupid is valid |
| | | $check = $app->db->queryOneRecord('SELECT groupid FROM sys_group WHERE groupid = ' . $app->functions->intval($value)); |
| | | $check = $app->db->queryOneRecord('SELECT groupid FROM sys_group WHERE groupid = ?', $app->functions->intval($value)); |
| | | if(!$check || !$check['groupid']) { |
| | | $this->server->fault('invalid parameters', $value . ' is no valid sys_groupid.'); |
| | | return false; |
| | |
| | | return false; |
| | | } |
| | | |
| | | $sql = "SELECT * FROM web_domain WHERE domain = '".$app->db->quote($params['main_domain'])."'"; |
| | | $domain = $app->db->queryOneRecord($sql); |
| | | $sql = "SELECT * FROM web_domain WHERE domain = ?"; |
| | | $domain = $app->db->queryOneRecord($sql, $params['main_domain']); |
| | | |
| | | if (!$domain) { |
| | | $this->server->fault('invalid parameters', 'No valid domain given.'); |
| | |
| | | return false; |
| | | } |
| | | |
| | | $sql = "SELECT * FROM aps_instances WHERE id = ".$app->functions->intval($primary_id); |
| | | $result = $app->db->queryOneRecord($sql); |
| | | $sql = "SELECT * FROM aps_instances WHERE id = ?"; |
| | | $result = $app->db->queryOneRecord($sql, $app->functions->intval($primary_id)); |
| | | return $result; |
| | | } |
| | | |
| | |
| | | return false; |
| | | } |
| | | |
| | | $sql = "SELECT * FROM aps_instances_settings WHERE instance_id = ".$app->functions->intval($primary_id); |
| | | $result = $app->db->queryAllRecords($sql); |
| | | $sql = "SELECT * FROM aps_instances_settings WHERE instance_id = ?"; |
| | | $result = $app->db->queryAllRecords($sql, $app->functions->intval($primary_id)); |
| | | return $result; |
| | | } |
| | | |
| | |
| | | $gui = new ApsGUIController($app); |
| | | |
| | | // Check if Instance exists |
| | | $sql = "SELECT * FROM aps_instances WHERE id = ".$app->functions->intval($primary_id); |
| | | $result = $app->db->queryOneRecord($sql); |
| | | $sql = "SELECT * FROM aps_instances WHERE id = ?"; |
| | | $result = $app->db->queryOneRecord($sql, $primary_id); |
| | | |
| | | if (!$result) { |
| | | $this->server->fault('instance_error', 'No valid instance id given.'); |
| | |
| | | if(isset($data['client_id'])) { |
| | | // this is a single record |
| | | if($data['template_additional'] == '') { |
| | | $tpls = $app->db->queryAllRecords('SELECT CONCAT(`assigned_template_id`, \':\', `client_template_id`) as `item` FROM `client_template_assigned` WHERE `client_id` = ' . $data['client_id']); |
| | | $tpls = $app->db->queryAllRecords('SELECT CONCAT(`assigned_template_id`, \':\', `client_template_id`) as `item` FROM `client_template_assigned` WHERE `client_id` = ?', $data['client_id']); |
| | | $tpl_arr = array(); |
| | | if($tpls) { |
| | | foreach($tpls as $tpl) $tpl_arr[] = $tpl['item']; |
| | |
| | | // multiple client records |
| | | foreach($data as $index => $client) { |
| | | if($client['template_additional'] == '') { |
| | | $tpls = $app->db->queryAllRecords('SELECT CONCAT(`assigned_template_id`, \':\', `client_template_id`) as `item` FROM `client_template_assigned` WHERE `client_id` = ' . $client['client_id']); |
| | | $tpls = $app->db->queryAllRecords('SELECT CONCAT(`assigned_template_id`, \':\', `client_template_id`) as `item` FROM `client_template_assigned` WHERE `client_id` = ?', $client['client_id']); |
| | | $tpl_arr = array(); |
| | | if($tpls) { |
| | | foreach($tpls as $tpl) $tpl_arr[] = $tpl['item']; |
| | |
| | | |
| | | $sys_userid = $app->functions->intval($sys_userid); |
| | | |
| | | $rec = $app->db->queryOneRecord("SELECT client_id FROM sys_user WHERE userid = ".$sys_userid); |
| | | $rec = $app->db->queryOneRecord("SELECT client_id FROM sys_user WHERE userid = ?", $sys_userid); |
| | | if(isset($rec['client_id'])) { |
| | | return $app->functions->intval($rec['client_id']); |
| | | } else { |
| | |
| | | |
| | | $client_id = $app->functions->intval($client_id); |
| | | |
| | | $rec = $app->db->queryOneRecord("SELECT company_name,contact_name,gender,email,language FROM client WHERE client_id = ".$client_id); |
| | | $rec = $app->db->queryOneRecord("SELECT company_name,contact_name,gender,email,language FROM client WHERE client_id = ?", $client_id); |
| | | |
| | | if(is_array($rec)) { |
| | | return $rec; |
| | |
| | | |
| | | $client_id = $app->functions->intval($client_id); |
| | | |
| | | $rec = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ".$client_id); |
| | | $rec = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ?", $client_id); |
| | | if(isset($rec['groupid'])) { |
| | | return $app->functions->intval($rec['groupid']); |
| | | } else { |
| | |
| | | |
| | | if($params['parent_client_id']) { |
| | | // check if this one is reseller |
| | | $check = $app->db->queryOneRecord('SELECT `limit_client` FROM `client` WHERE `client_id` = ' . intval($params['parent_client_id'])); |
| | | $check = $app->db->queryOneRecord('SELECT `limit_client` FROM `client` WHERE `client_id` = ?', intval($params['parent_client_id'])); |
| | | if($check['limit_client'] == 0) { |
| | | $this->server->fault('Invalid reseller', 'Selected client is not a reseller.'); |
| | | return false; |
| | |
| | | |
| | | if($params['parent_client_id']) { |
| | | // check if this one is reseller |
| | | $check = $app->db->queryOneRecord('SELECT `limit_client` FROM `client` WHERE `client_id` = ' . intval($params['parent_client_id'])); |
| | | $check = $app->db->queryOneRecord('SELECT `limit_client` FROM `client` WHERE `client_id` = ?', intval($params['parent_client_id'])); |
| | | if($check['limit_client'] == 0) { |
| | | $this->server->fault('Invalid reseller', 'Selected client is not a reseller.'); |
| | | return false; |
| | |
| | | } |
| | | |
| | | // we need the previuos templates assigned here |
| | | $this->oldTemplatesAssigned = $app->db->queryAllRecords('SELECT * FROM `client_template_assigned` WHERE `client_id` = ' . $client_id); |
| | | $this->oldTemplatesAssigned = $app->db->queryAllRecords('SELECT * FROM `client_template_assigned` WHERE `client_id` = ?', $client_id); |
| | | if(!is_array($this->oldTemplatesAssigned) || count($this->oldTemplatesAssigned) < 1) { |
| | | // check previous type of storing templates |
| | | $tpls = explode('/', $old_rec['template_additional']); |
| | |
| | | } |
| | | |
| | | if(@is_numeric($client_id)) { |
| | | $sql = "SELECT * FROM `client_template_assigned` WHERE `client_id` = ".$client_id; |
| | | return $app->db->queryOneRecord($sql); |
| | | $sql = "SELECT * FROM `client_template_assigned` WHERE `client_id` = ?"; |
| | | return $app->db->queryOneRecord($sql, $client_id); |
| | | } else { |
| | | $this->server->fault('The ID must be an integer.'); |
| | | return array(); |
| | |
| | | global $app; |
| | | |
| | | $this->id = $client_id; |
| | | $this->dataRecord = $app->db->queryOneRecord('SELECT * FROM `client` WHERE `client_id` = ' . $client_id); |
| | | $this->dataRecord = $app->db->queryOneRecord('SELECT * FROM `client` WHERE `client_id` = ?', $client_id); |
| | | $this->oldDataRecord = $this->dataRecord; |
| | | |
| | | $this->oldTemplatesAssigned = $app->db->queryAllRecords('SELECT * FROM `client_template_assigned` WHERE `client_id` = ' . $client_id); |
| | | $this->oldTemplatesAssigned = $app->db->queryAllRecords('SELECT * FROM `client_template_assigned` WHERE `client_id` = ?', $client_id); |
| | | if(!is_array($this->oldTemplatesAssigned) || count($this->oldTemplatesAssigned) < 1) { |
| | | // check previous type of storing templates |
| | | $tpls = explode('/', $this->oldDataRecord['template_additional']); |
| | |
| | | |
| | | if(@is_numeric($client_id) && @is_numeric($template_id)) { |
| | | // check if client exists |
| | | $check = $app->db->queryOneRecord('SELECT `client_id` FROM `client` WHERE `client_id` = ' . $client_id); |
| | | $check = $app->db->queryOneRecord('SELECT `client_id` FROM `client` WHERE `client_id` = ?', $client_id); |
| | | if(!$check) { |
| | | $this->server->fault('Invalid client'); |
| | | return false; |
| | | } |
| | | // check if template exists |
| | | $check = $app->db->queryOneRecord('SELECT `template_id` FROM `client_template` WHERE `template_id` = ' . $template_id); |
| | | $check = $app->db->queryOneRecord('SELECT `template_id` FROM `client_template` WHERE `template_id` = ?', $template_id); |
| | | if(!$check) { |
| | | $this->server->fault('Invalid template'); |
| | | return false; |
| | |
| | | // for the update event we have to cheat a bit |
| | | $this->_set_client_formdata($client_id); |
| | | |
| | | $sql = "INSERT INTO `client_template_assigned` (`client_id`, `client_template_id`) VALUES (" . $client_id . ", " . $template_id . ")"; |
| | | $app->db->query($sql); |
| | | $sql = "INSERT INTO `client_template_assigned` (`client_id`, `client_template_id`) VALUES (?, ?)"; |
| | | $app->db->query($sql, $client_id, $template_id); |
| | | $insert_id = $app->db->insertID(); |
| | | |
| | | $app->plugin->raiseEvent('client:client:on_after_update', $this); |
| | |
| | | |
| | | if(@is_numeric($client_id) && @is_numeric($template_id)) { |
| | | // check if client exists |
| | | $check = $app->db->queryOneRecord('SELECT `client_id` FROM `client` WHERE `client_id` = ' . $client_id); |
| | | $check = $app->db->queryOneRecord('SELECT `client_id` FROM `client` WHERE `client_id` = ?', $client_id); |
| | | if(!$check) { |
| | | $this->server->fault('Invalid client'); |
| | | return false; |
| | | } |
| | | // check if template exists |
| | | $check = $app->db->queryOneRecord('SELECT `assigned_template_id` FROM `client_template_assigned` WHERE `assigned_template_id` = ' . $assigned_template_id); |
| | | $check = $app->db->queryOneRecord('SELECT `assigned_template_id` FROM `client_template_assigned` WHERE `assigned_template_id` = ?', $assigned_template_id); |
| | | if(!$check) { |
| | | $this->server->fault('Invalid template'); |
| | | return false; |
| | |
| | | // for the update event we have to cheat a bit |
| | | $this->_set_client_formdata($client_id); |
| | | |
| | | $sql = "DELETE FROM `client_template_assigned` WHERE `assigned_template_id` = " . $template_id . " AND `client_id` = " . $client_id; |
| | | $app->db->query($sql); |
| | | $sql = "DELETE FROM `client_template_assigned` WHERE `assigned_template_id` = ? AND `client_id` = ?"; |
| | | $app->db->query($sql, $template_id, $client_id); |
| | | $affected_rows = $app->db->affectedRows(); |
| | | |
| | | $app->plugin->raiseEvent('client:client:on_after_update', $this); |
| | |
| | | if($client_id > 0) { |
| | | //* remove the group of the client from the resellers group |
| | | $parent_client_id = $app->functions->intval($this->dataRecord['parent_client_id']); |
| | | $parent_user = $app->db->queryOneRecord("SELECT userid FROM sys_user WHERE client_id = $parent_client_id"); |
| | | $client_group = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = $client_id"); |
| | | $parent_user = $app->db->queryOneRecord("SELECT userid FROM sys_user WHERE client_id = ?", $parent_client_id); |
| | | $client_group = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ?", $client_id); |
| | | $app->auth->remove_group_from_user($parent_user['userid'], $client_group['groupid']); |
| | | |
| | | //* delete the group of the client |
| | | $app->db->query("DELETE FROM sys_group WHERE client_id = $client_id"); |
| | | $app->db->query("DELETE FROM sys_group WHERE client_id = ?", $client_id); |
| | | |
| | | //* delete the sys user(s) of the client |
| | | $app->db->query("DELETE FROM sys_user WHERE client_id = $client_id"); |
| | | $app->db->query("DELETE FROM sys_user WHERE client_id = ?", $client_id); |
| | | |
| | | //* Delete all records (sub-clients, mail, web, etc....) of this client. |
| | | $tables = '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_traffic'; |
| | |
| | | if($client_group_id > 1) { |
| | | foreach($tables_array as $table) { |
| | | if($table != '') { |
| | | $records = $app->db->queryAllRecords("SELECT * FROM $table WHERE sys_groupid = ".$client_group_id); |
| | | $records = $app->db->queryAllRecords("SELECT * FROM $table WHERE sys_groupid = ?", $client_group_id); |
| | | //* find the primary ID of the table |
| | | $table_info = $app->db->tableInfo($table); |
| | | $index_field = ''; |
| | |
| | | $app->db->datalogDelete($table, $index_field, $rec[$index_field]); |
| | | //* Delete traffic records that dont have a sys_groupid column |
| | | if($table == 'web_domain') { |
| | | $app->db->query("DELETE FROM web_traffic WHERE hostname = '".$app->db->quote($rec['domain'])."'"); |
| | | $app->db->query("DELETE FROM web_traffic WHERE hostname = ?", $rec['domain']); |
| | | } |
| | | //* Delete mail_traffic records that dont have a sys_groupid |
| | | if($table == 'mail_user') { |
| | | $app->db->query("DELETE FROM mail_traffic WHERE mailuser_id = '".$app->db->quote($rec['mailuser_id'])."'"); |
| | | $app->db->query("DELETE FROM mail_traffic WHERE mailuser_id = ?", $rec['mailuser_id']); |
| | | } |
| | | } |
| | | } |
| | |
| | | throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); |
| | | return false; |
| | | } |
| | | $username = $app->db->quote($username); |
| | | $rec = $app->db->queryOneRecord("SELECT * FROM sys_user WHERE username = '".$username."'"); |
| | | $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.'); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | 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.'); |
| | | return false; |
| | | } |
| | | $customer_no = trim($customer_no); |
| | | if($customer_no == '') { |
| | | throw new SoapFault('permission_denied', 'There was no customer number specified.'); |
| | | return false; |
| | | } |
| | | $customer_no = $app->db->quote($customer_no); |
| | | $rec = $app->db->queryOneRecord("SELECT * FROM client WHERE customer_no = '".$customer_no."'"); |
| | | if (isset($rec)) { |
| | | return $rec; |
| | | } else { |
| | | throw new SoapFault('no_client_found', 'There is no user account for this customer number.'); |
| | | return false; |
| | | } |
| | | } |
| | |
| | | return false; |
| | | } |
| | | $client_id = $app->functions->intval($client_id); |
| | | $client = $app->db->queryOneRecord("SELECT client_id FROM client WHERE client_id = ".$client_id); |
| | | $client = $app->db->queryOneRecord("SELECT client_id FROM client WHERE client_id = ?", $client_id); |
| | | if($client['client_id'] > 0) { |
| | | $new_password = $app->db->quote($new_password); |
| | | $sql = "UPDATE client SET password = md5('".($new_password)."') WHERE client_id = ".$client_id; |
| | | $app->db->query($sql); |
| | | $sql = "UPDATE sys_user SET passwort = md5('".($new_password)."') WHERE client_id = ".$client_id; |
| | | $app->db->query($sql); |
| | | $sql = "UPDATE client SET password = md5(?) WHERE client_id = ?"; |
| | | $app->db->query($sql, $new_password, $client_id); |
| | | $sql = "UPDATE sys_user SET passwort = md5(?) WHERE client_id = ?"; |
| | | $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'); |
| | |
| | | } |
| | | |
| | | //* Check failed logins |
| | | $sql = "SELECT * FROM `attempts_login` WHERE `ip`= '".$app->db->quote($remote_ip)."' AND `login_time` > (NOW() - INTERVAL 1 MINUTE) LIMIT 1"; |
| | | $alreadyfailed = $app->db->queryOneRecord($sql); |
| | | $sql = "SELECT * FROM `attempts_login` WHERE `ip`= ? AND `login_time` > (NOW() - INTERVAL 1 MINUTE) LIMIT 1"; |
| | | $alreadyfailed = $app->db->queryOneRecord($sql, $remote_ip); |
| | | |
| | | //* too many failedlogins |
| | | if($alreadyfailed['times'] > 5) { |
| | |
| | | |
| | | if(strstr($username,'@')) { |
| | | // Check against client table |
| | | $sql = "SELECT * FROM client WHERE email = '".$app->db->quote($username)."'"; |
| | | $user = $app->db->queryOneRecord($sql); |
| | | $sql = "SELECT * FROM client WHERE email = ?"; |
| | | $user = $app->db->queryOneRecord($sql, $username); |
| | | |
| | | if($user) { |
| | | $saved_password = stripslashes($user['password']); |
| | |
| | | |
| | | } else { |
| | | // Check against sys_user table |
| | | $sql = "SELECT * FROM sys_user WHERE username = '".$app->db->quote($username)."'"; |
| | | $user = $app->db->queryOneRecord($sql); |
| | | $sql = "SELECT * FROM sys_user WHERE username = ?"; |
| | | $user = $app->db->queryOneRecord($sql, $username); |
| | | |
| | | if($user) { |
| | | $saved_password = stripslashes($user['passwort']); |
| | |
| | | |
| | | //* Log failed login attempts |
| | | if($user === false) { |
| | | $time = time(); |
| | | if(!$alreadyfailed['times'] ) { |
| | | //* user login the first time wrong |
| | | $sql = "INSERT INTO `attempts_login` (`ip`, `times`, `login_time`) VALUES ('".$app->db->quote($remote_ip)."', 1, NOW())"; |
| | | $app->db->query($sql); |
| | | $sql = "INSERT INTO `attempts_login` (`ip`, `times`, `login_time`) VALUES (?, 1, NOW())"; |
| | | $app->db->query($sql, $remote_ip); |
| | | } elseif($alreadyfailed['times'] >= 1) { |
| | | //* update times wrong |
| | | $sql = "UPDATE `attempts_login` SET `times`=`times`+1, `login_time`=NOW() WHERE `login_time` >= '".$time."' LIMIT 1"; |
| | | $app->db->query($sql); |
| | | $sql = "UPDATE `attempts_login` SET `times`=`times`+1, `login_time`=NOW() WHERE `ip` = ? AND `login_time` > (NOW() - INTERVAL 1 MINUTE) ORDER BY `login_time` DESC LIMIT 1"; |
| | | $app->db->query($sql, $remote_ip); |
| | | } |
| | | } |
| | | |
| | |
| | | return false; |
| | | } |
| | | |
| | | $client = $app->db->queryOneRecord("SELECT default_dnsserver FROM client WHERE client_id = ".$app->functions->intval($client_id)); |
| | | $client = $app->db->queryOneRecord("SELECT default_dnsserver FROM client WHERE client_id = ?", $client_id); |
| | | $server_id = $client["default_dnsserver"]; |
| | | $template_record = $app->db->queryOneRecord("SELECT * FROM dns_template WHERE template_id = '$template_id'"); |
| | | $template_record = $app->db->queryOneRecord("SELECT * FROM dns_template WHERE template_id = ?", $template_id); |
| | | $fields = explode(',', $template_record['fields']); |
| | | $tform_def_file = "../../web/dns/form/dns_soa.tform.php"; |
| | | $app->uses('tform'); |
| | |
| | | if($section == 'dns_records') { |
| | | $parts = explode('|', $row); |
| | | $dns_rr[] = array( |
| | | 'name' => $app->db->quote($parts[1]), |
| | | 'type' => $app->db->quote($parts[0]), |
| | | 'data' => $app->db->quote($parts[2]), |
| | | 'aux' => $app->db->quote($parts[3]), |
| | | 'ttl' => $app->db->quote($parts[4]) |
| | | 'name' => $parts[1], |
| | | 'type' => $parts[0], |
| | | 'data' => $parts[2], |
| | | 'aux' => $parts[3], |
| | | 'ttl' => $parts[4] |
| | | ); |
| | | } |
| | | } |
| | |
| | | |
| | | if($error == '') { |
| | | // Insert the soa record |
| | | $tmp = $app->db->queryOneRecord("SELECT userid,default_group FROM sys_user WHERE client_id = ".$app->functions->intval($client_id)); |
| | | $tmp = $app->db->queryOneRecord("SELECT userid,default_group FROM sys_user WHERE client_id = ?", $client_id); |
| | | $sys_userid = $tmp['userid']; |
| | | $sys_groupid = $tmp['default_group']; |
| | | unset($tmp); |
| | | $origin = $app->db->quote($vars['origin']); |
| | | $ns = $app->db->quote($vars['ns']); |
| | | $mbox = $app->db->quote(str_replace('@', '.', $vars['mbox'])); |
| | | $refresh = $app->db->quote($vars['refresh']); |
| | | $retry = $app->db->quote($vars['retry']); |
| | | $expire = $app->db->quote($vars['expire']); |
| | | $minimum = $app->db->quote($vars['minimum']); |
| | | $ttl = $app->db->quote($vars['ttl']); |
| | | $xfer = $app->db->quote($vars['xfer']); |
| | | $also_notify = $app->db->quote($vars['also_notify']); |
| | | $update_acl = $app->db->quote($vars['update_acl']); |
| | | $origin = $vars['origin']; |
| | | $ns = $vars['ns']; |
| | | $mbox = str_replace('@', '.', $vars['mbox']); |
| | | $refresh = $vars['refresh']; |
| | | $retry = $vars['retry']; |
| | | $expire = $vars['expire']; |
| | | $minimum = $vars['minimum']; |
| | | $ttl = $vars['ttl']; |
| | | $xfer = $vars['xfer']; |
| | | $also_notify = $vars['also_notify']; |
| | | $update_acl = $vars['update_acl']; |
| | | $serial = $app->validate_dns->increase_serial(0); |
| | | $insert_data = "(`sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `server_id`, `origin`, `ns`, `mbox`, `serial`, `refresh`, `retry`, `expire`, `minimum`, `ttl`, `active`, `xfer`, `also_notify`, `update_acl`) VALUES |
| | | ('$sys_userid', '$sys_groupid', 'riud', 'riud', '', '$server_id', '$origin', '$ns', '$mbox', '$serial', '$refresh', '$retry', '$expire', '$minimum', '$ttl', 'Y', '$xfer', '$also_notify', '$update_acl')"; |
| | | $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, |
| | | "origin" => $origin, |
| | | "ns" => $ns, |
| | | "mbox" => $mbox, |
| | | "serial" => $serial, |
| | | "refresh" => $refresh, |
| | | "retry" => $retry, |
| | | "expire" => $expire, |
| | | "minimum" => $minimum, |
| | | "ttl" => $ttl, |
| | | "active" => 'Y', |
| | | "xfer" => $xfer, |
| | | "also_notify" => $also_notify, |
| | | "update_acl" => $update_acl |
| | | ); |
| | | $dns_soa_id = $app->db->datalogInsert('dns_soa', $insert_data, 'id'); |
| | | // Insert the dns_rr records |
| | | if(is_array($dns_rr) && $dns_soa_id > 0) { |
| | | foreach($dns_rr as $rr) { |
| | | $insert_data = "(`sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `server_id`, `zone`, `name`, `type`, `data`, `aux`, `ttl`, `active`) VALUES |
| | | ('$sys_userid', '$sys_groupid', 'riud', 'riud', '', '$server_id', '$dns_soa_id', '$rr[name]', '$rr[type]', '$rr[data]', '$rr[aux]', '$rr[ttl]', 'Y')"; |
| | | $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" => $rr['name'], |
| | | "type" => $rr['type'], |
| | | "data" => $rr['data'], |
| | | "aux" => $rr['aux'], |
| | | "ttl" => $rr['ttl'], |
| | | "active" => 'Y' |
| | | ); |
| | | $dns_rr_id = $app->db->datalogInsert('dns_rr', $insert_data, 'id'); |
| | | } |
| | | } |
| | |
| | | return false; |
| | | } |
| | | |
| | | $rec = $app->db->queryOneRecord("SELECT id FROM dns_soa WHERE origin like '".$origin."%'"); |
| | | $rec = $app->db->queryOneRecord("SELECT id FROM dns_soa WHERE origin like ?", $origin."%"); |
| | | if(isset($rec['id'])) { |
| | | return $app->functions->intval($rec['id']); |
| | | } else { |
| | |
| | | if (!empty($client_id) && !empty($server_id)) { |
| | | $server_id = $app->functions->intval($server_id); |
| | | $client_id = $app->functions->intval($client_id); |
| | | $sql = "SELECT id, origin FROM dns_soa d INNER JOIN sys_user s on(d.sys_groupid = s.default_group) WHERE client_id = $client_id AND server_id = $server_id"; |
| | | $result = $app->db->queryAllRecords($sql); |
| | | $sql = "SELECT id, origin FROM dns_soa d INNER JOIN sys_user s on(d.sys_groupid = s.default_group) WHERE client_id = ? AND server_id = ?"; |
| | | $result = $app->db->queryAllRecords($sql, $client_id, $server_id); |
| | | return $result; |
| | | } |
| | | return false; |
| | |
| | | throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); |
| | | return false; |
| | | } |
| | | $sql = "SELECT * FROM dns_rr WHERE zone = ".$app->functions->intval($zone_id);; |
| | | $result = $app->db->queryAllRecords($sql); |
| | | $sql = "SELECT * FROM dns_rr WHERE zone = ?"; |
| | | $result = $app->db->queryAllRecords($sql, $zone_id); |
| | | return $result; |
| | | } |
| | | |
| | |
| | | } else { |
| | | $status = 'N'; |
| | | } |
| | | $sql = "UPDATE dns_soa SET active = '$status' WHERE id = ".$app->functions->intval($primary_id); |
| | | $app->db->query($sql); |
| | | $sql = "UPDATE dns_soa SET active = ? WHERE id = ?"; |
| | | $app->db->query($sql, $status, $primary_id); |
| | | $result = $app->db->affectedRows(); |
| | | return $result; |
| | | } else { |
| | |
| | | return false; |
| | | } |
| | | $group_id = $app->functions->intval($group_id); |
| | | $sql = "SELECT domain_id, domain FROM domain WHERE sys_groupid = $group_id "; |
| | | $all = $app->db->queryAllRecords($sql); |
| | | $sql = "SELECT domain_id, domain FROM domain WHERE sys_groupid = ?"; |
| | | $all = $app->db->queryAllRecords($sql, $group_id); |
| | | return $all; |
| | | } |
| | | |
| | |
| | | |
| | | //* Check if mail domain exists |
| | | $email_parts = explode('@', $params['email']); |
| | | $tmp = $app->db->queryOneRecord("SELECT domain FROM mail_domain WHERE domain = '".$app->db->quote($email_parts[1])."'"); |
| | | $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.'); |
| | | return false; |
| | |
| | | |
| | | //* Check if mail domain exists |
| | | $email_parts = explode('@', $params['email']); |
| | | $tmp = $app->db->queryOneRecord("SELECT domain FROM mail_domain WHERE domain = '".$app->db->quote($email_parts[1])."'"); |
| | | $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.'); |
| | | return false; |
| | |
| | | return false; |
| | | } |
| | | |
| | | $params = array(); |
| | | if ($site_id != null) { |
| | | $sql = "SELECT * FROM mail_backup WHERE parent_domain_id = ".$app->functions->intval($site_id); |
| | | $params[] = $site_id; |
| | | $sql = "SELECT * FROM mail_backup WHERE parent_domain_id = ?"; |
| | | } |
| | | else { |
| | | $sql = "SELECT * FROM mail_backup"; |
| | | } |
| | | |
| | | $result = $app->db->queryAllRecords($sql); |
| | | $result = $app->db->queryAllRecords($sql, true, $params); |
| | | return $result; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | //*Set variables |
| | | $backup_record = $app->db->queryOneRecord("SELECT * FROM `mail_backup` WHERE `backup_id`='$primary_id'"); |
| | | $backup_record = $app->db->queryOneRecord("SELECT * FROM `mail_backup` WHERE `backup_id`=?", $primary_id); |
| | | $server_id = $backup_record['server_id']; |
| | | |
| | | //*Set default action state |
| | |
| | | } |
| | | |
| | | //* Validate instance |
| | | $instance_record = $app->db->queryOneRecord("SELECT * FROM `sys_remoteaction` WHERE `action_param`='$primary_id' and `action_type`='$action_type' and `action_state`='pending'"); |
| | | $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) { |
| | | $this->server->fault('duplicate_action', "There is already a pending $action_type action"); |
| | | return false; |
| | | } |
| | | |
| | | //* Save the record |
| | | if ($app->db->query("INSERT INTO `sys_remoteaction` SET `server_id` = '$server_id', `tstamp` = '$tstamp', `action_type` = '$action_type', `action_param` = '$primary_id', `action_state` = '$action_state'")) { |
| | | if ($app->db->query("INSERT INTO `sys_remoteaction` SET `server_id` = ?, `tstamp` = ?, `action_type` = ?, `action_param` = ?, `action_state` = ?", $server_id, $tstamp, $action_type, $primary_id, $action_state)) { |
| | | return true; |
| | | } else { |
| | | 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 = '".$app->db->quote($params["source"])."'"); |
| | | $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.'); |
| | | } |
| | |
| | | } |
| | | |
| | | //* 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 = '".$app->db->quote($params["source"])."'"); |
| | | $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.'); |
| | | } |
| | |
| | | return false; |
| | | } |
| | | if (!empty($domain)) { |
| | | $domain = $app->db->quote($domain); |
| | | $sql = "SELECT * FROM mail_domain WHERE domain = '$domain'"; |
| | | $result = $app->db->queryAllRecords($sql); |
| | | $sql = "SELECT * FROM mail_domain WHERE domain = ?"; |
| | | $result = $app->db->queryAllRecords($sql, $domain); |
| | | return $result; |
| | | } |
| | | return false; |
| | |
| | | } else { |
| | | $status = 'n'; |
| | | } |
| | | $sql = "UPDATE mail_domain SET active = '$status' WHERE domain_id = ".$app->functions->intval($primary_id); |
| | | $app->db->query($sql); |
| | | $sql = "UPDATE mail_domain SET active = ? WHERE domain_id = ?"; |
| | | $app->db->query($sql, $status, $primary_id); |
| | | $result = $app->db->affectedRows(); |
| | | return $result; |
| | | } else { |
| | |
| | | $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 = $server_id LIMIT 0,1"); |
| | | $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 (!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 = ".$app->functions->intval($tmp['groupid']); |
| | | $result = $app->db->queryAllRecords($sql); |
| | | $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; |
| | |
| | | } |
| | | |
| | | // Verify if template and ostemplate exist |
| | | $tmp = $app->db->queryOneRecord("SELECT template_id FROM openvz_template WHERE template_id = $template_id"); |
| | | $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"); |
| | | $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"); |
| | | $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 = ".$override_params['server_id']." LIMIT 0,1"); |
| | | $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"); |
| | | } |
| | |
| | | $action = 'openvz_start_vm'; |
| | | |
| | | $tmp = $app->db->queryOneRecord("SELECT count(action_id) as actions FROM sys_remoteaction |
| | | WHERE server_id = '".$vm['server_id']."' |
| | | AND action_type = '$action' |
| | | AND action_param = '".$vm['veid']."' |
| | | AND action_state = 'pending'"); |
| | | 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 (". |
| | | (int)$vm['server_id'] . ", ". |
| | | time() . ", ". |
| | | "'".$action."', ". |
| | | $vm['veid'].", ". |
| | | "'pending', ". |
| | | "''". |
| | | ")"; |
| | | $app->db->query($sql); |
| | | "VALUES (?, ?, ?, ?, 'pending', '')"; |
| | | $app->db->query($sql, (int)$vm['server_id'], time(), $action, $vm['veid']); |
| | | } |
| | | } |
| | | |
| | |
| | | $action = 'openvz_stop_vm'; |
| | | |
| | | $tmp = $app->db->queryOneRecord("SELECT count(action_id) as actions FROM sys_remoteaction |
| | | WHERE server_id = '".$vm['server_id']."' |
| | | AND action_type = '$action' |
| | | AND action_param = '".$vm['veid']."' |
| | | AND action_state = 'pending'"); |
| | | 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 (". |
| | | (int)$vm['server_id'] . ", ". |
| | | time() . ", ". |
| | | "'".$action."', ". |
| | | $vm['veid'].", ". |
| | | "'pending', ". |
| | | "''". |
| | | ")"; |
| | | $app->db->query($sql); |
| | | "VALUES (?, ?, ?, ?, 'pending', '')"; |
| | | $app->db->query($sql, (int)$vm['server_id'], time(), $action, $vm['veid']); |
| | | } |
| | | } |
| | | |
| | |
| | | $action = 'openvz_restart_vm'; |
| | | |
| | | $tmp = $app->db->queryOneRecord("SELECT count(action_id) as actions FROM sys_remoteaction |
| | | WHERE server_id = '".$vm['server_id']."' |
| | | AND action_type = '$action' |
| | | AND action_param = '".$vm['veid']."' |
| | | AND action_state = 'pending'"); |
| | | 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 (". |
| | | (int)$vm['server_id'] . ", ". |
| | | time() . ", ". |
| | | "'".$action."', ". |
| | | $vm['veid'].", ". |
| | | "'pending', ". |
| | | "''". |
| | | ")"; |
| | | $app->db->query($sql); |
| | | "VALUES (?, ?, ?, ?, 'pending', '')"; |
| | | $app->db->query($sql, (int)$vm['server_id'], time(), $action, $vm['veid']); |
| | | } |
| | | } |
| | | |
| | |
| | | throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); |
| | | return false; |
| | | } |
| | | $sql = "SELECT server_id FROM server_ip WHERE ip_address = '$ipaddress' LIMIT 1 "; |
| | | $all = $app->db->queryAllRecords($sql); |
| | | $sql = "SELECT server_id FROM server_ip WHERE ip_address = ? LIMIT 1"; |
| | | $all = $app->db->queryAllRecords($sql, $ipaddress); |
| | | return $all; |
| | | } |
| | | |
| | |
| | | return false; |
| | | } |
| | | if (!empty($session_id) && !empty($server_name)) { |
| | | $sql = "SELECT server_id FROM server WHERE server_name = '$server_name' LIMIT 1 "; |
| | | $all = $app->db->queryAllRecords($sql); |
| | | $sql = "SELECT server_id FROM server WHERE server_name = ? LIMIT 1"; |
| | | $all = $app->db->queryAllRecords($sql, $server_name); |
| | | return $all; |
| | | } else { |
| | | return false; |
| | |
| | | return false; |
| | | } |
| | | if (!empty($session_id) && !empty($server_id)) { |
| | | $sql = "SELECT mail_server, web_server, dns_server, file_server, db_server, vserver_server, proxy_server, firewall_server FROM server WHERE server_id = '$server_id' LIMIT 1 "; |
| | | $all = $app->db->queryAllRecords($sql); |
| | | $sql = "SELECT mail_server, web_server, dns_server, file_server, db_server, vserver_server, proxy_server, firewall_server FROM server WHERE server_id = ? LIMIT 1 "; |
| | | $all = $app->db->queryAllRecords($sql, $server_id); |
| | | return $all; |
| | | } else { |
| | | return false; |
| | |
| | | $app->remoting_lib->loadFormDef('../sites/form/database.tform.php'); |
| | | return $app->remoting_lib->getDataRecord($primary_id); |
| | | } |
| | | |
| | | |
| | | /* TODO: secure queries! */ |
| | | //* Add a record |
| | | public function sites_database_add($session_id, $client_id, $params) |
| | | { |
| | |
| | | } |
| | | |
| | | //* Check for duplicates |
| | | $tmp = $app->db->queryOneRecord("SELECT count(database_id) as dbnum FROM web_database WHERE database_name = '".$app->db->quote($params['database_name'])."' AND server_id = '".intval($params["server_id"])."'"); |
| | | $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.'); |
| | | return false; |
| | |
| | | $sql_set = array(); |
| | | if(isset($params['backup_interval'])) $sql_set[] = "backup_interval = '".$app->db->quote($params['backup_interval'])."'"; |
| | | if(isset($params['backup_copies'])) $sql_set[] = "backup_copies = ".$app->functions->intval($params['backup_copies']); |
| | | //$app->db->query("UPDATE web_database SET ".implode(', ', $sql_set)." WHERE database_id = ".$retval); |
| | | $this->updateQueryExecute("UPDATE web_database SET ".implode(', ', $sql_set)." WHERE database_id = ".$retval, $retval, $params); |
| | | } |
| | | |
| | |
| | | $sql_set = array(); |
| | | if(isset($params['backup_interval'])) $sql_set[] = "backup_interval = '".$app->db->quote($params['backup_interval'])."'"; |
| | | if(isset($params['backup_copies'])) $sql_set[] = "backup_copies = ".$app->functions->intval($params['backup_copies']); |
| | | //$app->db->query("UPDATE web_database SET ".implode(', ', $sql_set)." WHERE database_id = ".$primary_id); |
| | | $this->updateQueryExecute("UPDATE web_database SET ".implode(', ', $sql_set)." WHERE database_id = ".$primary_id, $primary_id, $params); |
| | | } |
| | | |
| | |
| | | |
| | | $new_rec = $app->remoting_lib->getDataRecord($primary_id); |
| | | |
| | | $records = $app->db->queryAllRecords("SELECT DISTINCT server_id FROM web_database WHERE database_user_id = '".$app->functions->intval($primary_id)."' UNION SELECT DISTINCT server_id FROM web_database WHERE database_ro_user_id = '".$app->functions->intval($primary_id)."'"); |
| | | $records = $app->db->queryAllRecords("SELECT DISTINCT server_id FROM web_database WHERE database_user_id = ? UNION SELECT DISTINCT server_id FROM web_database WHERE database_ro_user_id = ?", $primary_id, $primary_id); |
| | | foreach($records as $rec) { |
| | | $tmp_rec = $new_rec; |
| | | $tmp_rec['server_id'] = $rec['server_id']; |
| | |
| | | $app->db->datalogDelete('web_database_user', 'database_user_id', $primary_id); |
| | | $affected_rows = $this->deleteQuery('../sites/form/database_user.tform.php', $primary_id); |
| | | |
| | | $records = $app->db->queryAllRecords("SELECT database_id FROM web_database WHERE database_user_id = '".$app->functions->intval($primary_id)."'"); |
| | | $records = $app->db->queryAllRecords("SELECT database_id FROM web_database WHERE database_user_id = ?", $primary_id); |
| | | foreach($records as $rec) { |
| | | $app->db->datalogUpdate('web_database', 'database_user_id=NULL', 'database_id', $rec['database_id']); |
| | | $app->db->datalogUpdate('web_database', array('database_user_id' => null), 'database_id', $rec['database_id']); |
| | | |
| | | } |
| | | $records = $app->db->queryAllRecords("SELECT database_id FROM web_database WHERE database_ro_user_id = '".$app->functions->intval($primary_id)."'"); |
| | | $records = $app->db->queryAllRecords("SELECT database_id FROM web_database WHERE database_ro_user_id = ?", $primary_id); |
| | | foreach($records as $rec) { |
| | | $app->db->datalogUpdate('web_database', 'database_ro_user_id=NULL', 'database_id', $rec['database_id']); |
| | | $app->db->datalogUpdate('web_database', array('database_ro_user_id' => null), 'database_id', $rec['database_id']); |
| | | } |
| | | |
| | | return $affected_rows; |
| | |
| | | return false; |
| | | } |
| | | |
| | | $data = $app->db->queryOneRecord("SELECT server_id FROM ftp_user WHERE username = '".$app->db->quote($ftp_user)."'"); |
| | | $data = $app->db->queryOneRecord("SELECT server_id FROM ftp_user WHERE username = ?", $ftp_user); |
| | | //file_put_contents('/tmp/test.txt', serialize($data)); |
| | | if(!isset($data['server_id'])) return false; |
| | | |
| | |
| | | return false; |
| | | } |
| | | $app->uses('remoting_lib'); |
| | | $app->remoting_lib->loadFormDef('../sites/form/web_domain.tform.php'); |
| | | $app->remoting_lib->loadFormDef('../sites/form/web_vhost_domain.tform.php'); |
| | | return $app->remoting_lib->getDataRecord($primary_id); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | if(!isset($params['client_group_id']) or (isset($params['client_group_id']) && empty($params['client_group_id']))) { |
| | | $rec = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ".$app->functions->intval($client_id)); |
| | | $rec = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ?", $client_id); |
| | | $params['client_group_id'] = $rec['groupid']; |
| | | } |
| | | |
| | |
| | | if($params['pm_min_spare_servers'] == '') $params['pm_min_spare_servers'] = 1; |
| | | if($params['pm_max_spare_servers'] == '') $params['pm_max_spare_servers'] = 1; |
| | | |
| | | $domain_id = $this->insertQuery('../sites/form/web_domain.tform.php', $client_id, $params, 'sites:web_domain:on_after_insert'); |
| | | $domain_id = $this->insertQuery('../sites/form/web_vhost_domain.tform.php', $client_id, $params, 'sites:web_domain:on_after_insert'); |
| | | if ($readonly === true) |
| | | $app->db->query("UPDATE web_domain SET `sys_userid` = '1' WHERE domain_id = ".$domain_id); |
| | | $app->db->query("UPDATE web_domain SET `sys_userid` = '1' WHERE domain_id = ?", $domain_id); |
| | | return $domain_id; |
| | | } |
| | | |
| | |
| | | if($params['pm_min_spare_servers'] == '') $params['pm_min_spare_servers'] = 1; |
| | | if($params['pm_max_spare_servers'] == '') $params['pm_max_spare_servers'] = 1; |
| | | |
| | | $affected_rows = $this->updateQuery('../sites/form/web_domain.tform.php', $client_id, $primary_id, $params); |
| | | $affected_rows = $this->updateQuery('../sites/form/web_vhost_domain.tform.php', $client_id, $primary_id, $params); |
| | | return $affected_rows; |
| | | } |
| | | |
| | |
| | | throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); |
| | | return false; |
| | | } |
| | | $affected_rows = $this->deleteQuery('../sites/form/web_domain.tform.php', $primary_id); |
| | | $affected_rows = $this->deleteQuery('../sites/form/web_vhost_domain.tform.php', $primary_id); |
| | | return $affected_rows; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | // Delete all users that belong to this folder. - taken from web_folder_delete.php |
| | | $records = $app->db->queryAllRecords("SELECT web_folder_user_id FROM web_folder_user WHERE web_folder_id = '".$app->functions->intval($primary_id)."'"); |
| | | $records = $app->db->queryAllRecords("SELECT web_folder_user_id FROM web_folder_user WHERE web_folder_id = ?", $primary_id); |
| | | foreach($records as $rec) { |
| | | $this->deleteQuery('../sites/form/web_folder_user.tform.php', $rec['web_folder_user_id']); |
| | | //$app->db->datalogDelete('web_folder_user','web_folder_user_id',$rec['web_folder_user_id']); |
| | |
| | | } else { |
| | | $status = 'n'; |
| | | } |
| | | $app->remoting_lib->loadFormDef('../sites/form/web_domain.tform.php'); |
| | | $app->remoting_lib->loadFormDef('../sites/form/web_vhost_domain.tform.php'); |
| | | $params = $app->remoting_lib->getDataRecord($primary_id); |
| | | $params['active'] = $status; |
| | | |
| | | $affected_rows = $this->updateQuery('../sites/form/web_domain.tform.php', 0, $primary_id, $params); |
| | | $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'); |
| | |
| | | return false; |
| | | } |
| | | $client_id = $app->functions->intval($client_id); |
| | | $sql = "SELECT d.database_id, d.database_name, d.database_user_id, d.database_ro_user_id, du.database_user, du.database_password FROM web_database d LEFT JOIN web_database_user du ON (du.database_user_id = d.database_user_id) INNER JOIN sys_user s on(d.sys_groupid = s.default_group) WHERE client_id = $client_id"; |
| | | $all = $app->db->queryAllRecords($sql); |
| | | $sql = "SELECT d.database_id, d.database_name, d.database_user_id, d.database_ro_user_id, du.database_user, du.database_password FROM web_database d LEFT JOIN web_database_user du ON (du.database_user_id = d.database_user_id) INNER JOIN sys_user s on(d.sys_groupid = s.default_group) WHERE client_id = ?"; |
| | | $all = $app->db->queryAllRecords($sql, $client_id); |
| | | return $all; |
| | | } |
| | | |
| | |
| | | return false; |
| | | } |
| | | |
| | | $result = $app->db->queryAllRecords("SELECT * FROM web_backup".(($site_id != null)?' WHERE parent_domain_id = ?':''), $app->functions->intval($site_id)); |
| | | $result = $app->db->queryAllRecords("SELECT * FROM web_backup".(($site_id != null)?' WHERE parent_domain_id = ?':''), $site_id); |
| | | return $result; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | //* Delete old remoting sessions |
| | | $sql = "DELETE FROM remote_session WHERE tstamp < ".time(); |
| | | $sql = "DELETE FROM remote_session WHERE tstamp < UNIX_TIMSTAMP()"; |
| | | $app->db->query($sql); |
| | | |
| | | $username = $app->db->quote($username); |
| | | $password = $app->db->quote($password); |
| | | |
| | | if($client_login == true) { |
| | | $sql = "SELECT * FROM sys_user WHERE USERNAME = '$username'"; |
| | | $user = $app->db->queryOneRecord($sql); |
| | | $sql = "SELECT * FROM sys_user WHERE USERNAME = ?"; |
| | | $user = $app->db->queryOneRecord($sql, $username); |
| | | if($user) { |
| | | $saved_password = stripslashes($user['passwort']); |
| | | |
| | |
| | | } |
| | | |
| | | // now we need the client data |
| | | $client = $app->db->queryOneRecord("SELECT client.can_use_api FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = " . $app->functions->intval($user['default_group'])); |
| | | $client = $app->db->queryOneRecord("SELECT client.can_use_api FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $user['default_group']); |
| | | if(!$client || $client['can_use_api'] != 'y') { |
| | | throw new SoapFault('client_login_failed', 'The login failed. Client may not use api.'); |
| | | return false; |
| | |
| | | $remote_functions = ''; |
| | | $tstamp = time() + $this->session_timeout; |
| | | $sql = 'INSERT INTO remote_session (remote_session,remote_userid,remote_functions,client_login,tstamp' |
| | | .') VALUES (' |
| | | ." '$remote_session',$remote_userid,'$remote_functions',1,$tstamp)"; |
| | | $app->db->query($sql); |
| | | .') VALUES (?, ?, ?, 1, $tstamp)'; |
| | | $app->db->query($sql, $remote_session,$remote_userid,$remote_functions,$tstamp); |
| | | return $remote_session; |
| | | } else { |
| | | $sql = "SELECT * FROM remote_user WHERE remote_username = '$username' and remote_password = md5('$password')"; |
| | | $remote_user = $app->db->queryOneRecord($sql); |
| | | $sql = "SELECT * FROM remote_user WHERE remote_username = ? and remote_password = md5(?)"; |
| | | $remote_user = $app->db->queryOneRecord($sql, $username, $password); |
| | | if($remote_user['remote_userid'] > 0) { |
| | | //* Create a remote user session |
| | | //srand ((double)microtime()*1000000); |
| | |
| | | $remote_functions = $remote_user['remote_functions']; |
| | | $tstamp = time() + $this->session_timeout; |
| | | $sql = 'INSERT INTO remote_session (remote_session,remote_userid,remote_functions,tstamp' |
| | | .') VALUES (' |
| | | ." '$remote_session',$remote_userid,'$remote_functions',$tstamp)"; |
| | | $app->db->query($sql); |
| | | .') VALUES (?, ?, ?, ?)'; |
| | | $app->db->query($sql, $remote_session,$remote_userid,$remote_functions,$tstamp); |
| | | return $remote_session; |
| | | } else { |
| | | throw new SoapFault('login_failed', 'The login failed. Username or password wrong.'); |
| | |
| | | return false; |
| | | } |
| | | |
| | | $session_id = $app->db->quote($session_id); |
| | | |
| | | $sql = "DELETE FROM remote_session WHERE remote_session = '$session_id'"; |
| | | if($app->db->query($sql) != false) { |
| | | $sql = "DELETE FROM remote_session WHERE remote_session = ?"; |
| | | if($app->db->query($sql, $session_id) != false) { |
| | | return true; |
| | | } else { |
| | | return false; |
| | |
| | | $sql = $app->remoting_lib->getSQL($params, 'INSERT', 0); |
| | | |
| | | //* Check if no system user with that username exists |
| | | $username = $app->db->quote($params["username"]); |
| | | $tmp = $app->db->queryOneRecord("SELECT count(userid) as number FROM sys_user WHERE username = '$username'"); |
| | | $username = $params["username"]; |
| | | $tmp = $app->db->queryOneRecord("SELECT count(userid) as number FROM sys_user WHERE username = ?", $username); |
| | | if($tmp['number'] > 0) $app->remoting_lib->errorMessage .= "Duplicate username<br />"; |
| | | |
| | | //* Stop on error while preparing the sql query |
| | |
| | | |
| | | /* copied from the client_edit php */ |
| | | exec('ssh-keygen -t rsa -C '.$username.'-rsa-key-'.time().' -f /tmp/id_rsa -N ""'); |
| | | $app->db->query("UPDATE client SET created_at = ".time().", id_rsa = '".$app->db->quote(@file_get_contents('/tmp/id_rsa'))."', ssh_rsa = '".$app->db->quote(@file_get_contents('/tmp/id_rsa.pub'))."' WHERE client_id = ".$this->id); |
| | | $app->db->query("UPDATE client SET created_at = UNIX_TIMSTAMP(), id_rsa = ?, ssh_rsa = ? WHERE client_id = ?", @file_get_contents('/tmp/id_rsa'), @file_get_contents('/tmp/id_rsa.pub'), $this->id); |
| | | exec('rm -f /tmp/id_rsa /tmp/id_rsa.pub'); |
| | | |
| | | |
| | |
| | | $app->remoting_lib->ispconfig_sysuser_add($params, $insert_id); |
| | | |
| | | if($reseller_id) { |
| | | $client_group = $app->db->queryOneRecord("SELECT * FROM sys_group WHERE client_id = ".$insert_id); |
| | | $reseller_user = $app->db->queryOneRecord("SELECT * FROM sys_user WHERE client_id = ".$reseller_id); |
| | | $client_group = $app->db->queryOneRecord("SELECT * FROM sys_group WHERE client_id = ?", $insert_id); |
| | | $reseller_user = $app->db->queryOneRecord("SELECT * FROM sys_user WHERE client_id = ?", $reseller_id); |
| | | $app->auth->add_group_to_user($reseller_user['userid'], $client_group['groupid']); |
| | | $app->db->query("UPDATE client SET parent_client_id = ".$reseller_id." WHERE client_id = ".$insert_id); |
| | | $app->db->query("UPDATE client SET parent_client_id = ? WHERE client_id = ?", $reseller_id, $insert_id); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | //* get old record and merge with params, so only new values have to be set in $params |
| | | $old_rec = $app->remoting_lib->getDataRecord($primary_id); |
| | | |
| | | foreach ($app->remoting_lib->formDef['fields'] as $fieldName => $fieldConf) |
| | | { |
| | | if ($fieldConf['formtype'] === 'PASSWORD' && empty($params[$fieldName])) { |
| | | unset($old_rec[$fieldName]); |
| | | } |
| | | } |
| | | |
| | | $params = $app->functions->array_merge($old_rec,$params); |
| | | |
| | | //* Get the SQL query |
| | | $sql = $app->remoting_lib->getSQL($params, 'UPDATE', $primary_id); |
| | | |
| | | // throw new SoapFault('debug', $sql); |
| | | if($app->remoting_lib->errorMessage != '') { |
| | | throw new SoapFault('data_processing_error', $app->remoting_lib->errorMessage); |
| | |
| | | return false; |
| | | } |
| | | |
| | | $session_id = $app->db->quote($session_id); |
| | | |
| | | $now = time(); |
| | | $sql = "SELECT * FROM remote_session WHERE remote_session = '$session_id' AND tstamp >= $now"; |
| | | $session = $app->db->queryOneRecord($sql); |
| | | $sql = "SELECT * FROM remote_session WHERE remote_session = ? AND tstamp >= UNIX_TIMSTAMP()"; |
| | | $session = $app->db->queryOneRecord($sql, $session_id); |
| | | if($session['remote_userid'] > 0) { |
| | | return $session; |
| | | } else { |
| | |
| | | if(isset($_SESSION['client_login']) && isset($_SESSION['client_sys_userid']) && $_SESSION['client_login'] == 1) { |
| | | $client_sys_userid = $app->functions->intval($_SESSION['client_sys_userid']); |
| | | |
| | | $client = $app->db->queryOneRecord("SELECT client.client_id FROM sys_user, client WHERE sys_user.client_id = client.client_id and sys_user.userid = " . $client_sys_userid); |
| | | $client = $app->db->queryOneRecord("SELECT client.client_id FROM sys_user, client WHERE sys_user.client_id = client.client_id and sys_user.userid = ?", $client_sys_userid); |
| | | |
| | | $this->client_id = $client['client_id']; |
| | | $client_login = true; |
| | |
| | | $this->sys_groups = 1; |
| | | $_SESSION["s"]["user"]["typ"] = 'admin'; |
| | | } else { |
| | | //* load system user - try with sysuser and before with userid (workarrond) |
| | | /* |
| | | $user = $app->db->queryOneRecord("SELECT * FROM sys_user WHERE sysuser_id = $client_id"); |
| | | if(empty($user["userid"])) { |
| | | $user = $app->db->queryOneRecord("SELECT * FROM sys_user WHERE userid = $client_id"); |
| | | if(empty($user["userid"])) { |
| | | $this->errorMessage .= "No sysuser with the ID $client_id found."; |
| | | return false; |
| | | } |
| | | }*/ |
| | | |
| | | $user = $app->db->queryOneRecord("SELECT * FROM sys_user WHERE client_id = $this->client_id"); |
| | | $user = $app->db->queryOneRecord("SELECT * FROM sys_user WHERE client_id = ?", $this->client_id); |
| | | $this->sys_username = $user['username']; |
| | | $this->sys_userid = $user['userid']; |
| | | $this->sys_default_group = $user['default_group']; |
| | | $this->sys_groups = $user['groups']; |
| | | // $_SESSION["s"]["user"]["typ"] = $user['typ']; |
| | | // we have to force admin priveliges for the remoting API as some function calls might fail otherwise. |
| | | if($client_login == false) $_SESSION["s"]["user"]["typ"] = 'admin'; |
| | | } |
| | |
| | | return parent::getDataRecord($primary_id); |
| | | } elseif($primary_id == -1) { |
| | | // Return a array with all records |
| | | $sql = "SELECT * FROM ".$escape.$this->formDef['db_table'].$escape; |
| | | return $app->db->queryAllRecords($sql); |
| | | $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.'); |
| | | return array(); |
| | |
| | | $sql_offset = 0; |
| | | $sql_limit = 0; |
| | | $sql_where = ''; |
| | | $params = array($this->formDef['db_table']); |
| | | foreach($primary_id as $key => $val) { |
| | | $key = $app->db->quote($key); |
| | | $val = $app->db->quote($val); |
| | | if($key == '#OFFSET#') $sql_offset = $app->functions->intval($val); |
| | | elseif($key == '#LIMIT#') $sql_limit = $app->functions->intval($val); |
| | | elseif(stristr($val, '%')) { |
| | | $sql_where .= "$key like '$val' AND "; |
| | | $sql_where .= "? like ? AND "; |
| | | } else { |
| | | $sql_where .= "$key = '$val' AND "; |
| | | $sql_where .= "? = ? AND "; |
| | | } |
| | | $params[] = $key; |
| | | $params[] = $val; |
| | | } |
| | | $sql_where = substr($sql_where, 0, -5); |
| | | if($sql_where == '') $sql_where = '1'; |
| | | $sql = "SELECT * FROM ".$escape.$this->formDef['db_table'].$escape." WHERE ".$sql_where. " AND " . $this->getAuthSQL('r', $this->formDef['db_table']); |
| | | $sql = "SELECT * FROM ?? WHERE ".$sql_where. " AND " . $this->getAuthSQL('r', $this->formDef['db_table']); |
| | | if($sql_offset >= 0 && $sql_limit > 0) $sql .= ' LIMIT ' . $sql_offset . ',' . $sql_limit; |
| | | return $app->db->queryAllRecords($sql); |
| | | return $app->db->queryAllRecords($sql, true, $params); |
| | | } else { |
| | | $this->errorMessage = 'The ID must be either an integer or an array.'; |
| | | return array(); |
| | |
| | | |
| | | function ispconfig_sysuser_add($params, $insert_id){ |
| | | global $conf, $app, $sql1; |
| | | $username = $app->db->quote($params["username"]); |
| | | $password = $app->db->quote($params["password"]); |
| | | $username = $params["username"]; |
| | | $password = $params["password"]; |
| | | if(!isset($params['modules'])) { |
| | | $modules = $conf['interface_modules_enabled']; |
| | | } else { |
| | | $modules = $app->db->quote($params['modules']); |
| | | $modules = $params['modules']; |
| | | } |
| | | if(isset($params['limit_client']) && $params['limit_client'] > 0) { |
| | | $modules .= ',client'; |
| | |
| | | if(!isset($params['startmodule'])) { |
| | | $startmodule = 'dashboard'; |
| | | } else { |
| | | $startmodule = $app->db->quote($params["startmodule"]); |
| | | $startmodule = $params["startmodule"]; |
| | | if(!preg_match('/'.$startmodule.'/', $modules)) { |
| | | $_modules = explode(',', $modules); |
| | | $startmodule=$_modules[0]; |
| | | } |
| | | } |
| | | $usertheme = $app->db->quote($params["usertheme"]); |
| | | $usertheme = $params["usertheme"]; |
| | | $type = 'user'; |
| | | $active = 1; |
| | | $insert_id = $app->functions->intval($insert_id); |
| | | $language = $app->db->quote($params["language"]); |
| | | $groupid = $app->db->datalogInsert('sys_group', "(name,description,client_id) VALUES ('$username','','$insert_id')", 'groupid'); |
| | | $language = $params["language"]; |
| | | $groupid = $app->db->datalogInsert('sys_group', array("name" => $username, "description" => "", "client_id" => $insert_id), 'groupid'); |
| | | $groups = $groupid; |
| | | if(!isset($params['_ispconfig_pw_crypted']) || $params['_ispconfig_pw_crypted'] != 1) $password = $app->auth->crypt_password(stripslashes($password)); |
| | | $sql1 = "INSERT INTO sys_user (username,passwort,modules,startmodule,app_theme,typ,active,language,groups,default_group,client_id) |
| | | VALUES ('$username','$password','$modules','$startmodule','$usertheme','$type','$active','$language',$groups,$groupid,$insert_id)"; |
| | | $app->db->query($sql1); |
| | | VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; |
| | | $app->db->query($sql1, $username,$password,$modules,$startmodule,$usertheme,$type,$active,$language,$groups,$groupid,$insert_id); |
| | | } |
| | | |
| | | function ispconfig_sysuser_update($params, $client_id){ |
| | | global $app; |
| | | $username = $app->db->quote($params["username"]); |
| | | $clear_password = $app->db->quote($params["password"]); |
| | | $username = $params["username"]; |
| | | $clear_password = $params["password"]; |
| | | $client_id = $app->functions->intval($client_id); |
| | | if(!isset($params['_ispconfig_pw_crypted']) || $params['_ispconfig_pw_crypted'] != 1) $password = $app->auth->crypt_password(stripslashes($clear_password)); |
| | | else $password = $clear_password; |
| | | if ($clear_password) $pwstring = ", passwort = '$password'"; else $pwstring ="" ; |
| | | $sql = "UPDATE sys_user set username = '$username' $pwstring WHERE client_id = $client_id"; |
| | | $app->db->query($sql); |
| | | $params = array($username); |
| | | if ($clear_password) { |
| | | $pwstring = ", passwort = ?"; |
| | | $params[] = $password; |
| | | } else { |
| | | $pwstring ="" ; |
| | | } |
| | | $params[] = $client_id; |
| | | $sql = "UPDATE sys_user set username = ? $pwstring WHERE client_id = ?"; |
| | | $app->db->query($sql, true, $params); |
| | | } |
| | | |
| | | function ispconfig_sysuser_delete($client_id){ |
| | | global $app; |
| | | $client_id = $app->functions->intval($client_id); |
| | | $sql = "DELETE FROM sys_user WHERE client_id = $client_id"; |
| | | $app->db->query($sql); |
| | | $sql = "DELETE FROM sys_group WHERE client_id = $client_id"; |
| | | $app->db->query($sql); |
| | | $sql = "DELETE FROM sys_user WHERE client_id = ?"; |
| | | $app->db->query($sql, $client_id); |
| | | $sql = "DELETE FROM sys_group WHERE client_id = ?"; |
| | | $app->db->query($sql, $client_id); |
| | | } |
| | | |
| | | } |
| | |
| | | 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 $table WHERE $sql_where"); |
| | | $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']; |
| | |
| | | $list_name = $this->listDef['name']; |
| | | $settings = $_SESSION['search'][$list_name]; |
| | | unset($settings['page']); |
| | | $data = $app->db->quote(serialize($settings)); |
| | | $data = serialize($settings); |
| | | |
| | | $userid = $_SESSION['s']['user']['userid']; |
| | | $groupid = $_SESSION['s']['user']['default_group']; |
| | |
| | | |
| | | $sql = 'INSERT INTO `searchform` ( ' |
| | | .'`sys_userid` , `sys_groupid` , `sys_perm_user` , `sys_perm_group` , `sys_perm_other` , `module` , `searchform` , `title` , `data` ' |
| | | .')VALUES (' |
| | | ."'$userid', '$groupid', '$sys_perm_user', '$sys_perm_group', '$sys_perm_other', '$module', '$searchform', '$title', '$data')"; |
| | | $app->db->query($sql); |
| | | .')VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)'; |
| | | $app->db->query($sql, $userid, $groupid, $sys_perm_user, $sys_perm_group, $sys_perm_other, $module, $searchform, $title, $data); |
| | | } |
| | | |
| | | public function decode($record) |
| | |
| | | return $record; |
| | | } |
| | | |
| | | /* TODO: check for double quoting mysql value */ |
| | | public function encode($record) |
| | | { |
| | | global $app; |
| | |
| | | function read ($session_id) { |
| | | |
| | | if($this->timeout > 0) { |
| | | $rec = $this->db->queryOneRecord("SELECT * FROM sys_session WHERE session_id = '".$this->db->quote($session_id)."' AND (`permanent` = 'y' OR last_updated >= DATE_SUB(NOW(), INTERVAL " . intval($this->timeout) . " MINUTE))"); |
| | | $rec = $this->db->queryOneRecord("SELECT * FROM sys_session WHERE session_id = ? AND (`permanent` = 'y' OR last_updated >= DATE_SUB(NOW(), INTERVAL ? MINUTE))", $session_id, $this->timeout); |
| | | } else { |
| | | $rec = $this->db->queryOneRecord("SELECT * FROM sys_session WHERE session_id = '".$this->db->quote($session_id)."'"); |
| | | $rec = $this->db->queryOneRecord("SELECT * FROM sys_session WHERE session_id = ?", $session_id); |
| | | } |
| | | |
| | | if (is_array($rec)) { |
| | |
| | | |
| | | // Dont write session_data to DB if session data has not been changed after reading it. |
| | | if(isset($this->session_array['session_data']) && $this->session_array['session_data'] != '' && $this->session_array['session_data'] == $session_data) { |
| | | $session_id = $this->db->quote($session_id); |
| | | $this->db->query("UPDATE sys_session SET last_updated = NOW() WHERE session_id = '$session_id'"); |
| | | $this->db->query("UPDATE sys_session SET last_updated = NOW() WHERE session_id = ?", $session_id); |
| | | return true; |
| | | } |
| | | |
| | | |
| | | if (@$this->session_array['session_id'] == '') { |
| | | $session_id = $this->db->quote($session_id); |
| | | $session_data = $this->db->quote($session_data); |
| | | $sql = "REPLACE INTO sys_session (session_id,date_created,last_updated,session_data,permanent) VALUES ('$session_id',NOW(),NOW(),'$session_data','" . ($this->permanent ? 'y' : 'n') . "')"; |
| | | $this->db->query($sql); |
| | | $sql = "REPLACE INTO sys_session (session_id,date_created,last_updated,session_data,permanent) VALUES (?,NOW(),NOW(),'$session_data',?)"; |
| | | $this->db->query($sql, $session_id, ($this->permanent ? 'y' : 'n')); |
| | | |
| | | } else { |
| | | $session_id = $this->db->quote($session_id); |
| | | $session_data = $this->db->quote($session_data); |
| | | $sql = "UPDATE sys_session SET last_updated = NOW(), session_data = '$session_data'" . ($this->permanent ? ", `permanent` = 'y'" : "") . " WHERE session_id = '$session_id'"; |
| | | $this->db->query($sql); |
| | | $sql = "UPDATE sys_session SET last_updated = NOW(), session_data = ?" . ($this->permanent ? ", `permanent` = 'y'" : "") . " WHERE session_id = ?"; |
| | | $this->db->query($sql, $session_data, $session_id); |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | function destroy ($session_id) { |
| | | |
| | | $session_id = $this->db->quote($session_id); |
| | | $sql = "DELETE FROM sys_session WHERE session_id = '$session_id'"; |
| | | $this->db->query($sql); |
| | | $sql = "DELETE FROM sys_session WHERE session_id = ?"; |
| | | $this->db->query($sql, $session_id); |
| | | |
| | | return true; |
| | | } |
| | | |
| | | function gc ($max_lifetime) { |
| | | |
| | | /*if($this->timeout > 0) { |
| | | $this->db->query("DELETE FROM sys_session WHERE last_updated < DATE_SUB(NOW(), INTERVAL " . intval($this->timeout) . " MINUTE)"); |
| | | } else {*/ |
| | | $sql = "DELETE FROM sys_session WHERE last_updated < DATE_SUB(NOW(), INTERVAL " . intval($max_lifetime) . " SECOND) AND `permanent` != 'y'"; |
| | | $this->db->query($sql); |
| | | $sql = "DELETE FROM sys_session WHERE last_updated < DATE_SUB(NOW(), INTERVAL ? SECOND) AND `permanent` != 'y'"; |
| | | $this->db->query($sql, intval($max_lifetime)); |
| | | |
| | | /* delete very old even if they are permanent */ |
| | | $sql = "DELETE FROM sys_session WHERE last_updated < DATE_SUB(NOW(), INTERVAL 1 YEAR)"; |
| | | $this->db->query($sql); |
| | | //} |
| | | /* delete very old even if they are permanent */ |
| | | $sql = "DELETE FROM sys_session WHERE last_updated < DATE_SUB(NOW(), INTERVAL 1 YEAR)"; |
| | | $this->db->query($sql); |
| | | |
| | | return true; |
| | | |
| | |
| | | global $app; |
| | | |
| | | if($form_page->dataRecord["parent_domain_id"] > 0) { |
| | | $web = $app->db->queryOneRecord("SELECT * FROM web_domain WHERE domain_id = ".$app->functions->intval($form_page->dataRecord["parent_domain_id"])); |
| | | $web = $app->db->queryOneRecord("SELECT * FROM web_domain WHERE domain_id = ?", $form_page->dataRecord["parent_domain_id"]); |
| | | |
| | | //* The Database user shall be owned by the same group then the website |
| | | $sys_groupid = $app->functions->intval($web['sys_groupid']); |
| | | $backup_interval = $app->db->quote($web['backup_interval']); |
| | | $backup_interval = $web['backup_interval']; |
| | | $backup_copies = $app->functions->intval($web['backup_copies']); |
| | | |
| | | $sql = "UPDATE web_database SET sys_groupid = '$sys_groupid', backup_interval = '$backup_interval', backup_copies = '$backup_copies' WHERE database_id = ".$form_page->id; |
| | | $app->db->query($sql); |
| | | $sql = "UPDATE web_database SET sys_groupid = ?, backup_interval = ?, backup_copies = ? WHERE database_id = ?"; |
| | | $app->db->query($sql, $sys_groupid, $backup_interval, $backup_copies, $form_page->id); |
| | | } |
| | | } |
| | | |
| | |
| | | $escape = '`'; |
| | | } |
| | | |
| | | $sql = "SELECT ".$this->formDef['db_table_idx']." FROM ".$escape.$this->formDef['db_table'].$escape." WHERE ".$this->formDef['db_table_idx']." = ".$record_id." AND ".$this->getAuthSQL($perm); |
| | | if($record = $app->db->queryOneRecord($sql)) { |
| | | $sql = "SELECT ?? FROM ?? WHERE ?? = ? AND ".$this->getAuthSQL($perm); |
| | | if($record = $app->db->queryOneRecord($sql, $this->formDef['db_table_idx'], $this->formDef['db_table'], $this->formDef['db_table_idx'], $record_id)) { |
| | | return true; |
| | | } else { |
| | | return false; |
| | |
| | | $escape = '`'; |
| | | } |
| | | |
| | | $sql = "SELECT sys_userid FROM ".$escape.$this->formDef['db_table'].$escape." WHERE ".$this->formDef['db_table_idx']." = ".$primary_id; |
| | | $record = $app->db->queryOneRecord($sql); |
| | | $sql = "SELECT sys_userid FROM ?? WHERE ?? = ?"; |
| | | $record = $app->db->queryOneRecord($sql, $this->formDef['db_table'], $this->formDef['db_table_idx'], $primary_id); |
| | | |
| | | // return true if the readonly flag of the form is set and the current loggedin user is not the owner of the record. |
| | | if(isset($this->formDef['tabs'][$tab]['readonly']) && $this->formDef['tabs'][$tab]['readonly'] == true && $record['sys_userid'] != $_SESSION["s"]["user"]["userid"]) { |
| | |
| | | global $app; |
| | | |
| | | $check_passed = true; |
| | | $limit_name = $app->db->quote($limit_name); |
| | | if($limit_name == '') $app->error('Limit name missing in function checkClientLimit.'); |
| | | |
| | | // Get the limits of the client that is currently logged in |
| | | $client_group_id = $app->functions->intval($_SESSION["s"]["user"]["default_group"]); |
| | | $client = $app->db->queryOneRecord("SELECT $limit_name as number, parent_client_id FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); |
| | | $client = $app->db->queryOneRecord("SELECT ?? as number, parent_client_id FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $limit_name, $client_group_id); |
| | | |
| | | // Check if the user may add another item |
| | | if($client["number"] >= 0) { |
| | | $sql = "SELECT count(".$this->formDef['db_table_idx'].") as number FROM ".$this->formDef['db_table']." WHERE ".$this->getAuthSQL('u'); |
| | | $sql = "SELECT count(??) as number FROM ?? WHERE ".$this->getAuthSQL('u'); |
| | | if($sql_where != '') $sql .= ' and '.$sql_where; |
| | | $tmp = $app->db->queryOneRecord($sql); |
| | | $tmp = $app->db->queryOneRecord($sql, $this->formDef['db_table_idx'], $this->formDef['db_table']); |
| | | if($tmp["number"] >= $client["number"]) $check_passed = false; |
| | | } |
| | | |
| | |
| | | global $app; |
| | | |
| | | $check_passed = true; |
| | | $limit_name = $app->db->quote($limit_name); |
| | | if($limit_name == '') $app->error('Limit name missing in function checkClientLimit.'); |
| | | |
| | | // Get the limits of the client that is currently logged in |
| | | $client_group_id = $app->functions->intval($_SESSION["s"]["user"]["default_group"]); |
| | | $client = $app->db->queryOneRecord("SELECT parent_client_id FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); |
| | | $client = $app->db->queryOneRecord("SELECT parent_client_id FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id); |
| | | |
| | | //* If the client belongs to a reseller, we will check against the reseller Limit too |
| | | if($client['parent_client_id'] != 0) { |
| | | |
| | | //* first we need to know the groups of this reseller |
| | | $tmp = $app->db->queryOneRecord("SELECT userid, groups FROM sys_user WHERE client_id = ".$client['parent_client_id']); |
| | | $tmp = $app->db->queryOneRecord("SELECT userid, groups FROM sys_user WHERE client_id = ?", $client['parent_client_id']); |
| | | $reseller_groups = $tmp["groups"]; |
| | | $reseller_userid = $tmp["userid"]; |
| | | |
| | | // Get the limits of the reseller of the logged in client |
| | | $client_group_id = $_SESSION["s"]["user"]["default_group"]; |
| | | $reseller = $app->db->queryOneRecord("SELECT $limit_name as number FROM client WHERE client_id = ".$client['parent_client_id']); |
| | | $reseller = $app->db->queryOneRecord("SELECT $limit_name as number FROM client WHERE client_id = ?", $client['parent_client_id']); |
| | | |
| | | // Check if the user may add another item |
| | | if($reseller["number"] >= 0) { |
| | | $sql = "SELECT count(".$this->formDef['db_table_idx'].") as number FROM ".$this->formDef['db_table']." WHERE (sys_groupid IN (".$reseller_groups.") or sys_userid = ".$reseller_userid.")"; |
| | | $sql = "SELECT count(??) as number FROM ?? WHERE (sys_groupid IN ? or sys_userid = ?)"; |
| | | if($sql_where != '') $sql .= ' and '.$sql_where; |
| | | $tmp = $app->db->queryOneRecord($sql); |
| | | $tmp = $app->db->queryOneRecord($sql, $this->formDef['db_table_idx'], $this->formDef['db_table'], explode(',', $reseller_groups), $reseller_userid); |
| | | if($tmp["number"] >= $reseller["number"]) $check_passed = false; |
| | | } |
| | | } |
| | |
| | | if ($display_seconds === true) { |
| | | $dselect[] = 'second'; |
| | | } |
| | | |
| | | $tmp_dt = strtr($this->datetimeformat,array('d' => 'dd', 'm' => 'mm', 'Y' => 'yyyy', 'y' => 'yy', 'H' => 'hh', 'h' => 'HH', 'i' => 'ii')) . ($display_seconds ? ':ss' : ''); |
| | | |
| | | $out = ''; |
| | | |
| | | |
| | | return '<input type="text" class="form-control" name="' . $form_element . '" value="' . ($_showdate ? date($this->datetimeformat . ($display_seconds ? ':s' : ''), $_datetime) : '') . '" data-input-element="datetime" data-date-format="' . $tmp_dt . '" />'; |
| | | /* |
| | | foreach ($dselect as $dt_element) |
| | | { |
| | | $dt_options = array(); |
| | |
| | | $selected_value = (int)floor(date('s', $_datetime)); |
| | | break; |
| | | } |
| | | |
| | | |
| | | $out .= "<select name=\"".$form_element."[$dt_element]\" id=\"".$form_element."_$dt_element\" class=\"selectInput\" style=\"width: auto; float: none;\">"; |
| | | if (!$_showdate) { |
| | | $out .= "<option value=\"-\" selected=\"selected\">--</option>" . PHP_EOL; |
| | |
| | | $out .= '</select>' . str_repeat(' ', $dt_space); |
| | | } |
| | | |
| | | return $out; |
| | | return $out;*/ |
| | | } |
| | | |
| | | } |
| | |
| | | // check if the client is locked - he may not change anything, then. |
| | | if(!$app->auth->is_admin()) { |
| | | $client_group_id = $app->functions->intval($_SESSION["s"]["user"]["default_group"]); |
| | | $client = $app->db->queryOneRecord("SELECT client.locked FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ".$app->functions->intval($client_group_id)); |
| | | $client = $app->db->queryOneRecord("SELECT client.locked FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id); |
| | | if(is_array($client) && $client['locked'] == 'y') { |
| | | $app->tform->errorMessage .= $app->lng("client_you_are_locked")."<br />"; |
| | | } |
| | |
| | | if($app->tform->checkPerm($this->id, 'd') == false) $app->error($app->lng('error_no_delete_permission')); |
| | | } |
| | | |
| | | //$this->dataRecord = $app->db->queryOneRecord("SELECT * FROM ".$liste["table"]." WHERE ".$liste["table_idx"]." = ".$this->id); |
| | | $this->dataRecord = $app->tform->getDataRecord($this->id); |
| | | |
| | | $app->plugin->raiseEvent($_SESSION['s']['module']['name'].':'.$app->tform->formDef['name'].':'.'on_check_delete', $this); |
| | |
| | | $app->tform->datalogSave('DELETE', $this->id, $this->dataRecord, array()); |
| | | } |
| | | |
| | | $app->db->query("DELETE FROM ".$app->tform->formDef['db_table']." WHERE ".$app->tform->formDef['db_table_idx']." = ".$this->id." LIMIT 1"); |
| | | $app->db->query("DELETE FROM ?? WHERE ?? = ? LIMIT 1", $app->tform->formDef['db_table'], $app->tform->formDef['db_table_idx'], $this->id); |
| | | |
| | | |
| | | // loading plugins |
| | |
| | | $app->tpl->setInclude("content_tpl", $app->tform->formDef['template_print']); |
| | | |
| | | if($app->tform->formDef['auth'] == 'no') { |
| | | $sql = "SELECT * FROM ".$app->tform->formDef['db_table']." WHERE ".$app->tform->formDef['db_table_idx']." = ".$this->id; |
| | | $sql = "SELECT * FROM ?? WHERE ?? = ?"; |
| | | } else { |
| | | $sql = "SELECT * FROM ".$app->tform->formDef['db_table']." WHERE ".$app->tform->formDef['db_table_idx']." = ".$this->id." AND ".$app->tform->getAuthSQL('r'); |
| | | $sql = "SELECT * FROM ?? WHERE ?? = ? AND ".$app->tform->getAuthSQL('r'); |
| | | } |
| | | if(!$record = $app->db->queryOneRecord($sql)) $app->error($app->lng('error_no_view_permission')); |
| | | if(!$record = $app->db->queryOneRecord($sql, $app->tform->formDef['db_table'], $app->tform->formDef['db_table_idx'], $this->id)) $app->error($app->lng('error_no_view_permission')); |
| | | |
| | | $record["datum"] = date("d.m.Y"); |
| | | |
| | |
| | | $app->tpl->setInclude("content_tpl", $app->tform->formDef['template_mailsend']); |
| | | $app->tpl->setVar('show_mail', 1); |
| | | if($app->tform->formDef['auth'] == 'no') { |
| | | $sql = "SELECT * FROM ".$app->tform->formDef['db_table']." WHERE ".$app->tform->formDef['db_table_idx']." = ".$this->id; |
| | | $sql = "SELECT * FROM ?? WHERE ?? = ?"; |
| | | } else { |
| | | $sql = "SELECT * FROM ".$app->tform->formDef['db_table']." WHERE ".$app->tform->formDef['db_table_idx']." = ".$this->id." AND ".$app->tform->getAuthSQL('r'); |
| | | $sql = "SELECT * FROM ?? WHERE ?? = ? AND ".$app->tform->getAuthSQL('r'); |
| | | } |
| | | if(!$record = $app->db->queryOneRecord($sql)) $app->error($app->lng('error_no_view_permission')); |
| | | if(!$record = $app->db->queryOneRecord($sql, $app->tform->formDef['db_table'], $app->tform->formDef['db_table_idx'], $this->id)) $app->error($app->lng('error_no_view_permission')); |
| | | |
| | | $record["datum"] = date("d.m.Y"); |
| | | $record["mailmessage"] = $_POST["message"]; |
| | |
| | | |
| | | |
| | | if($app->tform->formDef['auth'] == 'no') { |
| | | $sql = "SELECT * FROM ".$app->tform->formDef['db_table']." WHERE ".$app->tform->formDef['db_table_idx']." = ".$this->id; |
| | | $sql = "SELECT * FROM ?? WHERE ?? = ?"; |
| | | } else { |
| | | $sql = "SELECT * FROM ".$app->tform->formDef['db_table']." WHERE ".$app->tform->formDef['db_table_idx']." = ".$this->id." AND ".$app->tform->getAuthSQL('r'); |
| | | $sql = "SELECT * FROM ?? WHERE ?? = ? AND ".$app->tform->getAuthSQL('r'); |
| | | } |
| | | if(!$record = $app->db->queryOneRecord($sql)) $app->error($app->lng('error_no_view_permission')); |
| | | if(!$record = $app->db->queryOneRecord($sql, $app->tform->formDef['db_table'], $app->tform->formDef['db_table_idx'], $this->id)) $app->error($app->lng('error_no_view_permission')); |
| | | |
| | | $record["datum"] = date("d.m.Y"); |
| | | |
| | |
| | | // bestehenden Datensatz anzeigen |
| | | if($app->tform->errorMessage == '') { |
| | | if($app->tform->formDef['auth'] == 'yes' && $_SESSION["s"]["user"]["typ"] != 'admin') { |
| | | $sql = "SELECT * FROM ".$app->tform->formDef['db_table']." WHERE ".$app->tform->formDef['db_table_idx']." = ".$this->id." AND ".$app->tform->getAuthSQL('r'); |
| | | $sql = "SELECT * FROM ?? WHERE ?? = ? AND ".$app->tform->getAuthSQL('r'); |
| | | } else { |
| | | $sql = "SELECT * FROM ".$app->tform->formDef['db_table']." WHERE ".$app->tform->formDef['db_table_idx']." = ".$this->id; |
| | | $sql = "SELECT * FROM ?? WHERE ?? = ?"; |
| | | } |
| | | if(!$record = $app->db->queryOneRecord($sql)) $app->error($app->lng('error_no_view_permission')); |
| | | if(!$record = $app->db->queryOneRecord($sql, $app->tform->formDef['db_table'], $app->tform->formDef['db_table_idx'], $this->id)) $app->error($app->lng('error_no_view_permission')); |
| | | } else { |
| | | // $record = $app->tform->encode($_POST,$this->active_tab); |
| | | $record = $app->tform->encode($this->dataRecord, $this->active_tab, false); |
| | |
| | | var $errorMessage = ''; |
| | | |
| | | var $dateformat = "d.m.Y"; |
| | | var $datetimeformat = 'd.m.Y H:i'; |
| | | var $formDef = array(); |
| | | var $wordbook; |
| | | var $module; |
| | |
| | | $this->wordbook = $wb; |
| | | |
| | | $this->dateformat = $app->lng('conf_format_dateshort'); |
| | | $this->datetimeformat = $app->lng('conf_format_datetime'); |
| | | |
| | | return true; |
| | | } |
| | |
| | | return $values; |
| | | } else { |
| | | $client_group_id = $_SESSION["s"]["user"]["default_group"]; |
| | | $client = $app->db->queryOneRecord("SELECT ".$limit_parts[1]." as lm FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); |
| | | $client = $app->db->queryOneRecord("SELECT ".$limit_parts[1]." as lm FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id); |
| | | $allowed = explode(',', $client['lm']); |
| | | } |
| | | } |
| | |
| | | } else { |
| | | //* Get the limits of the client that is currently logged in |
| | | $client_group_id = $_SESSION["s"]["user"]["default_group"]; |
| | | $client = $app->db->queryOneRecord("SELECT parent_client_id FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); |
| | | $client = $app->db->queryOneRecord("SELECT parent_client_id FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id); |
| | | //echo "SELECT parent_client_id FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"; |
| | | //* If the client belongs to a reseller, we will check against the reseller Limit too |
| | | if($client['parent_client_id'] != 0) { |
| | | |
| | | //* first we need to know the groups of this reseller |
| | | $tmp = $app->db->queryOneRecord("SELECT userid, groups FROM sys_user WHERE client_id = ".$client['parent_client_id']); |
| | | $tmp = $app->db->queryOneRecord("SELECT userid, groups FROM sys_user WHERE client_id = ?", $client['parent_client_id']); |
| | | $reseller_groups = $tmp["groups"]; |
| | | $reseller_userid = $tmp["userid"]; |
| | | |
| | | // Get the limits of the reseller of the logged in client |
| | | $client_group_id = $_SESSION["s"]["user"]["default_group"]; |
| | | $reseller = $app->db->queryOneRecord("SELECT ".$limit_parts[1]." as lm FROM client WHERE client_id = ".$client['parent_client_id']); |
| | | $reseller = $app->db->queryOneRecord("SELECT ".$limit_parts[1]." as lm FROM client WHERE client_id = ?", $client['parent_client_id']); |
| | | $allowed = explode(',', $reseller['lm']); |
| | | } else { |
| | | return $values; |
| | |
| | | if(!is_array($this->formDef)) $app->error("No form definition found."); |
| | | if(!is_array($this->formDef['tabs'][$tab])) $app->error("The tab is empty or does not exist (TAB: $tab)."); |
| | | |
| | | /* CSRF PROTECTION */ |
| | | // generate csrf protection id and key |
| | | $csrf_token = $app->auth->csrf_token_get($this->formDef['name']); |
| | | $_csrf_id = $csrf_token['csrf_id']; |
| | | $_csrf_value = $csrf_token['csrf_key']; |
| | | |
| | | $this->formDef['tabs'][$tab]['fields']['_csrf_id'] = array( |
| | | 'datatype' => 'VARCHAR', |
| | | 'formtype' => 'TEXT', |
| | | 'default' => $_csrf_id, |
| | | 'value' => $_csrf_id |
| | | ); |
| | | $this->formDef['tabs'][$tab]['fields']['_csrf_key'] = array( |
| | | 'datatype' => 'VARCHAR', |
| | | 'formtype' => 'TEXT', |
| | | 'default' => $_csrf_value, |
| | | 'value' => $_csrf_value |
| | | ); |
| | | $record['_csrf_id'] = $_csrf_id; |
| | | $record['_csrf_key'] = $_csrf_value; |
| | | /* CSRF PROTECTION */ |
| | | |
| | | $new_record = array(); |
| | | if($action == 'EDIT') { |
| | | $record = $this->decode($record, $tab); |
| | |
| | | if(is_array($field['value'])) { |
| | | foreach($field['value'] as $k => $v) { |
| | | $selected = ($k == $val)?' SELECTED':''; |
| | | if(!empty($this->wordbook[$v])) |
| | | if(isset($this->wordbook[$v])) |
| | | $v = $this->wordbook[$v]; |
| | | $out .= "<option value='$k'$selected>".$this->lng($v)."</option>\r\n"; |
| | | } |
| | |
| | | */ |
| | | protected function _encode($record, $tab, $dbencode = true, $api = false) { |
| | | global $app; |
| | | if($api == true) $fields = &$this->formDef['fields']; |
| | | else $fields = &$this->formDef['tabs'][$tab]['fields']; |
| | | if($api == true) { |
| | | $fields = &$this->formDef['fields']; |
| | | } else { |
| | | $fields = &$this->formDef['tabs'][$tab]['fields']; |
| | | /* CSRF PROTECTION */ |
| | | if(isset($_POST) && is_array($_POST)) { |
| | | $_csrf_valid = false; |
| | | if(isset($_POST['_csrf_id']) && isset($_POST['_csrf_key'])) { |
| | | $_csrf_id = trim($_POST['_csrf_id']); |
| | | $_csrf_key = trim($_POST['_csrf_key']); |
| | | if(isset($_SESSION['_csrf']) && isset($_SESSION['_csrf'][$_csrf_id]) && isset($_SESSION['_csrf_timeout']) && isset($_SESSION['_csrf_timeout'][$_csrf_id])) { |
| | | if($_SESSION['_csrf'][$_csrf_id] === $_csrf_key && $_SESSION['_csrf_timeout'] >= time()) $_csrf_valid = true; |
| | | } |
| | | } |
| | | if($_csrf_valid !== true) { |
| | | $app->log('CSRF attempt blocked. Referer: ' . (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : 'unknown'), LOGLEVEL_WARN); |
| | | $errmsg = 'err_csrf_attempt_blocked'; |
| | | $this->errorMessage .= ($api == true ? $errmsg : $this->wordbook[$errmsg]."<br />") . "\r\n"; |
| | | unset($_POST); |
| | | unset($record); |
| | | } |
| | | |
| | | if(isset($_SESSION['_csrf_timeout']) && is_array($_SESSION['_csrf_timeout'])) { |
| | | $to_unset = array(); |
| | | foreach($_SESSION['_csrf_timeout'] as $_csrf_id => $timeout) { |
| | | if($timeout < time()) $to_unset[] = $_csrf_id; |
| | | } |
| | | foreach($to_unset as $_csrf_id) { |
| | | $_SESSION['_csrf'][$_csrf_id] = null; |
| | | $_SESSION['_csrf_timeout'][$_csrf_id] = null; |
| | | unset($_SESSION['_csrf'][$_csrf_id]); |
| | | unset($_SESSION['_csrf_timeout'][$_csrf_id]); |
| | | } |
| | | unset($to_unset); |
| | | } |
| | | } |
| | | /* CSRF PROTECTION */ |
| | | } |
| | | |
| | | $new_record = array(); |
| | | if(is_array($record)) { |
| | | foreach($fields as $key => $field) { |
| | | |
| | |
| | | if($record[$key] != '' && $record[$key] != '0000-00-00') { |
| | | if(function_exists('date_parse_from_format')) { |
| | | $date_parts = date_parse_from_format($this->dateformat, $record[$key]); |
| | | //list($tag,$monat,$jahr) = explode('.',$record[$key]); |
| | | $new_record[$key] = $date_parts['year'].'-'.$date_parts['month'].'-'.$date_parts['day']; |
| | | //$tmp = strptime($record[$key],$this->dateformat); |
| | | //$new_record[$key] = ($tmp['tm_year']+1900).'-'.($tmp['tm_mon']+1).'-'.$tmp['tm_mday']; |
| | | $new_record[$key] = $date_parts['year'].'-'.str_pad($date_parts['month'], 2, "0", STR_PAD_LEFT).'-'.str_pad($date_parts['day'], 2, "0", STR_PAD_LEFT); |
| | | } else { |
| | | //$tmp = strptime($record[$key],$this->dateformat); |
| | | //$new_record[$key] = ($tmp['tm_year']+1900).'-'.($tmp['tm_mon']+1).'-'.$tmp['tm_mday']; |
| | | $tmp = strtotime($record[$key]); |
| | | $new_record[$key] = date('Y-m-d', $tmp); |
| | | } |
| | |
| | | break; |
| | | case 'INTEGER': |
| | | $new_record[$key] = (isset($record[$key]))?$app->functions->intval($record[$key]):0; |
| | | //if($new_record[$key] != $record[$key]) $new_record[$key] = $field['default']; |
| | | //if($key == 'refresh') die($record[$key]); |
| | | break; |
| | | case 'DOUBLE': |
| | | $new_record[$key] = $record[$key]; |
| | |
| | | break; |
| | | |
| | | case 'DATETIME': |
| | | if (is_array($record[$key])) |
| | | /*if (is_array($record[$key])) |
| | | { |
| | | $filtered_values = array_map(create_function('$item', 'return (int)$item;'), $record[$key]); |
| | | extract($filtered_values, EXTR_PREFIX_ALL, '_dt'); |
| | |
| | | if ($_dt_day != 0 && $_dt_month != 0 && $_dt_year != 0) { |
| | | $new_record[$key] = date( 'Y-m-d H:i:s', mktime($_dt_hour, $_dt_minute, $_dt_second, $_dt_month, $_dt_day, $_dt_year) ); |
| | | } |
| | | } |
| | | } else {*/ |
| | | if($record[$key] != '' && $record[$key] != '0000-00-00 00:00:00') { |
| | | $tmp = strtotime($record[$key]); |
| | | $new_record[$key] = date($this->datetimeformat, $tmp); |
| | | } else { |
| | | $new_record[$key] = '0000-00-00 00:00:00'; |
| | | } |
| | | /*}*/ |
| | | break; |
| | | } |
| | | |
| | |
| | | case 'IDNTOUTF8': |
| | | $returnval = $app->functions->idn_decode($returnval); |
| | | break; |
| | | case 'TRIM': |
| | | $returnval = trim($returnval); |
| | | break; |
| | | default: |
| | | $this->errorMessage .= "Unknown Filter: ".$filter['type']; |
| | | break; |
| | |
| | | if($validator['allowempty'] != 'y') $validator['allowempty'] = 'n'; |
| | | if($validator['allowempty'] == 'n' || ($validator['allowempty'] == 'y' && $field_value != '')){ |
| | | if($this->action == 'NEW') { |
| | | $num_rec = $app->db->queryOneRecord("SELECT count(*) as number FROM ".$escape.$this->formDef['db_table'].$escape. " WHERE $field_name = '".$app->db->quote($field_value)."'"); |
| | | $num_rec = $app->db->queryOneRecord("SELECT count(*) as number FROM ?? WHERE ?? = ?", $this->formDef['db_table'], $field_name, $field_value); |
| | | if($num_rec["number"] > 0) { |
| | | $errmsg = $validator['errmsg']; |
| | | if(isset($this->wordbook[$errmsg])) { |
| | |
| | | } |
| | | } |
| | | } else { |
| | | $num_rec = $app->db->queryOneRecord("SELECT count(*) as number FROM ".$escape.$this->formDef['db_table'].$escape. " WHERE $field_name = '".$app->db->quote($field_value)."' AND ".$this->formDef['db_table_idx']." != ".$this->primary_id); |
| | | $num_rec = $app->db->queryOneRecord("SELECT count(*) as number FROM ?? WHERE ?? = ? AND ?? != ?", $this->formDef['db_table'], $field_name, $field_value, $this->formDef['db_table_idx'], $this->primary_id); |
| | | if($num_rec["number"] > 0) { |
| | | $errmsg = $validator['errmsg']; |
| | | if(isset($this->wordbook[$errmsg])) { |
| | |
| | | } |
| | | break; |
| | | case 'NOTEMPTY': |
| | | if(empty($field_value)) { |
| | | if(!isset($field_value) || $field_value === '') { |
| | | $errmsg = $validator['errmsg']; |
| | | if(isset($this->wordbook[$errmsg])) { |
| | | $this->errorMessage .= $this->wordbook[$errmsg]."<br />\r\n"; |
| | |
| | | * @param primary_id |
| | | * @return record |
| | | */ |
| | | /* TODO: check for double quoting */ |
| | | protected function _getSQL($record, $tab, $action = 'INSERT', $primary_id = 0, $sql_ext_where = '', $api = false) { |
| | | |
| | | global $app; |
| | |
| | | $record[$key] = $app->auth->crypt_password(stripslashes($record[$key])); |
| | | $sql_insert_val .= "'".$app->db->quote($record[$key])."', "; |
| | | } elseif (isset($field['encryption']) && $field['encryption'] == 'MYSQL') { |
| | | $tmp = $app->db->queryOneRecord("SELECT PASSWORD('".$app->db->quote(stripslashes($record[$key]))."') as `crypted`"); |
| | | $tmp = $app->db->queryOneRecord("SELECT PASSWORD(?) as `crypted`", stripslashes($record[$key])); |
| | | $record[$key] = $tmp['crypted']; |
| | | $sql_insert_val .= "'".$app->db->quote($record[$key])."', "; |
| | | } else { |
| | |
| | | $record[$key] = $app->auth->crypt_password(stripslashes($record[$key])); |
| | | $sql_update .= "`$key` = '".$app->db->quote($record[$key])."', "; |
| | | } elseif (isset($field['encryption']) && $field['encryption'] == 'MYSQL') { |
| | | $tmp = $app->db->queryOneRecord("SELECT PASSWORD('".$app->db->quote(stripslashes($record[$key]))."') as `crypted`"); |
| | | $tmp = $app->db->queryOneRecord("SELECT PASSWORD(?) as `crypted`", stripslashes($record[$key])); |
| | | $record[$key] = $tmp['crypted']; |
| | | $sql_update .= "`$key` = '".$app->db->quote($record[$key])."', "; |
| | | } else { |
| | |
| | | function getDataRecord($primary_id) { |
| | | global $app; |
| | | $escape = '`'; |
| | | $sql = "SELECT * FROM ".$escape.$this->formDef['db_table'].$escape." WHERE ".$this->formDef['db_table_idx']." = ".$primary_id." AND ".$this->getAuthSQL('r', $this->formDef['db_table']); |
| | | return $app->db->queryOneRecord($sql); |
| | | $sql = "SELECT * FROM ?? WHERE ?? = ? AND ".$this->getAuthSQL('r', $this->formDef['db_table']); |
| | | return $app->db->queryOneRecord($sql, $this->formDef['db_table'], $this->formDef['db_table_idx'], $primary_id); |
| | | } |
| | | |
| | | |
| | |
| | | global $app; |
| | | |
| | | /* fetch the Data from the DB */ |
| | | $record = $app->db->queryOneRecord("SELECT data, state FROM monitor_data WHERE type = 'server_load' and server_id = " . $_SESSION['monitor']['server_id'] . " order by created desc"); |
| | | $record = $app->db->queryOneRecord("SELECT data, state FROM monitor_data WHERE type = 'server_load' AND server_id = ? ORDER BY created DESC", $_SESSION['monitor']['server_id']); |
| | | |
| | | if(isset($record['data'])) { |
| | | $data = unserialize($record['data']); |
| | |
| | | global $app; |
| | | |
| | | /* fetch the Data from the DB */ |
| | | $record = $app->db->queryOneRecord("SELECT data, state FROM monitor_data WHERE type = 'disk_usage' and server_id = " . $_SESSION['monitor']['server_id'] . " order by created desc"); |
| | | $record = $app->db->queryOneRecord("SELECT data, state FROM monitor_data WHERE type = 'disk_usage' AND server_id = ? ORDER BY created DESC", $_SESSION['monitor']['server_id']); |
| | | |
| | | if(isset($record['data'])) { |
| | | $data = unserialize($record['data']); |
| | |
| | | function showDatabaseSize () { |
| | | global $app; |
| | | /* fetch the Data from the DB */ |
| | | $record = $app->db->queryOneRecord("SELECT data, state FROM monitor_data WHERE type = 'database_size' and server_id = " . $_SESSION['monitor']['server_id'] . " order by created desc"); |
| | | $record = $app->db->queryOneRecord("SELECT data, state FROM monitor_data WHERE type = 'database_size' AND server_id = ? ORDER BY created DESC", $_SESSION['monitor']['server_id']); |
| | | if(isset($record['data'])) { |
| | | $data = unserialize($record['data']); |
| | | //* format the data |
| | |
| | | if ($line['size'] > 0) $line['size'] = $app->functions->formatBytes($line['size']); |
| | | |
| | | //* get the client |
| | | $line['client']=$app->db->queryOneRecord("SELECT client.username FROM web_database, sys_group, client WHERE web_database.sys_groupid = sys_group.groupid AND sys_group.client_id = client.client_id AND web_database.database_name='".$line['database_name']."'")['username']; |
| | | $tmp = $app->db->queryOneRecord("SELECT client.username FROM web_database, sys_group, client WHERE web_database.sys_groupid = sys_group.groupid AND sys_group.client_id = client.client_id AND web_database.database_name=?", $line['database_name']); |
| | | $line['client'] = $tmp['username']; |
| | | |
| | | //* get the domain |
| | | $line['domain']=$app->db->queryOneRecord("SELECT domain FROM web_domain WHERE domain_id=(SELECT parent_domain_id FROM web_database WHERE database_name='".$line['database_name']."')")['domain']; |
| | | $tmp = $app->db->queryOneRecord("SELECT domain FROM web_domain WHERE domain_id=(SELECT parent_domain_id FROM web_database WHERE database_name=?", $line['database_name']); |
| | | $line['domain'] = $tmp['domain']; |
| | | |
| | | //* remove the sys_groupid from output |
| | | unset($line['sys_groupid']); |
| | |
| | | global $app; |
| | | |
| | | /* fetch the Data from the DB */ |
| | | $record = $app->db->queryOneRecord("SELECT data, state FROM monitor_data WHERE type = 'mem_usage' and server_id = " . $_SESSION['monitor']['server_id'] . " order by created desc"); |
| | | $record = $app->db->queryOneRecord("SELECT data, state FROM monitor_data WHERE type = 'mem_usage' and server_id = ? ORDER BY created DESC", $_SESSION['monitor']['server_id']); |
| | | |
| | | if(isset($record['data'])) { |
| | | $data = unserialize($record['data']); |
| | |
| | | global $app; |
| | | |
| | | /* fetch the Data from the DB */ |
| | | $record = $app->db->queryOneRecord("SELECT data, state FROM monitor_data WHERE type = 'cpu_info' and server_id = " . $_SESSION['monitor']['server_id'] . " order by created desc"); |
| | | $record = $app->db->queryOneRecord("SELECT data, state FROM monitor_data WHERE type = 'cpu_info' and server_id = ? ORDER BY created DESC", $_SESSION['monitor']['server_id']); |
| | | |
| | | if(isset($record['data'])) { |
| | | $data = unserialize($record['data']); |
| | |
| | | global $app; |
| | | |
| | | /* fetch the Data from the DB */ |
| | | $record = $app->db->queryOneRecord("SELECT data, state FROM monitor_data WHERE type = 'services' and server_id = " . $_SESSION['monitor']['server_id'] . " order by created desc"); |
| | | $record = $app->db->queryOneRecord("SELECT data, state FROM monitor_data WHERE type = 'services' and server_id = ? ORDER BY created DESC", $_SESSION['monitor']['server_id']); |
| | | |
| | | if(isset($record['data'])) { |
| | | $data = unserialize($record['data']); |
| | |
| | | global $app; |
| | | |
| | | /* fetch the Data from the DB */ |
| | | $record = $app->db->queryOneRecord("SELECT data, state FROM monitor_data WHERE type = 'system_update' and server_id = " . $_SESSION['monitor']['server_id'] . " order by created desc"); |
| | | $record = $app->db->queryOneRecord("SELECT data, state FROM monitor_data WHERE type = 'system_update' and server_id = ? ORDER BY created DESC", $_SESSION['monitor']['server_id']); |
| | | |
| | | if(isset($record['data'])) { |
| | | $html = |
| | |
| | | global $app; |
| | | |
| | | /* fetch the Data from the DB */ |
| | | $record = $app->db->queryOneRecord("SELECT data, state FROM monitor_data WHERE type = 'openvz_beancounter' and server_id = " . $_SESSION['monitor']['server_id'] . " order by created desc"); |
| | | $record = $app->db->queryOneRecord("SELECT data, state FROM monitor_data WHERE type = 'openvz_beancounter' and server_id = ? ORDER BY created DESC", $_SESSION['monitor']['server_id']); |
| | | |
| | | if(isset($record['data'])) { |
| | | $html = |
| | |
| | | global $app; |
| | | |
| | | /* fetch the Data from the DB */ |
| | | $record = $app->db->queryOneRecord("SELECT data, state FROM monitor_data WHERE type = 'raid_state' and server_id = " . $_SESSION['monitor']['server_id'] . " order by created desc"); |
| | | $record = $app->db->queryOneRecord("SELECT data, state FROM monitor_data WHERE type = 'raid_state' and server_id = ? ORDER BY created DESC", $_SESSION['monitor']['server_id']); |
| | | |
| | | if(isset($record['data'])) { |
| | | $html = |
| | |
| | | global $app; |
| | | |
| | | /* fetch the Data from the DB */ |
| | | $record = $app->db->queryOneRecord("SELECT data, state FROM monitor_data WHERE type = 'rkhunter' and server_id = " . $_SESSION['monitor']['server_id'] . " order by created desc"); |
| | | $record = $app->db->queryOneRecord("SELECT data, state FROM monitor_data WHERE type = 'rkhunter' and server_id = ? ORDER BY created DESC", $_SESSION['monitor']['server_id']); |
| | | |
| | | if(isset($record['data'])) { |
| | | $html = |
| | |
| | | global $app; |
| | | |
| | | /* fetch the Data from the DB */ |
| | | $record = $app->db->queryOneRecord("SELECT data, state FROM monitor_data WHERE type = 'log_fail2ban' and server_id = " . $_SESSION['monitor']['server_id'] . " order by created desc"); |
| | | $record = $app->db->queryOneRecord("SELECT data, state FROM monitor_data WHERE type = 'log_fail2ban' and server_id = ? ORDER BY created DESC", $_SESSION['monitor']['server_id']); |
| | | |
| | | if(isset($record['data'])) { |
| | | $html = |
| | |
| | | $data = unserialize($record['data']); |
| | | if ($data == '') { |
| | | $html .= '<p>'. |
| | | 'fail2ban is not installed at this server.<br />' . |
| | | 'fail2ban is not installed on this server.<br />' . |
| | | 'See more (for debian) <a href="http://www.howtoforge.com/fail2ban_debian_etch" target="htf">here...</a>'. |
| | | '</p>'; |
| | | } |
| | |
| | | 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 = " . $_SESSION['monitor']['server_id'] . " order by created desc"); |
| | | $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 = |
| | |
| | | $data = unserialize($record['data']); |
| | | if ($data == '') { |
| | | $html .= '<p>'. |
| | | 'MongoDB is not installed at this server.<br />' . |
| | | 'See more (for debian) <a href="http://www.howtoforge.com/fail2ban_debian_etch" target="htf">here...</a>'. |
| | | 'MongoDB is not installed on this server.<br />' . |
| | | '</p>'; |
| | | } |
| | | else { |
| | |
| | | |
| | | function showIPTables() { |
| | | global $app; |
| | | $record = $app->db->queryOneRecord("SELECT data, state FROM monitor_data WHERE type = 'iptables_rules' and server_id = " . $_SESSION['monitor']['server_id'] . " order by created desc"); |
| | | $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']); |
| | | if(isset($record['data'])) { |
| | | $html = |
| | | '<div class="systemmonitor-state state-'.$record['state'].'"> |
| | |
| | | global $app; |
| | | |
| | | /* fetch the Data from the DB */ |
| | | $record = $app->db->queryOneRecord("SELECT data, state FROM monitor_data WHERE type = 'mailq' and server_id = " . $_SESSION['monitor']['server_id'] . " order by created desc"); |
| | | $record = $app->db->queryOneRecord("SELECT data, state FROM monitor_data WHERE type = 'mailq' and server_id = ? ORDER BY created DESC", $_SESSION['monitor']['server_id']); |
| | | |
| | | if(isset($record['data'])) { |
| | | $data = unserialize($record['data']); |
| | |
| | | global $app; |
| | | |
| | | /* fetch the Data from the DB */ |
| | | $record = $app->db->queryOneRecord("SELECT created FROM monitor_data WHERE type = '" . $type . "' and server_id = " . $_SESSION['monitor']['server_id'] . " order by created desc"); |
| | | $record = $app->db->queryOneRecord("SELECT created FROM monitor_data WHERE type = ? and server_id = ? ORDER BY created DESC", $type, $_SESSION['monitor']['server_id']); |
| | | |
| | | /* TODO: datetimeformat should be set somewhat other way */ |
| | | $dateTimeFormat = $app->lng("monitor_settings_datetimeformat_txt"); |
| | |
| | | if(isset($dataRecord['client_group_id'])) { |
| | | $client_group_id = $dataRecord['client_group_id']; |
| | | } elseif (isset($dataRecord['parent_domain_id'])) { |
| | | $tmp = $app->db->queryOneRecord("SELECT sys_groupid FROM web_domain WHERE domain_id = " . $dataRecord['parent_domain_id']); |
| | | $tmp = $app->db->queryOneRecord("SELECT sys_groupid FROM web_domain WHERE domain_id = ?", $dataRecord['parent_domain_id']); |
| | | $client_group_id = $tmp['sys_groupid']; |
| | | } elseif(isset($dataRecord['sys_groupid'])) { |
| | | $client_group_id = $dataRecord['sys_groupid']; |
| | |
| | | } |
| | | } |
| | | |
| | | $tmp = $app->db->queryOneRecord("SELECT name FROM sys_group WHERE groupid = " . $app->functions->intval($client_group_id)); |
| | | $tmp = $app->db->queryOneRecord("SELECT name FROM sys_group WHERE groupid = ?", $client_group_id); |
| | | $clientName = $tmp['name']; |
| | | if ($clientName == "") $clientName = 'default'; |
| | | $clientName = $this->convertClientName($clientName); |
| | |
| | | if(isset($dataRecord['client_group_id'])) { |
| | | $client_group_id = $dataRecord['client_group_id']; |
| | | } elseif (isset($dataRecord['parent_domain_id']) && $dataRecord['parent_domain_id'] != 0) { |
| | | $tmp = $app->db->queryOneRecord("SELECT sys_groupid FROM web_domain WHERE domain_id = " . $dataRecord['parent_domain_id']); |
| | | $tmp = $app->db->queryOneRecord("SELECT sys_groupid FROM web_domain WHERE domain_id = ?", $dataRecord['parent_domain_id']); |
| | | $client_group_id = $tmp['sys_groupid']; |
| | | } elseif(isset($dataRecord['sys_groupid'])) { |
| | | $client_group_id = $dataRecord['sys_groupid']; |
| | |
| | | return '[CLIENTID]'; |
| | | } |
| | | } |
| | | $tmp = $app->db->queryOneRecord("SELECT client_id FROM sys_group WHERE groupid = " . $app->functions->intval($client_group_id)); |
| | | $tmp = $app->db->queryOneRecord("SELECT client_id FROM sys_group WHERE groupid = ?", $client_group_id); |
| | | $clientID = $tmp['client_id']; |
| | | if ($clientID == '') $clientID = '0'; |
| | | return $clientID; |
| | |
| | | return $res; |
| | | } |
| | | |
| | | /* TODO: rewrite SQL */ |
| | | function getDomainModuleDomains($not_used_in_table = null, $selected_domain = null) { |
| | | global $app; |
| | | |
| | |
| | | return $app->db->queryAllRecords($sql, $not_used_in_table, $selected_domain); |
| | | } |
| | | |
| | | /* TODO: rewrite SQL */ |
| | | function checkDomainModuleDomain($domain_id) { |
| | | global $app; |
| | | |
| | |
| | | if(!$domain || !$domain['domain_id']) return false; |
| | | return $domain['domain']; |
| | | } |
| | | |
| | | |
| | | /* TODO: rewrite SQL */ |
| | | function getClientIdForDomain($domain_id) { |
| | | global $app; |
| | | |
| | |
| | | } |
| | | |
| | | if($client_id == 0) { |
| | | $num_rec = $app->db->queryOneRecord("SELECT count(*) as number FROM sys_user WHERE username = '".$app->db->quote($field_value)."'"); |
| | | $num_rec = $app->db->queryOneRecord("SELECT count(*) as number FROM sys_user WHERE username = ?", $field_value); |
| | | if($num_rec["number"] > 0) { |
| | | $errmsg = $validator['errmsg']; |
| | | if(isset($app->tform->wordbook[$errmsg])) { |
| | |
| | | } |
| | | } |
| | | } else { |
| | | $num_rec = $app->db->queryOneRecord("SELECT count(*) as number FROM sys_user WHERE username = '".$app->db->quote($field_value)."' AND client_id != ".$app->functions->intval($client_id)); |
| | | $num_rec = $app->db->queryOneRecord("SELECT count(*) as number FROM sys_user WHERE username = ? AND client_id != ?", $field_value, $client_id); |
| | | if($num_rec["number"] > 0) { |
| | | $errmsg = $validator['errmsg']; |
| | | if(isset($app->tform->wordbook[$errmsg])) { |
| | |
| | | switch ($field_name) |
| | | { |
| | | case 'web_servers': |
| | | $used_servers = $app->db->queryAllRecords('SELECT domain_id FROM web_domain INNER JOIN sys_user ON web_domain.sys_userid = sys_user.userid WHERE client_id = ' . $client_id . ' AND server_id NOT IN (' . implode(', ', $field_value) . ');'); |
| | | $used_servers = $app->db->queryAllRecords('SELECT domain_id FROM web_domain INNER JOIN sys_user ON web_domain.sys_userid = sys_user.userid WHERE client_id = ? AND server_id NOT IN ?', $client_id, $field_value); |
| | | break; |
| | | |
| | | case 'dns_servers': |
| | | $used_servers = $app->db->queryAllRecords('SELECT id FROM dns_rr INNER JOIN sys_user ON dns_rr.sys_userid = sys_user.userid WHERE client_id = ' . $client_id . ' AND server_id NOT IN (' . implode(', ', $field_value) . ');'); |
| | | $used_servers = $app->db->queryAllRecords('SELECT id FROM dns_rr INNER JOIN sys_user ON dns_rr.sys_userid = sys_user.userid WHERE client_id = ? AND server_id NOT IN ?', $client_id, $field_value); |
| | | break; |
| | | |
| | | case 'db_servers': |
| | | $used_servers = $app->db->queryAllRecords('SELECT database_id FROM web_database INNER JOIN sys_user ON web_database.sys_userid = sys_user.userid WHERE client_id = ' . $client_id . ' AND server_id NOT IN (' . implode(', ', $field_value) . ');'); |
| | | $used_servers = $app->db->queryAllRecords('SELECT database_id FROM web_database INNER JOIN sys_user ON web_database.sys_userid = sys_user.userid WHERE client_id = ? AND server_id NOT IN ?', $client_id, $field_value); |
| | | break; |
| | | |
| | | case 'mail_servers': |
| | | $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 = ' . $client_id . ' AND server_id NOT IN (' . implode(', ', $field_value) . ');'); |
| | | $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)) |
| | |
| | | } |
| | | |
| | | // check if country is member of EU |
| | | $country_details = $app->db->queryOneRecord("SELECT * FROM country WHERE iso = '".$country."'"); |
| | | $country_details = $app->db->queryOneRecord("SELECT * FROM country WHERE iso = ?", $country); |
| | | if($country_details['eu'] == 'y' && $vatid != ''){ |
| | | |
| | | $vatid = preg_replace('/\s+/', '', $vatid); |
| | |
| | | |
| | | // Test if the country of the VAT-ID matches the country of the customer |
| | | if($country != ''){ |
| | | // Greece |
| | | if($country == 'GR') $country = 'EL'; |
| | | if(strtoupper($cc) != $country){ |
| | | $errmsg = $validator['errmsg']; |
| | | if(isset($app->tform->wordbook[$errmsg])) { |
| | |
| | | */ |
| | | function check_template($field_name, $field_value, $validator) { |
| | | $dkim=false; |
| | | foreach($field_value as $field ) { if($field == 'DKIM') $dkim=true; } |
| | | if ($dkim && $field_value[0]!='DOMAIN') return $this->get_error($validator['errmsg']); |
| | | if(is_array($field_value) && !empty($field_value)){ |
| | | foreach($field_value as $field ) { if($field == 'DKIM') $dkim=true; } |
| | | if ($dkim && $field_value[0]!='DOMAIN') return $this->get_error($validator['errmsg']); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | if(substr($field, -1) == '.' && $area == 'Name'){ |
| | | $soa = $app->db->queryOneRecord("SELECT * FROM soa WHERE id = ".intval($zoneid)); |
| | | $soa = $app->db->queryOneRecord("SELECT * FROM soa WHERE id = ?", $zoneid); |
| | | if(substr($field, (strlen($field) - strlen($soa['origin']))) != $soa['origin']) $error .= $desc." ".$app->tform->wordbook['error_out_of_zone']."<br>\r\n"; |
| | | } |
| | | |
| | |
| | | $app->uses('ini_parser,getconf'); |
| | | $settings = $app->getconf->get_global_config('domains'); |
| | | if ($settings['use_domain_module'] == 'y') { |
| | | $sql = "SELECT domain_id, domain FROM domain WHERE domain_id = " . $app->functions->intval($check_domain); |
| | | $domain_check = $app->db->queryOneRecord($sql); |
| | | $sql = "SELECT domain_id, domain FROM domain WHERE domain_id = ?"; |
| | | $domain_check = $app->db->queryOneRecord($sql, $check_domain); |
| | | if(!$domain_check) return; |
| | | $check_domain = $domain_check['domain']; |
| | | } |
| | |
| | | |
| | | if($domain['ip_address'] == '' || $domain['ipv6_address'] == ''){ |
| | | if($domain['parent_domain_id'] > 0){ |
| | | $parent_domain = $app->db->queryOneRecord("SELECT * FROM web_domain WHERE domain_id = ".$app->functions->intval($domain['parent_domain_id'])); |
| | | $parent_domain = $app->db->queryOneRecord("SELECT * FROM web_domain WHERE domain_id = ?", $domain['parent_domain_id']); |
| | | if(is_array($parent_domain) && !empty($parent_domain)){ |
| | | $domain['ip_address'] = $parent_domain['ip_address']; |
| | | $domain['ipv6_address'] = $parent_domain['ipv6_address']; |
| | | } |
| | | } |
| | | } |
| | | |
| | | // check if domain has alias/subdomains - if we move a web to another IP, make sure alias/subdomains are checked as well |
| | | $aliassubdomains = $app->db->queryAllRecords("SELECT * FROM web_domain WHERE parent_domain_id = ".$app->functions->intval($primary_id)." AND (type = 'alias' OR type = 'subdomain' OR type = 'vhostsubdomain')"); |
| | | $aliassubdomains = $app->db->queryAllRecords("SELECT * FROM web_domain WHERE parent_domain_id = ? AND (type = 'alias' OR type = 'subdomain' OR type = 'vhostsubdomain')", $primary_id); |
| | | $additional_sql1 = ''; |
| | | $additional_sql2 = ''; |
| | | $domain_params = array(); |
| | | if(is_array($aliassubdomains) && !empty($aliassubdomains)){ |
| | | foreach($aliassubdomains as $aliassubdomain){ |
| | | $additional_sql1 .= " OR d.domain = '".$app->db->quote($aliassubdomain['domain'])."'"; |
| | | $additional_sql2 .= " OR CONCAT(d.subdomain, '.', d.domain) = '".$app->db->quote($aliassubdomain['domain'])."'"; |
| | | $additional_sql1 .= " OR d.domain = ?"; |
| | | $additional_sql2 .= " OR CONCAT(d.subdomain, '.', d.domain) = ?"; |
| | | $domain_params[] = $aliassubdomain['domain']; |
| | | } |
| | | } |
| | | |
| | | |
| | | $qrystr = "SELECT d.domain_id, IF(d.parent_domain_id != 0 AND p.domain_id IS NOT NULL, p.ip_address, d.ip_address) as `ip_address`, IF(d.parent_domain_id != 0 AND p.domain_id IS NOT NULL, p.ipv6_address, d.ipv6_address) as `ipv6_address` FROM `web_domain` as d LEFT JOIN `web_domain` as p ON (p.domain_id = d.parent_domain_id) WHERE (d.domain = '" . $app->db->quote($domain_name) . "'" . $additional_sql1 . ") AND d.server_id = " . $app->functions->intval($domain['server_id']) . " AND d.domain_id != " . $app->functions->intval($primary_id) . ($primary_id ? " AND d.parent_domain_id != " . $app->functions->intval($primary_id) : ""); |
| | | $checks = $app->db->queryAllRecords($qrystr); |
| | | $qrystr = "SELECT d.domain_id, IF(d.parent_domain_id != 0 AND p.domain_id IS NOT NULL, p.ip_address, d.ip_address) as `ip_address`, IF(d.parent_domain_id != 0 AND p.domain_id IS NOT NULL, p.ipv6_address, d.ipv6_address) as `ipv6_address` FROM `web_domain` as d LEFT JOIN `web_domain` as p ON (p.domain_id = d.parent_domain_id) WHERE (d.domain = ?" . $additional_sql1 . ") AND d.server_id = ? AND d.domain_id != ?" . ($primary_id ? " AND d.parent_domain_id != ?" : ""); |
| | | $params = array_merge(array($domain_name), $domain_params, array($domain['server_id'], $primary_id, $primary_id)); |
| | | $checks = $app->db->queryAllRecords($qrystr, true, $params); |
| | | if(is_array($checks) && !empty($checks)){ |
| | | foreach($checks as $check){ |
| | | if($domain['ip_address'] == '*') return false; |
| | |
| | | } |
| | | |
| | | if($only_domain == false) { |
| | | $qrystr = "SELECT d.domain_id, IF(d.parent_domain_id != 0 AND p.domain_id IS NOT NULL, p.ip_address, d.ip_address) as `ip_address`, IF(d.parent_domain_id != 0 AND p.domain_id IS NOT NULL, p.ipv6_address, d.ipv6_address) as `ipv6_address` FROM `web_domain` as d LEFT JOIN `web_domain` as p ON (p.domain_id = d.parent_domain_id) WHERE (CONCAT(d.subdomain, '.', d.domain)= '" . $app->db->quote($domain_name) . "'" . $additional_sql2 . ") AND d.server_id = " . $app->functions->intval($domain['server_id']) . " AND d.domain_id != " . $app->functions->intval($primary_id) . ($primary_id ? " AND d.parent_domain_id != " . $app->functions->intval($primary_id) : ""); |
| | | $checks = $app->db->queryAllRecords($qrystr); |
| | | $qrystr = "SELECT d.domain_id, IF(d.parent_domain_id != 0 AND p.domain_id IS NOT NULL, p.ip_address, d.ip_address) as `ip_address`, IF(d.parent_domain_id != 0 AND p.domain_id IS NOT NULL, p.ipv6_address, d.ipv6_address) as `ipv6_address` FROM `web_domain` as d LEFT JOIN `web_domain` as p ON (p.domain_id = d.parent_domain_id) WHERE (CONCAT(d.subdomain, '.', d.domain) = ?" . $additional_sql2 . ") AND d.server_id = ? AND d.domain_id != ?" . ($primary_id ? " AND d.parent_domain_id != ?" : ""); |
| | | $params = array_merge(array($domain_name), $domain_params, array($domain['server_id'], $primary_id, $primary_id)); |
| | | $checks = $app->db->queryAllRecords($qrystr, true, $params); |
| | | if(is_array($checks) && !empty($checks)){ |
| | | foreach($checks as $check){ |
| | | if($domain['ip_address'] == '*') return false; |
| | |
| | | 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_wildcard FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); |
| | | $client = $app->db->queryOneRecord("SELECT limit_wildcard FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id); |
| | | |
| | | if($client["limit_wildcard"] == 'y') return true; |
| | | else return false; |
| | |
| | | |
| | | if($primary_id > 0) { |
| | | //* get parent_domain_id from website |
| | | $ftp_data = $app->db->queryOneRecord("SELECT parent_domain_id FROM ftp_user WHERE ftp_user_id = '".$app->db->quote($primary_id)."'"); |
| | | $ftp_data = $app->db->queryOneRecord("SELECT parent_domain_id FROM ftp_user WHERE ftp_user_id = ?", $primary_id); |
| | | if(!is_array($ftp_data) || $ftp_data["parent_domain_id"] < 1) { |
| | | $errmsg = $validator['errmsg']; |
| | | if(isset($app->tform->wordbook[$errmsg])) { |
| | |
| | | $parent_domain_id = $app->functions->intval($app->remoting_lib->dataRecord['parent_domain_id']); |
| | | } |
| | | |
| | | $domain_data = $app->db->queryOneRecord("SELECT domain_id, document_root FROM web_domain WHERE domain_id = '".$app->db->quote($parent_domain_id)."'"); |
| | | $domain_data = $app->db->queryOneRecord("SELECT domain_id, document_root FROM web_domain WHERE domain_id = ?", $parent_domain_id); |
| | | if(!is_array($domain_data) || $domain_data["domain_id"] < 1) { |
| | | $errmsg = $validator['errmsg']; |
| | | if(isset($app->tform->wordbook[$errmsg])) { |
| | |
| | | |
| | | if($primary_id > 0) { |
| | | //* get parent_domain_id from website |
| | | $shell_data = $app->db->queryOneRecord("SELECT parent_domain_id FROM shell_user WHERE shell_user_id = '".$app->db->quote($primary_id)."'"); |
| | | $shell_data = $app->db->queryOneRecord("SELECT parent_domain_id FROM shell_user WHERE shell_user_id = ?", $primary_id); |
| | | if(!is_array($shell_data) || $shell_data["parent_domain_id"] < 1) { |
| | | $errmsg = $validator['errmsg']; |
| | | if(isset($app->tform->wordbook[$errmsg])) { |
| | |
| | | $parent_domain_id = $app->functions->intval($app->remoting_lib->dataRecord['parent_domain_id']); |
| | | } |
| | | |
| | | $domain_data = $app->db->queryOneRecord("SELECT domain_id, document_root FROM web_domain WHERE domain_id = '".$app->db->quote($parent_domain_id)."'"); |
| | | $domain_data = $app->db->queryOneRecord("SELECT domain_id, document_root FROM web_domain WHERE domain_id = ?", $parent_domain_id); |
| | | if(!is_array($domain_data) || $domain_data["domain_id"] < 1) { |
| | | $errmsg = $validator['errmsg']; |
| | | if(isset($app->tform->wordbook[$errmsg])) { |
| | |
| | | //** Database |
| | | $conf['db_type'] = 'mysql'; |
| | | $conf['db_host'] = 'localhost'; |
| | | $conf['db_port'] = 3306; |
| | | $conf['db_database'] = 'ispconfig3_305'; |
| | | $conf['db_user'] = 'root'; |
| | | $conf['db_password'] = ''; |
| | |
| | | |
| | | define('DB_TYPE', $conf['db_type']); |
| | | define('DB_HOST', $conf['db_host']); |
| | | define('DB_PORT', $conf['db_port']); |
| | | define('DB_DATABASE', $conf['db_database']); |
| | | define('DB_USER', $conf['db_user']); |
| | | define('DB_PASSWORD', $conf['db_password']); |
| | |
| | | //** Database settings for the master DB. This setting is only used in multiserver setups |
| | | $conf['dbmaster_type'] = 'mysql'; |
| | | $conf['dbmaster_host'] = '{mysql_master_server_host}'; |
| | | $conf['dbmaster_port'] = '{mysql_master_server_port}'; |
| | | $conf['dbmaster_database'] = '{mysql_master_server_database}'; |
| | | $conf['dbmaster_user'] = '{mysql_master_server_ispconfig_user}'; |
| | | $conf['dbmaster_password'] = '{mysql_master_server_ispconfig_password}'; |
| | |
| | | $wb['top_menu_domain'] = 'Domains'; |
| | | $wb['top_menu_dashboard'] = 'Übersicht'; |
| | | $wb['latest_news_txt'] = 'Neuigkeiten'; |
| | | $wb['err_csrf_attempt_blocked'] = 'CSRF-Versuch blockiert.'; |
| | | $wb['top_menu_vm'] = 'vServer'; |
| | | $wb['err_csrf_attempt_blocked'] = 'CSRF-Versuch blockiert.'; |
| | | $wb['daynamesmin_su'] = 'So'; |
| | | $wb['daynamesmin_mo'] = 'Mo'; |
| | | $wb['daynamesmin_tu'] = 'Di'; |
| | |
| | | $wb['datalog_status_i_web_folder_user'] = 'Create folder protection user'; |
| | | $wb['datalog_status_u_web_folder_user'] = 'Update folder protection user'; |
| | | $wb['datalog_status_d_web_folder_user'] = 'Delete folder protection user'; |
| | | $wb['err_csrf_attempt_blocked'] = 'CSRF attempt blocked.'; |
| | | $wb['login_as_txt'] = 'Log in as'; |
| | | $wb["no_domain_perm"] = 'You have no permission for this domain.'; |
| | | $wb["no_destination_perm"] = 'You have no permission for this destination.'; |
| | |
| | | // make sure that the record belongs to the client group and not the admin group when a dmin inserts it |
| | | if($_SESSION["s"]["user"]["typ"] == 'admin' && isset($page_form->dataRecord["client_group_id"])) { |
| | | $client_group_id = $app->functions->intval($page_form->dataRecord["client_group_id"]); |
| | | $app->db->query("UPDATE dns_slave SET sys_groupid = $client_group_id WHERE id = ".$page_form->id); |
| | | $app->db->query("UPDATE dns_slave SET sys_groupid = ? WHERE id = ?", $client_group_id, $page_form->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 dns_slave SET sys_groupid = $client_group_id WHERE id = ".$page_form->id); |
| | | $app->db->query("UPDATE dns_slave SET sys_groupid = ? WHERE id = ?", $client_group_id, $page_form->id); |
| | | } |
| | | |
| | | //** When the client group has changed, change also the owner of the record if the owner is not the admin user |
| | | if($page_form->oldDataRecord && $page_form->oldDataRecord["client_group_id"] != $page_form->dataRecord["client_group_id"] && $page_form->dataRecord["sys_userid"] != 1) { |
| | | $client_group_id = $app->functions->intval($page_form->dataRecord["client_group_id"]); |
| | | $tmp = $app->db->queryOneREcord("SELECT userid FROM sys_user WHERE default_group = ".$client_group_id); |
| | | $tmp = $app->db->queryOneREcord("SELECT userid FROM sys_user WHERE default_group = ?", $client_group_id); |
| | | if($tmp["userid"] > 0) { |
| | | $app->db->query("UPDATE dns_slave SET sys_userid = ".$tmp["userid"]." WHERE id = ".$page_form->id); |
| | | $app->db->query("UPDATE dns_slave SET sys_userid = ? WHERE id = ?", $tmp["userid"], $page_form->id); |
| | | } |
| | | } |
| | | } |
| | |
| | | $tmp = $app->db->diffrec($page_form->oldDataRecord, $app->tform->getDataRecord($page_form->id)); |
| | | if($tmp['diff_num'] > 0) { |
| | | // Update the serial number of the SOA record |
| | | $soa = $app->db->queryOneRecord("SELECT serial FROM dns_soa WHERE id = ".$page_form->id); |
| | | $app->db->query("UPDATE dns_soa SET serial = '".$app->validate_dns->increase_serial($soa["serial"])."' WHERE id = ".$page_form->id); |
| | | $soa = $app->db->queryOneRecord("SELECT serial FROM dns_soa WHERE id = ?", $page_form->id); |
| | | $app->db->query("UPDATE dns_soa SET serial = ? WHERE id = ?", $app->validate_dns->increase_serial($soa["serial"]), $page_form->id); |
| | | } |
| | | |
| | | //** When the client group has changed, change also the owner of the record if the owner is not the admin user |
| | | if($page_form->oldDataRecord["client_group_id"] != $page_form->dataRecord["client_group_id"] && $page_form->dataRecord["sys_userid"] != 1) { |
| | | $client_group_id = $app->functions->intval($page_form->dataRecord["client_group_id"]); |
| | | $tmp = $app->db->queryOneREcord("SELECT userid FROM sys_user WHERE default_group = ".$client_group_id); |
| | | $tmp = $app->db->queryOneREcord("SELECT userid FROM sys_user WHERE default_group = ?", $client_group_id); |
| | | if($tmp["userid"] > 0) { |
| | | $app->db->query("UPDATE dns_soa SET sys_userid = ".$tmp["userid"]." WHERE id = ".$page_form->id); |
| | | $app->db->query("UPDATE dns_rr SET sys_userid = ".$tmp["userid"]." WHERE zone = ".$page_form->id); |
| | | $app->db->query("UPDATE dns_soa SET sys_userid = ? WHERE id = ?", $tmp["userid"], $page_form->id); |
| | | $app->db->query("UPDATE dns_rr SET sys_userid = ? WHERE zone = ?", $tmp["userid"], $page_form->id); |
| | | } |
| | | } |
| | | } |
| | |
| | | // make sure that the record belongs to the client group and not the admin group when a dmin inserts it |
| | | if($_SESSION["s"]["user"]["typ"] == 'admin' && isset($page_form->dataRecord["client_group_id"])) { |
| | | $client_group_id = $app->functions->intval($page_form->dataRecord["client_group_id"]); |
| | | $app->db->query("UPDATE dns_soa SET sys_groupid = $client_group_id, sys_perm_group = 'ru' WHERE id = ".$page_form->id); |
| | | $app->db->query("UPDATE dns_soa SET sys_groupid = ?, sys_perm_group = 'ru' WHERE id = ?", $client_group_id, $page_form->id); |
| | | // And we want to update all rr records too, that belong to this record |
| | | $app->db->query("UPDATE dns_rr SET sys_groupid = $client_group_id WHERE zone = ".$page_form->id); |
| | | $app->db->query("UPDATE dns_rr SET sys_groupid = ? WHERE zone = ?", $client_group_id, $page_form->id); |
| | | } |
| | | if($app->auth->has_clients($_SESSION['s']['user']['userid']) && isset($page_form->dataRecord["client_group_id"])) { |
| | | $client_group_id = $app->functions->intval($page_form->dataRecord["client_group_id"]); |
| | | $app->db->query("UPDATE dns_soa SET sys_groupid = $client_group_id, sys_perm_group = 'riud' WHERE id = ".$page_form->id); |
| | | $app->db->query("UPDATE dns_soa SET sys_groupid = ?, sys_perm_group = 'riud' WHERE id = ?", $client_group_id, $page_form->id); |
| | | // And we want to update all rr records too, that belong to this record |
| | | $app->db->query("UPDATE dns_rr SET sys_groupid = $client_group_id WHERE zone = ".$page_form->id); |
| | | $app->db->query("UPDATE dns_rr SET sys_groupid = ? WHERE zone = ?", $client_group_id, $page_form->id); |
| | | } |
| | | } |
| | | |
| | |
| | | // also make sure that the user can not delete entry created by an admin |
| | | if($_SESSION["s"]["user"]["typ"] == 'admin' && isset($page_form->dataRecord["client_group_id"])) { |
| | | $client_group_id = $app->functions->intval($page_form->dataRecord["client_group_id"]); |
| | | $updates = "sys_groupid = $client_group_id, sys_perm_group = 'ru'"; |
| | | $updates = "sys_groupid = ?, sys_perm_group = 'ru'"; |
| | | $update_params = array($client_group_id); |
| | | if ($event_name == 'mail:mail_domain:on_after_update') { |
| | | $tmp = $app->db->queryOneRecord("SELECT userid FROM sys_user WHERE default_group = $client_group_id"); |
| | | $tmp = $app->db->queryOneRecord("SELECT userid FROM sys_user WHERE default_group = ?", $client_group_id); |
| | | $client_user_id = ($tmp['userid'] > 0)?$tmp['userid']:1; |
| | | $updates = "sys_userid = $client_user_id, $updates"; |
| | | $updates .= ", sys_userid = ?"; |
| | | $update_params[] = $client_user_id; |
| | | } |
| | | $app->db->query("UPDATE mail_domain SET $updates WHERE domain_id = ".$page_form->id); |
| | | $update_params[] = $page_form->id; |
| | | $app->db->query("UPDATE mail_domain SET " . $updates . " WHERE domain_id = ?", true, $update_params); |
| | | } |
| | | if($app->auth->has_clients($_SESSION['s']['user']['userid']) && isset($page_form->dataRecord["client_group_id"])) { |
| | | $client_group_id = $app->functions->intval($page_form->dataRecord["client_group_id"]); |
| | | $updates = "sys_groupid = $client_group_id, sys_perm_group = 'riud'"; |
| | | $update_params = array($client_group_id); |
| | | if ($event_name == 'mail:mail_domain:on_after_update') { |
| | | $tmp = $app->db->queryOneRecord("SELECT userid FROM sys_user WHERE default_group = $client_group_id"); |
| | | $tmp = $app->db->queryOneRecord("SELECT userid FROM sys_user WHERE default_group = ?", $client_group_id); |
| | | $client_user_id = ($tmp['userid'] > 0)?$tmp['userid']:1; |
| | | $updates = "sys_userid = $client_user_id, $updates"; |
| | | $updates .= ", sys_userid = ?"; |
| | | $update_params[] = $client_user_id; |
| | | } |
| | | $app->db->query("UPDATE mail_domain SET $updates WHERE domain_id = ".$page_form->id); |
| | | $update_params[] = $page_form->id; |
| | | $app->db->query("UPDATE mail_domain SET " . $updates . " WHERE domain_id = ?", true, $update_params); |
| | | } |
| | | |
| | | //** If the domain name or owner has been changed, change the domain and owner in all mailbox records |
| | |
| | | $mail_config = $app->getconf->get_server_config($page_form->dataRecord["server_id"], 'mail'); |
| | | |
| | | //* Update the mailboxes |
| | | $mailusers = $app->db->queryAllRecords("SELECT * FROM mail_user WHERE email like '%@".$app->db->quote($page_form->oldDataRecord['domain'])."'"); |
| | | $mailusers = $app->db->queryAllRecords("SELECT * FROM mail_user WHERE email like ?", "%@" . $page_form->oldDataRecord['domain']); |
| | | $sys_groupid = $app->functions->intval((isset($page_form->dataRecord['client_group_id']))?$page_form->dataRecord['client_group_id']:$page_form->oldDataRecord['sys_groupid']); |
| | | $tmp = $app->db->queryOneRecord("SELECT userid FROM sys_user WHERE default_group = $sys_groupid"); |
| | | $tmp = $app->db->queryOneRecord("SELECT userid FROM sys_user WHERE default_group = ?", $sys_groupid); |
| | | $client_user_id = $app->functions->intval(($tmp['userid'] > 0)?$tmp['userid']:1); |
| | | if(is_array($mailusers)) { |
| | | foreach($mailusers as $rec) { |
| | |
| | | $mail_parts = explode("@", $rec['email']); |
| | | $maildir = str_replace("[domain]", $page_form->dataRecord['domain'], $mail_config["maildir_path"]); |
| | | $maildir = str_replace("[localpart]", $mail_parts[0], $maildir); |
| | | $maildir = $app->db->quote($maildir); |
| | | $email = $app->db->quote($mail_parts[0].'@'.$page_form->dataRecord['domain']); |
| | | $app->db->datalogUpdate('mail_user', "maildir = '$maildir', email = '$email', sys_userid = $client_user_id, sys_groupid = '$sys_groupid'", 'mailuser_id', $rec['mailuser_id']); |
| | | $email = $mail_parts[0].'@'.$page_form->dataRecord['domain']; |
| | | $app->db->datalogUpdate('mail_user', array("maildir" => $maildir, "email" => $email, "sys_userid" => $client_user_id, "sys_groupid" => $sys_groupid), 'mailuser_id', $rec['mailuser_id']); |
| | | } |
| | | } |
| | | |
| | | //* Update the aliases |
| | | $forwardings = $app->db->queryAllRecords("SELECT * FROM mail_forwarding WHERE source like '%@".$app->db->quote($page_form->oldDataRecord['domain'])."' OR destination like '%@".$app->db->quote($page_form->oldDataRecord['domain'])."'"); |
| | | $forwardings = $app->db->queryAllRecords("SELECT * FROM mail_forwarding WHERE source LIKE ? OR destination LIKE ?", "%@" . $page_form->oldDataRecord['domain'], "%@" . $page_form->oldDataRecord['domain']); |
| | | if(is_array($forwardings)) { |
| | | foreach($forwardings as $rec) { |
| | | $destination = $app->db->quote(str_replace($page_form->oldDataRecord['domain'], $page_form->dataRecord['domain'], $rec['destination'])); |
| | | $source = $app->db->quote(str_replace($page_form->oldDataRecord['domain'], $page_form->dataRecord['domain'], $rec['source'])); |
| | | $app->db->datalogUpdate('mail_forwarding', "source = '$source', destination = '$destination', sys_userid = $client_user_id, sys_groupid = '$sys_groupid'", 'forwarding_id', $rec['forwarding_id']); |
| | | $destination = str_replace($page_form->oldDataRecord['domain'], $page_form->dataRecord['domain'], $rec['destination']); |
| | | $source = str_replace($page_form->oldDataRecord['domain'], $page_form->dataRecord['domain'], $rec['source']); |
| | | $app->db->datalogUpdate('mail_forwarding', array("source" => $source, "destination" => $destination, "sys_userid" => $client_user_id, "sys_groupid" => $sys_groupid), 'forwarding_id', $rec['forwarding_id']); |
| | | } |
| | | } |
| | | |
| | | //* Update the mailinglist |
| | | $mailing_lists = $app->db->queryAllRecords("SELECT mailinglist_id FROM mail_mailinglist WHERE domain = '".$app->db->quote($page_form->oldDataRecord['domain'])."'"); |
| | | $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', "sys_userid = $client_user_id, sys_groupid = '$sys_groupid'", 'mailinglist_id', $rec['mailinglist_id']); |
| | | $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 '%@".$app->db->quote($page_form->oldDataRecord['domain'])."'"); |
| | | $mail_gets = $app->db->queryAllRecords("SELECT mailget_id, destination FROM mail_get WHERE destination LIKE ?", "%@" . $page_form->oldDataRecord['domain']); |
| | | if(is_array($mail_gets)) { |
| | | foreach($mail_gets as $rec) { |
| | | $destination = $app->db->quote(str_replace($page_form->oldDataRecord['domain'], $page_form->dataRecord['domain'], $rec['destination'])); |
| | | $app->db->datalogUpdate('mail_get', "destination = '$destination', sys_userid = $client_user_id, sys_groupid = '$sys_groupid'", 'mailget_id', $rec['mailget_id']); |
| | | $destination = str_replace($page_form->oldDataRecord['domain'], $page_form->dataRecord['domain'], $rec['destination']); |
| | | $app->db->datalogUpdate('mail_get', array("destination" => $destination, "sys_userid" => $client_user_id, "sys_groupid" => $sys_groupid), 'mailget_id', $rec['mailget_id']); |
| | | } |
| | | } |
| | | |
| | | if ($page_form->oldDataRecord["domain"] != $page_form->dataRecord['domain']) { |
| | | //* Delete the old spamfilter record |
| | | $tmp = $app->db->queryOneRecord("SELECT id FROM spamfilter_users WHERE email = '@".$app->db->quote($page_form->oldDataRecord["domain"])."'"); |
| | | $tmp = $app->db->queryOneRecord("SELECT id FROM spamfilter_users WHERE email = ?", "@" . $page_form->oldDataRecord["domain"]); |
| | | $app->db->datalogDelete('spamfilter_users', 'id', $tmp["id"]); |
| | | unset($tmp); |
| | | } |
| | | $app->db->query("UPDATE spamfilter_users SET email=REPLACE(email, '".$app->db->quote($page_form->oldDataRecord['domain'])."', '".$app->db->quote($page_form->dataRecord['domain'])."'), sys_userid = $client_user_id, sys_groupid = $sys_groupid WHERE email LIKE '%@".$app->db->quote($page_form->oldDataRecord['domain'])."'"); |
| | | $app->db->query("UPDATE spamfilter_users SET email=REPLACE(email, ?, ?), sys_userid = ?, sys_groupid = ? WHERE email LIKE ?", $page_form->oldDataRecord['domain'], $page_form->dataRecord['domain'], $client_user_id, $sys_groupid, "%@" . $page_form->oldDataRecord['domain']); |
| | | |
| | | } // end if domain name changed |
| | | } |
| | |
| | | function mail_user_filter_edit($event_name, $page_form) { |
| | | global $app, $conf; |
| | | |
| | | $mailuser = $app->db->queryOneRecord("SELECT custom_mailfilter FROM mail_user WHERE mailuser_id = ".$page_form->dataRecord["mailuser_id"]); |
| | | $mailuser = $app->db->queryOneRecord("SELECT custom_mailfilter FROM mail_user WHERE mailuser_id = ?", $page_form->dataRecord["mailuser_id"]); |
| | | $skip = false; |
| | | $lines = explode("\n", $mailuser['custom_mailfilter']); |
| | | $out = ''; |
| | |
| | | $out = $new_rule . $out; |
| | | } |
| | | |
| | | $out = $app->db->quote($out); |
| | | $app->db->datalogUpdate('mail_user', "custom_mailfilter = '$out'", 'mailuser_id', $page_form->dataRecord["mailuser_id"]); |
| | | $app->db->datalogUpdate('mail_user', array("custom_mailfilter" => $out), 'mailuser_id', $page_form->dataRecord["mailuser_id"]); |
| | | |
| | | |
| | | } |
| | |
| | | function mail_user_filter_del($event_name, $page_form) { |
| | | global $app, $conf; |
| | | |
| | | $mailuser = $app->db->queryOneRecord("SELECT custom_mailfilter FROM mail_user WHERE mailuser_id = ".$page_form->dataRecord["mailuser_id"]); |
| | | $mailuser = $app->db->queryOneRecord("SELECT custom_mailfilter FROM mail_user WHERE mailuser_id = ?", $page_form->dataRecord["mailuser_id"]); |
| | | $skip = false; |
| | | $lines = explode("\n", $mailuser['custom_mailfilter']); |
| | | $out = ''; |
| | |
| | | } |
| | | } |
| | | |
| | | $out = $app->db->quote($out); |
| | | $app->db->datalogUpdate('mail_user', "custom_mailfilter = '$out'", 'mailuser_id', $page_form->dataRecord["mailuser_id"]); |
| | | $app->db->datalogUpdate('mail_user', array("custom_mailfilter" => $out), 'mailuser_id', $page_form->dataRecord["mailuser_id"]); |
| | | } |
| | | |
| | | |
| | |
| | | global $app, $conf; |
| | | |
| | | $app->uses("getconf"); |
| | | $mailuser_rec = $app->db->queryOneRecord("SELECT server_id FROM mail_user WHERE mailuser_id = ".$app->functions->intval($page_form->dataRecord["mailuser_id"])); |
| | | $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') { |
| | |
| | | $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"] == '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"]).'"] ["'; |
| | | $content .= 'if header :regex ["'.strtolower($page_form->dataRecord["source"]).'"] ["'; |
| | | |
| | | $searchterm = preg_quote($page_form->dataRecord["searchterm"]); |
| | | $searchterm = str_replace( |
| | | array( |
| | | '"', |
| | | '\\[', |
| | | '\\]' |
| | | ), |
| | | array( |
| | | '\\"', |
| | | '\\\\[', |
| | | '\\\\]' |
| | | ), $searchterm); |
| | | $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."$"; |
| | | 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"; |
| | | } |
| | | |
| | | $content .= '"] {'."\n"; |
| | | |
| | | if($page_form->dataRecord["action"] == 'move') { |
| | | $content .= ' fileinto "'.$page_form->dataRecord["target"].'";' . "\n"; |
| | | $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'; |
| | | } else { |
| | | $content .= " discard;\n"; |
| | | $content .= " discard;\n stop;\n"; |
| | | } |
| | | |
| | | $content .= " stop;\n}\n"; |
| | | $content .= "}\n"; |
| | | |
| | | $content .= '### END FILTER_ID:'.$page_form->id."\n"; |
| | | |
| | |
| | | // also make sure that the user can not delete entry created by an admin |
| | | if($_SESSION["s"]["user"]["typ"] == 'admin' && isset($page_form->dataRecord["client_group_id"])) { |
| | | $client_group_id = $app->functions->intval($page_form->dataRecord["client_group_id"]); |
| | | $app->db->query("UPDATE web_database_user SET sys_groupid = $client_group_id, sys_perm_group = 'ru' WHERE database_user_id = ".$page_form->id); |
| | | $app->db->query("UPDATE web_database_user SET sys_groupid = ?, sys_perm_group = 'ru' WHERE database_user_id = ?", $client_group_id, $page_form->id); |
| | | } |
| | | if($app->auth->has_clients($_SESSION['s']['user']['userid']) && isset($page_form->dataRecord["client_group_id"])) { |
| | | $client_group_id = $app->functions->intval($page_form->dataRecord["client_group_id"]); |
| | | $app->db->query("UPDATE web_database_user SET sys_groupid = $client_group_id, sys_perm_group = 'riud' WHERE database_user_id = ".$page_form->id); |
| | | $app->db->query("UPDATE web_database_user SET sys_groupid = ?, sys_perm_group = 'riud' WHERE database_user_id = ?", $client_group_id, $page_form->id); |
| | | } |
| | | //$app->db->query("UPDATE web_database_user SET server_id = '" . $app->functions->intval($conf['server_id']) . "' WHERE database_user_id = ".$page_form->id); |
| | | } |
| | | |
| | | } |
| | |
| | | // also make sure that the user can not delete domain created by a admin |
| | | if($_SESSION["s"]["user"]["typ"] == 'admin' && isset($page_form->dataRecord["client_group_id"])) { |
| | | $client_group_id = $app->functions->intval($page_form->dataRecord["client_group_id"]); |
| | | $app->db->query("UPDATE web_domain SET sys_groupid = $client_group_id, sys_perm_group = 'ru' WHERE domain_id = ".$page_form->id); |
| | | $app->db->query("UPDATE web_domain SET sys_groupid = ?, sys_perm_group = 'ru' WHERE domain_id = ?", $client_group_id, $page_form->id); |
| | | } |
| | | if($app->auth->has_clients($_SESSION['s']['user']['userid']) && isset($page_form->dataRecord["client_group_id"])) { |
| | | $client_group_id = $app->functions->intval($page_form->dataRecord["client_group_id"]); |
| | | $app->db->query("UPDATE web_domain SET sys_groupid = $client_group_id, sys_perm_group = 'riud' WHERE domain_id = ".$page_form->id); |
| | | $app->db->query("UPDATE web_domain SET sys_groupid = ?, sys_perm_group = 'riud' WHERE domain_id = ?", $client_group_id, $page_form->id); |
| | | } |
| | | // Get configuration for the web system |
| | | $app->uses("getconf"); |
| | |
| | | // get the ID of the client |
| | | if($_SESSION["s"]["user"]["typ"] != 'admin' && !$app->auth->has_clients($_SESSION['s']['user']['userid'])) { |
| | | $client_group_id = $app->functions->intval($_SESSION["s"]["user"]["default_group"]); |
| | | $client = $app->db->queryOneRecord("SELECT client_id FROM sys_group WHERE sys_group.groupid = $client_group_id"); |
| | | $client = $app->db->queryOneRecord("SELECT client_id FROM sys_group WHERE sys_group.groupid = ?", $client_group_id); |
| | | $client_id = $app->functions->intval($client["client_id"]); |
| | | } elseif (isset($page_form->dataRecord["client_group_id"])) { |
| | | $client_group_id = $page_form->dataRecord["client_group_id"]; |
| | | $client = $app->db->queryOneRecord("SELECT client_id FROM sys_group WHERE sys_group.groupid = ".$app->functions->intval(@$page_form->dataRecord["client_group_id"])); |
| | | $client = $app->db->queryOneRecord("SELECT client_id FROM sys_group WHERE sys_group.groupid = ?", $app->functions->intval(@$page_form->dataRecord["client_group_id"])); |
| | | $client_id = $app->functions->intval($client["client_id"]); |
| | | } else { |
| | | $client_group_id = $page_form->dataRecord["client_group_id"]; |
| | | $client = $app->db->queryOneRecord("SELECT client_id FROM sys_group WHERE sys_group.groupid = ".$app->functions->intval($page_form->dataRecord["client_group_id"])); |
| | | $client = $app->db->queryOneRecord("SELECT client_id FROM sys_group WHERE sys_group.groupid = ?", $app->functions->intval($page_form->dataRecord["client_group_id"])); |
| | | $client_id = $app->functions->intval($client["client_id"]); |
| | | } |
| | | |
| | |
| | | $client_user_id = $app->functions->intval(($tmp['userid'] > 0)?$tmp['userid']:1); |
| | | |
| | | // Set the values for document_root, system_user and system_group |
| | | $system_user = $app->db->quote('web'.$page_form->id); |
| | | $system_group = $app->db->quote('client'.$client_id); |
| | | $system_user = 'web'.$page_form->id; |
| | | $system_group = 'client'.$client_id; |
| | | |
| | | $document_root = str_replace("[client_id]", $client_id, $document_root); |
| | | $document_root = str_replace("[client_idhash_1]", $this->id_hash($client_id, 1), $document_root); |
| | | $document_root = str_replace("[client_idhash_2]", $this->id_hash($client_id, 2), $document_root); |
| | | $document_root = str_replace("[client_idhash_3]", $this->id_hash($client_id, 3), $document_root); |
| | | $document_root = str_replace("[client_idhash_4]", $this->id_hash($client_id, 4), $document_root); |
| | | $document_root = $app->db->quote($document_root); |
| | | |
| | | if($event_name == 'sites:web_vhost_domain:on_after_update') { |
| | | if(($_SESSION["s"]["user"]["typ"] == 'admin' || $app->auth->has_clients($_SESSION['s']['user']['userid'])) && isset($page_form->dataRecord["client_group_id"]) && $page_form->dataRecord["client_group_id"] != $page_form->oldDataRecord["sys_groupid"]) { |
| | | |
| | | $sql = "UPDATE web_domain SET system_user = '$system_user', system_group = '$system_group', document_root = '$document_root' WHERE domain_id = ".$page_form->id; |
| | | $app->db->query($sql); |
| | | $sql = "UPDATE web_domain SET system_user = ?, system_group = ?, document_root = ? WHERE domain_id = ?"; |
| | | $app->db->query($sql, $system_user, $system_group, $document_root, $page_form->id); |
| | | |
| | | // Update the FTP user(s) too |
| | | $records = $app->db->queryAllRecords("SELECT ftp_user_id FROM ftp_user WHERE parent_domain_id = ".$page_form->id); |
| | | $records = $app->db->queryAllRecords("SELECT ftp_user_id FROM ftp_user WHERE parent_domain_id = ?", $page_form->id); |
| | | foreach($records as $rec) { |
| | | $app->db->datalogUpdate('ftp_user', "sys_userid = '".$app->functions->intval($web_rec['sys_userid'])."', sys_groupid = '".$app->functions->intval($web_rec['sys_groupid'])."', uid = '$system_user', gid = '$system_group', dir = '$document_root'", 'ftp_user_id', $app->functions->intval($rec['ftp_user_id'])); |
| | | $app->db->datalogUpdate('ftp_user', array("sys_userid" => $web_rec['sys_userid'], "sys_groupid" => $web_rec['sys_groupid'], "uid" => $system_user, "gid" => $system_group, "dir" => $document_root), 'ftp_user_id', $app->functions->intval($rec['ftp_user_id'])); |
| | | } |
| | | unset($records); |
| | | unset($rec); |
| | | |
| | | // Update the webdav user(s) too |
| | | $records = $app->db->queryAllRecords("SELECT webdav_user_id FROM webdav_user WHERE parent_domain_id = ".$page_form->id); |
| | | $records = $app->db->queryAllRecords("SELECT webdav_user_id FROM webdav_user WHERE parent_domain_id = ?", $page_form->id); |
| | | foreach($records as $rec) { |
| | | $app->db->datalogUpdate('webdav_user', "sys_userid = '".$app->functions->intval($web_rec['sys_userid'])."', sys_groupid = '".$app->functions->intval($web_rec['sys_groupid'])."'", 'webdav_user_id', $app->functions->intval($rec['webdav_user_id'])); |
| | | $app->db->datalogUpdate('webdav_user', array("sys_userid" => $web_rec['sys_userid'], "sys_groupid" => $web_rec['sys_groupid']), 'webdav_user_id', $app->functions->intval($rec['webdav_user_id'])); |
| | | } |
| | | unset($records); |
| | | unset($rec); |
| | | |
| | | // Update the web folder(s) too |
| | | $records = $app->db->queryAllRecords("SELECT web_folder_id FROM web_folder WHERE parent_domain_id = ".$page_form->id); |
| | | $records = $app->db->queryAllRecords("SELECT web_folder_id FROM web_folder WHERE parent_domain_id = ?", $page_form->id); |
| | | foreach($records as $rec) { |
| | | $app->db->datalogUpdate('web_folder', "sys_userid = '".$app->functions->intval($web_rec['sys_userid'])."', sys_groupid = '".$app->functions->intval($web_rec['sys_groupid'])."'", 'web_folder_id', $app->functions->intval($rec['web_folder_id'])); |
| | | $app->db->datalogUpdate('web_folder', array("sys_userid" => $web_rec['sys_userid'], "sys_groupid" => $web_rec['sys_groupid']), 'web_folder_id', $app->functions->intval($rec['web_folder_id'])); |
| | | } |
| | | unset($records); |
| | | unset($rec); |
| | | |
| | | //* Update all web folder users |
| | | $records = $app->db->queryAllRecords("SELECT web_folder_user.web_folder_user_id FROM web_folder_user, web_folder WHERE web_folder_user.web_folder_id = web_folder.web_folder_id AND web_folder.parent_domain_id = ".$page_form->id); |
| | | $records = $app->db->queryAllRecords("SELECT web_folder_user.web_folder_user_id FROM web_folder_user, web_folder WHERE web_folder_user.web_folder_id = web_folder.web_folder_id AND web_folder.parent_domain_id = ?", $page_form->id); |
| | | foreach($records as $rec) { |
| | | $app->db->datalogUpdate('web_folder_user', "sys_userid = '".$app->functions->intval($web_rec['sys_userid'])."', sys_groupid = '".$app->functions->intval($web_rec['sys_groupid'])."'", 'web_folder_user_id', $app->functions->intval($rec['web_folder_user_id'])); |
| | | $app->db->datalogUpdate('web_folder_user', array("sys_userid" => $web_rec['sys_userid'], "sys_groupid" => $web_rec['sys_groupid']), 'web_folder_user_id', $app->functions->intval($rec['web_folder_user_id'])); |
| | | } |
| | | unset($records); |
| | | unset($rec); |
| | | |
| | | // Update the Shell user(s) too |
| | | $records = $app->db->queryAllRecords("SELECT shell_user_id FROM shell_user WHERE parent_domain_id = ".$page_form->id); |
| | | $records = $app->db->queryAllRecords("SELECT shell_user_id FROM shell_user WHERE parent_domain_id = ?", $page_form->id); |
| | | foreach($records as $rec) { |
| | | $app->db->datalogUpdate('shell_user', "sys_userid = '".$web_rec['sys_userid']."', sys_groupid = '".$web_rec['sys_groupid']."', puser = '$system_user', pgroup = '$system_group', dir = '$document_root'", 'shell_user_id', $app->functions->intval($rec['shell_user_id'])); |
| | | $app->db->datalogUpdate('shell_user', array("sys_userid" => $web_rec['sys_userid'], "sys_groupid" => $web_rec['sys_groupid'], "puser" => $system_user, "pgroup" => $system_group, "dir" => $document_root), 'shell_user_id', $app->functions->intval($rec['shell_user_id'])); |
| | | } |
| | | unset($records); |
| | | unset($rec); |
| | | |
| | | // Update the cron(s) too |
| | | $records = $app->db->queryAllRecords("SELECT id FROM cron WHERE parent_domain_id = ".$page_form->id); |
| | | $records = $app->db->queryAllRecords("SELECT id FROM cron WHERE parent_domain_id = ?", $page_form->id); |
| | | foreach($records as $rec) { |
| | | $app->db->datalogUpdate('cron', "sys_userid = '".$app->functions->intval($web_rec['sys_userid'])."', sys_groupid = '".$app->functions->intval($web_rec['sys_groupid'])."'", 'id', $app->functions->intval($rec['id'])); |
| | | $app->db->datalogUpdate('cron', array("sys_userid" => $web_rec['sys_userid'], "sys_groupid" => $web_rec['sys_groupid']), 'id', $app->functions->intval($rec['id'])); |
| | | } |
| | | unset($records); |
| | | unset($rec); |
| | | |
| | | //* Update all subdomains and alias domains |
| | | $records = $app->db->queryAllRecords("SELECT domain_id, `domain`, `type`, `web_folder` FROM web_domain WHERE parent_domain_id = ".$page_form->id); |
| | | $records = $app->db->queryAllRecords("SELECT domain_id, `domain`, `type`, `web_folder` FROM web_domain WHERE parent_domain_id = ?", $page_form->id); |
| | | foreach($records as $rec) { |
| | | $update_columns = "sys_userid = '".$web_rec['sys_userid']."', sys_groupid = '".$web_rec['sys_groupid']."'"; |
| | | $update_columns = array("sys_userid" => $web_rec['sys_userid'], "sys_groupid" => $web_rec['sys_groupid']); |
| | | if($rec['type'] == 'vhostsubdomain' || $rec['type'] == 'vhostalias') { |
| | | $php_open_basedir = str_replace("[website_path]/web", $document_root.'/'.$rec['web_folder'], $web_config["php_open_basedir"]); |
| | | $php_open_basedir = str_replace("[website_domain]/web", $rec['domain'].'/'.$rec['web_folder'], $php_open_basedir); |
| | | $php_open_basedir = str_replace("[website_path]", $document_root, $php_open_basedir); |
| | | $php_open_basedir = $app->db->quote(str_replace("[website_domain]", $rec['domain'], $php_open_basedir)); |
| | | $php_open_basedir = str_replace("[website_domain]", $rec['domain'], $php_open_basedir); |
| | | |
| | | $update_columns .= ", document_root = '".$document_root."', `php_open_basedir` = '".$php_open_basedir."'"; |
| | | $update_columns["document_root"] = $document_root; |
| | | $update_columns["php_open_basedir"] = $php_open_basedir; |
| | | } |
| | | $app->db->datalogUpdate('web_domain', $update_columns, 'domain_id', $rec['domain_id']); |
| | | } |
| | |
| | | unset($rec); |
| | | |
| | | //* Update all databases |
| | | $records = $app->db->queryAllRecords("SELECT database_id FROM web_database WHERE parent_domain_id = ".$page_form->id); |
| | | $records = $app->db->queryAllRecords("SELECT database_id FROM web_database WHERE parent_domain_id = ?", $page_form->id); |
| | | foreach($records as $rec) { |
| | | $app->db->datalogUpdate('web_database', "sys_userid = '".$app->functions->intval($web_rec['sys_userid'])."', sys_groupid = '".$app->functions->intval($web_rec['sys_groupid'])."'", 'database_id', $app->functions->intval($rec['database_id'])); |
| | | $app->db->datalogUpdate('web_database', array("sys_userid" => $web_rec['sys_userid'], "sys_groupid" => $web_rec['sys_groupid']), 'database_id', $app->functions->intval($rec['database_id'])); |
| | | } |
| | | |
| | | //* Update all database users |
| | | $records = $app->db->queryAllRecords("SELECT web_database_user.database_user_id FROM web_database_user, web_database WHERE web_database_user.database_user_id IN (web_database.database_user_id, web_database.database_ro_user_id) AND web_database.parent_domain_id = ".$page_form->id); |
| | | $records = $app->db->queryAllRecords("SELECT web_database_user.database_user_id FROM web_database_user, web_database WHERE web_database_user.database_user_id IN (web_database.database_user_id, web_database.database_ro_user_id) AND web_database.parent_domain_id = ?", $page_form->id); |
| | | foreach($records as $rec) { |
| | | $app->db->datalogUpdate('web_database_user', "sys_userid = '".$app->functions->intval($web_rec['sys_userid'])."', sys_groupid = '".$app->functions->intval($web_rec['sys_groupid'])."'", 'database_user_id', $app->functions->intval($rec['database_user_id'])); |
| | | $app->db->datalogUpdate('web_database_user', array("sys_userid" => $web_rec['sys_userid'], "sys_groupid" => $web_rec['sys_groupid']), 'database_user_id', $app->functions->intval($rec['database_user_id'])); |
| | | } |
| | | unset($records); |
| | | unset($rec); |
| | | |
| | | // Update APS instances |
| | | $records = $app->db->queryAllRecords("SELECT instance_id FROM aps_instances_settings WHERE name = 'main_domain' AND value = '".$app->db->quote($page_form->oldDataRecord["domain"])."'"); |
| | | $records = $app->db->queryAllRecords("SELECT instance_id FROM aps_instances_settings WHERE name = 'main_domain' AND value = ?", $page_form->oldDataRecord["domain"]); |
| | | if(is_array($records) && !empty($records)){ |
| | | foreach($records as $rec){ |
| | | $app->db->datalogUpdate('aps_instances', "sys_userid = '".$app->functions->intval($web_rec['sys_userid'])."', sys_groupid = '".$app->functions->intval($web_rec['sys_groupid'])."', customer_id = '".$app->functions->intval($client_id)."'", 'id', $rec['instance_id']); |
| | | $app->db->datalogUpdate('aps_instances', array("sys_userid" => $web_rec['sys_userid'], "sys_groupid" => $web_rec['sys_groupid'], "customer_id" => $client_id), 'id', $rec['instance_id']); |
| | | } |
| | | } |
| | | unset($records); |
| | |
| | | |
| | | //* If the domain name has been changed, we will have to change all subdomains + APS instances |
| | | if(!empty($page_form->dataRecord["domain"]) && !empty($page_form->oldDataRecord["domain"]) && $page_form->dataRecord["domain"] != $page_form->oldDataRecord["domain"]) { |
| | | $records = $app->db->queryAllRecords("SELECT domain_id,domain FROM web_domain WHERE (type = 'subdomain' OR type = 'vhostsubdomain' OR type = 'vhostalias') AND domain LIKE '%.".$app->db->quote($page_form->oldDataRecord["domain"])."'"); |
| | | $records = $app->db->queryAllRecords("SELECT domain_id,domain FROM web_domain WHERE (type = 'subdomain' OR type = 'vhostsubdomain' OR type = 'vhostalias') AND domain LIKE ?", "%." . $page_form->oldDataRecord["domain"]); |
| | | foreach($records as $rec) { |
| | | $subdomain = $app->db->quote(str_replace($page_form->oldDataRecord["domain"], $page_form->dataRecord["domain"], $rec['domain'])); |
| | | $app->db->datalogUpdate('web_domain', "domain = '".$subdomain."'", 'domain_id', $rec['domain_id']); |
| | | $subdomain = str_replace($page_form->oldDataRecord["domain"], $page_form->dataRecord["domain"], $rec['domain']); |
| | | $app->db->datalogUpdate('web_domain', array("domain" => $subdomain), 'domain_id', $rec['domain_id']); |
| | | } |
| | | unset($records); |
| | | unset($rec); |
| | | unset($subdomain); |
| | | |
| | | // Update APS instances |
| | | $records = $app->db->queryAllRecords("SELECT id, instance_id FROM aps_instances_settings WHERE name = 'main_domain' AND value = '".$app->db->quote($page_form->oldDataRecord["domain"])."'"); |
| | | $records = $app->db->queryAllRecords("SELECT id, instance_id FROM aps_instances_settings WHERE name = 'main_domain' AND value = ?", $page_form->oldDataRecord["domain"]); |
| | | if(is_array($records) && !empty($records)){ |
| | | foreach($records as $rec){ |
| | | $app->db->datalogUpdate('aps_instances_settings', "value = '".$app->db->quote($page_form->dataRecord["domain"])."'", 'id', $rec['id']); |
| | | $app->db->datalogUpdate('aps_instances_settings', array("value" => $page_form->dataRecord["domain"]), 'id', $rec['id']); |
| | | } |
| | | } |
| | | unset($records); |
| | |
| | | |
| | | //* Set allow_override if empty |
| | | if($web_rec['allow_override'] == '') { |
| | | $sql = "UPDATE web_domain SET allow_override = '".$app->db->quote($web_config["htaccess_allow_override"])."' WHERE domain_id = ".$page_form->id; |
| | | $app->db->query($sql); |
| | | $sql = "UPDATE web_domain SET allow_override = ? WHERE domain_id = ?"; |
| | | $app->db->query($sql, $web_config["htaccess_allow_override"], $page_form->id); |
| | | } |
| | | |
| | | //* Set php_open_basedir if empty or domain or client has been changed |
| | | if(empty($web_rec['php_open_basedir']) || |
| | | (!empty($page_form->dataRecord["domain"]) && !empty($page_form->oldDataRecord["domain"]) && $page_form->dataRecord["domain"] != $page_form->oldDataRecord["domain"])) { |
| | | $php_open_basedir = $web_rec['php_open_basedir']; |
| | | $php_open_basedir = $app->db->quote(str_replace($page_form->oldDataRecord['domain'], $web_rec['domain'], $php_open_basedir)); |
| | | $sql = "UPDATE web_domain SET php_open_basedir = '$php_open_basedir' WHERE domain_id = ".$page_form->id; |
| | | $app->db->query($sql); |
| | | $php_open_basedir = str_replace($page_form->oldDataRecord['domain'], $web_rec['domain'], $php_open_basedir); |
| | | $sql = "UPDATE web_domain SET php_open_basedir = ? WHERE domain_id = ?"; |
| | | $app->db->query($sql, $php_open_basedir, $page_form->id); |
| | | } |
| | | if(empty($web_rec['php_open_basedir']) || |
| | | (isset($page_form->dataRecord["client_group_id"]) && $page_form->dataRecord["client_group_id"] != $page_form->oldDataRecord["sys_groupid"])) { |
| | | $document_root = $app->db->quote(str_replace("[client_id]", $client_id, $document_root)); |
| | | $document_root = str_replace("[client_id]", $client_id, $document_root); |
| | | $php_open_basedir = str_replace("[website_path]", $document_root, $web_config["php_open_basedir"]); |
| | | $php_open_basedir = $app->db->quote(str_replace("[website_domain]", $web_rec['domain'], $php_open_basedir)); |
| | | $sql = "UPDATE web_domain SET php_open_basedir = '$php_open_basedir' WHERE domain_id = ".$page_form->id; |
| | | $app->db->query($sql); |
| | | $php_open_basedir = str_replace("[website_domain]", $web_rec['domain'], $php_open_basedir); |
| | | $sql = "UPDATE web_domain SET php_open_basedir = ? WHERE domain_id = ?"; |
| | | $app->db->query($sql, $php_open_basedir, $page_form->id); |
| | | } |
| | | |
| | | //* Change database backup options when web backup options have been changed |
| | | if(isset($page_form->dataRecord['backup_interval']) && ($page_form->dataRecord['backup_interval'] != $page_form->oldDataRecord['backup_interval'] || $page_form->dataRecord['backup_copies'] != $page_form->oldDataRecord['backup_copies'])) { |
| | | //* Update all databases |
| | | $backup_interval = $app->db->quote($page_form->dataRecord['backup_interval']); |
| | | $backup_interval = $page_form->dataRecord['backup_interval']; |
| | | $backup_copies = $app->functions->intval($page_form->dataRecord['backup_copies']); |
| | | $records = $app->db->queryAllRecords("SELECT database_id FROM web_database WHERE parent_domain_id = ".$page_form->id); |
| | | foreach($records as $rec) { |
| | | $app->db->datalogUpdate('web_database', "backup_interval = '$backup_interval', backup_copies = '$backup_copies'", 'database_id', $rec['database_id']); |
| | | $app->db->datalogUpdate('web_database', array("backup_interval" => $backup_interval, "backup_copies" => $backup_copies), 'database_id', $rec['database_id']); |
| | | } |
| | | unset($records); |
| | | unset($rec); |
| | |
| | | |
| | | //* Change vhost subdomain and alias ip/ipv6 if domain ip/ipv6 has changed |
| | | if(isset($page_form->dataRecord['ip_address']) && ($page_form->dataRecord['ip_address'] != $page_form->oldDataRecord['ip_address'] || $page_form->dataRecord['ipv6_address'] != $page_form->oldDataRecord['ipv6_address'])) { |
| | | $records = $app->db->queryAllRecords("SELECT domain_id FROM web_domain WHERE (type = 'vhostsubdomain' OR type = 'vhostalias') AND parent_domain_id = ".$page_form->id); |
| | | $records = $app->db->queryAllRecords("SELECT domain_id FROM web_domain WHERE (type = 'vhostsubdomain' OR type = 'vhostalias') AND parent_domain_id = ?", $page_form->id); |
| | | foreach($records as $rec) { |
| | | $app->db->datalogUpdate('web_domain', "ip_address = '".$app->db->quote($web_rec['ip_address'])."', ipv6_address = '".$app->db->quote($web_rec['ipv6_address'])."'", 'domain_id', $rec['domain_id']); |
| | | $app->db->datalogUpdate('web_domain', array("ip_address" => $web_rec['ip_address'], "ipv6_address" => $web_rec['ipv6_address']), 'domain_id', $rec['domain_id']); |
| | | } |
| | | unset($records); |
| | | unset($rec); |
| | | } |
| | | } else { |
| | | $php_open_basedir = str_replace("[website_path]", $document_root, $web_config["php_open_basedir"]); |
| | | $php_open_basedir = $app->db->quote(str_replace("[website_domain]", $page_form->dataRecord['domain'], $php_open_basedir)); |
| | | |
| | | $htaccess_allow_override = $app->db->quote($web_config["htaccess_allow_override"]); |
| | | $sql = "UPDATE web_domain SET system_user = '$system_user', system_group = '$system_group', document_root = '$document_root', allow_override = '$htaccess_allow_override', php_open_basedir = '$php_open_basedir' WHERE domain_id = ".$page_form->id; |
| | | $app->db->query($sql); |
| | | $php_open_basedir = str_replace("[website_domain]", $page_form->dataRecord['domain'], $php_open_basedir); |
| | | $htaccess_allow_override = $web_config["htaccess_allow_override"]; |
| | | |
| | | $sql = "UPDATE web_domain SET system_user = ?, system_group = ?, document_root = ?, allow_override = ?, php_open_basedir = ? WHERE domain_id = ?"; |
| | | $app->db->query($sql, $system_user, $system_group, $document_root, $htaccess_allow_override, $php_open_basedir, $page_form->id); |
| | | } |
| | | } else { |
| | | if(isset($page_form->dataRecord["parent_domain_id"]) && $page_form->dataRecord["parent_domain_id"] != $page_form->oldDataRecord["parent_domain_id"]) { |
| | | $parent_domain = $app->db->queryOneRecord("SELECT * FROM `web_domain` WHERE `domain_id` = '" . $app->functions->intval($page_form->dataRecord['parent_domain_id']) . "'"); |
| | | $parent_domain = $app->db->queryOneRecord("SELECT * FROM `web_domain` WHERE `domain_id` = ?", $page_form->dataRecord['parent_domain_id']); |
| | | |
| | | // Set the values for document_root, system_user and system_group |
| | | $system_user = $app->db->quote($parent_domain['system_user']); |
| | | $system_group = $app->db->quote($parent_domain['system_group']); |
| | | $document_root = $app->db->quote($parent_domain['document_root']); |
| | | $system_user = $parent_domain['system_user']; |
| | | $system_group = $parent_domain['system_group']; |
| | | $document_root = $parent_domain['document_root']; |
| | | $php_open_basedir = str_replace("[website_path]/web", $document_root.'/'.$page_form->dataRecord['web_folder'], $web_config["php_open_basedir"]); |
| | | $php_open_basedir = str_replace("[website_domain]/web", $page_form->dataRecord['domain'].'/'.$page_form->dataRecord['web_folder'], $php_open_basedir); |
| | | $php_open_basedir = str_replace("[website_path]", $document_root, $php_open_basedir); |
| | | $php_open_basedir = $app->db->quote(str_replace("[website_domain]", $page_form->dataRecord['domain'], $php_open_basedir)); |
| | | $htaccess_allow_override = $app->db->quote($parent_domain['allow_override']); |
| | | $sql = "UPDATE web_domain SET sys_groupid = ".$app->functions->intval($parent_domain['sys_groupid']).",system_user = '$system_user', system_group = '$system_group', document_root = '$document_root', allow_override = '$htaccess_allow_override', php_open_basedir = '$php_open_basedir' WHERE domain_id = ".$page_form->id; |
| | | $app->db->query($sql); |
| | | $php_open_basedir = str_replace("[website_domain]", $page_form->dataRecord['domain'], $php_open_basedir); |
| | | $htaccess_allow_override = $parent_domain['allow_override']; |
| | | $sql = "UPDATE web_domain SET sys_groupid = ?,system_user = ?, system_group = ?, document_root = ?, allow_override = ?, php_open_basedir = ? WHERE domain_id = ?"; |
| | | $app->db->query($sql, $parent_domain['sys_groupid'], $system_user, $system_group, $document_root, $htaccess_allow_override, $php_open_basedir, $page_form->id); |
| | | } |
| | | } |
| | | } |
| | |
| | | // 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 = $client_group_id WHERE vm_id = ".$this->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 = $client_group_id WHERE vm_id = ".$this->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 = ".$veid." WHERE vm_id = ".$this->id); |
| | | $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 = ".$this->id." WHERE ip_address = '".$app->db->quote($this->dataRecord['ip_address'])."'"); |
| | | $app->db->query("UPDATE openvz_ip SET vm_id = ? WHERE ip_address = ?", $this->id, $this->dataRecord['ip_address']); |
| | | |
| | | // Create the OpenVZ config file and store it in config field |
| | | $this->makeOpenVZConfig(); |
| | |
| | | // 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 = $client_group_id WHERE vm_id = ".$this->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 = $client_group_id WHERE vm_id = ".$this->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"]) { |
| | |
| | | } |
| | | |
| | | // Set the IP address |
| | | if(isset($this->dataRecord['ip_address'])) $app->db->query("UPDATE openvz_ip SET vm_id = ".$this->id." WHERE ip_address = '".$app->db->quote($this->dataRecord['ip_address'])."'"); |
| | | if(isset($this->dataRecord['ip_address'])) $app->db->query("UPDATE openvz_ip SET vm_id = ? WHERE ip_address = ?", $this->id, $this->dataRecord['ip_address']); |
| | | |
| | | // Create the OpenVZ config file and store it in config field |
| | | $this->makeOpenVZConfig(); |
| | |
| | | global $app, $conf; |
| | | |
| | | //* Free the IP address |
| | | $tmp = $app->db->queryOneRecord("SELECT ip_address_id FROM openvz_ip WHERE vm_id = ".$app->functions->intval($page_form->id)); |
| | | $app->db->datalogUpdate('openvz_ip', 'vm_id = 0', 'ip_address_id', $tmp['ip_address_id']); |
| | | $tmp = $app->db->queryOneRecord("SELECT ip_address_id FROM openvz_ip WHERE vm_id = ?", $page_form->id); |
| | | $app->db->datalogUpdate('openvz_ip', array('vm_id' => 0), 'ip_address_id', $tmp['ip_address_id']); |
| | | unset($tmp); |
| | | |
| | | } |
| | |
| | | private function applyTemplate() { |
| | | global $app, $conf; |
| | | |
| | | $tpl = $app->db->queryOneRecord("SELECT * FROM openvz_template WHERE template_id = ".$app->functions->intval($this->dataRecord["template_id"])); |
| | | $tpl = $app->db->queryOneRecord("SELECT * FROM openvz_template WHERE template_id = ?", $this->dataRecord["template_id"]); |
| | | |
| | | $sql = "UPDATE openvz_vm SET "; |
| | | $sql .= "diskspace = '".$app->db->quote($tpl['diskspace'])."', "; |
| | | $sql .= "ram = '".$app->db->quote($tpl['ram'])."', "; |
| | | $sql .= "ram_burst = '".$app->db->quote($tpl['ram_burst'])."', "; |
| | | $sql .= "cpu_units = '".$app->db->quote($tpl['cpu_units'])."', "; |
| | | $sql .= "cpu_num = '".$app->db->quote($tpl['cpu_num'])."', "; |
| | | $sql .= "cpu_limit = '".$app->db->quote($tpl['cpu_limit'])."', "; |
| | | $sql .= "io_priority = '".$app->db->quote($tpl['io_priority'])."', "; |
| | | $sql .= "nameserver = '".$app->db->quote($tpl['nameserver'])."', "; |
| | | $sql .= "create_dns = '".$app->db->quote($tpl['create_dns'])."', "; |
| | | $sql .= "capability = '".$app->db->quote($tpl['capability'])."' "; |
| | | $sql .= "WHERE vm_id = ".$app->functions->intval($this->id); |
| | | $app->db->query($sql); |
| | | $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 .= "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'], $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'])); |
| | | $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; |
| | | |
| | |
| | | $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']); |
| | | |
| | | $tmp = $app->db->queryOneRecord("SELECT template_file FROM openvz_ostemplate WHERE ostemplate_id = ".$app->functions->intval($vm['ostemplate_id'])); |
| | | $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 = $app->db->quote($tpl->grab()); |
| | | $app->db->query("UPDATE openvz_vm SET config = '".$openvz_config."' WHERE vm_id = ".$app->functions->intval($this->id)); |
| | | $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)); |
| | | $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 = $app->db->quote($hostname_parts[0]); |
| | | $hostname = $hostname_parts[0]; |
| | | unset($hostname_parts[0]); |
| | | $zone = $app->db->quote((implode('.', $hostname_parts))); |
| | | $zone = implode('.', $hostname_parts); |
| | | unset($hostname_parts); |
| | | |
| | | // Find the dns zone |
| | | $zone_rec = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE origin = '".$app->db->quote($zone).".'"); |
| | | $rr_rec = $app->db->queryOneRecord("SELECT * FROM dns_rr WHERE zone = '".$app->functions->intval($zone_rec['id'])."' AND name = '".$app->db->quote($hostname)."'"); |
| | | $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 = $app->db->quote($vm['ip_address']); |
| | | $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']); |
| | |
| | | |
| | | if($rr_rec['id'] > 0) { |
| | | $app->uses('validate_dns'); |
| | | $app->db->datalogUpdate('dns_rr', "data = '$ip_address'", 'id', $app->functions->intval($rr_rec['id'])); |
| | | $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', "serial = '$serial'", 'id', $app->functions->intval($zone_rec['id'])); |
| | | $app->db->datalogUpdate('dns_soa', array("serial" => $serial), 'id', $app->functions->intval($zone_rec['id'])); |
| | | } else { |
| | | $insert_data = "(`sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `server_id`, `zone`, `name`, `type`, `data`, `aux`, `ttl`, `active`) VALUES |
| | | ('$sys_userid', '$sys_groupid', 'riud', 'riud', '', '$server_id', '$dns_soa_id', '$hostname', 'A', '$ip_address', '0', '3600', 'Y')"; |
| | | $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" => 'A', |
| | | "data" => $ip_address, |
| | | "aux" => '0', |
| | | "ttl" => '3600', |
| | | "active" => 'Y' |
| | | ); |
| | | $dns_rr_id = $app->db->datalogInsert('dns_rr', $insert_data, 'id'); |
| | | } |
| | | |
| | |
| | | //* 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'])) { |
| | | $rec = $app->db->queryOneRecord("SELECT server_id from firewall WHERE firewall_id = ".$this->id); |
| | | $rec = $app->db->queryOneRecord("SELECT server_id from firewall WHERE firewall_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.'); |
| | |
| | | 'default' => 'y', |
| | | 'value' => array(0 => 'n', 1 => 'y') |
| | | ), |
| | | 'required_php_snippets' => array ( |
| | | 'datatype' => 'VARCHAR', |
| | | 'formtype' => 'CHECKBOXARRAY', |
| | | 'default' => '', |
| | | 'datasource' => array ( 'type' => 'SQL', |
| | | 'querystring' => "SELECT directive_snippets_id,name FROM directive_snippets WHERE type = 'php' AND active = 'y'ORDER BY name", |
| | | 'keyfield' => 'directive_snippets_id', |
| | | 'valuefield' => 'name' |
| | | ), |
| | | 'separator' => ',', |
| | | ), |
| | | //################################# |
| | | // ENDE Datatable fields |
| | | //################################# |
| | |
| | | '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', |
| | |
| | | 'backup_dir_is_mount' => array( |
| | | 'datatype' => 'VARCHAR', |
| | | 'formtype' => 'CHECKBOX', |
| | | 'default' => 'n', |
| | | 'default' => 'y', |
| | | 'value' => array(0 => 'n', 1 => 'y') |
| | | ), |
| | | 'backup_mode' => array( |
| | |
| | | 'width' => '40', |
| | | 'maxlength' => '255' |
| | | ), |
| | | 'maildir_format' => array( |
| | | 'datatype' => 'VARCHAR', |
| | | 'formtype' => 'SELECT', |
| | | 'default' => '20', |
| | | 'value' => array('maildir' => 'Maildir', 'mdbox' => 'mdbox') |
| | | ), |
| | | 'homedir_path' => array( |
| | | 'datatype' => 'VARCHAR', |
| | | 'formtype' => 'TEXT', |
| | |
| | | 'datatype' => 'INTEGER', |
| | | 'formtype' => 'SELECT', |
| | | 'default' => '2048', |
| | | 'value' => array('1024' => 'week (1024)', '2048' => 'normal (2048)', '4096' => 'strong (4096)') |
| | | 'value' => array('1024' => 'weak (1024)', '2048' => 'normal (2048)', '4096' => 'strong (4096)') |
| | | ), |
| | | 'relayhost_password' => array( |
| | | 'datatype' => 'VARCHAR', |
| | |
| | | 'value' => '', |
| | | 'width' => '40', |
| | | 'maxlength' => '255' |
| | | ), |
| | | 'reject_sender_login_mismatch' => array ( |
| | | 'datatype' => 'VARCHAR', |
| | | 'formtype' => 'CHECKBOX', |
| | | 'default' => 'n', |
| | | 'value' => array(0 => 'n', 1 => 'y') |
| | | ), |
| | | 'mailbox_size_limit' => array( |
| | | 'datatype' => 'INTEGER', |
| | |
| | | 'width' => '40', |
| | | 'maxlength' => '255' |
| | | ), |
| | | /* |
| | | 'vhost_rewrite_v6' => array ( |
| | | 'datatype' => 'VARCHAR', |
| | | 'formtype' => 'CHECKBOX', |
| | | 'default' => 'n', |
| | | 'value' => array(0 => 'n',1 => 'y') |
| | | ), |
| | | */ |
| | | 'vhost_rewrite_v6' => array ( |
| | | 'datatype' => 'VARCHAR', |
| | | 'formtype' => 'CHECKBOX', |
| | | 'default' => 'n', |
| | | 'value' => array(0 => 'n',1 => 'y') |
| | | ), |
| | | 'vhost_conf_dir' => array( |
| | | 'datatype' => 'VARCHAR', |
| | | 'formtype' => 'TEXT', |
| | |
| | | 'enable_spdy' => array ( |
| | | 'datatype' => 'VARCHAR', |
| | | 'formtype' => 'CHECKBOX', |
| | | 'default' => 'n', |
| | | 'default' => 'y', |
| | | 'value' => array ( |
| | | 0 => 'n', |
| | | 1 => 'y' |
| | |
| | | 'width' => '40', |
| | | 'maxlength' => '255' |
| | | ), |
| | | 'disable_bind_log' => array ( |
| | | 'datatype' => 'VARCHAR', |
| | | 'formtype' => 'CHECKBOX', |
| | | 'default' => 'n', |
| | | 'value' => array(0 => 'n', 1 => 'y') |
| | | ), |
| | | //################################# |
| | | // ENDE Datatable fields |
| | | //################################# |
| | |
| | | ); |
| | | |
| | | |
| | | $form["tabs"]['xmpp'] = array( |
| | | 'title' => "XMPP", |
| | | 'width' => 80, |
| | | 'template' => "templates/server_config_xmpp_edit.htm", |
| | | 'fields' => array( |
| | | //################################# |
| | | // Begin Datatable fields |
| | | //################################# |
| | | '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', |
| | | 'default' => 'admin@service.com, superuser@service.com', |
| | | 'value' => '', |
| | | 'width' => '15' |
| | | ), |
| | | |
| | | 'xmpp_modules_enabled' => array( |
| | | 'datatype' => 'TEXT', |
| | | 'formtype' => 'TEXT', |
| | | '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, |
New file |
| | |
| | | <?php |
| | | |
| | | /* |
| | | Copyright (c) 2015, Florian Schaal, schaal @it |
| | | 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. |
| | | */ |
| | | |
| | | $form["title"] = "IP Addresse mapping"; |
| | | $form["description"] = ""; |
| | | $form["name"] = "server_ip_map"; |
| | | $form["action"] = "server_ip_map_edit.php"; |
| | | $form["db_table"] = "server_ip_map"; |
| | | $form["db_table_idx"] = "server_ip_map_id"; |
| | | $form["db_history"] = "yes"; |
| | | $form["tab_default"] = "server_ip_map"; |
| | | $form["list_default"] = "server_ip_map_list.php"; |
| | | $form["auth"] = 'yes'; |
| | | |
| | | $form["auth_preset"]["userid"] = 0; // 0 = id of the user, > 0 id must match with id of current user |
| | | $form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user |
| | | $form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete |
| | | $form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete |
| | | $form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete |
| | | |
| | | $form["tabs"]['server_ip_map'] = array ( |
| | | 'title' => "IP Address Mapping", |
| | | 'width' => 80, |
| | | 'template' => "templates/server_ip_map_edit.htm", |
| | | 'fields' => array ( |
| | | 'server_id' => array ( |
| | | 'datatype' => 'VARCHAR', |
| | | 'formtype' => 'SELECT', |
| | | 'default' => '', |
| | | 'value' => '' |
| | | ), |
| | | 'source_ip' => array ( |
| | | 'datatype' => 'VARCHAR', |
| | | 'formtype' => 'SELECT', |
| | | 'validators' => array ( |
| | | 0 => array ( 'type' => 'NOTEMPTY', 'errmsg'=> 'source_ip_empty'), |
| | | ), |
| | | 'default' => '', |
| | | 'value' => '' |
| | | ), |
| | | 'destination_ip' => array ( |
| | | 'datatype' => 'VARCHAR', |
| | | 'formtype' => 'TEXT', |
| | | 'validators' => array ( |
| | | 0 => array ( 'type' => 'ISIP', 'errmsg'=> 'ip_error_wrong'), |
| | | 1 => array ( 'type' => 'NOTEMPTY', 'errmsg'=> 'destination_ip_empty'), |
| | | ), |
| | | 'default' => '', |
| | | 'value' => '', |
| | | 'separator' => '', |
| | | 'width' => '15', |
| | | 'maxlength' => '15', |
| | | 'rows' => '', |
| | | 'cols' => '', |
| | | 'searchable' => 1 |
| | | ), |
| | | 'active' => array( |
| | | 'datatype' => 'VARCHAR', |
| | | 'formtype' => 'CHECKBOX', |
| | | 'default' => 'y', |
| | | 'value' => array(0 => 'n', 1 => 'y') |
| | | ), |
| | | ) |
| | | ); |
| | | ?> |
| | |
| | | //################################# |
| | | // Begin Datatable fields |
| | | //################################# |
| | | 'company_name' => array ( |
| | | 'datatype' => 'VARCHAR', |
| | | 'formtype' => 'TEXT', |
| | | 'default' => '', |
| | | 'value' => '' |
| | | ), |
| | | 'dashboard_atom_url_admin' => array ( |
| | | 'datatype' => 'VARCHAR', |
| | | 'formtype' => 'TEXT', |
| | |
| | | $app->tpl->setVar('error', $error); |
| | | |
| | | if(isset($_POST['lng_new']) && strlen($_POST['lng_new']) == 2 && $error == '') { |
| | | |
| | | //* CSRF Check |
| | | $app->auth->csrf_token_check(); |
| | | |
| | | $lng_new = $_POST['lng_new']; |
| | | if(!preg_match("/^[a-z]{2}$/i", $lng_new)) die('unallowed characters in language name.'); |
| | | |
| | |
| | | |
| | | $app->tpl->setVar('msg', $msg); |
| | | |
| | | //* SET csrf token |
| | | $csrf_token = $app->auth->csrf_token_get('language_add'); |
| | | $app->tpl->setVar('_csrf_id',$csrf_token['csrf_id']); |
| | | $app->tpl->setVar('_csrf_key',$csrf_token['csrf_key']); |
| | | |
| | | //* load language file |
| | | $lng_file = 'lib/lang/'.$_SESSION['s']['language'].'_language_add.lng'; |
| | | include $lng_file; |
| | |
| | | // Export the language file |
| | | if(isset($_POST['lng_select']) && $error == '') { |
| | | |
| | | //* CSRF Check |
| | | $app->auth->csrf_token_check(); |
| | | |
| | | // complete the global langauge file |
| | | merge_langfile(ISPC_LIB_PATH."/lang/".$selected_language.".lng", ISPC_LIB_PATH."/lang/en.lng"); |
| | | |
| | |
| | | |
| | | $app->tpl->setVar('msg', $msg); |
| | | |
| | | //* SET csrf token |
| | | $csrf_token = $app->auth->csrf_token_get('language_merge'); |
| | | $app->tpl->setVar('_csrf_id',$csrf_token['csrf_id']); |
| | | $app->tpl->setVar('_csrf_key',$csrf_token['csrf_key']); |
| | | |
| | | //* load language file |
| | | $lng_file = 'lib/lang/'.$_SESSION['s']['language'].'_language_complete.lng'; |
| | | include $lng_file; |
| | |
| | | |
| | | //* Save data |
| | | if(isset($_POST['records']) && is_array($_POST['records'])) { |
| | | |
| | | //* CSRF Check |
| | | $app->auth->csrf_token_check(); |
| | | |
| | | $file_content = "<?php\n"; |
| | | foreach($_POST['records'] as $key => $val) { |
| | | $val = stripslashes($val); |
| | |
| | | unset($wb); |
| | | } |
| | | |
| | | //* SET csrf token |
| | | $csrf_token = $app->auth->csrf_token_get('language_edit'); |
| | | $app->tpl->setVar('_csrf_id',$csrf_token['csrf_id']); |
| | | $app->tpl->setVar('_csrf_key',$csrf_token['csrf_key']); |
| | | |
| | | |
| | | //* load language file |
| | | $lng_file = 'lib/lang/'.$_SESSION['s']['language'].'_language_edit.lng'; |
| | |
| | | $new_string = ''; |
| | | |
| | | for($c = 0; $c < mb_strlen($string); $c++) { |
| | | $char = $string{$c}; |
| | | $char = mb_substr($string, $c, 1); |
| | | |
| | | if($in_string === true && $escaped === false && $char === $quote) { |
| | | // this marks a string end (e.g. for concatenation) |
| | |
| | | |
| | | // Export the language file |
| | | if(isset($_FILES['file']['name']) && is_uploaded_file($_FILES['file']['tmp_name'])) { |
| | | |
| | | //* CSRF Check |
| | | $app->auth->csrf_token_check(); |
| | | |
| | | $lines = file($_FILES['file']['tmp_name']); |
| | | // initial check |
| | | $parts = explode('|', $lines[0]); |
| | |
| | | $app->tpl->setVar('msg', $msg); |
| | | $app->tpl->setVar('error', $error); |
| | | |
| | | //* SET csrf token |
| | | $csrf_token = $app->auth->csrf_token_get('language_import'); |
| | | $app->tpl->setVar('_csrf_id',$csrf_token['csrf_id']); |
| | | $app->tpl->setVar('_csrf_key',$csrf_token['csrf_key']); |
| | | |
| | | //* load language file |
| | | $lng_file = 'lib/lang/'.$_SESSION['s']['language'].'_language_import.lng'; |
| | | include $lng_file; |
| | |
| | | $wb['fastcgi_bin_txt'] = 'FastCGI Bin'; |
| | | $wb['module_txt'] = 'Module'; |
| | | $wb['maildir_path_txt'] = 'Maildir Path'; |
| | | $wb['maildir_format_txt'] = 'Maildir Format'; |
| | | $wb['homedir_path_txt'] = 'Homedir Path'; |
| | | $wb['mailuser_uid_txt'] = 'Mailuser UID'; |
| | | $wb['mailuser_gid_txt'] = 'Mailuser GID'; |
| | |
| | | $wb['relayhost_txt'] = 'Relayhost'; |
| | | $wb['relayhost_user_txt'] = 'Relayhost User'; |
| | | $wb['relayhost_password_txt'] = 'Relayhost Password'; |
| | | $wb['reject_sender_login_mismatch_txt'] = 'Reject sender and login mismatch'; |
| | | $wb['mailbox_size_limit_txt'] = 'Mailbox Size Limit'; |
| | | $wb['message_size_limit_txt'] = 'Message Size Limit'; |
| | | $wb['ip_address_txt'] = 'IP Address'; |
| | |
| | | $wb['crontab_dir_error_regex'] = 'Invalid crontab directory.'; |
| | | $wb['cron_wget_error_regex'] = 'Invalid cron wget path.'; |
| | | $wb['network_filesystem_txt'] = 'Network Filesystem'; |
| | | $wb["disable_bind_log_txt"] = "Disable bind9 messages for Loglevel WARN"; |
| | | ?> |
New file |
| | |
| | | <?php |
| | | $wb["server_id_txt"] = 'Rewrite on Server'; |
| | | $wb["source_txt"] = 'Source IP'; |
| | | $wb["destination_txt"] = 'Destination IP'; |
| | | $wb["active_txt"] = 'Active'; |
| | | $wb["ip_error_wrong"] = 'The Destination IP address is invalid'; |
| | | $wb["destination_ip_empty"] = 'The Destination IP is empty.'; |
| | | $wb["source_ip_empty"] = 'The Source IP is empty.'; |
| | | $wb["duplicate_mapping_error"] = "Mapping already exists."; |
| | | $wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server"; |
| | | ?> |
New file |
| | |
| | | <?php |
| | | $wb["list_head_txt"] = 'IP Mappings'; |
| | | $wb["server_id_txt"] = 'Server'; |
| | | $wb["source_ip_txt"] = 'Source IP'; |
| | | $wb["destination_ip_txt"] = 'Destination IP'; |
| | | $wb["active_txt"] = 'Active'; |
| | | ?> |
| | |
| | | $wb['No'] = 'No'; |
| | | $wb['min_password_length_txt'] = 'Minimum password length'; |
| | | $wb['min_password_strength_txt'] = 'Minimum password strength'; |
| | | $wb["company_name_txt"] = "Company Name for the page title"; |
| | | $wb["reseller_can_use_options_txt"] = "Reseller can use the option-tab for websites"; |
| | | ?> |
| | |
| | | $wb['fastcgi_bin_txt'] = 'FastCGI Bin'; |
| | | $wb['module_txt'] = 'Модул'; |
| | | $wb['maildir_path_txt'] = 'Maildir Path'; |
| | | $wb['maildir_format_txt'] = 'Maildir Format'; |
| | | $wb['homedir_path_txt'] = 'Homedir Path'; |
| | | $wb['mailuser_uid_txt'] = 'Mailuser UID'; |
| | | $wb['mailuser_gid_txt'] = 'Mailuser GID'; |
| | |
| | | $wb['relayhost_txt'] = 'Relayhost'; |
| | | $wb['relayhost_user_txt'] = 'Relayhost User'; |
| | | $wb['relayhost_password_txt'] = 'Relayhost Password'; |
| | | $wb['reject_sender_login_mismatch_txt'] = 'Reject sender and login mismatch'; |
| | | $wb['mailbox_size_limit_txt'] = 'Mailbox Size Limit'; |
| | | $wb['message_size_limit_txt'] = 'Message Size Limit'; |
| | | $wb['ip_address_txt'] = 'IP адрес'; |
| | |
| | | $wb['crontab_dir_error_regex'] = 'Invalid crontab directory.'; |
| | | $wb['cron_wget_error_regex'] = 'Invalid cron wget path.'; |
| | | $wb['network_filesystem_txt'] = 'Network Filesystem'; |
| | | $wb["disable_bind_log_txt"] = "Disable bind9 messages for Loglevel WARN"; |
| | | ?> |
New file |
| | |
| | | <?php |
| | | $wb["server_id_txt"] = 'Rewrite on Server'; |
| | | $wb["source_txt"] = 'Source IP'; |
| | | $wb["destination_txt"] = 'Destination IP'; |
| | | $wb["active_txt"] = 'Active'; |
| | | $wb["ip_error_wrong"] = 'The Destination IP address is invalid'; |
| | | $wb["destination_ip_empty"] = 'The Destination IP is empty.'; |
| | | $wb["source_ip_empty"] = 'The Source IP is empty.'; |
| | | $wb["duplicate_mapping_error"] = "Mapping already exists."; |
| | | $wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server"; |
| | | ?> |
New file |
| | |
| | | <?php |
| | | $wb["list_head_txt"] = 'IP Mappings'; |
| | | $wb["server_id_txt"] = 'Server'; |
| | | $wb["source_ip_txt"] = 'Source IP'; |
| | | $wb["destination_ip_txt"] = 'Destination IP'; |
| | | $wb["active_txt"] = 'Active'; |
| | | ?> |
| | |
| | | $wb['No'] = 'No'; |
| | | $wb['min_password_length_txt'] = 'Minimum password length'; |
| | | $wb['min_password_strength_txt'] = 'Minimum password strength'; |
| | | $wb["company_name_txt"] = "Company Name for the page title"; |
| | | $wb["reseller_can_use_options_txt"] = "Reseller can use the option-tab for websites"; |
| | | ?> |
| | |
| | | $wb['fastcgi_bin_txt'] = 'FastCGI Bin'; |
| | | $wb['module_txt'] = 'Módulo'; |
| | | $wb['maildir_path_txt'] = 'Caminho do diretório Maildir'; |
| | | $wb['maildir_format_txt'] = 'Maildir Format'; |
| | | $wb['homedir_path_txt'] = 'Caminho do diretório Home'; |
| | | $wb['mailuser_uid_txt'] = 'UID usuário de email'; |
| | | $wb['mailuser_gid_txt'] = 'GID usuário de email'; |
| | |
| | | $wb['relayhost_txt'] = 'Host Relay'; |
| | | $wb['relayhost_user_txt'] = 'Usuário do Host Relay'; |
| | | $wb['relayhost_password_txt'] = 'Senha do Host Relay'; |
| | | $wb['reject_sender_login_mismatch_txt'] = 'Reject sender and login mismatch'; |
| | | $wb['mailbox_size_limit_txt'] = 'Tamanho máximo da Caixa Postal'; |
| | | $wb['message_size_limit_txt'] = 'Tamanho máximo de mensagem'; |
| | | $wb['ip_address_txt'] = 'Endereço IP'; |
| | |
| | | $wb['crontab_dir_error_regex'] = 'Invalid crontab directory.'; |
| | | $wb['cron_wget_error_regex'] = 'Invalid cron wget path.'; |
| | | $wb['network_filesystem_txt'] = 'Network Filesystem'; |
| | | $wb["disable_bind_log_txt"] = "Disable bind9 messages for Loglevel WARN"; |
| | | ?> |
New file |
| | |
| | | <?php |
| | | $wb["server_id_txt"] = 'Rewrite on Server'; |
| | | $wb["source_txt"] = 'Source IP'; |
| | | $wb["destination_txt"] = 'Destination IP'; |
| | | $wb["active_txt"] = 'Active'; |
| | | $wb["ip_error_wrong"] = 'The Destination IP address is invalid'; |
| | | $wb["destination_ip_empty"] = 'The Destination IP is empty.'; |
| | | $wb["source_ip_empty"] = 'The Source IP is empty.'; |
| | | $wb["duplicate_mapping_error"] = "Mapping already exists."; |
| | | $wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server"; |
| | | ?> |
New file |
| | |
| | | <?php |
| | | $wb["list_head_txt"] = 'IP Mappings'; |
| | | $wb["server_id_txt"] = 'Server'; |
| | | $wb["source_ip_txt"] = 'Source IP'; |
| | | $wb["destination_ip_txt"] = 'Destination IP'; |
| | | $wb["active_txt"] = 'Active'; |
| | | ?> |
| | |
| | | $wb['No'] = 'No'; |
| | | $wb['min_password_length_txt'] = 'Minimum password length'; |
| | | $wb['min_password_strength_txt'] = 'Minimum password strength'; |
| | | $wb["company_name_txt"] = "Company Name for the page title"; |
| | | $wb["reseller_can_use_options_txt"] = "Reseller can use the option-tab for websites"; |
| | | ?> |
| | |
| | | $wb['fastcgi_bin_txt'] = 'FastCGI cesta k binarnímu balíčku'; |
| | | $wb['module_txt'] = 'Modul'; |
| | | $wb['maildir_path_txt'] = 'Cesta k mail adresáři'; |
| | | $wb['maildir_format_txt'] = 'Maildir Format'; |
| | | $wb['homedir_path_txt'] = 'Cesta k domácímu adresáři'; |
| | | $wb['mailuser_uid_txt'] = 'Mail uživatel UID'; |
| | | $wb['mailuser_gid_txt'] = 'Mail uživatel GID'; |
| | |
| | | $wb['relayhost_txt'] = 'Relayhost'; |
| | | $wb['relayhost_user_txt'] = 'Relayhost uživatel'; |
| | | $wb['relayhost_password_txt'] = 'Relayhost heslo'; |
| | | $wb['reject_sender_login_mismatch_txt'] = 'Reject sender and login mismatch'; |
| | | $wb['mailbox_size_limit_txt'] = 'Limit velikosti mailboxu'; |
| | | $wb['message_size_limit_txt'] = 'Limit velikosti zprávy'; |
| | | $wb['ip_address_txt'] = 'IP adresa'; |
| | |
| | | $wb['crontab_dir_error_regex'] = 'Invalid crontab directory.'; |
| | | $wb['cron_wget_error_regex'] = 'Invalid cron wget path.'; |
| | | $wb['network_filesystem_txt'] = 'Network Filesystem'; |
| | | $wb["disable_bind_log_txt"] = "Disable bind9 messages for Loglevel WARN"; |
| | | ?> |
| | | |
New file |
| | |
| | | <?php |
| | | $wb["server_id_txt"] = 'Rewrite on Server'; |
| | | $wb["source_txt"] = 'Source IP'; |
| | | $wb["destination_txt"] = 'Destination IP'; |
| | | $wb["active_txt"] = 'Active'; |
| | | $wb["ip_error_wrong"] = 'The Destination IP address is invalid'; |
| | | $wb["destination_ip_empty"] = 'The Destination IP is empty.'; |
| | | $wb["source_ip_empty"] = 'The Source IP is empty.'; |
| | | $wb["duplicate_mapping_error"] = "Mapping already exists."; |
| | | $wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server"; |
| | | ?> |
New file |
| | |
| | | <?php |
| | | $wb["list_head_txt"] = 'IP Mappings'; |
| | | $wb["server_id_txt"] = 'Server'; |
| | | $wb["source_ip_txt"] = 'Source IP'; |
| | | $wb["destination_ip_txt"] = 'Destination IP'; |
| | | $wb["active_txt"] = 'Active'; |
| | | ?> |
| | |
| | | $wb['No'] = 'Ne'; |
| | | $wb['min_password_length_txt'] = 'Minimální délka hesla'; |
| | | $wb['min_password_strength_txt'] = 'Minimální síla hesla'; |
| | | $wb["company_name_txt"] = "Company Name for the page title"; |
| | | $wb["reseller_can_use_options_txt"] = "Reseller can use the option-tab for websites"; |
| | | ?> |
| | | |
| | |
| | | $wb['fastcgi_bin_txt'] = 'FastCGI Bin'; |
| | | $wb['module_txt'] = 'Modul'; |
| | | $wb['maildir_path_txt'] = 'Maildir Pfad'; |
| | | $wb['maildir_format_txt'] = 'Maildir Format'; |
| | | $wb['homedir_path_txt'] = 'Homedir Pfad'; |
| | | $wb['dkim_path_txt'] = 'DKIM Pfad'; |
| | | $wb['mailuser_uid_txt'] = 'Mailbenutzer UID'; |
| | |
| | | $wb['relayhost_txt'] = 'Relayhost'; |
| | | $wb['relayhost_user_txt'] = 'Relayhost Benutzer'; |
| | | $wb['relayhost_password_txt'] = 'Relayhost Passwort'; |
| | | $wb['reject_sender_login_mismatch_txt'] = 'Zurückweisen von Mails, wenn Sender nicht gleich Login'; |
| | | $wb['mailbox_size_limit_txt'] = 'E-Mailkonto Beschränkung'; |
| | | $wb['message_size_limit_txt'] = 'E-Mailgrößen Beschränkung'; |
| | | $wb['ip_address_txt'] = 'IP Adresse'; |
| | |
| | | $wb['php_ini_check_minutes_info_txt'] = '0 = keine Prüfung'; |
| | | $wb['php_handler_txt'] = 'Standard-PHP-Handler'; |
| | | $wb['enable_spdy_txt'] = 'Stellt SPDY zur Verfügung'; |
| | | $wb["disable_bind_log_txt"] = "Disable bind9 messages for Loglevel WARN"; |
| | | ?> |
New file |
| | |
| | | <?php |
| | | $wb["server_id_txt"] = 'Rewrite auf Server'; |
| | | $wb["source_txt"] = 'eigentliche IP'; |
| | | $wb["destination_txt"] = 'neue IP'; |
| | | $wb["active_txt"] = 'Aktiv'; |
| | | $wb["ip_error_wrong"] = 'Die neue IP ist ungueltig'; |
| | | $wb["destination_ip_empty"] = 'Die neue IP ist leer.'; |
| | | $wb["source_ip_empty"] = 'Die eigentliche IP ist leer.'; |
| | | $wb["duplicate_mapping_error"] = "Mapping existiert bereits."; |
| | | $wb["duplicate_mapping_error"] = "Die eigentliche IP darf keine IP des Rewrite-Servers sein."; |
| | | ?> |
New file |
| | |
| | | <?php |
| | | $wb["list_head_txt"] = 'IP Mappings'; |
| | | $wb["server_id_txt"] = 'Server'; |
| | | $wb["source_ip_txt"] = 'eigentliche IP'; |
| | | $wb["destination_ip_txt"] = 'neue IP'; |
| | | $wb["active_txt"] = 'Aktiv'; |
| | | ?> |
| | |
| | | $wb['No'] = 'Nein'; |
| | | $wb['min_password_length_txt'] = 'Minimale Passwortlänge'; |
| | | $wb['min_password_strength_txt'] = 'Minimale Passwortstärke'; |
| | | $wb["company_name_txt"] = "Firmenname fuer den Seitentitel"; |
| | | ?> |
| | |
| | | $wb['fastcgi_bin_txt'] = 'FastCGI Bin'; |
| | | $wb['module_txt'] = 'Άρθρωμα'; |
| | | $wb['maildir_path_txt'] = 'Διαδρομή Maildir'; |
| | | $wb['maildir_format_txt'] = 'Maildir Format'; |
| | | $wb['homedir_path_txt'] = 'Διαδρομή Homedir'; |
| | | $wb['mailuser_uid_txt'] = 'Mailuser UID'; |
| | | $wb['mailuser_gid_txt'] = 'Mailuser GID'; |
| | |
| | | $wb['relayhost_txt'] = 'Relayhost'; |
| | | $wb['relayhost_user_txt'] = 'Χρήστης Relayhost'; |
| | | $wb['relayhost_password_txt'] = 'Συνθηματικό Relayhost'; |
| | | $wb['reject_sender_login_mismatch_txt'] = 'Reject sender and login mismatch'; |
| | | $wb['mailbox_size_limit_txt'] = 'Όριο χώρου θυρίδας'; |
| | | $wb['message_size_limit_txt'] = 'Μήνυμα ορίου χώρου'; |
| | | $wb['ip_address_txt'] = 'Διεύθυνση IP'; |
| | |
| | | $wb['crontab_dir_error_regex'] = 'Invalid crontab directory.'; |
| | | $wb['cron_wget_error_regex'] = 'Invalid cron wget path.'; |
| | | $wb['network_filesystem_txt'] = 'Network Filesystem'; |
| | | $wb["disable_bind_log_txt"] = "Disable bind9 messages for Loglevel WARN"; |
| | | ?> |
New file |
| | |
| | | <?php |
| | | $wb["server_id_txt"] = 'Rewrite on Server'; |
| | | $wb["source_txt"] = 'Source IP'; |
| | | $wb["destination_txt"] = 'Destination IP'; |
| | | $wb["active_txt"] = 'Active'; |
| | | $wb["ip_error_wrong"] = 'The Destination IP address is invalid'; |
| | | $wb["destination_ip_empty"] = 'The Destination IP is empty.'; |
| | | $wb["source_ip_empty"] = 'The Source IP is empty.'; |
| | | $wb["duplicate_mapping_error"] = "Mapping already exists."; |
| | | $wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server"; |
| | | ?> |
New file |
| | |
| | | <?php |
| | | $wb["list_head_txt"] = 'IP Mappings'; |
| | | $wb["server_id_txt"] = 'Server'; |
| | | $wb["source_ip_txt"] = 'Source IP'; |
| | | $wb["destination_ip_txt"] = 'Destination IP'; |
| | | $wb["active_txt"] = 'Active'; |
| | | ?> |
| | |
| | | $wb['No'] = 'No'; |
| | | $wb['min_password_length_txt'] = 'Minimum password length'; |
| | | $wb['min_password_strength_txt'] = 'Minimum password strength'; |
| | | $wb["company_name_txt"] = "Company Name for the page title"; |
| | | $wb["reseller_can_use_options_txt"] = "Reseller can use the option-tab for websites"; |
| | | ?> |
| | |
| | | $wb["active_txt"] = 'Active'; |
| | | $wb["mirror_server_id_txt"] = 'Is mirror of Server'; |
| | | $wb["- None -"] = '- None -'; |
| | | // New for XMPP |
| | | $wb['xmpp_server_txt'] = 'XMPP Server'; |
| | | ?> |
| | |
| | | $wb["fastcgi_bin_txt"] = 'FastCGI Bin'; |
| | | $wb["module_txt"] = 'Module'; |
| | | $wb["maildir_path_txt"] = 'Maildir Path'; |
| | | $wb['maildir_format_txt'] = 'Maildir Format'; |
| | | $wb["homedir_path_txt"] = 'Homedir Path'; |
| | | $wb["dkim_path_txt"] = 'DKIM Path'; |
| | | $wb["mailuser_uid_txt"] = 'Mailuser UID'; |
| | |
| | | $wb["relayhost_txt"] = 'Relayhost'; |
| | | $wb["relayhost_user_txt"] = 'Relayhost User'; |
| | | $wb["relayhost_password_txt"] = 'Relayhost Password'; |
| | | $wb['reject_sender_login_mismatch_txt'] = 'Reject sender and login mismatch'; |
| | | $wb["mailbox_size_limit_txt"] = 'Mailbox Size Limit'; |
| | | $wb["message_size_limit_txt"] = 'Message Size Limit'; |
| | | $wb["ip_address_txt"] = 'IP Address'; |
| | |
| | | $wb['php_ini_check_minutes_error_empty'] = 'Please specify a value how often php.ini should be checked for changes.'; |
| | | $wb['php_ini_check_minutes_info_txt'] = '0 = no check'; |
| | | $wb['enable_spdy_txt'] = 'Makes SPDY available'; |
| | | |
| | | // New for XMPP |
| | | $wb['xmpp_server_txt'] = 'XMPP Server'; |
| | | $wb['xmpp_use_ipv6_txt'] = 'Use IPv6'; |
| | | $wb['xmpp_bosh_max_inactivity_txt'] = 'Max. BOSH inactivity time'; |
| | | $wb['xmpp_bosh_timeout_range_wrong'] = 'Please enter a bosh timeout range between 15 - 360'; |
| | | $wb['xmpp_module_saslauth'] = 'saslauth'; |
| | | $wb['xmpp_server_admins_txt'] = 'Server Admins (JIDs)'; |
| | | $wb['xmpp_modules_enabled_txt'] = 'Serverwide enabled plugins (one per line)'; |
| | | $wb['xmpp_ports_txt'] = 'Component ports'; |
| | | $wb['xmpp_port_http_txt'] = 'HTTP'; |
| | | $wb['xmpp_port_https_txt'] = 'HTTPS'; |
| | | $wb['xmpp_port_pastebin_txt'] = 'Pastebin'; |
| | | $wb['xmpp_port_bosh_txt'] = 'BOSH'; |
| | | $wb["disable_bind_log_txt"] = "Disable bind9 messages for Loglevel WARN"; |
| | | ?> |
New file |
| | |
| | | <?php |
| | | $wb["server_id_txt"] = 'Rewrite on Server'; |
| | | $wb["source_txt"] = 'Source IP'; |
| | | $wb["destination_txt"] = 'Destination IP'; |
| | | $wb["active_txt"] = 'Active'; |
| | | $wb["ip_error_wrong"] = 'The Destination IP address is invalid'; |
| | | $wb["destination_ip_empty"] = 'The Destination IP is empty.'; |
| | | $wb["source_ip_empty"] = 'The Source IP is empty.'; |
| | | $wb["duplicate_mapping_error"] = "Mapping already exists."; |
| | | $wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server"; |
| | | ?> |
New file |
| | |
| | | <?php |
| | | $wb["list_head_txt"] = 'IP Mappings'; |
| | | $wb["server_id_txt"] = 'Server'; |
| | | $wb["source_ip_txt"] = 'Source IP'; |
| | | $wb["destination_ip_txt"] = 'Destination IP'; |
| | | $wb["active_txt"] = 'Active'; |
| | | ?> |
| | |
| | | $wb["proxy_server_txt"] = 'Proxy'; |
| | | $wb["firewall_server_txt"] = 'Firewall'; |
| | | $wb["add_new_record_txt"] = 'Add new Server'; |
| | | // New for XMPP |
| | | $wb['xmpp_server_txt'] = 'XMPP'; |
| | | ?> |
| | |
| | | $wb["default_dnsserver_txt"] = 'Default DNS Server'; |
| | | $wb["default_slave_dnsserver_txt"] = 'Default Secondary DNS Server'; |
| | | $wb["default_dbserver_txt"] = 'Default Database Server'; |
| | | $wb["company_name_txt"] = "Company Name for the page title"; |
| | | $wb["reseller_can_use_options_txt"] = "Reseller can use the option-tab for websites"; |
| | | ?> |
| | |
| | | $wb['fastcgi_bin_txt'] = 'Binario de FastCGI'; |
| | | $wb['module_txt'] = 'Módulo'; |
| | | $wb['maildir_path_txt'] = 'Ruta de buzones'; |
| | | $wb['maildir_format_txt'] = 'Maildir Format'; |
| | | $wb['homedir_path_txt'] = 'Ruta base de correo'; |
| | | $wb['mailuser_uid_txt'] = 'UID del usuario de correo'; |
| | | $wb['mailuser_gid_txt'] = 'GID del usuario de correo'; |
| | |
| | | $wb['relayhost_txt'] = 'Servidor de retransmisión'; |
| | | $wb['relayhost_user_txt'] = 'Usuario de retransmisión'; |
| | | $wb['relayhost_password_txt'] = 'Contraseña de retramisión'; |
| | | $wb['reject_sender_login_mismatch_txt'] = 'Reject sender and login mismatch'; |
| | | $wb['mailbox_size_limit_txt'] = 'Límite de tamaño del buzón'; |
| | | $wb['message_size_limit_txt'] = 'Límite de tamaño del mensaje'; |
| | | $wb['ip_address_txt'] = 'Dirección IP'; |
| | |
| | | $wb['crontab_dir_error_regex'] = 'Invalid crontab directory.'; |
| | | $wb['cron_wget_error_regex'] = 'Invalid cron wget path.'; |
| | | $wb['network_filesystem_txt'] = 'Network Filesystem'; |
| | | $wb["disable_bind_log_txt"] = "Disable bind9 messages for Loglevel WARN"; |
| | | ?> |
New file |
| | |
| | | <?php |
| | | $wb["server_id_txt"] = 'Rewrite on Server'; |
| | | $wb["source_txt"] = 'Source IP'; |
| | | $wb["destination_txt"] = 'Destination IP'; |
| | | $wb["active_txt"] = 'Active'; |
| | | $wb["ip_error_wrong"] = 'The Destination IP address is invalid'; |
| | | $wb["destination_ip_empty"] = 'The Destination IP is empty.'; |
| | | $wb["source_ip_empty"] = 'The Source IP is empty.'; |
| | | $wb["duplicate_mapping_error"] = "Mapping already exists."; |
| | | $wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server"; |
| | | ?> |
New file |
| | |
| | | <?php |
| | | $wb["list_head_txt"] = 'IP Mappings'; |
| | | $wb["server_id_txt"] = 'Server'; |
| | | $wb["source_ip_txt"] = 'Source IP'; |
| | | $wb["destination_ip_txt"] = 'Destination IP'; |
| | | $wb["active_txt"] = 'Active'; |
| | | ?> |
| | |
| | | $wb['default_dnsserver_txt'] = 'Servidor DNS por defecto'; |
| | | $wb['default_slave_dnsserver_txt'] = 'Servidor DNS secundario por defecto'; |
| | | $wb['default_dbserver_txt'] = 'Servidor de bases de datos por defecto'; |
| | | $wb["company_name_txt"] = "Company Name for the page title"; |
| | | $wb["reseller_can_use_options_txt"] = "Reseller can use the option-tab for websites"; |
| | | ?> |
| | |
| | | $wb['fastcgi_bin_txt'] = 'FastCGI-binääri'; |
| | | $wb['module_txt'] = 'Ohjelmaosio'; |
| | | $wb['maildir_path_txt'] = 'Postilaatikon hakemistopolku'; |
| | | $wb['maildir_format_txt'] = 'Maildir Format'; |
| | | $wb['homedir_path_txt'] = 'Kotikansion hakemistopolku'; |
| | | $wb['mailuser_uid_txt'] = 'Käyttäjätunnus'; |
| | | $wb['mailuser_gid_txt'] = 'Käyttäjäryhmä'; |
| | |
| | | $wb['relayhost_txt'] = 'Edelleenlähetyspalvelin'; |
| | | $wb['relayhost_user_txt'] = 'Edelleenlähetyspalvelimen käyttäjätunnus'; |
| | | $wb['relayhost_password_txt'] = 'Edelleenlähetyspalvelimen salasana'; |
| | | $wb['reject_sender_login_mismatch_txt'] = 'Reject sender and login mismatch'; |
| | | $wb['mailbox_size_limit_txt'] = 'Postilaatikon koko'; |
| | | $wb['message_size_limit_txt'] = 'Viestien enimmäiskoko'; |
| | | $wb['ip_address_txt'] = 'IP-osoite'; |
| | |
| | | $wb['crontab_dir_error_regex'] = 'Invalid crontab directory.'; |
| | | $wb['cron_wget_error_regex'] = 'Invalid cron wget path.'; |
| | | $wb['network_filesystem_txt'] = 'Network Filesystem'; |
| | | $wb["disable_bind_log_txt"] = "Disable bind9 messages for Loglevel WARN"; |
| | | ?> |
New file |
| | |
| | | <?php |
| | | $wb["server_id_txt"] = 'Rewrite on Server'; |
| | | $wb["source_txt"] = 'Source IP'; |
| | | $wb["destination_txt"] = 'Destination IP'; |
| | | $wb["active_txt"] = 'Active'; |
| | | $wb["ip_error_wrong"] = 'The Destination IP address is invalid'; |
| | | $wb["destination_ip_empty"] = 'The Destination IP is empty.'; |
| | | $wb["source_ip_empty"] = 'The Source IP is empty.'; |
| | | $wb["duplicate_mapping_error"] = "Mapping already exists."; |
| | | $wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server"; |
| | | ?> |
New file |
| | |
| | | <?php |
| | | $wb["list_head_txt"] = 'IP Mappings'; |
| | | $wb["server_id_txt"] = 'Server'; |
| | | $wb["source_ip_txt"] = 'Source IP'; |
| | | $wb["destination_ip_txt"] = 'Destination IP'; |
| | | $wb["active_txt"] = 'Active'; |
| | | ?> |
old mode 100755
new mode 100644
| | |
| | | $wb['No'] = 'No'; |
| | | $wb['min_password_length_txt'] = 'Minimum password length'; |
| | | $wb['min_password_strength_txt'] = 'Minimum password strength'; |
| | | $wb["company_name_txt"] = "Company Name for the page title"; |
| | | $wb["reseller_can_use_options_txt"] = "Reseller can use the option-tab for websites"; |
| | | ?> |
| | |
| | | $wb['fastcgi_bin_txt'] = 'Exétable FastCGI'; |
| | | $wb['module_txt'] = 'Module'; |
| | | $wb['maildir_path_txt'] = 'Chemin Maildir'; |
| | | $wb['maildir_format_txt'] = 'Maildir Format'; |
| | | $wb['homedir_path_txt'] = 'Chemin Homedir'; |
| | | $wb['mailuser_uid_txt'] = 'UID de l\'utilisateur mail'; |
| | | $wb['mailuser_gid_txt'] = 'GID de l\'utilisateur mail'; |
| | |
| | | $wb['relayhost_txt'] = 'Hôde relais'; |
| | | $wb['relayhost_user_txt'] = 'Utilisateur du relais'; |
| | | $wb['relayhost_password_txt'] = 'Mot de passe du relais'; |
| | | $wb['reject_sender_login_mismatch_txt'] = 'Reject sender and login mismatch'; |
| | | $wb['mailbox_size_limit_txt'] = 'Taille maximale de la boite mail'; |
| | | $wb['message_size_limit_txt'] = 'Taille maximale des messages'; |
| | | $wb['ip_address_txt'] = 'Adresse IP'; |
| | |
| | | $wb['crontab_dir_error_regex'] = 'Invalid crontab directory.'; |
| | | $wb['cron_wget_error_regex'] = 'Invalid cron wget path.'; |
| | | $wb['network_filesystem_txt'] = 'Network Filesystem'; |
| | | $wb["disable_bind_log_txt"] = "Disable bind9 messages for Loglevel WARN"; |
| | | ?> |
| | | |
New file |
| | |
| | | <?php |
| | | $wb["server_id_txt"] = 'Rewrite on Server'; |
| | | $wb["source_txt"] = 'Source IP'; |
| | | $wb["destination_txt"] = 'Destination IP'; |
| | | $wb["active_txt"] = 'Active'; |
| | | $wb["ip_error_wrong"] = 'The Destination IP address is invalid'; |
| | | $wb["destination_ip_empty"] = 'The Destination IP is empty.'; |
| | | $wb["source_ip_empty"] = 'The Source IP is empty.'; |
| | | $wb["duplicate_mapping_error"] = "Mapping already exists."; |
| | | $wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server"; |
| | | ?> |
New file |
| | |
| | | <?php |
| | | $wb["list_head_txt"] = 'IP Mappings'; |
| | | $wb["server_id_txt"] = 'Server'; |
| | | $wb["source_ip_txt"] = 'Source IP'; |
| | | $wb["destination_ip_txt"] = 'Destination IP'; |
| | | $wb["active_txt"] = 'Active'; |
| | | ?> |
| | |
| | | $wb['No'] = 'No'; |
| | | $wb['min_password_length_txt'] = 'Minimum password length'; |
| | | $wb['min_password_strength_txt'] = 'Minimum password strength'; |
| | | $wb["company_name_txt"] = "Company Name for the page title"; |
| | | $wb["reseller_can_use_options_txt"] = "Reseller can use the option-tab for websites"; |
| | | ?> |
| | |
| | | $wb['fastcgi_bin_txt'] = 'FastCGI Bin'; |
| | | $wb['module_txt'] = 'Modul'; |
| | | $wb['maildir_path_txt'] = 'Put do Maildir-a'; |
| | | $wb['maildir_format_txt'] = 'Maildir Format'; |
| | | $wb['homedir_path_txt'] = 'Put do početne stranice'; |
| | | $wb['mailuser_uid_txt'] = 'Mailuser UID'; |
| | | $wb['mailuser_gid_txt'] = 'Mailuser GID'; |
| | |
| | | $wb['relayhost_txt'] = 'Relayhost'; |
| | | $wb['relayhost_user_txt'] = 'Relayhost korisnik'; |
| | | $wb['relayhost_password_txt'] = 'Relayhost šifra'; |
| | | $wb['reject_sender_login_mismatch_txt'] = 'Reject sender and login mismatch'; |
| | | $wb['mailbox_size_limit_txt'] = 'Dozvoljena veličina mailboxa'; |
| | | $wb['message_size_limit_txt'] = 'Dozvoljena veličina emaila'; |
| | | $wb['ip_address_txt'] = 'IP adresa'; |
| | |
| | | $wb['crontab_dir_error_regex'] = 'Neispravan crontab direktorij.'; |
| | | $wb['cron_wget_error_regex'] = 'Neispravna cron wget putanja.'; |
| | | $wb['network_filesystem_txt'] = 'Network Filesystem'; |
| | | $wb["disable_bind_log_txt"] = "Disable bind9 messages for Loglevel WARN"; |
| | | ?> |
| | | |
| | | |
New file |
| | |
| | | <?php |
| | | $wb["server_id_txt"] = 'Rewrite on Server'; |
| | | $wb["source_txt"] = 'Source IP'; |
| | | $wb["destination_txt"] = 'Destination IP'; |
| | | $wb["active_txt"] = 'Active'; |
| | | $wb["ip_error_wrong"] = 'The Destination IP address is invalid'; |
| | | $wb["destination_ip_empty"] = 'The Destination IP is empty.'; |
| | | $wb["source_ip_empty"] = 'The Source IP is empty.'; |
| | | $wb["duplicate_mapping_error"] = "Mapping already exists."; |
| | | $wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server"; |
| | | ?> |
New file |
| | |
| | | <?php |
| | | $wb["list_head_txt"] = 'IP Mappings'; |
| | | $wb["server_id_txt"] = 'Server'; |
| | | $wb["source_ip_txt"] = 'Source IP'; |
| | | $wb["destination_ip_txt"] = 'Destination IP'; |
| | | $wb["active_txt"] = 'Active'; |
| | | ?> |
| | |
| | | $wb['No'] = 'No'; |
| | | $wb['min_password_length_txt'] = 'Minimum password length'; |
| | | $wb['min_password_strength_txt'] = 'Minimum password strength'; |
| | | $wb["company_name_txt"] = "Company Name for the page title"; |
| | | $wb["reseller_can_use_options_txt"] = "Reseller can use the option-tab for websites"; |
| | | ?> |
| | | |
| | | |
| | |
| | | $wb['fastcgi_bin_txt'] = 'FastCGI Bin'; |
| | | $wb['module_txt'] = 'Modul'; |
| | | $wb['maildir_path_txt'] = 'Maildir Path'; |
| | | $wb['maildir_format_txt'] = 'Maildir Format'; |
| | | $wb['homedir_path_txt'] = 'Homedir Path'; |
| | | $wb['mailuser_uid_txt'] = 'Mailuser UID'; |
| | | $wb['mailuser_gid_txt'] = 'Mailuser GID'; |
| | |
| | | $wb['relayhost_txt'] = 'Relayhost'; |
| | | $wb['relayhost_user_txt'] = 'Relayhost User'; |
| | | $wb['relayhost_password_txt'] = 'Relayhost Password'; |
| | | $wb['reject_sender_login_mismatch_txt'] = 'Reject sender and login mismatch'; |
| | | $wb['mailbox_size_limit_txt'] = 'Mailbox Size Limit'; |
| | | $wb['message_size_limit_txt'] = 'Message Size Limit'; |
| | | $wb['ip_address_txt'] = 'IP Address'; |
| | |
| | | $wb['crontab_dir_error_regex'] = 'Invalid crontab directory.'; |
| | | $wb['cron_wget_error_regex'] = 'Invalid cron wget path.'; |
| | | $wb['network_filesystem_txt'] = 'Network Filesystem'; |
| | | $wb["disable_bind_log_txt"] = "Disable bind9 messages for Loglevel WARN"; |
| | | ?> |
New file |
| | |
| | | <?php |
| | | $wb["server_id_txt"] = 'Rewrite on Server'; |
| | | $wb["source_txt"] = 'Source IP'; |
| | | $wb["destination_txt"] = 'Destination IP'; |
| | | $wb["active_txt"] = 'Active'; |
| | | $wb["ip_error_wrong"] = 'The Destination IP address is invalid'; |
| | | $wb["destination_ip_empty"] = 'The Destination IP is empty.'; |
| | | $wb["source_ip_empty"] = 'The Source IP is empty.'; |
| | | $wb["duplicate_mapping_error"] = "Mapping already exists."; |
| | | $wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server"; |
| | | ?> |
New file |
| | |
| | | <?php |
| | | $wb["list_head_txt"] = 'IP Mappings'; |
| | | $wb["server_id_txt"] = 'Server'; |
| | | $wb["source_ip_txt"] = 'Source IP'; |
| | | $wb["destination_ip_txt"] = 'Destination IP'; |
| | | $wb["active_txt"] = 'Active'; |
| | | ?> |
| | |
| | | $wb['No'] = 'No'; |
| | | $wb['min_password_length_txt'] = 'Minimum password length'; |
| | | $wb['min_password_strength_txt'] = 'Minimum password strength'; |
| | | $wb["company_name_txt"] = "Company Name for the page title"; |
| | | $wb["reseller_can_use_options_txt"] = "Reseller can use the option-tab for websites"; |
| | | ?> |
| | |
| | | $wb['fastcgi_bin_txt'] = 'FastCGI Bin'; |
| | | $wb['module_txt'] = 'Modul'; |
| | | $wb['maildir_path_txt'] = 'Path Direktori Mail'; |
| | | $wb['maildir_format_txt'] = 'Maildir Format'; |
| | | $wb['homedir_path_txt'] = 'Path Direktori Home'; |
| | | $wb['mailuser_uid_txt'] = 'UID Pengguna Mail'; |
| | | $wb['mailuser_gid_txt'] = 'GID Pengguna Mail'; |
| | |
| | | $wb['relayhost_txt'] = 'Relayhost'; |
| | | $wb['relayhost_user_txt'] = 'Pengguna Relayhost'; |
| | | $wb['relayhost_password_txt'] = 'Kata Sandi Relayhost'; |
| | | $wb['reject_sender_login_mismatch_txt'] = 'Reject sender and login mismatch'; |
| | | $wb['mailbox_size_limit_txt'] = 'Batasan Ukuran Mailbox'; |
| | | $wb['message_size_limit_txt'] = 'Batasan Ukuran Pesan'; |
| | | $wb['ip_address_txt'] = 'Alamat IP'; |
| | |
| | | $wb['crontab_dir_error_regex'] = 'Invalid crontab directory.'; |
| | | $wb['cron_wget_error_regex'] = 'Invalid cron wget path.'; |
| | | $wb['network_filesystem_txt'] = 'Network Filesystem'; |
| | | $wb["disable_bind_log_txt"] = "Disable bind9 messages for Loglevel WARN"; |
| | | ?> |
New file |
| | |
| | | <?php |
| | | $wb["server_id_txt"] = 'Rewrite on Server'; |
| | | $wb["source_txt"] = 'Source IP'; |
| | | $wb["destination_txt"] = 'Destination IP'; |
| | | $wb["active_txt"] = 'Active'; |
| | | $wb["ip_error_wrong"] = 'The Destination IP address is invalid'; |
| | | $wb["destination_ip_empty"] = 'The Destination IP is empty.'; |
| | | $wb["source_ip_empty"] = 'The Source IP is empty.'; |
| | | $wb["duplicate_mapping_error"] = "Mapping already exists."; |
| | | $wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server"; |
| | | ?> |
New file |
| | |
| | | <?php |
| | | $wb["list_head_txt"] = 'IP Mappings'; |
| | | $wb["server_id_txt"] = 'Server'; |
| | | $wb["source_ip_txt"] = 'Source IP'; |
| | | $wb["destination_ip_txt"] = 'Destination IP'; |
| | | $wb["active_txt"] = 'Active'; |
| | | ?> |
| | |
| | | $wb['No'] = 'No'; |
| | | $wb['min_password_length_txt'] = 'Minimum password length'; |
| | | $wb['min_password_strength_txt'] = 'Minimum password strength'; |
| | | $wb["company_name_txt"] = "Company Name for the page title"; |
| | | $wb["reseller_can_use_options_txt"] = "Reseller can use the option-tab for websites"; |
| | | ?> |
| | |
| | | $wb['fastcgi_bin_txt'] = 'FastCGI Bin'; |
| | | $wb['module_txt'] = 'Module'; |
| | | $wb['maildir_path_txt'] = 'Maildir Path'; |
| | | $wb['maildir_format_txt'] = 'Maildir Format'; |
| | | $wb['homedir_path_txt'] = 'Homedir Path'; |
| | | $wb['mailuser_uid_txt'] = 'Mailuser UID'; |
| | | $wb['mailuser_gid_txt'] = 'Mailuser GID'; |
| | |
| | | $wb['relayhost_txt'] = 'Relayhost'; |
| | | $wb['relayhost_user_txt'] = 'Relayhost User'; |
| | | $wb['relayhost_password_txt'] = 'Relayhost Password'; |
| | | $wb['reject_sender_login_mismatch_txt'] = 'Reject sender and login mismatch'; |
| | | $wb['mailbox_size_limit_txt'] = 'Mailbox Size Limit'; |
| | | $wb['message_size_limit_txt'] = 'Message Size Limit'; |
| | | $wb['ip_address_txt'] = 'Indirizzo IP'; |
| | |
| | | $wb['crontab_dir_error_regex'] = 'Invalid crontab directory.'; |
| | | $wb['cron_wget_error_regex'] = 'Invalid cron wget path.'; |
| | | $wb['network_filesystem_txt'] = 'Network Filesystem'; |
| | | $wb["disable_bind_log_txt"] = "Disable bind9 messages for Loglevel WARN"; |
| | | ?> |
New file |
| | |
| | | <?php |
| | | $wb["server_id_txt"] = 'Rewrite on Server'; |
| | | $wb["source_txt"] = 'Source IP'; |
| | | $wb["destination_txt"] = 'Destination IP'; |
| | | $wb["active_txt"] = 'Active'; |
| | | $wb["ip_error_wrong"] = 'The Destination IP address is invalid'; |
| | | $wb["destination_ip_empty"] = 'The Destination IP is empty.'; |
| | | $wb["source_ip_empty"] = 'The Source IP is empty.'; |
| | | $wb["duplicate_mapping_error"] = "Mapping already exists."; |
| | | $wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server"; |
| | | ?> |
New file |
| | |
| | | <?php |
| | | $wb["list_head_txt"] = 'IP Mappings'; |
| | | $wb["server_id_txt"] = 'Server'; |
| | | $wb["source_ip_txt"] = 'Source IP'; |
| | | $wb["destination_ip_txt"] = 'Destination IP'; |
| | | $wb["active_txt"] = 'Active'; |
| | | ?> |
| | |
| | | $wb['No'] = 'No'; |
| | | $wb['min_password_length_txt'] = 'Minimum password length'; |
| | | $wb['min_password_strength_txt'] = 'Minimum password strength'; |
| | | $wb["company_name_txt"] = "Company Name for the page title"; |
| | | $wb["reseller_can_use_options_txt"] = "Reseller can use the option-tab for websites"; |
| | | ?> |
| | |
| | | $wb['fastcgi_bin_txt'] = 'FastCGI実行ファイル'; |
| | | $wb['module_txt'] = 'モジュール'; |
| | | $wb['maildir_path_txt'] = 'メールディレクトリ'; |
| | | $wb['maildir_format_txt'] = 'Maildir Format'; |
| | | $wb['homedir_path_txt'] = 'ホームディレクトリ'; |
| | | $wb['mailuser_uid_txt'] = 'メールユーザーのUID'; |
| | | $wb['mailuser_gid_txt'] = 'メールユーザーのGID'; |
| | |
| | | $wb['relayhost_txt'] = 'リレーホスト'; |
| | | $wb['relayhost_user_txt'] = 'リレーホストユーザー'; |
| | | $wb['relayhost_password_txt'] = 'リレーホストパスワード'; |
| | | $wb['reject_sender_login_mismatch_txt'] = 'Reject sender and login mismatch'; |
| | | $wb['mailbox_size_limit_txt'] = 'メールボックスのサイズ'; |
| | | $wb['message_size_limit_txt'] = 'メッセージの最大サイズ'; |
| | | $wb['ip_address_txt'] = 'IPアドレス'; |
| | |
| | | $wb['crontab_dir_error_regex'] = 'Invalid crontab directory.'; |
| | | $wb['cron_wget_error_regex'] = 'Invalid cron wget path.'; |
| | | $wb['network_filesystem_txt'] = 'Network Filesystem'; |
| | | $wb["disable_bind_log_txt"] = "Disable bind9 messages for Loglevel WARN"; |
| | | ?> |
New file |
| | |
| | | <?php |
| | | $wb["server_id_txt"] = 'Rewrite on Server'; |
| | | $wb["source_txt"] = 'Source IP'; |
| | | $wb["destination_txt"] = 'Destination IP'; |
| | | $wb["active_txt"] = 'Active'; |
| | | $wb["ip_error_wrong"] = 'The Destination IP address is invalid'; |
| | | $wb["destination_ip_empty"] = 'The Destination IP is empty.'; |
| | | $wb["source_ip_empty"] = 'The Source IP is empty.'; |
| | | $wb["duplicate_mapping_error"] = "Mapping already exists."; |
| | | $wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server"; |
| | | ?> |
New file |
| | |
| | | <?php |
| | | $wb["list_head_txt"] = 'IP Mappings'; |
| | | $wb["server_id_txt"] = 'Server'; |
| | | $wb["source_ip_txt"] = 'Source IP'; |
| | | $wb["destination_ip_txt"] = 'Destination IP'; |
| | | $wb["active_txt"] = 'Active'; |
| | | ?> |
| | |
| | | $wb['No'] = 'No'; |
| | | $wb['min_password_length_txt'] = 'Minimum password length'; |
| | | $wb['min_password_strength_txt'] = 'Minimum password strength'; |
| | | $wb["company_name_txt"] = "Company Name for the page title"; |
| | | $wb["reseller_can_use_options_txt"] = "Reseller can use the option-tab for websites"; |
| | | ?> |
| | |
| | | $wb['fastcgi_bin_txt'] = 'FastCGI bin'; |
| | | $wb['module_txt'] = 'Module'; |
| | | $wb['maildir_path_txt'] = 'Maildir pad'; |
| | | $wb['maildir_format_txt'] = 'Maildir Format'; |
| | | $wb['homedir_path_txt'] = 'Homedir pad'; |
| | | $wb['mailuser_uid_txt'] = 'Mailuser UID'; |
| | | $wb['mailuser_gid_txt'] = 'Mailuser GID'; |
| | |
| | | $wb['relayhost_txt'] = 'Relayhost'; |
| | | $wb['relayhost_user_txt'] = 'Relayhost gebruiker'; |
| | | $wb['relayhost_password_txt'] = 'Relayhost wachtwoord'; |
| | | $wb['reject_sender_login_mismatch_txt'] = 'Reject sender and login mismatch'; |
| | | $wb['mailbox_size_limit_txt'] = 'Mailbox grootte limiet'; |
| | | $wb['message_size_limit_txt'] = 'Message grootte limiet'; |
| | | $wb['ip_address_txt'] = 'IP adres'; |
| | |
| | | $wb['crontab_dir_error_regex'] = 'Invalid crontab directory.'; |
| | | $wb['cron_wget_error_regex'] = 'Invalid cron wget path.'; |
| | | $wb['network_filesystem_txt'] = 'Network Filesystem'; |
| | | $wb["disable_bind_log_txt"] = "Disable bind9 messages for Loglevel WARN"; |
| | | ?> |
New file |
| | |
| | | <?php |
| | | $wb["server_id_txt"] = 'Rewrite on Server'; |
| | | $wb["source_txt"] = 'Source IP'; |
| | | $wb["destination_txt"] = 'Destination IP'; |
| | | $wb["active_txt"] = 'Active'; |
| | | $wb["ip_error_wrong"] = 'The Destination IP address is invalid'; |
| | | $wb["destination_ip_empty"] = 'The Destination IP is empty.'; |
| | | $wb["source_ip_empty"] = 'The Source IP is empty.'; |
| | | $wb["duplicate_mapping_error"] = "Mapping already exists."; |
| | | $wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server"; |
| | | ?> |
New file |
| | |
| | | <?php |
| | | $wb["list_head_txt"] = 'IP Mappings'; |
| | | $wb["server_id_txt"] = 'Server'; |
| | | $wb["source_ip_txt"] = 'Source IP'; |
| | | $wb["destination_ip_txt"] = 'Destination IP'; |
| | | $wb["active_txt"] = 'Active'; |
| | | ?> |
| | |
| | | $wb['No'] = 'No'; |
| | | $wb['min_password_length_txt'] = 'Minimum password length'; |
| | | $wb['min_password_strength_txt'] = 'Minimum password strength'; |
| | | $wb["company_name_txt"] = "Company Name for the page title"; |
| | | $wb["reseller_can_use_options_txt"] = "Reseller can use the option-tab for websites"; |
| | | ?> |
| | |
| | | $wb['fastcgi_bin_txt'] = 'Kosz FastCGI'; |
| | | $wb['module_txt'] = 'Moduł'; |
| | | $wb['maildir_path_txt'] = 'Adres poczty e-mail'; |
| | | $wb['maildir_format_txt'] = 'Maildir Format'; |
| | | $wb['homedir_path_txt'] = 'Bazowy adres poczty e-mail'; |
| | | $wb['mailuser_uid_txt'] = 'UID użytkownika e-mail'; |
| | | $wb['mailuser_gid_txt'] = 'GID użytkownika e-mail'; |
| | |
| | | $wb['relayhost_txt'] = 'Adres Relayhost'; |
| | | $wb['relayhost_user_txt'] = 'Użytkownik Relayhost'; |
| | | $wb['relayhost_password_txt'] = 'Hasło Relayhost'; |
| | | $wb['reject_sender_login_mismatch_txt'] = 'Reject sender and login mismatch'; |
| | | $wb['mailbox_size_limit_txt'] = 'Maksymalna wielkość skrzynki pocztowej'; |
| | | $wb['message_size_limit_txt'] = 'Maksymalna wielkość wiadomości'; |
| | | $wb['ip_address_txt'] = 'Adres IP'; |
| | |
| | | $wb['crontab_dir_error_regex'] = 'Invalid crontab directory.'; |
| | | $wb['cron_wget_error_regex'] = 'Invalid cron wget path.'; |
| | | $wb['network_filesystem_txt'] = 'Network Filesystem'; |
| | | $wb["disable_bind_log_txt"] = "Disable bind9 messages for Loglevel WARN"; |
| | | ?> |
New file |
| | |
| | | <?php |
| | | $wb["server_id_txt"] = 'Rewrite on Server'; |
| | | $wb["source_txt"] = 'Source IP'; |
| | | $wb["destination_txt"] = 'Destination IP'; |
| | | $wb["active_txt"] = 'Active'; |
| | | $wb["ip_error_wrong"] = 'The Destination IP address is invalid'; |
| | | $wb["destination_ip_empty"] = 'The Destination IP is empty.'; |
| | | $wb["source_ip_empty"] = 'The Source IP is empty.'; |
| | | $wb["duplicate_mapping_error"] = "Mapping already exists."; |
| | | $wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server"; |
| | | ?> |
New file |
| | |
| | | <?php |
| | | $wb["list_head_txt"] = 'IP Mappings'; |
| | | $wb["server_id_txt"] = 'Server'; |
| | | $wb["source_ip_txt"] = 'Source IP'; |
| | | $wb["destination_ip_txt"] = 'Destination IP'; |
| | | $wb["active_txt"] = 'Active'; |
| | | ?> |
| | |
| | | $wb['No'] = 'No'; |
| | | $wb['min_password_length_txt'] = 'Minimum password length'; |
| | | $wb['min_password_strength_txt'] = 'Minimum password strength'; |
| | | $wb["company_name_txt"] = "Company Name for the page title"; |
| | | $wb["reseller_can_use_options_txt"] = "Reseller can use the option-tab for websites"; |
| | | ?> |
| | |
| | | $wb['fastcgi_bin_txt'] = 'FastCGI Bin'; |
| | | $wb['module_txt'] = 'Módulo'; |
| | | $wb['maildir_path_txt'] = 'Pasta do Maildir'; |
| | | $wb['maildir_format_txt'] = 'Maildir Format'; |
| | | $wb['homedir_path_txt'] = 'Pasta Home'; |
| | | $wb['mailuser_uid_txt'] = 'UID utilizador de email'; |
| | | $wb['mailuser_gid_txt'] = 'GID utilizador de email'; |
| | |
| | | $wb['relayhost_txt'] = 'Host Relay'; |
| | | $wb['relayhost_user_txt'] = 'Utilizador do Host Relay'; |
| | | $wb['relayhost_password_txt'] = 'Senha do Host Relay'; |
| | | $wb['reject_sender_login_mismatch_txt'] = 'Reject sender and login mismatch'; |
| | | $wb['mailbox_size_limit_txt'] = 'Tamanho máximo da Caixa Postal'; |
| | | $wb['message_size_limit_txt'] = 'Tamanho máximo de mensagem'; |
| | | $wb['ip_address_txt'] = 'Endereço IP'; |
| | |
| | | $wb['crontab_dir_error_regex'] = 'Invalid crontab directory.'; |
| | | $wb['cron_wget_error_regex'] = 'Invalid cron wget path.'; |
| | | $wb['network_filesystem_txt'] = 'Network Filesystem'; |
| | | $wb["disable_bind_log_txt"] = "Disable bind9 messages for Loglevel WARN"; |
| | | ?> |
New file |
| | |
| | | <?php |
| | | $wb["server_id_txt"] = 'Rewrite on Server'; |
| | | $wb["source_txt"] = 'Source IP'; |
| | | $wb["destination_txt"] = 'Destination IP'; |
| | | $wb["active_txt"] = 'Active'; |
| | | $wb["ip_error_wrong"] = 'The Destination IP address is invalid'; |
| | | $wb["destination_ip_empty"] = 'The Destination IP is empty.'; |
| | | $wb["source_ip_empty"] = 'The Source IP is empty.'; |
| | | $wb["duplicate_mapping_error"] = "Mapping already exists."; |
| | | $wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server"; |
| | | ?> |
New file |
| | |
| | | <?php |
| | | $wb["list_head_txt"] = 'IP Mappings'; |
| | | $wb["server_id_txt"] = 'Server'; |
| | | $wb["source_ip_txt"] = 'Source IP'; |
| | | $wb["destination_ip_txt"] = 'Destination IP'; |
| | | $wb["active_txt"] = 'Active'; |
| | | ?> |
| | |
| | | $wb['No'] = 'No'; |
| | | $wb['min_password_length_txt'] = 'Minimum password length'; |
| | | $wb['min_password_strength_txt'] = 'Minimum password strength'; |
| | | $wb["company_name_txt"] = "Company Name for the page title"; |
| | | $wb["reseller_can_use_options_txt"] = "Reseller can use the option-tab for websites"; |
| | | ?> |
| | |
| | | $wb['fastcgi_bin_txt'] = 'FastCGI Bin'; |
| | | $wb['module_txt'] = 'Module'; |
| | | $wb['maildir_path_txt'] = 'Maildir Path'; |
| | | $wb['maildir_format_txt'] = 'Maildir Format'; |
| | | $wb['homedir_path_txt'] = 'Homedir Path'; |
| | | $wb['mailuser_uid_txt'] = 'Mailuser UID'; |
| | | $wb['mailuser_gid_txt'] = 'Mailuser GID'; |
| | |
| | | $wb['relayhost_txt'] = 'Relayhost'; |
| | | $wb['relayhost_user_txt'] = 'Relayhost User'; |
| | | $wb['relayhost_password_txt'] = 'Relayhost Password'; |
| | | $wb['reject_sender_login_mismatch_txt'] = 'Reject sender and login mismatch'; |
| | | $wb['mailbox_size_limit_txt'] = 'Mailbox Size Limit'; |
| | | $wb['message_size_limit_txt'] = 'Message Size Limit'; |
| | | $wb['ip_address_txt'] = 'IP Address'; |
| | |
| | | $wb['crontab_dir_error_regex'] = 'Invalid crontab directory.'; |
| | | $wb['cron_wget_error_regex'] = 'Invalid cron wget path.'; |
| | | $wb['network_filesystem_txt'] = 'Network Filesystem'; |
| | | $wb["disable_bind_log_txt"] = "Disable bind9 messages for Loglevel WARN"; |
| | | ?> |
New file |
| | |
| | | <?php |
| | | $wb["server_id_txt"] = 'Rewrite on Server'; |
| | | $wb["source_txt"] = 'Source IP'; |
| | | $wb["destination_txt"] = 'Destination IP'; |
| | | $wb["active_txt"] = 'Active'; |
| | | $wb["ip_error_wrong"] = 'The Destination IP address is invalid'; |
| | | $wb["destination_ip_empty"] = 'The Destination IP is empty.'; |
| | | $wb["source_ip_empty"] = 'The Source IP is empty.'; |
| | | $wb["duplicate_mapping_error"] = "Mapping already exists."; |
| | | $wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server"; |
| | | ?> |
New file |
| | |
| | | <?php |
| | | $wb["list_head_txt"] = 'IP Mappings'; |
| | | $wb["server_id_txt"] = 'Server'; |
| | | $wb["source_ip_txt"] = 'Source IP'; |
| | | $wb["destination_ip_txt"] = 'Destination IP'; |
| | | $wb["active_txt"] = 'Active'; |
| | | ?> |
| | |
| | | $wb['No'] = 'No'; |
| | | $wb['min_password_length_txt'] = 'Minimum password length'; |
| | | $wb['min_password_strength_txt'] = 'Minimum password strength'; |
| | | $wb["company_name_txt"] = "Company Name for the page title"; |
| | | $wb["reseller_can_use_options_txt"] = "Reseller can use the option-tab for websites"; |
| | | ?> |
| | |
| | | $wb['fastcgi_bin_txt'] = 'FastCGI Bin'; |
| | | $wb['module_txt'] = 'Модуль'; |
| | | $wb['maildir_path_txt'] = 'Путь Maildir'; |
| | | $wb['maildir_format_txt'] = 'Maildir Format'; |
| | | $wb['homedir_path_txt'] = 'Путь Homedir'; |
| | | $wb['mailuser_uid_txt'] = 'Mailuser UID'; |
| | | $wb['mailuser_gid_txt'] = 'Mailuser GID'; |
| | |
| | | $wb['relayhost_txt'] = 'Relay-хост'; |
| | | $wb['relayhost_user_txt'] = 'Логин Relay-хоста'; |
| | | $wb['relayhost_password_txt'] = 'Пароль Relay-хоста'; |
| | | $wb['reject_sender_login_mismatch_txt'] = 'Reject sender and login mismatch'; |
| | | $wb['mailbox_size_limit_txt'] = 'Лимит размера Mailbox'; |
| | | $wb['message_size_limit_txt'] = 'Лимит размера сообщения'; |
| | | $wb['ip_address_txt'] = 'IP-адрес'; |
| | |
| | | $wb['crontab_dir_error_regex'] = 'Invalid crontab directory.'; |
| | | $wb['cron_wget_error_regex'] = 'Invalid cron wget path.'; |
| | | $wb['network_filesystem_txt'] = 'Network Filesystem'; |
| | | $wb["disable_bind_log_txt"] = "Disable bind9 messages for Loglevel WARN"; |
| | | ?> |
New file |
| | |
| | | <?php |
| | | $wb["server_id_txt"] = 'Rewrite on Server'; |
| | | $wb["source_txt"] = 'Source IP'; |
| | | $wb["destination_txt"] = 'Destination IP'; |
| | | $wb["active_txt"] = 'Active'; |
| | | $wb["ip_error_wrong"] = 'The Destination IP address is invalid'; |
| | | $wb["destination_ip_empty"] = 'The Destination IP is empty.'; |
| | | $wb["source_ip_empty"] = 'The Source IP is empty.'; |
| | | $wb["duplicate_mapping_error"] = "Mapping already exists."; |
| | | $wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server"; |
| | | ?> |
New file |
| | |
| | | <?php |
| | | $wb["list_head_txt"] = 'IP Mappings'; |
| | | $wb["server_id_txt"] = 'Server'; |
| | | $wb["source_ip_txt"] = 'Source IP'; |
| | | $wb["destination_ip_txt"] = 'Destination IP'; |
| | | $wb["active_txt"] = 'Active'; |
| | | ?> |
| | |
| | | $wb['No'] = 'No'; |
| | | $wb['min_password_length_txt'] = 'Minimum password length'; |
| | | $wb['min_password_strength_txt'] = 'Minimum password strength'; |
| | | $wb["company_name_txt"] = "Company Name for the page title"; |
| | | $wb["reseller_can_use_options_txt"] = "Reseller can use the option-tab for websites"; |
| | | ?> |
| | |
| | | $wb['fastcgi_bin_txt'] = 'FastCGI Bin'; |
| | | $wb['module_txt'] = 'Module'; |
| | | $wb['maildir_path_txt'] = 'Maildir Path'; |
| | | $wb['maildir_format_txt'] = 'Maildir Format'; |
| | | $wb['homedir_path_txt'] = 'Homedir Path'; |
| | | $wb['mailuser_uid_txt'] = 'Mailuser UID'; |
| | | $wb['mailuser_gid_txt'] = 'Mailuser GID'; |
| | |
| | | $wb['relayhost_txt'] = 'Relayhost'; |
| | | $wb['relayhost_user_txt'] = 'Relayhost User'; |
| | | $wb['relayhost_password_txt'] = 'Relayhost Password'; |
| | | $wb['reject_sender_login_mismatch_txt'] = 'Reject sender and login mismatch'; |
| | | $wb['mailbox_size_limit_txt'] = 'Mailbox Size Limit'; |
| | | $wb['message_size_limit_txt'] = 'Message Size Limit'; |
| | | $wb['ip_address_txt'] = 'IP Address'; |
| | |
| | | $wb['crontab_dir_error_regex'] = 'Invalid crontab directory.'; |
| | | $wb['cron_wget_error_regex'] = 'Invalid cron wget path.'; |
| | | $wb['network_filesystem_txt'] = 'Network Filesystem'; |
| | | $wb["disable_bind_log_txt"] = "Disable bind9 messages for Loglevel WARN"; |
| | | ?> |
New file |
| | |
| | | <?php |
| | | $wb["server_id_txt"] = 'Rewrite on Server'; |
| | | $wb["source_txt"] = 'Source IP'; |
| | | $wb["destination_txt"] = 'Destination IP'; |
| | | $wb["active_txt"] = 'Active'; |
| | | $wb["ip_error_wrong"] = 'The Destination IP address is invalid'; |
| | | $wb["destination_ip_empty"] = 'The Destination IP is empty.'; |
| | | $wb["source_ip_empty"] = 'The Source IP is empty.'; |
| | | $wb["duplicate_mapping_error"] = "Mapping already exists."; |
| | | $wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server"; |
| | | ?> |
New file |
| | |
| | | <?php |
| | | $wb["list_head_txt"] = 'IP Mappings'; |
| | | $wb["server_id_txt"] = 'Server'; |
| | | $wb["source_ip_txt"] = 'Source IP'; |
| | | $wb["destination_ip_txt"] = 'Destination IP'; |
| | | $wb["active_txt"] = 'Active'; |
| | | ?> |
| | |
| | | $wb['No'] = 'Nej'; |
| | | $wb['min_password_length_txt'] = 'Minsta lösenordslängd'; |
| | | $wb['min_password_strength_txt'] = 'Minsta lösenordsstyrka'; |
| | | $wb["company_name_txt"] = "Company Name for the page title"; |
| | | $wb["reseller_can_use_options_txt"] = "Reseller can use the option-tab for websites"; |
| | | ?> |
| | |
| | | $wb['fastcgi_bin_txt'] = 'FastCGI Bin'; |
| | | $wb['module_txt'] = 'Modul'; |
| | | $wb['maildir_path_txt'] = 'Maildir Cesta'; |
| | | $wb['maildir_format_txt'] = 'Maildir Format'; |
| | | $wb['homedir_path_txt'] = 'Cesta k domovskému adresáru'; |
| | | $wb['mailuser_uid_txt'] = 'Mailuser UID'; |
| | | $wb['mailuser_gid_txt'] = 'Mailuser GID'; |
| | |
| | | $wb['relayhost_txt'] = 'Relayhost'; |
| | | $wb['relayhost_user_txt'] = 'Relayhost uživateľ'; |
| | | $wb['relayhost_password_txt'] = 'Relayhost heslo'; |
| | | $wb['reject_sender_login_mismatch_txt'] = 'Reject sender and login mismatch'; |
| | | $wb['mailbox_size_limit_txt'] = 'Limit ve?kosti poštovej schránky'; |
| | | $wb['message_size_limit_txt'] = 'Limit ve?kosti správy'; |
| | | $wb['ip_address_txt'] = 'IP Adresa'; |
| | |
| | | $wb['crontab_dir_error_regex'] = 'Invalid crontab directory.'; |
| | | $wb['cron_wget_error_regex'] = 'Invalid cron wget path.'; |
| | | $wb['network_filesystem_txt'] = 'Network Filesystem'; |
| | | $wb["disable_bind_log_txt"] = "Disable bind9 messages for Loglevel WARN"; |
| | | ?> |
New file |
| | |
| | | <?php |
| | | $wb["server_id_txt"] = 'Rewrite on Server'; |
| | | $wb["source_txt"] = 'Source IP'; |
| | | $wb["destination_txt"] = 'Destination IP'; |
| | | $wb["active_txt"] = 'Active'; |
| | | $wb["ip_error_wrong"] = 'The Destination IP address is invalid'; |
| | | $wb["destination_ip_empty"] = 'The Destination IP is empty.'; |
| | | $wb["source_ip_empty"] = 'The Source IP is empty.'; |
| | | $wb["duplicate_mapping_error"] = "Mapping already exists."; |
| | | $wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server"; |
| | | ?> |
New file |
| | |
| | | <?php |
| | | $wb["list_head_txt"] = 'IP Mappings'; |
| | | $wb["server_id_txt"] = 'Server'; |
| | | $wb["source_ip_txt"] = 'Source IP'; |
| | | $wb["destination_ip_txt"] = 'Destination IP'; |
| | | $wb["active_txt"] = 'Active'; |
| | | ?> |
| | |
| | | $wb['No'] = 'No'; |
| | | $wb['min_password_length_txt'] = 'Minimum password length'; |
| | | $wb['min_password_strength_txt'] = 'Minimum password strength'; |
| | | $wb["company_name_txt"] = "Company Name for the page title"; |
| | | $wb["reseller_can_use_options_txt"] = "Reseller can use the option-tab for websites"; |
| | | ?> |
| | |
| | | $wb['fastcgi_bin_txt'] = 'FastCGI Bin'; |
| | | $wb['module_txt'] = 'Modül'; |
| | | $wb['maildir_path_txt'] = 'Mail dizini yolu'; |
| | | $wb['maildir_format_txt'] = 'Maildir Format'; |
| | | $wb['homedir_path_txt'] = 'Kullanıcı dizini yolu'; |
| | | $wb['mailuser_uid_txt'] = 'Mail kullanıcısı UID'; |
| | | $wb['mailuser_gid_txt'] = 'Mail kullanıcısı GID'; |
| | |
| | | $wb['relayhost_txt'] = 'Relayhost'; |
| | | $wb['relayhost_user_txt'] = 'Relayhost Kullanıcı'; |
| | | $wb['relayhost_password_txt'] = 'Relayhost Şifre'; |
| | | $wb['reject_sender_login_mismatch_txt'] = 'Reject sender and login mismatch'; |
| | | $wb['mailbox_size_limit_txt'] = 'Mail kutusu boyutu'; |
| | | $wb['message_size_limit_txt'] = 'Mesaj boyutu'; |
| | | $wb['ip_address_txt'] = 'IP Adresleri'; |
| | |
| | | $wb['crontab_dir_error_regex'] = 'Invalid crontab directory.'; |
| | | $wb['cron_wget_error_regex'] = 'Invalid cron wget path.'; |
| | | $wb['network_filesystem_txt'] = 'Network Filesystem'; |
| | | $wb["disable_bind_log_txt"] = "Disable bind9 messages for Loglevel WARN"; |
| | | ?> |
New file |
| | |
| | | <?php |
| | | $wb["server_id_txt"] = 'Rewrite on Server'; |
| | | $wb["source_txt"] = 'Source IP'; |
| | | $wb["destination_txt"] = 'Destination IP'; |
| | | $wb["active_txt"] = 'Active'; |
| | | $wb["ip_error_wrong"] = 'The Destination IP address is invalid'; |
| | | $wb["destination_ip_empty"] = 'The Destination IP is empty.'; |
| | | $wb["source_ip_empty"] = 'The Source IP is empty.'; |
| | | $wb["duplicate_mapping_error"] = "Mapping already exists."; |
| | | $wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server"; |
| | | ?> |
New file |
| | |
| | | <?php |
| | | $wb["list_head_txt"] = 'IP Mappings'; |
| | | $wb["server_id_txt"] = 'Server'; |
| | | $wb["source_ip_txt"] = 'Source IP'; |
| | | $wb["destination_ip_txt"] = 'Destination IP'; |
| | | $wb["active_txt"] = 'Active'; |
| | | ?> |
| | |
| | | $wb['No'] = 'No'; |
| | | $wb['min_password_length_txt'] = 'Minimum password length'; |
| | | $wb['min_password_strength_txt'] = 'Minimum password strength'; |
| | | $wb["company_name_txt"] = "Company Name for the page title"; |
| | | $wb["reseller_can_use_options_txt"] = "Reseller can use the option-tab for websites"; |
| | | ?> |
| | |
| | | $module['template'] = 'module.tpl.htm'; |
| | | $module['startpage'] = 'admin/server_list.php'; |
| | | $module['tab_width'] = '60'; |
| | | $module['order'] = '90'; |
| | | |
| | | |
| | | $items[] = array( 'title' => 'CP Users', |
| | |
| | | 'link' => 'admin/server_ip_list.php', |
| | | 'html_id' => 'server_ip_list'); |
| | | |
| | | |
| | | $items[] = array( 'title' => 'Server IP mapping', |
| | | 'target' => 'content', |
| | | 'link' => 'admin/server_ip_map_list.php', |
| | | 'html_id' => 'server_ip_map_list'); |
| | | |
| | | $items[] = array( 'title' => 'Additional PHP Versions', |
| | | 'target' => 'content', |
| | |
| | | 'prefix' => "", |
| | | 'suffix' => "", |
| | | 'width' => "", |
| | | 'value' => array('y' => "<div id=\"ir-Yes\" class=\"swap\"><span>Yes</span></div>", 'n' => "<div class=\"swap\" id=\"ir-No\"><span>No</span></div>")); |
| | | 'value' => array('y' => "<div id=\"ir-Yes\" class=\"swap\"><span>".$app->lng('yes_txt')."</span></div>", 'n' => "<div class=\"swap\" id=\"ir-No\"><span>".$app->lng('no_txt')."</span></div>")); |
| | | |
| | | |
| | | $liste["item"][] = array( 'field' => "name", |
| | |
| | | 'prefix' => "", |
| | | 'suffix' => "", |
| | | 'width' => "", |
| | | 'value' => array('y' => "<div id=\"ir-Yes\" class=\"swap\"><span>Yes</span></div>", 'n' => "<div class=\"swap\" id=\"ir-No\"><span>No</span></div>")); |
| | | 'value' => array('y' => "<div id=\"ir-Yes\" class=\"swap\"><span>".$app->lng('yes_txt')."</span></div>", 'n' => "<div class=\"swap\" id=\"ir-No\"><span>".$app->lng('no_txt')."</span></div>")); |
| | | |
| | | ?> |
| | |
| | | 'prefix' => "", |
| | | 'suffix' => "", |
| | | 'width' => "", |
| | | 'value' => array('y' => "<div id=\"ir-Yes\" class=\"swap\"><span>Yes</span></div>", 'n' => "<div class=\"swap\" id=\"ir-No\"><span>No</span></div>")); |
| | | 'value' => array('y' => "<div id=\"ir-Yes\" class=\"swap\"><span>".$app->lng('yes_txt')."</span></div>", 'n' => "<div class=\"swap\" id=\"ir-No\"><span>".$app->lng('no_txt')."</span></div>")); |
| | | |
| | | $liste["item"][] = array( 'field' => "server_id", |
| | | 'datatype' => "VARCHAR", |
| | |
| | | 'prefix' => "", |
| | | 'suffix' => "", |
| | | 'width' => "", |
| | | 'value' => array("y" => "<div id=\"ir-Yes\" class=\"swap\"><span>Yes</span></div>", "n" => "<div class=\"swap\" id=\"ir-No\"><span>No</span></div>")); |
| | | 'value' => array("y" => "<div id=\"ir-Yes\" class=\"swap\"><span>".$app->lng('yes_txt')."</span></div>", "n" => "<div class=\"swap\" id=\"ir-No\"><span>".$app->lng('no_txt')."</span></div>")); |
| | | |
| | | $liste["item"][] = array( 'field' => "server_id", |
| | | 'datatype' => "VARCHAR", |
| | | 'datatype' => "INTEGER", |
| | | 'formtype' => "SELECT", |
| | | 'op' => "like", |
| | | 'prefix' => "%", |
| | | 'suffix' => "%", |
| | | 'op' => "=", |
| | | 'prefix' => "", |
| | | 'suffix' => "", |
| | | 'datasource' => array ( 'type' => "SQL", |
| | | 'querystring' => "SELECT server_id,server_name FROM server WHERE {AUTHSQL} AND db_server = 1 ORDER BY server_name", |
| | | 'keyfield'=> "server_id", |
| | |
| | | 'prefix' => '%', |
| | | 'suffix' => '%', |
| | | 'width' => '', |
| | | 'value' => array('1' => "<div id=\"ir-Yes\" class=\"swap\"><span>Yes</span></div>", '0' => "<div class=\"swap\" id=\"ir-No\"><span>No</span></div>")); |
| | | 'value' => array('1' => "<div id=\"ir-Yes\" class=\"swap\"><span>".$app->lng('yes_txt')."</span></div>", '0' => "<div class=\"swap\" id=\"ir-No\"><span>".$app->lng('no_txt')."</span></div>")); |
| | | |
| | | $liste['item'][] = array( 'field' => 'web_server', |
| | | 'datatype' => 'VARCHAR', |
| | |
| | | 'prefix' => '%', |
| | | 'suffix' => '%', |
| | | 'width' => '', |
| | | 'value' => array('1' => "<div id=\"ir-Yes\" class=\"swap\"><span>Yes</span></div>", '0' => "<div class=\"swap\" id=\"ir-No\"><span>No</span></div>")); |
| | | 'value' => array('1' => "<div id=\"ir-Yes\" class=\"swap\"><span>".$app->lng('yes_txt')."</span></div>", '0' => "<div class=\"swap\" id=\"ir-No\"><span>".$app->lng('no_txt')."</span></div>")); |
| | | |
| | | $liste['item'][] = array( 'field' => 'dns_server', |
| | | 'datatype' => 'VARCHAR', |
| | |
| | | 'prefix' => '%', |
| | | 'suffix' => '%', |
| | | 'width' => '', |
| | | 'value' => array('1' => "<div id=\"ir-Yes\" class=\"swap\"><span>Yes</span></div>", '0' => "<div class=\"swap\" id=\"ir-No\"><span>No</span></div>")); |
| | | 'value' => array('1' => "<div id=\"ir-Yes\" class=\"swap\"><span>".$app->lng('yes_txt')."</span></div>", '0' => "<div class=\"swap\" id=\"ir-No\"><span>".$app->lng('no_txt')."</span></div>")); |
| | | |
| | | $liste['item'][] = array( 'field' => 'file_server', |
| | | 'datatype' => 'VARCHAR', |
| | |
| | | 'prefix' => '%', |
| | | 'suffix' => '%', |
| | | 'width' => '', |
| | | 'value' => array('1' => "<div id=\"ir-Yes\" class=\"swap\"><span>Yes</span></div>", '0' => "<div class=\"swap\" id=\"ir-No\"><span>No</span></div>")); |
| | | 'value' => array('1' => "<div id=\"ir-Yes\" class=\"swap\"><span>".$app->lng('yes_txt')."</span></div>", '0' => "<div class=\"swap\" id=\"ir-No\"><span>".$app->lng('no_txt')."</span></div>")); |
| | | |
| | | $liste['item'][] = array( 'field' => 'db_server', |
| | | 'datatype' => 'VARCHAR', |
| | |
| | | 'prefix' => '%', |
| | | 'suffix' => '%', |
| | | 'width' => '', |
| | | 'value' => array('1' => "<div id=\"ir-Yes\" class=\"swap\"><span>Yes</span></div>", '0' => "<div class=\"swap\" id=\"ir-No\"><span>No</span></div>")); |
| | | 'value' => array('1' => "<div id=\"ir-Yes\" class=\"swap\"><span>".$app->lng('yes_txt')."</span></div>", '0' => "<div class=\"swap\" id=\"ir-No\"><span>".$app->lng('no_txt')."</span></div>")); |
| | | |
| | | $liste['item'][] = array( 'field' => 'vserver_server', |
| | | 'datatype' => 'VARCHAR', |
| | |
| | | 'prefix' => '%', |
| | | 'suffix' => '%', |
| | | 'width' => '', |
| | | 'value' => array('1' => "<div id=\"ir-Yes\" class=\"swap\"><span>Yes</span></div>", '0' => "<div class=\"swap\" id=\"ir-No\"><span>No</span></div>")); |
| | | 'value' => array('1' => "<div id=\"ir-Yes\" class=\"swap\"><span>".$app->lng('yes_txt')."</span></div>", '0' => "<div class=\"swap\" id=\"ir-No\"><span>".$app->lng('no_txt')."</span></div>")); |
| | | |
| | | $liste['item'][] = array( 'field' => 'xmpp_server', |
| | | 'datatype' => 'VARCHAR', |
| | | 'formtype' => 'SELECT', |
| | | 'op' => 'like', |
| | | 'prefix' => '%', |
| | | 'suffix' => '%', |
| | | 'width' => '', |
| | | 'value' => array('1' => "<div id=\"ir-Yes\" class=\"swap\"><span>".$app->lng('yes_txt')."</span></div>", '0' => "<div class=\"swap\" id=\"ir-No\"><span>".$app->lng('no_txt')."</span></div>")); |
| | | |
| | | ?> |
| | |
| | | *****************************************************/ |
| | | |
| | | $liste['item'][] = array( 'field' => 'server_id', |
| | | 'datatype' => 'VARCHAR', |
| | | 'datatype' => 'INTEGER', |
| | | 'formtype' => 'SELECT', |
| | | 'op' => 'like', |
| | | 'prefix' => '%', |
| | | 'suffix' => '%', |
| | | 'op' => '=', |
| | | 'prefix' => '', |
| | | 'suffix' => '', |
| | | 'datasource' => array ( 'type' => 'SQL', |
| | | 'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name', |
| | | 'keyfield'=> 'server_id', |
| | |
| | | 'value' => ''); |
| | | |
| | | $liste['item'][] = array( 'field' => 'client_id', |
| | | 'datatype' => 'VARCHAR', |
| | | 'datatype' => 'INTEGER', |
| | | 'formtype' => 'SELECT', |
| | | 'op' => 'like', |
| | | 'prefix' => '%', |
| | | 'suffix' => '%', |
| | | 'op' => '=', |
| | | 'prefix' => '', |
| | | 'suffix' => '', |
| | | 'datasource' => array ( 'type' => 'SQL', |
| | | 'querystring' => 'SELECT client_id,contact_name FROM client WHERE {AUTHSQL} ORDER BY contact_name', |
| | | 'keyfield'=> 'client_id', |
| | |
| | | 'prefix' => "", |
| | | 'suffix' => "", |
| | | 'width' => "", |
| | | 'value' => array('y' => "<div id=\"ir-Yes\" class=\"swap\"><span>Yes</span></div>", 'n' => "<div class=\"swap\" id=\"ir-No\"><span>No</span></div>")); |
| | | 'value' => array('y' => "<div id=\"ir-Yes\" class=\"swap\"><span>".$app->lng('yes_txt')."</span></div>", 'n' => "<div class=\"swap\" id=\"ir-No\"><span>".$app->lng('no_txt')."</span></div>")); |
| | | |
| | | |
| | | $liste['item'][] = array( 'field' => 'virtualhost_port', |
New file |
| | |
| | | <?php |
| | | |
| | | $liste['name'] = 'server_ip_map'; |
| | | $liste['table'] = 'server_ip_map'; |
| | | $liste['table_idx'] = 'server_ip_map_id'; |
| | | $liste['search_prefix'] = 'search_'; |
| | | $liste['records_per_page'] = "15"; |
| | | $liste['file'] = 'server_ip_map_list.php'; |
| | | $liste['edit_file'] = 'server_ip_map_edit.php'; |
| | | $liste['delete_file'] = 'server_ip_del.php'; |
| | | $liste['paging_tpl'] = 'templates/paging.tpl.htm'; |
| | | $liste['auth'] = 'no'; |
| | | |
| | | $liste["item"][] = array( 'field' => "active", |
| | | 'datatype' => "VARCHAR", |
| | | 'formtype' => "SELECT", |
| | | 'op' => "=", |
| | | 'prefix' => "", |
| | | 'suffix' => "", |
| | | 'width' => "", |
| | | 'value' => array('y' => "<div id=\"ir-Yes\" class=\"swap\"><span>Yes</span></div>", 'n' => "<div class=\"swap\" id=\"ir-No\"><span>No</span></div>")); |
| | | |
| | | $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' => 'source_ip', |
| | | 'datatype' => 'VARCHAR', |
| | | 'op' => '=', |
| | | 'prefix' => '', |
| | | 'suffix' => '', |
| | | 'datasource' => array ( 'type' => 'SQL', |
| | | 'querystring' => 'SELECT server_ip_map_id,source_ip FROM server_ip_map WHERE {AUTHSQL}', |
| | | 'keyfield'=> 'server_ip_map_id', |
| | | 'valuefield'=> 'source_ip' |
| | | ), |
| | | 'width' => '', |
| | | 'value' => ''); |
| | | |
| | | $liste['item'][] = array( 'field' => 'destination_ip', |
| | | 'datatype' => 'VARCHAR', |
| | | 'op' => '=', |
| | | 'prefix' => '', |
| | | 'suffix' => '', |
| | | 'datasource' => array ( 'type' => 'SQL', |
| | | 'querystring' => 'SELECT server_ip_map_id,destination_ip FROM server_ip_map WHERE {AUTHSQL}', |
| | | 'keyfield'=> 'server_ip_map_id', |
| | | 'valuefield'=> 'destination_ip' |
| | | ), |
| | | 'width' => '', |
| | | 'value' => ''); |
| | | ?> |
| | |
| | | *****************************************************/ |
| | | |
| | | $liste['item'][] = array( 'field' => 'server_id', |
| | | 'datatype' => 'VARCHAR', |
| | | 'datatype' => 'INTEGER', |
| | | 'formtype' => 'SELECT', |
| | | 'op' => 'like', |
| | | 'prefix' => '%', |
| | | 'suffix' => '%', |
| | | 'op' => '=', |
| | | 'prefix' => '', |
| | | 'suffix' => '', |
| | | 'datasource' => array ( 'type' => 'SQL', |
| | | 'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name', |
| | | 'keyfield'=> 'server_id', |
| | |
| | | 'value' => ''); |
| | | |
| | | $liste['item'][] = array( 'field' => 'client_id', |
| | | 'datatype' => 'VARCHAR', |
| | | 'datatype' => 'INTEGER', |
| | | 'formtype' => 'SELECT', |
| | | 'op' => 'like', |
| | | 'prefix' => '%', |
| | | 'suffix' => '%', |
| | | 'op' => '=', |
| | | 'prefix' => '', |
| | | 'suffix' => '', |
| | | 'datasource' => array ( 'type' => 'SQL', |
| | | 'querystring' => 'SELECT client_id,contact_name FROM client WHERE {AUTHSQL} ORDER BY contact_name', |
| | | 'keyfield'=> 'client_id', |
| | |
| | | 'prefix' => "", |
| | | 'suffix' => "", |
| | | 'width' => "", |
| | | 'value' => array('y' => "<div id=\"ir-Yes\" class=\"swap\"><span>Yes</span></div>", 'n' => "<div class=\"swap\" id=\"ir-No\"><span>No</span></div>")); |
| | | 'value' => array('y' => "<div id=\"ir-Yes\" class=\"swap\"><span>".$app->lng('yes_txt')."</span></div>", 'n' => "<div class=\"swap\" id=\"ir-No\"><span>".$app->lng('no_txt')."</span></div>")); |
| | | |
| | | $liste["item"][] = array( 'field' => "repo_name", |
| | | 'datatype' => "VARCHAR", |
| | |
| | | 'prefix' => "", |
| | | 'suffix' => "", |
| | | 'width' => "", |
| | | 'value' => array('1' => "<div id=\"ir-Yes\" class=\"swap\"><span>Yes</span></div>", '0' => "<div class=\"swap\" id=\"ir-No\"><span>No</span></div>")); |
| | | 'value' => array('1' => "<div id=\"ir-Yes\" class=\"swap\"><span>".$app->lng('yes_txt')."</span></div>", '0' => "<div class=\"swap\" id=\"ir-No\"><span>".$app->lng('no_txt')."</span></div>")); |
| | | |
| | | $liste['item'][] = array( 'field' => 'username', |
| | | 'datatype' => 'VARCHAR', |
| | |
| | | |
| | | //* Note: Disabled post action |
| | | if (1 == 0 && isset($_POST['server_select'])) { |
| | | |
| | | //* CSRF Check |
| | | $app->auth->csrf_token_check(); |
| | | |
| | | $server = $_POST['server_select']; |
| | | $servers = array(); |
| | | if ($server == '*') { |
| | |
| | | } |
| | | foreach ($servers as $serverId) { |
| | | $sql = "INSERT INTO sys_remoteaction (server_id, tstamp, action_type, action_param, action_state, response) " . |
| | | "VALUES (". |
| | | $app->functions->intval($serverId) . ", " . |
| | | time() . ", " . |
| | | "'ispc_update', " . |
| | | "'', " . |
| | | "'pending', " . |
| | | "''" . |
| | | ")"; |
| | | $app->db->query($sql); |
| | | "VALUES (?, UNIX_TIMESTAMP(), 'ispc_update', '', 'pending', '')"; |
| | | $app->db->query($sql, $serverId); |
| | | } |
| | | $msg = $wb['action_scheduled']; |
| | | } |
| | | |
| | | $app->tpl->setVar('msg', $msg); |
| | | |
| | | //* SET csrf token |
| | | $csrf_token = $app->auth->csrf_token_get('ispupdate'); |
| | | $app->tpl->setVar('_csrf_id',$csrf_token['csrf_id']); |
| | | $app->tpl->setVar('_csrf_key',$csrf_token['csrf_key']); |
| | | |
| | | $app->tpl->setVar($wb); |
| | | |
| | | $app->tpl_defaults(); |
| | |
| | | * If the user wants to do the action, write this to our db |
| | | */ |
| | | if (isset($_POST['server_select'])) { |
| | | |
| | | //* CSRF Check |
| | | $app->auth->csrf_token_check(); |
| | | |
| | | $server = $_POST['server_select']; |
| | | $servers = array(); |
| | | if ($server == '*') { |
| | |
| | | } |
| | | foreach ($servers as $serverId) { |
| | | $sql = "INSERT INTO sys_remoteaction (server_id, tstamp, action_type, action_param, action_state, response) " . |
| | | "VALUES (". |
| | | $app->functions->intval($serverId) . ", " . |
| | | time() . ", " . |
| | | "'os_update', " . |
| | | "'', " . |
| | | "'pending', " . |
| | | "''" . |
| | | ")"; |
| | | $app->db->query($sql); |
| | | "VALUES (?, UNIX_TIMESTAMP(), 'os_update', '', 'pending', '')"; |
| | | $app->db->query($sql, $serverId); |
| | | } |
| | | $msg = $wb['action_scheduled']; |
| | | } |
| | | |
| | | $app->tpl->setVar('msg', $msg); |
| | | |
| | | //* SET csrf token |
| | | $csrf_token = $app->auth->csrf_token_get('osupdate'); |
| | | $app->tpl->setVar('_csrf_id',$csrf_token['csrf_id']); |
| | | $app->tpl->setVar('_csrf_key',$csrf_token['csrf_key']); |
| | | |
| | | $app->tpl->setVar($wb); |
| | | |
| | | $app->tpl_defaults(); |
| | |
| | | } |
| | | } |
| | | |
| | | $server_config_array[$section] = $app->tform->encode($this->dataRecord, $section); |
| | | $server_config_str = $app->ini_parser->get_ini_string($server_config_array); |
| | | 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); |
| | | |
| | | $app->db->datalogUpdate('server', "config = '".$app->db->quote($server_config_str)."'", 'server_id', $server_id); |
| | | $app->db->datalogUpdate('server', array("config" => $server_config_str), 'server_id', $server_id); |
| | | } else { |
| | | $app->error('Security breach!'); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | global $app, $conf; |
| | | |
| | | // Getting Servers |
| | | $sql = "SELECT server_id,server_name FROM server WHERE server_id != ".$app->functions->intval($this->id)." ORDER BY server_name"; |
| | | $mirror_servers = $app->db->queryAllRecords($sql); |
| | | $sql = "SELECT server_id,server_name FROM server WHERE server_id != ? ORDER BY server_name"; |
| | | $mirror_servers = $app->db->queryAllRecords($sql, $this->id); |
| | | $mirror_server_select = '<option value="0">'.$app->tform->lng('- None -').'</option>'; |
| | | if(is_array($mirror_servers)) { |
| | | foreach( $mirror_servers as $mirror_server) { |
| | |
| | | //* 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'])) { |
| | | $rec = $app->db->queryOneRecord("SELECT server_id from server_ip WHERE server_ip_id = ".$app->functions->intval($this->id)); |
| | | $rec = $app->db->queryOneRecord("SELECT server_id from server_ip WHERE server_ip_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.'); |
New file |
| | |
| | | <?php |
| | | |
| | | /* |
| | | Copyright (c) 2015, Florian Schaal, schaal @it |
| | | 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. |
| | | */ |
| | | |
| | | $list_def_file = "list/server_ip_map.list.php"; |
| | | $tform_def_file = "form/server_ip_map.tform.php"; |
| | | |
| | | require_once '../../lib/config.inc.php'; |
| | | require_once '../../lib/app.inc.php'; |
| | | |
| | | //* Check permissions for module |
| | | $app->auth->check_module_permissions('admin'); |
| | | $app->auth->check_security_permissions('admin_allow_server_ip'); |
| | | |
| | | $app->uses("tform_actions"); |
| | | $app->tform_actions->onDelete(); |
| | | |
| | | ?> |
New file |
| | |
| | | <?php |
| | | /* |
| | | Copyright (c) 2015, Florian Schaal, schaal @it |
| | | 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. |
| | | */ |
| | | |
| | | $tform_def_file = "form/server_ip_map.tform.php"; |
| | | |
| | | require_once '../../lib/config.inc.php'; |
| | | require_once '../../lib/app.inc.php'; |
| | | |
| | | //* Check permissions for module |
| | | $app->auth->check_module_permissions('admin'); |
| | | $app->auth->check_security_permissions('admin_allow_server_ip'); |
| | | |
| | | // Loading classes |
| | | $app->uses('tpl,tform,tform_actions'); |
| | | $app->load('tform_actions'); |
| | | |
| | | class page_action extends tform_actions { |
| | | |
| | | function onShowEnd() { |
| | | global $app; |
| | | |
| | | // server-list |
| | | $sql = "SELECT server_id, server_name FROM server WHERE mirror_server_id > 0 ORDER BY server_name"; |
| | | $servers = $app->db->queryAllRecords($sql); |
| | | $server_select = "<option value=''></option>"; |
| | | if(is_array($servers)) { |
| | | foreach($servers as $server) { |
| | | $selected = ($server['server_id'] == $this->dataRecord['server_id'])?'SELECTED':''; |
| | | $server_select .= "<option value='$server[server_id]' $selected>$server[server_name]</option>\r\n"; |
| | | } |
| | | } |
| | | unset($servers); |
| | | $app->tpl->setVar('server_id', $server_select); |
| | | |
| | | // ip-list |
| | | $sql = "SELECT server_ip.server_ip_id, server_ip.ip_address AS ip_address, server.server_name, CONCAT(server_ip.ip_address,' :: [', server.server_name, ']') AS source FROM server_ip, server WHERE (server_ip.server_id = server.server_id AND server.web_server =1 AND mirror_server_id = 0 AND virtualhost = 'y')"; |
| | | $ips = $app->db->queryAllRecords($sql); |
| | | $ip_select = "<option value=''></option>"; |
| | | if(is_array($ips)) { |
| | | foreach( $ips as $ip) { |
| | | $selected = ($ip['ip_address'] == $this->dataRecord['source_ip'])?'SELECTED':''; |
| | | $ip_select .= "<option value='$ip[ip_address]' $selected>$ip[source]</option>\r\n"; |
| | | } |
| | | } |
| | | unset($ips); |
| | | $app->tpl->setVar('source_ip', $ip_select); |
| | | |
| | | parent::onShowEnd(); |
| | | } |
| | | |
| | | function onBeforeInsert() { |
| | | global $app; |
| | | |
| | | $sql = "SELECT * FROM server_ip WHERE server_id = ? and ip_address = ?"; |
| | | $ip_check=$app->db->queryOneRecord($sql, $this->dataRecord['server_id'], $this->dataRecord['source_ip']); |
| | | if (is_array($ip_check)) $app->tform->errorMessage .= $app->tform->wordbook['duplicate_mapping_error']; |
| | | |
| | | $sql = 'SELECT count(*) as no FROM server_ip_map WHERE server_id = ? AND source_ip = ? AND destination_ip = ?'; |
| | | $check = $app->db->queryOneRecord($sql, $this->dataRecord['server_id'], $this->dataRecord['source_ip'], $this->dataRecord['destination_ip']); |
| | | if ($check['no'] > 0) $app->tform->errorMessage .= $app->tform->wordbook['duplicate_mapping_error']; |
| | | } |
| | | |
| | | function onBeforeUpdate() { |
| | | global $app; |
| | | $sql = "SELECT * FROM server_ip WHERE server_id = ? and ip_address = ?"; |
| | | $ip_check=$app->db->queryOneRecord($sql, $this->dataRecord['server_id'], $this->dataRecord['source_ip']); |
| | | if (is_array($ip_check)) $app->tform->errorMessage .= $app->tform->wordbook['duplicate_mapping_error']; |
| | | |
| | | $this->oldDataRecord = $app->tform->getDataRecord($this->id); |
| | | if ($this->dataRecord['source_ip'] != $this->oldDataRecord['source_ip'] || $this->dataRecord['destination_ip'] != $this->oldDataRecord['destination_ip']) { |
| | | $sql = 'SELECT count(*) as no FROM server_ip_map WHERE server_id = ? AND source_ip = ? AND destination_ip = ?'; |
| | | $check = $app->db->queryOneRecord($sql, $this->dataRecord['server_id'], $this->dataRecord['source_ip'], $this->dataRecord['destination_ip']); |
| | | if ($check['no'] > 0) $app->tform->errorMessage .= $app->tform->wordbook['duplicate_mapping_error']; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | $page = new page_action; |
| | | $page->onLoad(); |
| | | |
| | | ?> |
New file |
| | |
| | | <?php |
| | | |
| | | /* |
| | | Copyright (c) 2015, Florian Schaal, schaal @it |
| | | 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. |
| | | */ |
| | | |
| | | require_once '../../lib/config.inc.php'; |
| | | require_once '../../lib/app.inc.php'; |
| | | |
| | | $list_def_file = "list/server_ip_map.list.php"; |
| | | |
| | | //* Check permissions for module |
| | | $app->auth->check_module_permissions('admin'); |
| | | |
| | | $app->uses('listform_actions'); |
| | | |
| | | //$app->listform_actions->SQLOrderBy = "ORDER BY server_ip.server_id, server_ip.ip_address"; |
| | | $app->listform_actions->SQLOrderBy = ""; |
| | | |
| | | $app->listform_actions->onLoad(); |
| | | |
| | | ?> |
| | |
| | | //* 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'])) && isset($this->dataRecord["server_id"])) { |
| | | $rec = $app->db->queryOneRecord("SELECT server_id from server_php WHERE server_php_id = ".$app->functions->intval($this->id)); |
| | | $rec = $app->db->queryOneRecord("SELECT server_id from server_php WHERE server_php_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 is only allowed for administrators |
| | | if(!$app->auth->is_admin()) die('only allowed for administrators.'); |
| | | |
| | | $package_name = $app->db->quote($_REQUEST['package']); |
| | | $package_name = $_REQUEST['package']; |
| | | $install_server_id = $app->functions->intval($_REQUEST['server_id']); |
| | | $install_key = $app->db->quote(trim($_REQUEST['install_key'])); |
| | | $install_key = trim($_REQUEST['install_key']); |
| | | |
| | | $package = $app->db->queryOneRecord("SELECT * FROM software_package WHERE package_name = '$package_name'"); |
| | | $package = $app->db->queryOneRecord("SELECT * FROM software_package WHERE package_name = ?", $package_name); |
| | | |
| | | $install_key_verified = false; |
| | | $message_err = ''; |
| | |
| | | //* verify the key |
| | | if($package['package_installable'] == 'key' && $install_key != '') { |
| | | |
| | | $repo = $app->db->queryOneRecord("SELECT * FROM software_repo WHERE software_repo_id = ".$app->db->quote($package['software_repo_id'])); |
| | | $repo = $app->db->queryOneRecord("SELECT * FROM software_repo WHERE software_repo_id = ?", $package['software_repo_id']); |
| | | |
| | | $client = new SoapClient(null, array('location' => $repo['repo_url'], |
| | | 'uri' => $repo['repo_url'])); |
| | |
| | | $message_err = 'Verification of the key failed.'; |
| | | } else { |
| | | // Store the verified key into the database |
| | | $app->db->datalogUpdate('software_package', "package_key = '".$app->db->quote($install_key)."'", 'package_id', $package['package_id']); |
| | | $app->db->datalogUpdate('software_package', array("package_key" => $install_key), 'package_id', $package['package_id']); |
| | | } |
| | | } else { |
| | | $message_ok = 'Please enter the software key for the package.'; |
| | |
| | | |
| | | //* Install packages, if all requirements are fullfilled. |
| | | if($install_server_id > 0 && $package_name != '' && ($package['package_installable'] == 'yes' || $install_key_verified == true)) { |
| | | $sql = "SELECT software_update_id, package_name, update_title FROM software_update WHERE type = 'full' AND package_name = '".$app->db->quote($package_name)."' ORDER BY v1 DESC, v2 DESC, v3 DESC, v4 DESC LIMIT 0,1"; |
| | | $tmp = $app->db->queryOneRecord($sql); |
| | | $sql = "SELECT software_update_id, package_name, update_title FROM software_update WHERE type = 'full' AND package_name = ? ORDER BY v1 DESC, v2 DESC, v3 DESC, v4 DESC LIMIT 0,1"; |
| | | $tmp = $app->db->queryOneRecord($sql, $package_name); |
| | | $software_update_id = $tmp['software_update_id']; |
| | | |
| | | //* if package requires a DB and there is no data for a db in config, then we create this data now |
| | |
| | | 'database_host' => 'localhost'); |
| | | $package_config_str = $app->ini_parser->get_ini_string($package_config_array); |
| | | $package['package_config'] = $package_config_str; |
| | | $app->db->datalogUpdate('software_package', "package_config = '".$app->db->quote($package_config_str)."'", 'package_id', $package['package_id']); |
| | | $app->db->datalogUpdate('software_package', array("package_config" => $package_config_str), 'package_id', $package['package_id']); |
| | | } |
| | | } |
| | | |
| | |
| | | if(!isset($package_config_array['remote_api'])) { |
| | | $remote_user = 'ispapp'.$package['package_id']; |
| | | $remote_password = md5(mt_rand()); |
| | | $remote_functions = $app->db->quote($package['package_remote_functions']); |
| | | $remote_functions = $package['package_remote_functions']; |
| | | |
| | | $package_config_array['remote_api'] = array( |
| | | 'remote_hostname' => $_SERVER['HTTP_HOST'], |
| | |
| | | $package_config_str = $app->ini_parser->get_ini_string($package_config_array); |
| | | $package['package_config'] = $package_config_str; |
| | | $remote_password_md5 = md5($remote_password); |
| | | $app->db->datalogUpdate('software_package', "package_config = '".$app->db->quote($package_config_str)."'", 'package_id', $package['package_id']); |
| | | $app->db->datalogUpdate('software_package', array("package_config" => $package_config_str), 'package_id', $package['package_id']); |
| | | |
| | | $sql = "INSERT INTO `remote_user` (`sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `remote_username`, `remote_password`, `remote_functions`) VALUES |
| | | (1, 1, 'riud', 'riud', '', '".$app->db->quote($remote_user)."', '".$app->db->quote($remote_password_md5)."', '".$app->db->quote($remote_functions)."');"; |
| | | |
| | | $app->db->query($sql); |
| | | (1, 1, 'riud', 'riud', '', ?, ?, ?)"; |
| | | $app->db->query($sql, $remote_user, $remote_password_md5, $remote_functions); |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | //* Add the record to start the install process |
| | | $insert_data = "(package_name, server_id, software_update_id, status) VALUES ('".$app->db->quote($package_name)."', '".$app->db->quote($install_server_id)."', '".$app->db->quote($software_update_id)."','installing')"; |
| | | $insert_data = array( |
| | | "package_name" => $package_name, |
| | | "server_id" => $install_server_id, |
| | | "software_update_id" => $software_update_id, |
| | | "status" => 'installing' |
| | | ); |
| | | $app->db->datalogInsert('software_update_inst', $insert_data, 'software_update_inst_id'); |
| | | $message_ok = 'Starting package installation '."<a href=\"#\" onclick=\"ISPConfig.submitForm('pageForm','admin/software_package_list.php');\">".$app->lng('next')."</a>"; |
| | | |
| | |
| | | $packages = $client->get_packages($repo['repo_username'], $repo['repo_password']); |
| | | if(is_array($packages)) { |
| | | foreach($packages as $p) { |
| | | $package_name = $app->db->quote($p['name']); |
| | | $tmp = $app->db->queryOneRecord("SELECT package_id FROM software_package WHERE package_name = '".$app->db->quote($package_name)."'"); |
| | | $package_name = $p['name']; |
| | | $tmp = $app->db->queryOneRecord("SELECT package_id FROM software_package WHERE package_name = ?", $package_name); |
| | | |
| | | $package_title = $app->db->quote($p['title']); |
| | | $package_description = $app->db->quote($p['description']); |
| | | $package_title = $p['title']; |
| | | $package_description = $p['description']; |
| | | $software_repo_id = $app->functions->intval($repo['software_repo_id']); |
| | | $package_type = $app->db->quote($p['type']); |
| | | $package_installable = $app->db->quote($p['installable']); |
| | | $package_requires_db = $app->db->quote($p['requires_db']); |
| | | $package_remote_functions = $app->db->quote($p['remote_functions']); |
| | | $package_type = $p['type']; |
| | | $package_installable = $p['installable']; |
| | | $package_requires_db = $p['requires_db']; |
| | | $package_remote_functions = $p['remote_functions']; |
| | | |
| | | if(empty($tmp['package_id'])) { |
| | | //$sql = "INSERT INTO software_package (software_repo_id, package_name, package_title, package_description,package_type,package_installable,package_requires_db) VALUES ($software_repo_id, '$package_name', '$package_title', '$package_description','$package_type','$package_installable','$package_requires_db')"; |
| | | //$app->db->query($sql); |
| | | $insert_data = "(software_repo_id, package_name, package_title, package_description,package_type,package_installable,package_requires_db,package_remote_functions) VALUES ($software_repo_id, '$package_name', '$package_title', '$package_description','$package_type','$package_installable','$package_requires_db','$package_remote_functions')"; |
| | | $insert_data = array( |
| | | "software_repo_id" => $software_repo_id, |
| | | "package_name" => $package_name, |
| | | "package_title" => $package_title, |
| | | "package_description" => $package_description, |
| | | "package_type" => $package_type, |
| | | "package_installable" => $package_installable, |
| | | "package_requires_db" => $package_requires_db, |
| | | "package_remote_functions" => $package_remote_functions |
| | | ); |
| | | $app->db->datalogInsert('software_package', $insert_data, 'package_id'); |
| | | $packages_added++; |
| | | } else { |
| | | //$sql = "UPDATE software_package SET software_repo_id = $software_repo_id, package_title = '$package_title', package_description = '$package_description', package_type = '$package_type', package_installable = '$package_installable', package_requires_db = '$package_requires_db' WHERE package_name = '$package_name'"; |
| | | //$app->db->query($sql); |
| | | $update_data = "software_repo_id = $software_repo_id, package_title = '$package_title', package_description = '$package_description', package_type = '$package_type', package_installable = '$package_installable', package_requires_db = '$package_requires_db', package_remote_functions = '$package_remote_functions'"; |
| | | $update_data = array( |
| | | "software_repo_id" => $software_repo_id, |
| | | "package_title" => $package_title, |
| | | "package_description" => $package_description, |
| | | "package_type" => $package_type, |
| | | "package_installable" => $package_installable, |
| | | "package_requires_db" => $package_requires_db, |
| | | "package_remote_functions" => $package_remote_functions |
| | | ); |
| | | //echo $update_data; |
| | | $app->db->datalogUpdate('software_package', $update_data, 'package_id', $tmp['package_id']); |
| | | } |
| | |
| | | $v3 = $app->functions->intval($version_array[2]); |
| | | $v4 = $app->functions->intval($version_array[3]); |
| | | |
| | | $package_name = $app->db->quote($u['package_name']); |
| | | $package_name = $u['package_name']; |
| | | $software_repo_id = $app->functions->intval($repo['software_repo_id']); |
| | | $update_url = $app->db->quote($u['url']); |
| | | $update_md5 = $app->db->quote($u['md5']); |
| | | $update_dependencies = (isset($u['dependencies']))?$app->db->quote($u['dependencies']):''; |
| | | $update_title = $app->db->quote($u['title']); |
| | | $type = $app->db->quote($u['type']); |
| | | $update_url = $u['url']; |
| | | $update_md5 = $u['md5']; |
| | | $update_dependencies = (isset($u['dependencies']))?$u['dependencies']:''; |
| | | $update_title = $u['title']; |
| | | $type = $u['type']; |
| | | |
| | | // Check that we do not have this update in the database yet |
| | | $sql = "SELECT * FROM software_update WHERE package_name = '$package_name' and v1 = '$v1' and v2 = '$v2' and v3 = '$v3' and v4 = '$v4'"; |
| | | $tmp = $app->db->queryOneRecord($sql); |
| | | $sql = "SELECT * FROM software_update WHERE package_name = ? and v1 = ? and v2 = ? and v3 = ? and v4 = ?"; |
| | | $tmp = $app->db->queryOneRecord($sql, $package_name, $v1, $v2, $v3, $v4); |
| | | if(!isset($tmp['software_update_id'])) { |
| | | // Insert the update in the datbase |
| | | //$sql = "INSERT INTO software_update (software_repo_id, package_name, update_url, update_md5, update_dependencies, update_title, v1, v2, v3, v4, type) |
| | | //VALUES ($software_repo_id, '$package_name', '$update_url', '$update_md5', '$update_dependencies', '$update_title', '$v1', '$v2', '$v3', '$v4', '$type')"; |
| | | //die($sql); |
| | | //$app->db->query($sql); |
| | | $insert_data = "(software_repo_id, package_name, update_url, update_md5, update_dependencies, update_title, v1, v2, v3, v4, type) |
| | | VALUES ($software_repo_id, '$package_name', '$update_url', '$update_md5', '$update_dependencies', '$update_title', '$v1', '$v2', '$v3', '$v4', '$type')"; |
| | | $insert_data = array( |
| | | "software_repo_id" => $software_repo_id, |
| | | "package_name" => $package_name, |
| | | "update_url" => $update_url, |
| | | "update_md5" => $update_md5, |
| | | "update_dependencies" => $update_dependencies, |
| | | "update_title" => $update_title, |
| | | "v1" => $v1, |
| | | "v2" => $v2, |
| | | "v3" => $v3, |
| | | "v4" => $v4, |
| | | "type" => $type |
| | | ); |
| | | $app->db->datalogInsert('software_update', $insert_data, 'software_update_id'); |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | //* Install packages, if GET Request |
| | | /* |
| | | if(isset($_GET['action']) && $_GET['action'] == 'install' && $_GET['package'] != '' && $_GET['server_id'] > 0) { |
| | | $package_name = $app->db->quote($_GET['package']); |
| | | $server_id = $app->functions->intval($_GET['server_id']); |
| | | $sql = "SELECT software_update_id, package_name, update_title FROM software_update WHERE type = 'full' AND package_name = '$package_name' ORDER BY v1 DESC, v2 DESC, v3 DESC, v4 DESC LIMIT 0,1"; |
| | | $tmp = $app->db->queryOneRecord($sql); |
| | | $software_update_id = $tmp['software_update_id']; |
| | | |
| | | $insert_data = "(package_name, server_id, software_update_id, status) VALUES ('$package_name', '$server_id', '$software_update_id','installing')"; |
| | | // $insert_data = "(package_name, server_id, software_update_id, status) VALUES ('$package_name', '$server_id', '$software_update_id','installed')"; |
| | | $app->db->datalogInsert('software_update_inst', $insert_data, 'software_update_inst_id'); |
| | | } |
| | | */ |
| | | |
| | | |
| | | |
| | | // Show the list in the interface |
| | | // Loading the template |
| | |
| | | foreach($packages as $key => $p) { |
| | | $installed_txt = ''; |
| | | foreach($servers as $s) { |
| | | $inst = $app->db->queryOneRecord("SELECT * FROM software_update, software_update_inst WHERE software_update_inst.software_update_id = software_update.software_update_id AND software_update_inst.package_name = '".$app->db->quote($p["package_name"])."' AND server_id = '".$app->functions->intval($s["server_id"])."'"); |
| | | $inst = $app->db->queryOneRecord("SELECT * FROM software_update, software_update_inst WHERE software_update_inst.software_update_id = software_update.software_update_id AND software_update_inst.package_name = ? AND server_id = ?", $p["package_name"], $s["server_id"]); |
| | | $version = $inst['v1'].'.'.$inst['v2'].'.'.$inst['v3'].'.'.$inst['v4']; |
| | | |
| | | if($inst['status'] == 'installed') { |
| | |
| | | $v3 = $app->functions->intval($version_array[2]); |
| | | $v4 = $app->functions->intval($version_array[3]); |
| | | |
| | | $package_name = $app->db->quote($u['package_name']); |
| | | $package_name = $u['package_name']; |
| | | $software_repo_id = $app->functions->intval($repo['software_repo_id']); |
| | | $update_url = $app->db->quote($u['url']); |
| | | $update_md5 = $app->db->quote($u['md5']); |
| | | $update_dependencies = (isset($u['dependencies']))?$app->db->quote($u['dependencies']):''; |
| | | $update_title = $app->db->quote($u['title']); |
| | | $type = $app->db->quote($u['type']); |
| | | $update_url = $u['url']; |
| | | $update_md5 = $u['md5']; |
| | | $update_dependencies = (isset($u['dependencies']))?$u['dependencies']:''; |
| | | $update_title = $u['title']; |
| | | $type = $u['type']; |
| | | |
| | | // Check that we do not have this update in the database yet |
| | | $sql = "SELECT * FROM software_update WHERE package_name = '$package_name' and v1 = '$v1' and v2 = '$v2' and v3 = '$v3' and v4 = '$v4'"; |
| | | $tmp = $app->db->queryOneRecord($sql); |
| | | $sql = "SELECT * FROM software_update WHERE package_name = ? and v1 = ? and v2 = ? and v3 = ? and v4 = ?"; |
| | | $tmp = $app->db->queryOneRecord($sql, $package_name, $v1, $v2, $v3, $v4); |
| | | if(!isset($tmp['software_update_id'])) { |
| | | // Insert the update in the datbase |
| | | $sql = "INSERT INTO software_update (software_repo_id, package_name, update_url, update_md5, update_dependencies, update_title, v1, v2, v3, v4, type) |
| | | VALUES ($software_repo_id, '$package_name', '$update_url', '$update_md5', '$update_dependencies', '$update_title', '$v1', '$v2', '$v3', '$v4', '$type')"; |
| | | VALUES ($software_repo_id, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; |
| | | //die($sql); |
| | | $app->db->query($sql); |
| | | $app->db->query($sql, $package_name, $update_url, $update_md5, $update_dependencies, $update_title, $v1, $v2, $v3, $v4, $type); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | //* Install packages, if GET Request |
| | | if(isset($_GET['action']) && $_GET['action'] == 'install' && $_GET['package'] != '' && $_GET['server_id'] > 0) { |
| | | $package_name = $app->db->quote($_GET['package']); |
| | | $package_name = $_GET['package']; |
| | | $server_id = $app->functions->intval($_GET['server_id']); |
| | | $software_update_id = $app->functions->intval($_GET['id']); |
| | | |
| | | $insert_data = "(package_name, server_id, software_update_id, status) VALUES ('$package_name', '$server_id', '$software_update_id','installing')"; |
| | | // $insert_data = "(package_name, server_id, software_update_id, status) VALUES ('$package_name', '$server_id', '$software_update_id','installed')"; |
| | | $insert_data = array( |
| | | "package_name" => $package_name, |
| | | "server_id" => $server_id, |
| | | "software_update_id" => $software_update_id, |
| | | "status" => 'installing' |
| | | ); |
| | | $app->db->datalogInsert('software_update_inst', $insert_data, 'software_update_inst_id'); |
| | | |
| | | } |
| | |
| | | foreach($installed_packages as $ip) { |
| | | |
| | | // Get version number of the latest installed version |
| | | $sql = "SELECT v1, v2, v3, v4 FROM software_update, software_update_inst WHERE software_update.software_update_id = software_update_inst.software_update_id AND server_id = ".$app->functions->intval($server_id)." ORDER BY v1 DESC , v2 DESC , v3 DESC , v4 DESC LIMIT 0,1"; |
| | | $lu = $app->db->queryOneRecord($sql); |
| | | $sql = "SELECT v1, v2, v3, v4 FROM software_update, software_update_inst WHERE software_update.software_update_id = software_update_inst.software_update_id AND server_id = ? ORDER BY v1 DESC , v2 DESC , v3 DESC , v4 DESC LIMIT 0,1"; |
| | | $lu = $app->db->queryOneRecord($sql, $server_id); |
| | | |
| | | // Get all installable updates |
| | | $sql = "SELECT * FROM software_update WHERE v1 >= ".$app->functions->intval($lu['v1'])." AND v2 >= ".$app->functions->intval($lu['v2'])." AND v3 >= ".$app->functions->intval($lu['v3'])." AND v4 >= ".$app->functions->intval($lu['v4'])." AND package_name = '".$app->db->quote($ip['package_name'])."' ORDER BY v1 DESC , v2 DESC , v3 DESC , v4 DESC"; |
| | | $updates = $app->db->queryAllRecords($sql); |
| | | $sql = "SELECT * FROM software_update WHERE v1 >= ? AND v2 >= ? AND v3 >= ? AND v4 >= ? AND package_name = ? ORDER BY v1 DESC , v2 DESC , v3 DESC , v4 DESC"; |
| | | $updates = $app->db->queryAllRecords($sql, $lu['v1'], $lu['v2'], $lu['v3'], $lu['v4'], $ip['package_name']); |
| | | //die($sql); |
| | | |
| | | if(is_array($updates)) { |
| | |
| | | $available_dashlets_txt = ''; |
| | | $handle = @opendir(ISPC_WEB_PATH.'/dashboard/dashlets'); |
| | | while ($file = @readdir($handle)) { |
| | | if ($file != '.' && $file != '..' && !is_dir($file)) { |
| | | if ($file != '.' && $file != '..' && !is_dir(ISPC_WEB_PATH.'/dashboard/dashlets/'.$file)) { |
| | | $available_dashlets_txt .= '<a href="javascript:void(0);" class="addPlaceholderContent">['.substr($file, 0, -4).']<pre class="addPlaceholderContent" style="display:none;">['.substr($file, 0, -4).'],</pre></a> '; |
| | | } |
| | | } |
| | | |
| | | if($available_dashlets_txt == '') $available_dashlets_txt = '------'; |
| | | $app->tpl->setVar("available_dashlets_txt", $available_dashlets_txt); |
| | | |
| | | // Logo |
| | | $sys_ini = $app->db->queryOneRecord("SELECT * FROM sys_ini WHERE sysini_id = ?", $this->id); |
| | | if($sys_ini['custom_logo'] != ''){ |
| | | $logo = '<img src="'.$sys_ini['custom_logo'].'" /> <a href="#" class="btn btn-default formbutton-danger formbutton-narrow" style="margin:5px" id="del_custom_logo"><span class="icon icon-delete"></span></a>'; |
| | | } else { |
| | | $logo = '<img src="'.$sys_ini['default_logo'].'" />'; |
| | | } |
| | | $default_logo = '<img src="'.$sys_ini['default_logo'].'" />'; |
| | | $app->tpl->setVar("used_logo", $logo); |
| | | $app->tpl->setVar("default_logo", $default_logo); |
| | | |
| | | parent::onShowEnd(); |
| | | } |
| | |
| | | $server_config_array[$section] = $new_config; |
| | | $server_config_str = $app->ini_parser->get_ini_string($server_config_array); |
| | | |
| | | //$sql = "UPDATE sys_ini SET config = '".$app->db->quote($server_config_str)."' WHERE sysini_id = 1"; |
| | | //if($conf['demo_mode'] != true) $app->db->query($sql); |
| | | if($conf['demo_mode'] != true) $app->db->datalogUpdate('sys_ini', "config = '".$app->db->quote($server_config_str)."'", 'sysini_id', 1); |
| | | if($conf['demo_mode'] != true) $app->db->datalogUpdate('sys_ini', array("config" => $server_config_str), 'sysini_id', 1); |
| | | |
| | | /* |
| | | * If we should use the domain-module, we have to insert all existing domains into the table |
| | |
| | | "FROM web_domain WHERE type NOT IN ('subdomain','vhostsubdomain')"; |
| | | $app->db->query($sql); |
| | | } |
| | | |
| | | //die(print_r($_FILES)); |
| | | // Logo |
| | | /* |
| | | if(isset($_FILES['file']['name']) && is_uploaded_file($_FILES['file']['tmp_name'])){ |
| | | //print_r($_FILES); |
| | | |
| | | $path= $_FILES['file']['tmp_name']; |
| | | $type = pathinfo($path, PATHINFO_EXTENSION); |
| | | $data = file_get_contents($path); |
| | | $base64 = 'data:image/' . $type . ';base64,' . base64_encode($data); |
| | | $app->db->query("UPDATE sys_ini SET custom_logo = ? WHERE sysini_id = ?", $base64, $this->id); |
| | | } |
| | | */ |
| | | |
| | | // Maintenance mode |
| | | if($server_config_array['misc']['maintenance_mode'] == 'y'){ |
| | | //print_r($_SESSION); |
| | | //echo $_SESSION['s']['id']; |
| | | $app->db->query("DELETE FROM sys_session WHERE session_id != '".$app->db->quote($_SESSION['s']['id'])."'"); |
| | | $app->db->query("DELETE FROM sys_session WHERE session_id != ?", $_SESSION['s']['id']); |
| | | } |
| | | } |
| | | |
| | | /* |
| | | function onAfterUpdate() { |
| | | if($this->_js_changed == true) { |
| | | // not the best way, but it works |
| | | header('Content-Type: text/html'); |
| | | print '<script type="text/javascript">document.location.reload(true);</script>'; |
| | | exit; |
| | | } |
| | | } |
| | | */ |
| | | |
| | | } |
| | | |
| | | $app->tform_actions = new page_action; |
| | |
| | | <label for="snippet" class="col-sm-3 control-label">{tmpl_var name='snippet_txt'}</label> |
| | | <div class="col-sm-9"><textarea class="form-control" name="snippet" id="snippet" rows='10' cols='50'>{tmpl_var name='snippet'}</textarea></div><span class="nginx"> {tmpl_var name='variables_txt'}: </span><a href="javascript:void(0);" class="addPlaceholder nginx">{DOCROOT}</a><span class="nginx">, </span><a href="javascript:void(0);" class="addPlaceholder nginx">{FASTCGIPASS}</a> |
| | | </div> |
| | | <div class="form-group php"> |
| | | <label class="col-sm-3 control-label">{tmpl_var name='required_php_snippets_txt'}</label> |
| | | <div class="col-sm-9"> |
| | | {tmpl_var name='required_php_snippets'} |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">{tmpl_var name='customer_viewable_txt'}</label> |
| | | <div class="col-sm-9"> |
| | |
| | | |
| | | if (jQuery('#type').val() != 'nginx' && jQuery('#type').val() != 'apache') { |
| | | jQuery('#customer_viewable').closest('div.ctrlHolder:visible').hide(); |
| | | }else { |
| | | jQuery('.php:visible').hide(); |
| | | } else { |
| | | jQuery('#customer_viewable').closest('div.ctrlHolder:hidden').show(); |
| | | jQuery('.php:hidden').show(); |
| | | } |
| | | |
| | | jQuery('#type').change(function(){ |
| | | if (jQuery(this).val() != 'nginx' && jQuery(this).val() != 'apache') { |
| | | jQuery('#customer_viewable').closest('div.ctrlHolder:visible').hide(); |
| | | jQuery('.php:visible').hide(); |
| | | } else { |
| | | jQuery('#customer_viewable').closest('div.ctrlHolder:hidden').show(); |
| | | jQuery('.php:hidden').show(); |
| | | } |
| | | if(jQuery(this).val() == 'nginx'){ |
| | | jQuery('.nginx:hidden').show(); |
| | |
| | | <td><a href="#" data-load-content="admin/directive_snippets_edit.php?id={tmpl_var name='id'}">{tmpl_var name="type"}</a></td> |
| | | <td><a href="#" data-load-content="admin/directive_snippets_edit.php?id={tmpl_var name='id'}">{tmpl_var name="customer_viewable"}</a></td> |
| | | <td class="text-right"> |
| | | <a class="btn btn-default formbutton-danger formbutton-narrow" href="javascript: ISPConfig.confirm_action('admin/directive_snippets_del.php?id={tmpl_var name='id'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name='delete_confirmation'}');"><span class="icon icon-delete"></span></button> |
| | | <a class="btn btn-default formbutton-danger formbutton-narrow" href="javascript: ISPConfig.confirm_action('admin/directive_snippets_del.php?id={tmpl_var name='id'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name='delete_confirmation'}');"><span class="icon icon-delete"></span></a> |
| | | </td> |
| | | </tr> |
| | | </tmpl_loop> |
| | |
| | | <td><a href="#" data-load-content="admin/firewall_edit.php?id={tmpl_var name='id'}">{tmpl_var name="tcp_port"}</a></td> |
| | | <td><a href="#" data-load-content="admin/firewall_edit.php?id={tmpl_var name='id'}">{tmpl_var name="udp_port"}</a></td> |
| | | <td class="text-right"> |
| | | <a class="btn btn-default formbutton-danger formbutton-narrow" href="javascript: ISPConfig.confirm_action('admin/firewall_del.php?id={tmpl_var name='id'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name='delete_confirmation'}');"><span class="icon icon-delete"></span></button> |
| | | <a class="btn btn-default formbutton-danger formbutton-narrow" href="javascript: ISPConfig.confirm_action('admin/firewall_del.php?id={tmpl_var name='id'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name='delete_confirmation'}');"><span class="icon icon-delete"></span></a> |
| | | </td> |
| | | </tr> |
| | | </tmpl_loop> |
| | |
| | | <td><a href="#" data-load-content="admin/groups_edit.php?id={tmpl_var name='id'}">{tmpl_var name="name"}</a></td> |
| | | <td><a href="#" data-load-content="admin/groups_edit.php?id={tmpl_var name='id'}">{tmpl_var name="description"}</a></td> |
| | | <td class="text-right"> |
| | | <a class="btn btn-default formbutton-danger formbutton-narrow" href="javascript: ISPConfig.confirm_action('admin/groups_del.php?id={tmpl_var name='id'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name='delete_confirmation'}');"><span class="icon icon-delete"></span></button> |
| | | <a class="btn btn-default formbutton-danger formbutton-narrow" href="javascript: ISPConfig.confirm_action('admin/groups_del.php?id={tmpl_var name='id'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name='delete_confirmation'}');"><span class="icon icon-delete"></span></a> |
| | | </td> |
| | | </tr> |
| | | </tmpl_loop> |
| | |
| | | <td><a href="#" data-load-content="admin/iptables_edit.php?id={tmpl_var name='id'}">{tmpl_var name="state"}</a></td> |
| | | <td><a href="#" data-load-content="admin/iptables_edit.php?id={tmpl_var name='id'}">{tmpl_var name="target"}</a></td> |
| | | <td class="text-right"> |
| | | <a class="btn btn-default formbutton-danger formbutton-narrow" href="javascript: ISPConfig.confirm_action('admin/iptables_del.php?id={tmpl_var name='id'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name='delete_confirmation'}');"><span class="icon icon-delete"></span></button> |
| | | <a class="btn btn-default formbutton-danger formbutton-narrow" href="javascript: ISPConfig.confirm_action('admin/iptables_del.php?id={tmpl_var name='id'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name='delete_confirmation'}');"><span class="icon icon-delete"></span></a> |
| | | </td> |
| | | </tr> |
| | | </tmpl_loop> |
| | |
| | | <div id="OKMsg"><p><tmpl_var name="msg"></p></div> |
| | | </tmpl_if> |
| | | <tmpl_if name="error"> |
| | | <div id="errorMsg"><h3>ERROR</h3><ol><tmpl_var name="error"></ol></div> |
| | | <div id="errorMsg"><h3><tmpl_var name="error_txt"></h3><ol><tmpl_var name="error"></ol></div> |
| | | </tmpl_if> |
| | | |
| | | <input type="hidden" name="id" value="{tmpl_var name='id'}"> |
| | |
| | | <td><a href="#" data-load-content="admin/remote_user_edit.php?id={tmpl_var name='remote_userid'}">{tmpl_var name="remote_userid"}</a></td> |
| | | <td><a href="#" data-load-content="admin/remote_user_edit.php?id={tmpl_var name='remote_userid'}">{tmpl_var name="remote_username"}</a></td> |
| | | <td class="text-right"> |
| | | <a class="btn btn-default formbutton-danger formbutton-narrow" href="javascript: ISPConfig.confirm_action('admin/remote_user_del.php?id={tmpl_var name='remote_userid'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name='delete_confirmation'}');"><span class="icon icon-delete"></span></button> |
| | | <a class="btn btn-default formbutton-danger formbutton-narrow" href="javascript: ISPConfig.confirm_action('admin/remote_user_del.php?id={tmpl_var name='remote_userid'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name='delete_confirmation'}');"><span class="icon icon-delete"></span></a> |
| | | </td> |
| | | </tr> |
| | | </tmpl_loop> |
| | |
| | | <div class="form-group"> |
| | | <label for="named_conf_local_path" class="col-sm-3 control-label">{tmpl_var name='named_conf_local_path_txt'}</label> |
| | | <div class="col-sm-9"><input type="text" name="named_conf_local_path" id="named_conf_local_path" value="{tmpl_var name='named_conf_local_path'}" class="form-control" /></div></div> |
| | | |
| | | <div class="form-group"> |
| | | <label for="disable_bind_log" class="col-sm-3 control-label">{tmpl_var name='disable_bind_log_txt'}</label> |
| | | <div class="col-sm-9">{tmpl_var name='disable_bind_log'}</div></div> |
| | | |
| | | <input type="hidden" name="id" value="{tmpl_var name='id'}"> |
| | | |
| | | <div class="clear"><div class="right"> |
| | | <button class="btn btn-default formbutton-success" type="button" value="{tmpl_var name='btn_save_txt'}" data-submit-form="pageForm" data-form-action="admin/server_config_edit.php">{tmpl_var name='btn_save_txt'}</button> |
| | | <button class="btn btn-default formbutton-default" type="button" value="{tmpl_var name='btn_cancel_txt'}" data-load-content="admin/server_config_list.php">{tmpl_var name='btn_cancel_txt'}</button> |
| | | </div></div> |
| | | </div></div> |
| | |
| | | <tr> |
| | | <td><a href="#" data-load-content="admin/server_config_edit.php?id={tmpl_var name='id'}">{tmpl_var name="server_name"}</a></td> |
| | | <td class="text-right"> |
| | | <a class="btn btn-default formbutton-danger formbutton-narrow" href="javascript: ISPConfig.confirm_action('admin/server_config_del.php?id={tmpl_var name='id'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name='delete_confirmation'}');"><span class="icon icon-delete"></span></button> |
| | | <a class="btn btn-default formbutton-danger formbutton-narrow" href="javascript: ISPConfig.confirm_action('admin/server_config_del.php?id={tmpl_var name='id'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name='delete_confirmation'}');"><span class="icon icon-delete"></span></a> |
| | | </td> |
| | | </tr> |
| | | </tmpl_loop> |
| | |
| | | <label for="maildir_path" class="col-sm-3 control-label">{tmpl_var name='maildir_path_txt'}</label> |
| | | <div class="col-sm-9"><input type="text" name="maildir_path" id="maildir_path" value="{tmpl_var name='maildir_path'}" class="form-control" /></div></div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">{tmpl_var name='maildir_format_txt'}</label> |
| | | <div class="col-sm-9"><select name="maildir_format" id="maildir_format" class="form-control"> |
| | | {tmpl_var name='maildir_format'} |
| | | </select></div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label for="homedir_path" class="col-sm-3 control-label">{tmpl_var name='homedir_path_txt'}</label> |
| | | <div class="col-sm-9"><input type="text" name="homedir_path" id="homedir_path" value="{tmpl_var name='homedir_path'}" class="form-control" /></div></div> |
| | | <div class="form-group"> |
| | |
| | | <div class="form-group"> |
| | | <label for="relayhost_password" class="col-sm-3 control-label">{tmpl_var name='relayhost_password_txt'}</label> |
| | | <div class="col-sm-9"><input type="password" name="relayhost_password" id="relayhost_password" value="{tmpl_var name='relayhost_password'}" autocomplete="off" class="form-control" autocomplete="off" /></div></div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">{tmpl_var name='reject_sender_login_mismatch_txt'}</label> |
| | | <div class="col-sm-9"> |
| | | {tmpl_var name='reject_sender_login_mismatch'} |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label for="mailbox_size_limit" class="col-sm-3 control-label">{tmpl_var name='mailbox_size_limit_txt'}</label> |
| | | <div class="col-sm-6"><input type="text" name="mailbox_size_limit" id="mailbox_size_limit" value="{tmpl_var name='mailbox_size_limit'}" class="form-control" /></div><div class="col-sm-3 input-sm"> MB |
New file |
| | |
| | | <div class='page-header'> |
| | | <h1><tmpl_var name="list_head_txt"></h1> |
| | | </div> |
| | | <p><tmpl_var name="list_desc_txt"></p> |
| | | |
| | | |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">{tmpl_var name='xmpp_use_ipv6_txt'}</label> |
| | | <div class="col-sm-9"> |
| | | {tmpl_var name='xmpp_use_ipv6'} |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">{tmpl_var name='xmpp_bosh_max_inactivity_txt'}</label> |
| | | <div class="col-sm-3"> |
| | | <input type="number" name="xmpp_bosh_max_inactivity" id="xmpp_bosh_max_inactivity" value="{tmpl_var name='xmpp_bosh_max_inactivity'}" class="form-control" /> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">{tmpl_var name='xmpp_server_admins_txt'}</label> |
| | | <div class="col-sm-9"> |
| | | <input type="text" name="xmpp_server_admins" id="xmpp_server_admins" value="{tmpl_var name='xmpp_server_admins'}" class="form-control" /> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">{tmpl_var name='xmpp_modules_enabled_txt'}</label> |
| | | <div class="col-sm-9"><textarea class="form-control" name="xmpp_modules_enabled" id="xmpp_modules_enabled" rows='3' cols='30'>{tmpl_var name='xmpp_modules_enabled'}</textarea></div> |
| | | </div> |
| | | <div class="col-sm-12"> |
| | | <h4>{tmpl_var name='xmpp_ports_txt'}</h4> |
| | | <div class="col-sm-6"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-6 control-label">{tmpl_var name='xmpp_port_http_txt'}</label> |
| | | <div class="col-sm-6"> |
| | | <input type="number" name="xmpp_port_http" id="xmpp_port_http" value="{tmpl_var name='xmpp_port_http'}" class="form-control" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-6"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-6 control-label">{tmpl_var name='xmpp_port_https_txt'}</label> |
| | | <div class="col-sm-6"> |
| | | <input type="number" name="xmpp_port_https" id="xmpp_port_https" value="{tmpl_var name='xmpp_port_https'}" class="form-control" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-6"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-6 control-label">{tmpl_var name='xmpp_port_pastebin_txt'}</label> |
| | | <div class="col-sm-6"> |
| | | <input type="number" name="xmpp_port_pastebin" id="xmpp_port_pastebin" value="{tmpl_var name='xmpp_port_pastebin'}" class="form-control" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-6"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-6 control-label">{tmpl_var name='xmpp_port_bosh_txt'}</label> |
| | | <div class="col-sm-6"> |
| | | <input type="number" name="xmpp_port_bosh" id="xmpp_port_bosh" value="{tmpl_var name='xmpp_port_bosh'}" class="form-control" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <input type="hidden" name="id" value="{tmpl_var name='id'}"> |
| | | |
| | | <div class="clear"><div class="right"> |
| | | <button class="btn btn-default formbutton-success" type="button" value="{tmpl_var name='btn_save_txt'}" data-submit-form="pageForm" data-form-action="admin/server_config_edit.php">{tmpl_var name='btn_save_txt'}</button> |
| | | <button class="btn btn-default formbutton-default" type="button" value="{tmpl_var name='btn_cancel_txt'}" data-load-content="admin/server_config_list.php">{tmpl_var name='btn_cancel_txt'}</button> |
| | | </div></div> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">{tmpl_var name='xmpp_server_txt'}</label> |
| | | <div class="col-sm-9"> |
| | | {tmpl_var name='xmpp_server'} |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label for="mirror_server_id" class="col-sm-3 control-label">{tmpl_var name='mirror_server_id_txt'}</label> |
| | | <div class="col-sm-9"><select name="mirror_server_id" id="server_id" class="form-control"> |
| | | {tmpl_var name='mirror_server_id'} |
| | |
| | | <td><a href="#" data-load-content="admin/server_ip_edit.php?id={tmpl_var name='id'}">{tmpl_var name="virtualhost"}</a></td> |
| | | <td><a href="#" data-load-content="admin/server_ip_edit.php?id={tmpl_var name='id'}">{tmpl_var name="virtualhost_port"}</a></td> |
| | | <td class="text-right"> |
| | | <a class="btn btn-default formbutton-danger formbutton-narrow" href="javascript: ISPConfig.confirm_action('admin/server_ip_del.php?id={tmpl_var name='id'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name='delete_confirmation'}');"><span class="icon icon-delete"></span></button> |
| | | <a class="btn btn-default formbutton-danger formbutton-narrow" href="javascript: ISPConfig.confirm_action('admin/server_ip_del.php?id={tmpl_var name='id'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name='delete_confirmation'}');"><span class="icon icon-delete"></span></a> |
| | | </td> |
| | | </tr> |
| | | </tmpl_loop> |
New file |
| | |
| | | <div class='page-header'> |
| | | <h1><tmpl_var name="list_head_txt"></h1> |
| | | </div> |
| | | <p><tmpl_var name="list_desc_txt"></p> |
| | | <legend>IP Address Mapping</legend> |
| | | <div class="form-group"> |
| | | <label for="server_id" class="col-sm-3 control-label">{tmpl_var name='server_id_txt'}</label> |
| | | <div class="col-sm-9"> |
| | | <select name="server_id" id="server_id" class="form-control"> |
| | | {tmpl_var name='server_id'} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label for="source_ip" class="col-sm-3 control-label">{tmpl_var name='source_txt'}</label> |
| | | <div class="col-sm-9"> |
| | | <select name="source_ip" id="source_ip" class="form-control"> |
| | | {tmpl_var name='source_ip'} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label for="destination_ip" class="col-sm-3 control-label">{tmpl_var name='destination_txt'}</label> |
| | | <div class="col-sm-9"> |
| | | <input type="text" name="destination_ip" id=destination_ip" value="{tmpl_var name='destination_ip'}" class="form-control" /> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">{tmpl_var name='active_txt'}</label> |
| | | <div class="col-sm-9"> |
| | | {tmpl_var name='active'} |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <input type="hidden" name="id" value="{tmpl_var name='id'}"> |
| | | <div class="clear"><div class="right"> |
| | | <button class="btn btn-default formbutton-success" type="button" value="{tmpl_var name='btn_save_txt'}" data-submit-form="pageForm" data-form-action="admin/server_ip_map_edit.php">{tmpl_var name='btn_save_txt'}</button> |
| | | <button class="btn btn-default formbutton-default" type="button" value="{tmpl_var name='btn_cancel_txt'}" data-load-content="admin/server_ip_map_list.php">{tmpl_var name='btn_cancel_txt'}</button> |
| | | </div></div> |
| | | </div> |
New file |
| | |
| | | <div class='page-header'></div> |
| | | <p class="fieldset-legend">{tmpl_var name="toolsarea_head_txt"}</p> |
| | | <button class="btn btn-default formbutton-success" type="button" data-load-content="admin/server_ip_map_edit.php">{tmpl_var name="add_new_record_txt"}</button> |
| | | <p class="fieldset-legend"><tmpl_var name="list_head_txt"></p> |
| | | <div class="table-wrapper marginTop15"> |
| | | <table class="table"> |
| | | <thead class="dark form-group-sm"> |
| | | <tr> |
| | | <th class="tiny-col" data-column="active"><tmpl_var name="active_txt"></th> |
| | | <th data-column="server_id"><tmpl_var name="server_id_txt"></th> |
| | | <th data-column="source_ip"><tmpl_var name="source_ip_txt"></th> |
| | | <th data-column="destination_ip"><tmpl_var name="destination_ip_txt"></th> |
| | | <th class="text-right">{tmpl_var name='search_limit'}</th> |
| | | </tr> |
| | | <tr> |
| | | <td><select class="form-control" name="search_active">{tmpl_var name='search_active'}</select></td> |
| | | <td><select class="form-control" name="search_server_id">{tmpl_var name='search_server_id'}</select></td> |
| | | <td><input class="form-control" type="text" name="search_ip_address" value="{tmpl_var name='search_ip_address'}" /></td> |
| | | <td><input class="form-control" type="text" name="search_ip_address" value="{tmpl_var name='search_ip_address'}" /></td> |
| | | <td class="text-right"> |
| | | <button type="button" class="btn btn-default formbutton-default formbutton-narrow" name="Filter" id="Filter" value="{tmpl_var name="filter_txt"}" data-submit-form="pageForm" data-form-action="admin/server_ip_map_list.php"><span class="icon icon-filter"></span></button> |
| | | </td> |
| | | </tr> |
| | | </thead> |
| | | <tbody> |
| | | <tmpl_loop name="records"> |
| | | <tr> |
| | | <td><a href="#" data-load-content="admin/server_ip_map_edit.php?id={tmpl_var name='id'}">{tmpl_var name="active"}</a></td> |
| | | <td><a href="#" data-load-content="admin/server_ip_map_edit.php?id={tmpl_var name='id'}">{tmpl_var name="server_id"}</a></td> |
| | | <td><a href="#" data-load-content="admin/server_ip_map_edit.php?id={tmpl_var name='id'}">{tmpl_var name="source_ip"}</a></td> |
| | | <td><a href="#" data-load-content="admin/server_ip_map_edit.php?id={tmpl_var name='id'}">{tmpl_var name="destination_ip"}</a></td> |
| | | <td class="text-right"> |
| | | <a class="btn btn-default formbutton-danger formbutton-narrow" href="javascript: ISPConfig.confirm_action('admin/server_ip_map_del.php?id={tmpl_var name='id'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name='delete_confirmation'}');"><span class="icon icon-delete"></span></a> |
| | | </td> |
| | | </tr> |
| | | </tmpl_loop> |
| | | <tmpl_unless name="records"> |
| | | <tr class="tbl_row_noresults tbl_row_<tmpl_if name='__EVEN__'}even<tmpl_else>uneven</tmpl_if>"> |
| | | <td colspan="4">{tmpl_var name='globalsearch_noresults_text_txt'}</td> |
| | | </tr> |
| | | </tmpl_unless> |
| | | </tbody> |
| | | <tfoot> |
| | | <tr> |
| | | <td colspan="4"><tmpl_var name="paging"></td> |
| | | </tr> |
| | | </tfoot> |
| | | </table> |
| | | </div> |
| | |
| | | <th data-column="file_server"><tmpl_var name="file_server_txt"></th> |
| | | <th data-column="db_server"><tmpl_var name="db_server_txt"></th> |
| | | <th data-column="vserver_server"><tmpl_var name="vserver_server_txt"></th> |
| | | <th data-column="vserver_server"><tmpl_var name="xmpp_server_txt"></th> |
| | | <th class="small-col text-right">{tmpl_var name='search_limit'}</th> |
| | | </tr> |
| | | <tr> |
| | |
| | | <td><select class="form-control" name="search_active">{tmpl_var name='search_file_server'}</select></td> |
| | | <td><select class="form-control" name="search_active">{tmpl_var name='search_db_server'}</select></td> |
| | | <td><select class="form-control" name="search_active">{tmpl_var name='search_vserver_server'}</select></td> |
| | | <td><select class="form-control" name="search_active">{tmpl_var name='search_xmpp_server'}</select></td> |
| | | <td class="text-right"> |
| | | <button type="button" class="btn btn-default formbutton-default formbutton-narrow" name="Filter" id="Filter" value="{tmpl_var name="filter_txt"}" data-submit-form="pageForm" data-form-action="admin/server_list.php"><span class="icon icon-filter"></span></button> |
| | | </td> |
| | |
| | | <td>{tmpl_var name="file_server"}</td> |
| | | <td>{tmpl_var name="db_server"}</td> |
| | | <td>{tmpl_var name="vserver_server"}</td> |
| | | <td>{tmpl_var name="xmpp_server"}</td> |
| | | <td class="text-right"> |
| | | <a class="btn btn-default formbutton-danger formbutton-narrow" href="javascript: ISPConfig.confirm_action('admin/server_del.php?id={tmpl_var name='id'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name='delete_confirmation'}');"><span class="icon icon-delete"></span></button> |
| | | <a class="btn btn-default formbutton-danger formbutton-narrow" href="javascript: ISPConfig.confirm_action('admin/server_del.php?id={tmpl_var name='id'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name='delete_confirmation'}');"><span class="icon icon-delete"></span></a> |
| | | </td> |
| | | </tr> |
| | | </tmpl_loop> |
| | | <tmpl_unless name="records"> |
| | | <tr class="tbl_row_noresults tbl_row_<tmpl_if name='__EVEN__'}even<tmpl_else>uneven</tmpl_if>"> |
| | | <td colspan="8">{tmpl_var name='globalsearch_noresults_text_txt'}</td> |
| | | <td colspan="7">{tmpl_var name='globalsearch_noresults_text_txt'}</td> |
| | | </tr> |
| | | </tmpl_unless> |
| | | </tbody> |
| | | <tfoot> |
| | | <tr> |
| | | <td colspan="8"><tmpl_var name="paging"></td> |
| | | <td colspan="7"><tmpl_var name="paging"></td> |
| | | </tr> |
| | | </tfoot> |
| | | </table> |
| | |
| | | <td><a href="#" data-load-content="admin/server_php_edit.php?id={tmpl_var name='id'}">{tmpl_var name="client_id"}</a></td> |
| | | <td><a href="#" data-load-content="admin/server_php_edit.php?id={tmpl_var name='id'}">{tmpl_var name="name"}</a></td> |
| | | <td class="text-right"> |
| | | <a class="btn btn-default formbutton-danger formbutton-narrow" href="javascript: ISPConfig.confirm_action('admin/server_php_del.php?id={tmpl_var name='id'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name='delete_confirmation'}');"><span class="icon icon-delete"></span></button> |
| | | <a class="btn btn-default formbutton-danger formbutton-narrow" href="javascript: ISPConfig.confirm_action('admin/server_php_del.php?id={tmpl_var name='id'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name='delete_confirmation'}');"><span class="icon icon-delete"></span></a> |
| | | </td> |
| | | </tr> |
| | | </tmpl_loop> |
| | |
| | | <td>{tmpl_var name="package_description"}</td> |
| | | <td>ispapp{tmpl_var name="package_id"}</td> |
| | | <td class="text-right"> |
| | | <a class="btn btn-default formbutton-default formbutton-narrow" data-load-content="admin/software_package_edit.php?id={tmpl_var name='package_id'}"><span class="icon icon-edit"></span></button> |
| | | <a class="btn btn-default formbutton-danger formbutton-narrow" href="javascript: ISPConfig.confirm_action('admin/software_package_del.php?software_update_inst_id={tmpl_var name='software_update_inst_id'}','{tmpl_var name='delete_confirmation'}');"><span class="icon icon-delete"></span></button> |
| | | <a class="btn btn-default formbutton-default formbutton-narrow" data-load-content="admin/software_package_edit.php?id={tmpl_var name='package_id'}"><span class="icon icon-edit"></span></a> |
| | | <a class="btn btn-default formbutton-danger formbutton-narrow" href="javascript: ISPConfig.confirm_action('admin/software_package_del.php?software_update_inst_id={tmpl_var name='software_update_inst_id'}','{tmpl_var name='delete_confirmation'}');"><span class="icon icon-delete"></span></a> |
| | | </td> |
| | | </tr> |
| | | </tmpl_if> |
| | |
| | | <td><a href="#" data-load-content="admin/software_repo_edit.php?id={tmpl_var name='id'}">{tmpl_var name="repo_name"}</a></td> |
| | | <td><a href="#" data-load-content="admin/software_repo_edit.php?id={tmpl_var name='id'}">{tmpl_var name="repo_url"}</a></td> |
| | | <td class="text-right"> |
| | | <a class="btn btn-default formbutton-danger formbutton-narrow" href="javascript: ISPConfig.confirm_action('admin/software_repo_del.php?id={tmpl_var name='id'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name='delete_confirmation'}');"><span class="icon icon-delete"></span></button> |
| | | <a class="btn btn-default formbutton-danger formbutton-narrow" href="javascript: ISPConfig.confirm_action('admin/software_repo_del.php?id={tmpl_var name='id'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name='delete_confirmation'}');"><span class="icon icon-delete"></span></a> |
| | | </td> |
| | | </tr> |
| | | </tmpl_loop> |
| | |
| | | <tmpl_if name="list_head_txt"> |
| | | <div class='page-header'> |
| | | <h1><tmpl_var name="list_head_txt"></h1> |
| | | <h1><tmpl_var name="list_head_txt"></h1> |
| | | </div> |
| | | <p><tmpl_var name="list_desc_txt"></p> |
| | | </tmpl_if> |
| | | <tmpl_if name="list_desc_txt"><p><tmpl_var name="list_desc_txt"></p></tmpl_if> |
| | | |
| | | |
| | | |
| | | <div class="form-group"> |
| | | <div style="float:left;width:100%"> |
| | | <p class="label" style="width:270px">{tmpl_var name='use_domain_module_txt'}</p> |
| | |
| | | </div> |
| | | <p><tmpl_var name="list_desc_txt"></p> |
| | | |
| | | |
| | | <legend>Misc</legend> |
| | | <div class="form-group"> |
| | | <label for="file" class="col-sm-3 control-label">{tmpl_var name='logo_txt'}</label> |
| | | <div class="col-sm-3 col-text"><input name="file" id="file" size="30" type="file" class="fileUpload" /></div><div class="col-sm-6"><button class="btn btn-default formbutton-success" type="button" value="{tmpl_var name='btn_save_txt'}" id="start_upload">{tmpl_var name='upload_txt'}</button></div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label for="dashboard_atom_url_admin" class="col-sm-3 control-label">{tmpl_var name='used_logo_txt'}</label> |
| | | <div class="col-sm-9" id="used_logo">{tmpl_var name='used_logo'}</div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label for="page_title" class="col-sm-3 control-label">{tmpl_var name='company_name_txt'}</label> |
| | | <div class="col-sm-9"><input type="text" name="company_name" id="company_name" value="{tmpl_var name='company_name'}" size="" maxlength="" class="form-control" /></div></div> |
| | | <div class="form-group"> |
| | | <label for="dashboard_atom_url_admin" class="col-sm-3 control-label">{tmpl_var name='dashboard_atom_url_admin_txt'}</label> |
| | | <div class="col-sm-9"><input type="text" name="dashboard_atom_url_admin" id="dashboard_atom_url_admin" value="{tmpl_var name='dashboard_atom_url_admin'}" size="" maxlength="" class="form-control" /></div></div> |
| | |
| | | {tmpl_var name='maintenance_mode'} |
| | | </div> |
| | | </div> |
| | | |
| | | <tmpl_if name="msg"> |
| | | <div id="OKMsg"><p><tmpl_var name="msg"></p></div> |
| | | </tmpl_if> |
| | | <tmpl_if name="error"> |
| | | <div id="errorMsg"><h3><tmpl_var name="error_txt"></h3><ol><tmpl_var name="error"></ol></div> |
| | | </tmpl_if> |
| | | |
| | | <input type="hidden" name="id" value="{tmpl_var name='id'}"> |
| | | <input type="hidden" name="id" id="id" value="{tmpl_var name='id'}"> |
| | | <div class="clear"><div class="right"> |
| | | <button class="btn btn-default formbutton-success" type="button" value="{tmpl_var name='btn_save_txt'}" data-submit-form="pageForm" data-form-action="admin/system_config_edit.php">{tmpl_var name='btn_save_txt'}</button> |
| | | <button class="btn btn-default formbutton-default" type="button" value="{tmpl_var name='btn_cancel_txt'}" data-load-content="admin/server_list.php">{tmpl_var name='btn_cancel_txt'}</button> |
| | | </div></div> |
| | | </div></div> |
| | | <script language="JavaScript" type="text/javascript"> |
| | | var defaultLogo = '{tmpl_var name='default_logo'}'; |
| | | $(document).on('click', '#del_custom_logo', function(){ |
| | | delCustomLogo(); |
| | | }); |
| | | |
| | | function delCustomLogo() { |
| | | var id = jQuery('input[name="id"]').val(); |
| | | |
| | | jQuery.getJSON('admin/ajax_get_json.php'+ '?' + Math.round(new Date().getTime()), {'id': id, 'type': "delcustomlogo"}, function(data) { |
| | | //console.log(data); |
| | | $('#used_logo').html(defaultLogo); |
| | | $('#logo').css({ "background": "url("+data.data+") no-repeat", "width": data.width, "height": data.height }); |
| | | }); |
| | | } |
| | | |
| | | // Variable to store your files |
| | | var files; |
| | | // Add events |
| | | $('input[type="file"]').on('change', prepareUpload); |
| | | $('#start_upload').on('click', uploadFiles); |
| | | |
| | | // Grab the files and set them to our variable |
| | | function prepareUpload(event){ |
| | | files = event.target.files; |
| | | } |
| | | |
| | | // Catch the form submit and upload the files |
| | | function uploadFiles(event){ |
| | | event.stopPropagation(); // Stop stuff happening |
| | | event.preventDefault(); // Totally stop stuff happening |
| | | |
| | | var id = jQuery('input[name="id"]').val(); |
| | | |
| | | // Create a formdata object and add the files |
| | | var data = new FormData(); |
| | | $.each(files, function(key, value){ |
| | | data.append(key, value); |
| | | }); |
| | | |
| | | $.ajax({ |
| | | url: 'admin/ajax_get_json.php?id='+id+'&type=uploadfile', |
| | | type: 'POST', |
| | | data: data, |
| | | cache: false, |
| | | dataType: 'json', |
| | | processData: false, // Don't process the files |
| | | contentType: false, // Set content type to false as jQuery will tell the server its a query string request |
| | | success: function(data, textStatus, jqXHR){ |
| | | if(typeof data.error === 'undefined'){ |
| | | // Success so call function to process the form |
| | | //console.log(data); |
| | | $('#used_logo').html('<img src="'+data.data+'" /> <a href="#" class="btn btn-default formbutton-danger formbutton-narrow" style="margin:5px" id="del_custom_logo"><span class="icon icon-delete"></span></a>'); |
| | | $('#logo').css({ "background": "url("+data.data+") no-repeat", "width": data.width, "height": data.height }); |
| | | } else { |
| | | // Handle errors here |
| | | //console.log(data); |
| | | } |
| | | }, |
| | | error: function(jqXHR, textStatus, errorThrown){ |
| | | // Handle errors here |
| | | //console.log(data); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | </script> |
| | |
| | | <td>{tmpl_var name="groups"}</td> |
| | | <td class="text-right"> |
| | | <tmpl_if name="username" op="!=" value="admin"> |
| | | <a class="btn btn-default formbutton-success formbutton-narrow" data-load-content="login/login_as.php?cid={tmpl_var name='client_id'}"><span class="icon icon-loginas"></span></button> |
| | | <a class="btn btn-default formbutton-danger formbutton-narrow" href="javascript: ISPConfig.confirm_action('admin/users_del.php?id={tmpl_var name='id'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name='delete_confirmation'}');"><span class="icon icon-delete"></span></button> |
| | | <a class="btn btn-default formbutton-success formbutton-narrow" data-load-content="login/login_as.php?cid={tmpl_var name='client_id'}"><span class="icon icon-loginas"></span></a> |
| | | <a class="btn btn-default formbutton-danger formbutton-narrow" href="javascript: ISPConfig.confirm_action('admin/users_del.php?id={tmpl_var name='id'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name='delete_confirmation'}');"><span class="icon icon-delete"></span></a> |
| | | </tmpl_if> |
| | | </td> |
| | | </tr> |
| | |
| | | |
| | | class page_action extends tform_actions { |
| | | |
| | | // function onBeforeUpdate() { |
| | | // global $app, $conf; |
| | | // |
| | | // //* 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'])) && isset($this->dataRecord["server_id"])) { |
| | | // $rec = $app->db->queryOneRecord("SELECT server_id from server_php WHERE server_php_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); |
| | | // } |
| | | // } |
| | | } |
| | | |
| | | $page = new page_action; |
| | |
| | | function onAfterUpdate() { |
| | | global $app, $conf; |
| | | |
| | | $client = $app->db->queryOneRecord("SELECT * FROM sys_user WHERE userid = ".$this->id); |
| | | $client = $app->db->queryOneRecord("SELECT * FROM sys_user WHERE userid = ?", $this->id); |
| | | $client_id = $app->functions->intval($client['client_id']); |
| | | $username = $app->db->quote($this->dataRecord["username"]); |
| | | $old_username = $app->db->quote($this->oldDataRecord['username']); |
| | | $username = $this->dataRecord["username"]; |
| | | $old_username = $this->oldDataRecord['username']; |
| | | |
| | | // username changed |
| | | if(isset($conf['demo_mode']) && $conf['demo_mode'] != true && isset($this->dataRecord['username']) && $this->dataRecord['username'] != '' && $this->oldDataRecord['username'] != $this->dataRecord['username']) { |
| | | $sql = "UPDATE client SET username = '$username' WHERE client_id = $client_id AND username = '$old_username'"; |
| | | $app->db->query($sql); |
| | | $tmp = $app->db->queryOneRecord("SELECT * FROM sys_group WHERE client_id = $client_id"); |
| | | $app->db->datalogUpdate("sys_group", "name = '$username'", 'groupid', $tmp['groupid']); |
| | | $sql = "UPDATE client SET username = ? WHERE client_id = ? AND username = ?"; |
| | | $app->db->query($sql, $username, $client_id, $old_username); |
| | | $tmp = $app->db->queryOneRecord("SELECT * FROM sys_group WHERE client_id = ?", $client_id); |
| | | $app->db->datalogUpdate("sys_group", array("name" => $username), 'groupid', $tmp['groupid']); |
| | | unset($tmp); |
| | | } |
| | | |
| | | // password changed |
| | | if(isset($conf['demo_mode']) && $conf['demo_mode'] != true && isset($this->dataRecord["passwort"]) && $this->dataRecord["passwort"] != '') { |
| | | $password = $app->db->quote($this->dataRecord["passwort"]); |
| | | $password = $this->dataRecord["passwort"]; |
| | | $salt="$1$"; |
| | | $base64_alphabet='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; |
| | | for ($n=0;$n<8;$n++) { |
| | |
| | | } |
| | | $salt.="$"; |
| | | $password = crypt(stripslashes($password), $salt); |
| | | $sql = "UPDATE client SET password = '$password' WHERE client_id = $client_id AND username = '$username'"; |
| | | $app->db->query($sql); |
| | | $sql = "UPDATE client SET password = ? WHERE client_id = ? AND username = ?"; |
| | | $app->db->query($sql, $password, $client_id, $username); |
| | | } |
| | | |
| | | // language changed |
| | | if(isset($conf['demo_mode']) && $conf['demo_mode'] != true && isset($this->dataRecord['language']) && $this->dataRecord['language'] != '' && $this->oldDataRecord['language'] != $this->dataRecord['language']) { |
| | | $language = $app->db->quote($this->dataRecord["language"]); |
| | | $sql = "UPDATE client SET language = '$language' WHERE client_id = $client_id AND username = '$username'"; |
| | | $app->db->query($sql); |
| | | $language = $this->dataRecord["language"]; |
| | | $sql = "UPDATE client SET language = ? WHERE client_id = ? AND username = ?"; |
| | | $app->db->query($sql, $language, $client_id, $username); |
| | | } |
| | | |
| | | // reseller status changed |
| | | /* |
| | | if(isset($this->dataRecord["limit_client"]) && $this->dataRecord["limit_client"] != $this->oldDataRecord["limit_client"]) { |
| | | $modules = $conf['interface_modules_enabled']; |
| | | if($this->dataRecord["limit_client"] > 0) $modules .= ',client'; |
| | | $modules = $app->db->quote($modules); |
| | | $client_id = $this->id; |
| | | $sql = "UPDATE sys_user SET modules = '$modules' WHERE client_id = $client_id"; |
| | | $app->db->query($sql); |
| | | } |
| | | */ |
| | | parent::onAfterUpdate(); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | if(!preg_match("/^[a-z]{2,20}$/i", $mod)) die('module name contains unallowed chars.'); |
| | | if($redirect != '' && !preg_match("/^[a-z0-9]+\/[a-z0-9_\.\-]+\?id=[0-9]{1,9}$/i", $redirect)) die('redirect contains unallowed chars.'); |
| | | |
| | | //* Check if user may use the module. |
| | | $user_modules = explode(",", $_SESSION["s"]["user"]["modules"]); |
| | |
| | | |
| | | $this->dataRecord = $app->tform->getDataRecord($this->id); |
| | | $client_id = $app->functions->intval($this->dataRecord['client_id']); |
| | | |
| | | |
| | | //$parent_client_id = $app->functions->intval($this->dataRecord['parent_client_id']); |
| | | //$parent_user = $app->db->queryOneRecord("SELECT userid FROM sys_user WHERE client_id = $parent_client_id"); |
| | | $client_group = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = $client_id"); |
| | | $client_group = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ?", $client_id); |
| | | |
| | | // Get 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'; |
| | |
| | | if($client_group_id > 1) { |
| | | foreach($tables_array as $table) { |
| | | if($table != '') { |
| | | $records = $app->db->queryAllRecords("SELECT * FROM $table WHERE sys_groupid = ".$client_group_id); |
| | | $records = $app->db->queryAllRecords("SELECT * FROM ?? WHERE sys_groupid = ?", $table, $client_group_id); |
| | | $number = count($records); |
| | | if($number > 0) $table_list[] = array('table' => $table."(".$number.")"); |
| | | } |
| | |
| | | if($client_id > 0) { |
| | | // remove the group of the client from the resellers group |
| | | $parent_client_id = $app->functions->intval($this->dataRecord['parent_client_id']); |
| | | $parent_user = $app->db->queryOneRecord("SELECT userid FROM sys_user WHERE client_id = $parent_client_id"); |
| | | $client_group = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = $client_id"); |
| | | $parent_user = $app->db->queryOneRecord("SELECT userid FROM sys_user WHERE client_id = ?", $parent_client_id); |
| | | $client_group = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ?", $client_id); |
| | | $app->auth->remove_group_from_user($parent_user['userid'], $client_group['groupid']); |
| | | |
| | | // delete the group of the client |
| | | $app->db->query("DELETE FROM sys_group WHERE client_id = $client_id"); |
| | | $app->db->query("DELETE FROM sys_group WHERE client_id = ?", $client_id); |
| | | |
| | | // delete the sys user(s) of the client |
| | | $app->db->query("DELETE FROM sys_user WHERE client_id = $client_id"); |
| | | $app->db->query("DELETE FROM sys_user WHERE client_id = ?", $client_id); |
| | | |
| | | // Delete all records (sub-clients, mail, web, etc....) of this client. |
| | | $tables = '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'; |
| | |
| | | if($client_group_id > 1) { |
| | | foreach($tables_array as $table) { |
| | | if($table != '') { |
| | | $records = $app->db->queryAllRecords("SELECT * FROM $table WHERE sys_groupid = ".$client_group_id); |
| | | $records = $app->db->queryAllRecords("SELECT * FROM ?? WHERE sys_groupid = ?", $table, $client_group_id); |
| | | //* find the primary ID of the table |
| | | $table_info = $app->db->tableInfo($table); |
| | | $index_field = ''; |
| | |
| | | $app->db->datalogDelete($table, $index_field, $rec[$index_field]); |
| | | //* Delete traffic records that dont have a sys_groupid column |
| | | if($table == 'web_domain') { |
| | | $app->db->query("DELETE FROM web_traffic WHERE hostname = '".$app->db->quote($rec['domain'])."'"); |
| | | $app->db->query("DELETE FROM web_traffic WHERE hostname = ?", $rec['domain']); |
| | | } |
| | | //* Delete mail_traffic records that dont have a sys_groupid |
| | | if($table == 'mail_user') { |
| | | $app->db->query("DELETE FROM mail_traffic WHERE mailuser_id = '".$app->db->quote($rec['mailuser_id'])."'"); |
| | | $app->db->query("DELETE FROM mail_traffic WHERE mailuser_id = ?", $rec['mailuser_id']); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | // Get the limits of the client |
| | | $client_group_id = $app->functions->intval($_SESSION["s"]["user"]["default_group"]); |
| | | $client = $app->db->queryOneRecord("SELECT limit_client FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); |
| | | $client = $app->db->queryOneRecord("SELECT limit_client 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 website. |
| | | if($client["limit_client"] >= 0) { |
| | | $tmp = $app->db->queryOneRecord("SELECT count(client_id) as number FROM client WHERE sys_groupid = $client_group_id"); |
| | | $tmp = $app->db->queryOneRecord("SELECT count(client_id) as number FROM client WHERE sys_groupid = ?", $client_group_id); |
| | | if($tmp["number"] >= $client["limit_client"]) { |
| | | $app->error($app->tform->wordbook["limit_client_txt"]); |
| | | } |
| | |
| | | |
| | | // Get the limits of the client |
| | | $client_group_id = $_SESSION["s"]["user"]["default_group"]; |
| | | $client = $app->db->queryOneRecord("SELECT limit_client FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); |
| | | $client = $app->db->queryOneRecord("SELECT limit_client 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 website. |
| | | if($client["limit_client"] >= 0) { |
| | | $tmp = $app->db->queryOneRecord("SELECT count(client_id) as number FROM client WHERE sys_groupid = $client_group_id"); |
| | | $tmp = $app->db->queryOneRecord("SELECT count(client_id) as number FROM client WHERE sys_groupid = ?", $client_group_id); |
| | | if($tmp["number"] >= $client["limit_client"]) { |
| | | $app->error($app->tform->wordbook["limit_client_txt"]); |
| | | } |
| | |
| | | } |
| | | |
| | | if($this->id != 0) { |
| | | $this->oldTemplatesAssigned = $app->db->queryAllRecords('SELECT * FROM `client_template_assigned` WHERE `client_id` = ' . $this->id); |
| | | $this->oldTemplatesAssigned = $app->db->queryAllRecords('SELECT * FROM `client_template_assigned` WHERE `client_id` = ?', $this->id); |
| | | if(!is_array($this->oldTemplatesAssigned) || count($this->oldTemplatesAssigned) < 1) { |
| | | // check previous type of storing templates |
| | | $tpls = explode('/', $this->oldDataRecord['template_additional']); |
| | |
| | | $app->tpl->setVar('tpl_add_select', $option); |
| | | |
| | | // check for new-style records |
| | | $result = $app->db->queryAllRecords('SELECT assigned_template_id, client_template_id FROM client_template_assigned WHERE client_id = ' . $this->id); |
| | | $result = $app->db->queryAllRecords('SELECT assigned_template_id, client_template_id FROM client_template_assigned WHERE client_id = ?', $this->id); |
| | | if($result && count($result) > 0) { |
| | | // new style |
| | | $items = array(); |
| | |
| | | unset($tmprec); |
| | | } else { |
| | | // old style |
| | | $sql = "SELECT template_additional FROM client WHERE client_id = " . $this->id; |
| | | $result = $app->db->queryOneRecord($sql); |
| | | $sql = "SELECT template_additional FROM client WHERE client_id = ?"; |
| | | $result = $app->db->queryOneRecord($sql, $this->id); |
| | | $tplAdd = explode("/", $result['template_additional']); |
| | | $text = ''; |
| | | foreach($tplAdd as $item){ |
| | |
| | | $customer_no = $app->functions->intval($system_config['misc']['customer_no_start']+$system_config['misc']['customer_no_counter']); |
| | | $customer_no_string = str_replace('[CUSTOMER_NO]',$customer_no,$system_config['misc']['customer_no_template']); |
| | | $app->tpl->setVar('customer_no',$customer_no_string); |
| | | |
| | | //* save new counter value |
| | | /* |
| | | $system_config['misc']['customer_no_counter']++; |
| | | $system_config_str = $app->ini_parser->get_ini_string($system_config); |
| | | $app->db->datalogUpdate('sys_ini', "config = '".$app->db->quote($system_config_str)."'", 'sysini_id', 1); |
| | | */ |
| | | } |
| | | } else { |
| | | //* Logged in user must be a reseller |
| | | //* get the record of the reseller |
| | | $client_group_id = $app->functions->intval($_SESSION["s"]["user"]["default_group"]); |
| | | $reseller = $app->db->queryOneRecord("SELECT client.client_id, client.customer_no_template, client.customer_no_counter, client.customer_no_start FROM sys_group,client WHERE client.client_id = sys_group.client_id and sys_group.groupid = ".$client_group_id); |
| | | $reseller = $app->db->queryOneRecord("SELECT client.client_id, client.customer_no_template, client.customer_no_counter, client.customer_no_start FROM sys_group,client WHERE client.client_id = sys_group.client_id and sys_group.groupid = ?", $client_group_id); |
| | | |
| | | if($reseller['customer_no_template'] != '') { |
| | | //* Set customer no default |
| | | $customer_no = $app->functions->intval($reseller['customer_no_start']+$reseller['customer_no_counter']); |
| | | $customer_no_string = str_replace('[CUSTOMER_NO]',$customer_no,$reseller['customer_no_template']); |
| | | $app->tpl->setVar('customer_no',$customer_no_string); |
| | | |
| | | //* save new counter value |
| | | /* |
| | | $customer_no_counter = $app->functions->intval($reseller['customer_no_counter']+1); |
| | | $app->db->query("UPDATE client SET customer_no_counter = $customer_no_counter WHERE client_id = ".$app->functions->intval($reseller['client_id'])); |
| | | */ |
| | | } |
| | | } |
| | | } |
| | |
| | | function onAfterInsert() { |
| | | global $app, $conf; |
| | | // Create the group for the client |
| | | $groupid = $app->db->datalogInsert('sys_group', "(name,description,client_id) VALUES ('".$app->db->quote($this->dataRecord["username"])."','',".$this->id.")", 'groupid'); |
| | | $groupid = $app->db->datalogInsert('sys_group', array("name" => $this->dataRecord["username"], "description" => '', "client_id" => $this->id), 'groupid'); |
| | | $groups = $groupid; |
| | | |
| | | $username = $app->db->quote($this->dataRecord["username"]); |
| | | $password = $app->db->quote($this->dataRecord["password"]); |
| | | $username = $this->dataRecord["username"]; |
| | | $password = $this->dataRecord["password"]; |
| | | $modules = $conf['interface_modules_enabled']; |
| | | if(isset($this->dataRecord["limit_client"]) && $this->dataRecord["limit_client"] > 0) $modules .= ',client'; |
| | | $startmodule = (stristr($modules, 'dashboard'))?'dashboard':'client'; |
| | | $usertheme = $app->db->quote($this->dataRecord["usertheme"]); |
| | | $usertheme = (isset($this->dataRecord["usertheme"]) && $this->dataRecord["usertheme"] != ''? $this->dataRecord["usertheme"] : 'default'); |
| | | $type = 'user'; |
| | | $active = 1; |
| | | $language = $app->db->quote($this->dataRecord["language"]); |
| | | $language = $this->dataRecord["language"]; |
| | | $password = $app->auth->crypt_password($password); |
| | | |
| | | // Create the controlpaneluser for the client |
| | | //Generate ssh-rsa-keys |
| | | exec('ssh-keygen -t rsa -C '.$username.'-rsa-key-'.time().' -f /tmp/id_rsa -N ""'); |
| | | $app->db->query("UPDATE client SET created_at = ".time().", id_rsa = '".$app->db->quote(@file_get_contents('/tmp/id_rsa'))."', ssh_rsa = '".$app->db->quote(@file_get_contents('/tmp/id_rsa.pub'))."' WHERE client_id = ".$this->id); |
| | | $app->db->query("UPDATE client SET created_at = UNIX_TIMESTAMP(), id_rsa = ?, ssh_rsa = ? WHERE client_id = ?", @file_get_contents('/tmp/id_rsa'), @file_get_contents('/tmp/id_rsa.pub'), $this->id); |
| | | exec('rm -f /tmp/id_rsa /tmp/id_rsa.pub'); |
| | | |
| | | // Create the controlpaneluser for the client |
| | | $sql = "INSERT INTO sys_user (username,passwort,modules,startmodule,app_theme,typ,active,language,groups,default_group,client_id) |
| | | VALUES ('$username','$password','$modules','$startmodule','$usertheme','$type','$active','$language',$groups,$groupid,".$this->id.")"; |
| | | $app->db->query($sql); |
| | | VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; |
| | | $app->db->query($sql, $username, $password, $modules, $startmodule, $usertheme, $type, $active, $language, $groups, $groupid, $this->id); |
| | | |
| | | //* If the user who inserted the client is a reseller (not admin), we will have to add this new client group |
| | | //* to his groups, so he can administrate the records of this client. |
| | | if($_SESSION['s']['user']['typ'] == 'user') { |
| | | $app->auth->add_group_to_user($_SESSION['s']['user']['userid'], $groupid); |
| | | $app->db->query("UPDATE client SET parent_client_id = ".$app->functions->intval($_SESSION['s']['user']['client_id'])." WHERE client_id = ".$this->id); |
| | | $app->db->query("UPDATE client SET parent_client_id = ? WHERE client_id = ?", $_SESSION['s']['user']['client_id'], $this->id); |
| | | } else { |
| | | if($this->dataRecord['parent_client_id'] > 0) { |
| | | //* get userid of the reseller and add it to the group of the client |
| | | $tmp = $app->db->queryOneRecord("SELECT sys_user.userid FROM sys_user,sys_group WHERE sys_user.default_group = sys_group.groupid AND sys_group.client_id = ".$app->functions->intval($this->dataRecord['parent_client_id'])); |
| | | $tmp = $app->db->queryOneRecord("SELECT sys_user.userid FROM sys_user,sys_group WHERE sys_user.default_group = sys_group.groupid AND sys_group.client_id = ?", $this->dataRecord['parent_client_id']); |
| | | $app->auth->add_group_to_user($tmp['userid'], $groupid); |
| | | $app->db->query("UPDATE client SET parent_client_id = ".$app->functions->intval($this->dataRecord['parent_client_id'])." WHERE client_id = ".$this->id); |
| | | $app->db->query("UPDATE client SET parent_client_id = ? WHERE client_id = ?", $this->dataRecord['parent_client_id'], $this->id); |
| | | unset($tmp); |
| | | } |
| | | } |
| | |
| | | $default_dnsserver = $app->functions->intval($tmp['server_id']); |
| | | } |
| | | |
| | | $sql = "UPDATE client SET mail_servers = $default_mailserver, web_servers = $default_webserver, dns_servers = $default_dnsserver, default_slave_dnsserver = $default_dnsserver, db_servers = $default_dbserver WHERE client_id = ".$this->id; |
| | | $app->db->query($sql); |
| | | $sql = "UPDATE client SET mail_servers = ?, web_servers = ?, dns_servers = ?, default_slave_dnsserver = ?, db_servers = ? WHERE client_id = ?"; |
| | | $app->db->query($sql, $default_mailserver, $default_webserver, $default_dnsserver, $default_dnsserver, $default_dbserver, $this->id); |
| | | |
| | | if(isset($this->dataRecord['template_master'])) { |
| | | $app->uses('client_templates'); |
| | |
| | | //* save new counter value |
| | | $system_config['misc']['customer_no_counter']++; |
| | | $system_config_str = $app->ini_parser->get_ini_string($system_config); |
| | | $app->db->datalogUpdate('sys_ini', "config = '".$app->db->quote($system_config_str)."'", 'sysini_id', 1); |
| | | $app->db->datalogUpdate('sys_ini', array("config" => $system_config_str), 'sysini_id', 1); |
| | | } |
| | | } else { |
| | | //* Logged in user must be a reseller |
| | | //* get the record of the reseller |
| | | $client_group_id = $app->functions->intval($_SESSION["s"]["user"]["default_group"]); |
| | | $reseller = $app->db->queryOneRecord("SELECT client.client_id, client.customer_no_template, client.customer_no_counter, client.customer_no_start FROM sys_group,client WHERE client.client_id = sys_group.client_id and sys_group.groupid = ".$client_group_id); |
| | | $reseller = $app->db->queryOneRecord("SELECT client.client_id, client.customer_no_template, client.customer_no_counter, client.customer_no_start FROM sys_group,client WHERE client.client_id = sys_group.client_id and sys_group.groupid = ?", $client_group_id); |
| | | |
| | | if($reseller['customer_no_template'] != '') { |
| | | //* save new counter value |
| | | $customer_no_counter = $app->functions->intval($reseller['customer_no_counter']+1); |
| | | $app->db->query("UPDATE client SET customer_no_counter = $customer_no_counter WHERE client_id = ".$app->functions->intval($reseller['client_id'])); |
| | | $app->db->query("UPDATE client SET customer_no_counter = ? WHERE client_id = ?", $customer_no_counter, $reseller['client_id']); |
| | | } |
| | | } |
| | | } |
| | | |
| | | //* Send welcome email |
| | | $client_group_id = $app->functions->intval($_SESSION["s"]["user"]["default_group"]); |
| | | $sql = "SELECT * FROM client_message_template WHERE template_type = 'welcome' AND sys_groupid = ".$client_group_id; |
| | | $email_template = $app->db->queryOneRecord($sql); |
| | | $sql = "SELECT * FROM client_message_template WHERE template_type = 'welcome' AND sys_groupid = ?"; |
| | | $email_template = $app->db->queryOneRecord($sql, $client_group_id); |
| | | $client = $app->tform->getDataRecord($this->id); |
| | | |
| | | if(is_array($email_template) && $client['email'] != '') { |
| | |
| | | $from = $system_config['admin_mail']; |
| | | } else { |
| | | $client_group_id = $app->functions->intval($_SESSION["s"]["user"]["default_group"]); |
| | | $reseller = $app->db->queryOneRecord("SELECT client.email FROM sys_group,client WHERE client.client_id = sys_group.client_id and sys_group.groupid = ".$client_group_id); |
| | | $reseller = $app->db->queryOneRecord("SELECT client.email FROM sys_group,client WHERE client.client_id = sys_group.client_id and sys_group.groupid = ?", $client_group_id); |
| | | $from = $reseller["email"]; |
| | | } |
| | | |
| | |
| | | global $app, $conf; |
| | | // username changed |
| | | if(isset($conf['demo_mode']) && $conf['demo_mode'] != true && isset($this->dataRecord['username']) && $this->dataRecord['username'] != '' && $this->oldDataRecord['username'] != $this->dataRecord['username']) { |
| | | $username = $app->db->quote($this->dataRecord["username"]); |
| | | $username = $this->dataRecord["username"]; |
| | | $client_id = $this->id; |
| | | $sql = "UPDATE sys_user SET username = '$username' WHERE client_id = $client_id"; |
| | | $app->db->query($sql); |
| | | $sql = "UPDATE sys_user SET username = ? WHERE client_id = ?"; |
| | | $app->db->query($sql, $username, $client_id); |
| | | |
| | | $tmp = $app->db->queryOneRecord("SELECT * FROM sys_group WHERE client_id = $client_id"); |
| | | $app->db->datalogUpdate("sys_group", "name = '$username'", 'groupid', $tmp['groupid']); |
| | | $tmp = $app->db->queryOneRecord("SELECT * FROM sys_group WHERE client_id = ?", $client_id); |
| | | $app->db->datalogUpdate("sys_group", array("name" => $username), 'groupid', $tmp['groupid']); |
| | | unset($tmp); |
| | | } |
| | | |
| | | // password changed |
| | | if(isset($conf['demo_mode']) && $conf['demo_mode'] != true && isset($this->dataRecord["password"]) && $this->dataRecord["password"] != '') { |
| | | $password = $app->db->quote($this->dataRecord["password"]); |
| | | $password = $this->dataRecord["password"]; |
| | | $salt="$1$"; |
| | | $base64_alphabet='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; |
| | | for ($n=0;$n<8;$n++) { |
| | |
| | | $salt.="$"; |
| | | $password = crypt(stripslashes($password), $salt); |
| | | $client_id = $this->id; |
| | | $sql = "UPDATE sys_user SET passwort = '$password' WHERE client_id = $client_id"; |
| | | $app->db->query($sql); |
| | | $sql = "UPDATE sys_user SET passwort = ? WHERE client_id = ?"; |
| | | $app->db->query($sql, $password, $client_id); |
| | | } |
| | | |
| | | if(!isset($this->dataRecord['locked'])) $this->dataRecord['locked'] = 'n'; |
| | |
| | | |
| | | |
| | | // get tmp_data of client |
| | | $client_data = $app->db->queryOneRecord('SELECT `tmp_data` FROM `client` WHERE `client_id` = ' . $this->id); |
| | | $client_data = $app->db->queryOneRecord('SELECT `tmp_data` FROM `client` WHERE `client_id` = ?', $this->id); |
| | | |
| | | if($client_data['tmp_data'] == '') $tmp_data = array(); |
| | | else $tmp_data = unserialize($client_data['tmp_data']); |
| | |
| | | 'web_folder_user' => 'web_folder_user_id' |
| | | ); |
| | | |
| | | $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); |
| | | $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); |
| | | $sys_groupid = $gdata['groupid']; |
| | | $sys_userid = $udata['userid']; |
| | | |
| | |
| | | if(!isset($prev_active[$current])) $prev_active[$current] = array(); |
| | | if(!isset($prev_sysuser[$current])) $prev_sysuser[$current] = array(); |
| | | |
| | | $entries = $app->db->queryAllRecords('SELECT `' . $keycolumn . '` as `id`, `sys_userid`, `' . $active_col . '` FROM `' . $current . '` WHERE `sys_groupid` = ' . $sys_groupid); |
| | | $entries = $app->db->queryAllRecords('SELECT ?? as `id`, `sys_userid`, ?? FROM ?? WHERE `sys_groupid` = ?', $keycolumn, $active_col, $current, $sys_groupid); |
| | | foreach($entries as $item) { |
| | | |
| | | if($item[$active_col] != 'y' && $reverse == false) $prev_active[$current][$item['id']][$active_col] = 'n'; |
| | |
| | | |
| | | $tmp_data['prev_active'] = $prev_active; |
| | | $tmp_data['prev_sys_userid'] = $prev_sysuser; |
| | | $app->db->query("UPDATE `client` SET `tmp_data` = '" . $app->db->quote(serialize($tmp_data)) . "' WHERE `client_id` = " . $this->id); |
| | | $app->db->query("UPDATE `client` SET `tmp_data` = ? WHERE `client_id` = ?", serialize($tmp_data), $this->id); |
| | | unset($prev_active); |
| | | unset($prev_sysuser); |
| | | } elseif($this->dataRecord['locked'] == 'n') { |
| | |
| | | $reverse = true; |
| | | } |
| | | |
| | | $entries = $app->db->queryAllRecords('SELECT `' . $keycolumn . '` as `id` FROM `' . $current . '` WHERE `sys_groupid` = ' . $sys_groupid); |
| | | $entries = $app->db->queryAllRecords('SELECT ?? as `id` FROM ?? WHERE `sys_groupid` = ?', $keycolumn, $current, $sys_groupid); |
| | | foreach($entries as $item) { |
| | | $set_active = ($reverse == true ? 'n' : 'y'); |
| | | $set_inactive = ($reverse == true ? 'y' : 'n'); |
| | |
| | | } |
| | | } |
| | | if(array_key_exists('prev_active', $tmp_data)) unset($tmp_data['prev_active']); |
| | | $app->db->query("UPDATE `client` SET `tmp_data` = '" . $app->db->quote(serialize($tmp_data)) . "' WHERE `client_id` = " . $this->id); |
| | | $app->db->query("UPDATE `client` SET `tmp_data` = ? WHERE `client_id` = ?", serialize($tmp_data), $this->id); |
| | | } |
| | | unset($tmp_data); |
| | | unset($entries); |
| | |
| | | if(!isset($this->dataRecord['canceled'])) $this->dataRecord['canceled'] = 'n'; |
| | | if(isset($conf['demo_mode']) && $conf['demo_mode'] != true && $this->dataRecord["canceled"] != $this->oldDataRecord['canceled']) { |
| | | if($this->dataRecord['canceled'] == 'y') { |
| | | $sql = "UPDATE sys_user SET active = '0' WHERE client_id = " . $this->id; |
| | | $app->db->query($sql); |
| | | $sql = "UPDATE sys_user SET active = '0' WHERE client_id = ?"; |
| | | $app->db->query($sql, $this->id); |
| | | } elseif($this->dataRecord['canceled'] == 'n') { |
| | | $sql = "UPDATE sys_user SET active = '1' WHERE client_id = " . $this->id; |
| | | $app->db->query($sql); |
| | | $sql = "UPDATE sys_user SET active = '1' WHERE client_id = ?"; |
| | | $app->db->query($sql, $this->id); |
| | | } |
| | | } |
| | | |
| | | // language changed |
| | | if(isset($conf['demo_mode']) && $conf['demo_mode'] != true && isset($this->dataRecord['language']) && $this->dataRecord['language'] != '' && $this->oldDataRecord['language'] != $this->dataRecord['language']) { |
| | | $language = $app->db->quote($this->dataRecord["language"]); |
| | | $language = $this->dataRecord["language"]; |
| | | $client_id = $this->id; |
| | | $sql = "UPDATE sys_user SET language = '$language' WHERE client_id = $client_id"; |
| | | $app->db->query($sql); |
| | | $sql = "UPDATE sys_user SET language = ? WHERE client_id = ?"; |
| | | $app->db->query($sql, $language, $client_id); |
| | | } |
| | | |
| | | //* reseller status changed |
| | | if(isset($this->dataRecord["limit_client"]) && $this->dataRecord["limit_client"] != $this->oldDataRecord["limit_client"]) { |
| | | $modules = $conf['interface_modules_enabled']; |
| | | if($this->dataRecord["limit_client"] > 0) $modules .= ',client'; |
| | | $modules = $app->db->quote($modules); |
| | | $client_id = $this->id; |
| | | $sql = "UPDATE sys_user SET modules = '$modules' WHERE client_id = $client_id"; |
| | | $app->db->query($sql); |
| | | $sql = "UPDATE sys_user SET modules = ? WHERE client_id = ?"; |
| | | $app->db->query($sql, $modules, $client_id); |
| | | } |
| | | |
| | | //* Client has been moved to another reseller |
| | | if($_SESSION['s']['user']['typ'] == 'admin' && isset($this->dataRecord['parent_client_id']) && $this->dataRecord['parent_client_id'] != $this->oldDataRecord['parent_client_id']) { |
| | | //* Get groupid of the client |
| | | $tmp = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ".intval($this->id)); |
| | | $tmp = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ?", $this->id); |
| | | $groupid = $tmp['groupid']; |
| | | unset($tmp); |
| | | |
| | | //* Remove sys_user of old reseller from client group |
| | | if($this->oldDataRecord['parent_client_id'] > 0) { |
| | | //* get userid of the old reseller remove it from the group of the client |
| | | $tmp = $app->db->queryOneRecord("SELECT sys_user.userid FROM sys_user,sys_group WHERE sys_user.default_group = sys_group.groupid AND sys_group.client_id = ".$app->functions->intval($this->oldDataRecord['parent_client_id'])); |
| | | $tmp = $app->db->queryOneRecord("SELECT sys_user.userid FROM sys_user,sys_group WHERE sys_user.default_group = sys_group.groupid AND sys_group.client_id = ?", $this->oldDataRecord['parent_client_id']); |
| | | $app->auth->remove_group_from_user($tmp['userid'], $groupid); |
| | | unset($tmp); |
| | | } |
| | |
| | | //* Add sys_user of new reseller to client group |
| | | if($this->dataRecord['parent_client_id'] > 0) { |
| | | //* get userid of the reseller and add it to the group of the client |
| | | $tmp = $app->db->queryOneRecord("SELECT sys_user.userid, sys_user.default_group FROM sys_user,sys_group WHERE sys_user.default_group = sys_group.groupid AND sys_group.client_id = ".$app->functions->intval($this->dataRecord['parent_client_id'])); |
| | | $tmp = $app->db->queryOneRecord("SELECT sys_user.userid, sys_user.default_group FROM sys_user,sys_group WHERE sys_user.default_group = sys_group.groupid AND sys_group.client_id = ?", $this->dataRecord['parent_client_id']); |
| | | $app->auth->add_group_to_user($tmp['userid'], $groupid); |
| | | $app->db->query("UPDATE client SET sys_userid = ".$app->functions->intval($tmp['userid']).", sys_groupid = ".$app->functions->intval($tmp['default_group']).", parent_client_id = ".$app->functions->intval($this->dataRecord['parent_client_id'])." WHERE client_id = ".$this->id); |
| | | $app->db->query("UPDATE client SET sys_userid = ?, sys_groupid = ?, parent_client_id = ? WHERE client_id = ?", $tmp['userid'], $tmp['default_group'], $this->dataRecord['parent_client_id'], $this->id); |
| | | unset($tmp); |
| | | } else { |
| | | //* Client is not assigned to a reseller anymore, so we assign it to the admin |
| | | $app->db->query("UPDATE client SET sys_userid = 1, sys_groupid = 1, parent_client_id = 0 WHERE client_id = ".$this->id); |
| | | $app->db->query("UPDATE client SET sys_userid = 1, sys_groupid = 1, parent_client_id = 0 WHERE client_id = ?", $this->id); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | //* Save data |
| | | if(isset($_POST) && count($_POST) > 1) { |
| | | |
| | | |
| | | //* CSRF Check |
| | | $app->auth->csrf_token_check(); |
| | | |
| | | //* Check values |
| | | if(!preg_match("/^\w+[\w\.\-\+]*\w{0,}@\w+[\w.-]*\w+\.[a-zA-Z0-9\-]{2,30}$/i", $_POST['sender'])) $error .= $wb['sender_invalid_error'].'<br />'; |
| | | if(empty($_POST['subject'])) $error .= $wb['subject_invalid_error'].'<br />'; |
| | |
| | | //* Send message |
| | | if($error == '') { |
| | | if($app->functions->intval($_POST['recipient']) > 0){ |
| | | $circle = $app->db->queryOneRecord("SELECT client_ids FROM client_circle WHERE active = 'y' AND circle_id = ".$app->functions->intval($_POST['recipient'])." AND ".$app->tform->getAuthSQL('r')); |
| | | $circle = $app->db->queryOneRecord("SELECT client_ids FROM client_circle WHERE active = 'y' AND circle_id = ? AND ".$app->tform->getAuthSQL('r'), $_POST['recipient']); |
| | | if(isset($circle['client_ids']) && $circle['client_ids'] != ''){ |
| | | $tmp_client_ids = explode(',', $circle['client_ids']); |
| | | $where = array(); |
| | |
| | | if($_SESSION["s"]["user"]["typ"] != 'admin'){ |
| | | $client_id = $app->functions->intval($_SESSION['s']['user']['client_id']); |
| | | if($client_id > 0){ |
| | | $sql = "SELECT email FROM client WHERE client_id = ".$client_id; |
| | | $client = $app->db->queryOneRecord($sql); |
| | | $sql = "SELECT email FROM client WHERE client_id = ?"; |
| | | $client = $app->db->queryOneRecord($sql, $client_id); |
| | | if($client['email'] != '') $app->tpl->setVar('sender', $client['email']); |
| | | } |
| | | } |
| | |
| | | } |
| | | $app->tpl->setVar('message_variables', trim($message_variables)); |
| | | |
| | | //* SET csrf token |
| | | $csrf_token = $app->auth->csrf_token_get('client_message'); |
| | | $app->tpl->setVar('_csrf_id',$csrf_token['csrf_id']); |
| | | $app->tpl->setVar('_csrf_key',$csrf_token['csrf_key']); |
| | | |
| | | $app->tpl->setVar('okmsg', $msg); |
| | | $app->tpl->setVar('error', $error); |
| | | |
| | |
| | | global $app; |
| | | |
| | | // check new style |
| | | $rec = $app->db->queryOneRecord("SELECT count(client_id) as number FROM client_template_assigned WHERE client_template_id = ".$this->id); |
| | | $rec = $app->db->queryOneRecord("SELECT count(client_id) as number FROM client_template_assigned WHERE client_template_id = ?", $this->id); |
| | | if($rec['number'] > 0) { |
| | | $app->error($app->tform->lng('template_del_aborted_txt')); |
| | | } |
| | | |
| | | // check old style |
| | | $rec = $app->db->queryOneRecord("SELECT count(client_id) as number FROM client WHERE template_master = ".$this->id." OR template_additional like '%/".$this->id."/%'"); |
| | | $rec = $app->db->queryOneRecord("SELECT count(client_id) as number FROM client WHERE template_master = ? OR template_additional like ?", $this->id, '%/".$this->id."/%'); |
| | | if($rec['number'] > 0) { |
| | | $app->error($app->tform->lng('template_del_aborted_txt')); |
| | | } |
| | |
| | | |
| | | if(isset($this->dataRecord['template_type'])) { |
| | | //* Check if the template_type has been changed |
| | | $rec = $app->db->queryOneRecord("SELECT template_type from client_template WHERE template_id = ".$this->id); |
| | | $rec = $app->db->queryOneRecord("SELECT template_type from client_template WHERE template_id = ?", $this->id); |
| | | if($rec['template_type'] != $this->dataRecord['template_type']) { |
| | | //* Add a error message and switch back to old server |
| | | $app->tform->errorMessage .= $app->lng('The template type can not be changed.'); |
| | |
| | | * the template has changed. apply the new data to all clients |
| | | */ |
| | | if ($template_type == 'm'){ |
| | | $sql = "SELECT client_id FROM client WHERE template_master = " . $this->id; |
| | | $sql = "SELECT client_id FROM client WHERE template_master = ?"; |
| | | $clients = $app->db->queryAllRecords($sql, $this->id); |
| | | } else { |
| | | $sql = "SELECT client_id FROM client WHERE template_additional LIKE '%/" . $this->id . "/%' OR template_additional LIKE '" . $this->id . "/%' OR template_additional LIKE '%/" . $this->id . "' UNION SELECT client_id FROM client_template_assigned WHERE client_template_id = " . $this->id; |
| | | $sql = "SELECT client_id FROM client WHERE template_additional LIKE ? OR template_additional LIKE ? OR template_additional LIKE ? UNION SELECT client_id FROM client_template_assigned WHERE client_template_id = ?"; |
| | | $clients = $app->db->queryAllRecords($sql, '%/' . $this->id . '/%', $this->id . '/%', '%/' . $this->id, $this->id); |
| | | } |
| | | $clients = $app->db->queryAllRecords($sql); |
| | | if (is_array($clients)){ |
| | | foreach ($clients as $client){ |
| | | $app->client_templates->apply_client_templates($client['client_id']); |
| | |
| | | */ |
| | | $domain = $this->dataRecord['domain']; |
| | | |
| | | $sql = "SELECT id FROM dns_soa WHERE origin = '" . $app->db->quote($domain.".") . "'"; |
| | | $res = $app->db->queryOneRecord($sql); |
| | | $sql = "SELECT id FROM dns_soa WHERE origin = ?"; |
| | | $res = $app->db->queryOneRecord($sql, $domain."."); |
| | | if (is_array($res)){ |
| | | $app->error($wb['error_domain_in dnsuse']); |
| | | } |
| | | |
| | | $sql = "SELECT id FROM dns_slave WHERE origin = '" . $app->db->quote($domain.".") . "'"; |
| | | $res = $app->db->queryOneRecord($sql); |
| | | $sql = "SELECT id FROM dns_slave WHERE origin = ?"; |
| | | $res = $app->db->queryOneRecord($sql, $domain."."); |
| | | if (is_array($res)){ |
| | | $app->error($wb['error_domain_in dnsslaveuse']); |
| | | } |
| | | |
| | | $sql = "SELECT domain_id FROM mail_domain WHERE domain = '" . $app->db->quote($domain) . "'"; |
| | | $res = $app->db->queryOneRecord($sql); |
| | | $sql = "SELECT domain_id FROM mail_domain WHERE domain = ?"; |
| | | $res = $app->db->queryOneRecord($sql, $domain); |
| | | if (is_array($res)){ |
| | | $app->error($wb['error_domain_in mailuse']); |
| | | } |
| | | |
| | | $sql = "SELECT domain_id FROM web_domain WHERE (domain = '" . $app->db->quote($domain) . "' AND type IN ('alias', 'vhost', 'vhostalias')) OR (domain LIKE '%." . $app->db->quote($domain) . "' AND type IN ('subdomain', 'vhostsubdomain'))"; |
| | | $res = $app->db->queryOneRecord($sql); |
| | | $sql = "SELECT domain_id FROM web_domain WHERE (domain = ? AND type IN ('alias', 'vhost', 'vhostalias')) OR (domain LIKE ? AND type IN ('subdomain', 'vhostsubdomain'))"; |
| | | $res = $app->db->queryOneRecord($sql, $domain, '%.' . $domain); |
| | | if (is_array($res)){ |
| | | $app->error($wb['error_domain_in webuse']); |
| | | } |
| | |
| | | } else { |
| | | // 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, 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->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 = ?", $client_group_id); |
| | | |
| | | // 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 = ".$client['client_id']." ORDER BY client.company_name, client.contact_name, sys_group.name"; |
| | | $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"; |
| | | //die($sql); |
| | | $records = $app->db->queryAllRecords($sql); |
| | | $tmp = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ".$app->functions->intval($client['client_id'])); |
| | | $records = $app->db->queryAllRecords($sql, $client['client_id']); |
| | | $tmp = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ?", $client['client_id']); |
| | | $client_select = '<option value="'.$tmp['groupid'].'">'.$client['contactname'].'</option>'; |
| | | //$tmp_data_record = $app->tform->getDataRecord($this->id); |
| | | if(is_array($records)) { |
| | |
| | | // 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"])) || ($_SESSION["s"]["user"]["typ"] != 'admin' && $app->auth->has_clients($_SESSION['s']['user']['userid']))) { |
| | | $client_group_id = $app->functions->intval($this->dataRecord["client_group_id"]); |
| | | $app->db->query("UPDATE domain SET sys_groupid = $client_group_id, sys_perm_group = 'ru' WHERE domain_id = ".$this->id); |
| | | $app->db->query("UPDATE domain SET sys_groupid = ?, sys_perm_group = 'ru' WHERE domain_id = ?", $client_group_id, $this->id); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | if($_SESSION["s"]["user"]["typ"] != 'admin' && isset($this->dataRecord["client_group_id"])) { |
| | | $client_group_id = $app->functions->intval($_SESSION["s"]["user"]["default_group"]); |
| | | $client = $app->db->queryOneRecord("SELECT client.client_id FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); |
| | | $group = $app->db->queryOneRecord("SELECT sys_group.groupid FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id']." AND sys_group.groupid = ".$this->dataRecord["client_group_id"]." ORDER BY client.company_name, client.contact_name, sys_group.name"); |
| | | $client = $app->db->queryOneRecord("SELECT client.client_id FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id); |
| | | $group = $app->db->queryOneRecord("SELECT sys_group.groupid FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ? AND sys_group.groupid = ? ORDER BY client.company_name, client.contact_name, sys_group.name", $client['client_id'], $this->dataRecord["client_group_id"]); |
| | | $this->dataRecord["client_group_id"] = $group["groupid"]; |
| | | } |
| | | } |
| | | |
| | | // 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(isset($this->dataRecord["client_group_id"])) { |
| | | $client_group_id = $app->functions->intval($this->dataRecord["client_group_id"]); |
| | | $app->db->query("UPDATE domain SET sys_groupid = $client_group_id, sys_perm_group = 'ru' WHERE domain_id = ".$this->id); |
| | | $app->db->query("UPDATE domain SET sys_groupid = ?, sys_perm_group = 'ru' WHERE domain_id = ?", $client_group_id, $this->id); |
| | | |
| | | $data = new tform_actions(); |
| | | $tform = $app->tform; |
| | | $app->tform = new tform(); |
| | | |
| | | $app->tform->loadFormDef("../dns/form/dns_soa.tform.php"); |
| | | $data->oldDataRecord = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE origin LIKE '".$this->dataRecord['domain'].".'"); |
| | | $data->oldDataRecord = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE origin = ?", $this->dataRecord['domain']."."); |
| | | if ($data->oldDataRecord) { |
| | | $data->dataRecord = array_merge($data->oldDataRecord, array('client_group_id' => $this->dataRecord["client_group_id"])); |
| | | $data->id = $data->dataRecord['id']; |
| | |
| | | } |
| | | |
| | | $app->tform->loadFormDef("../dns/form/dns_slave.tform.php"); |
| | | $data->oldDataRecord = $app->db->queryOneRecord("SELECT * FROM dns_slave WHERE origin LIKE '".$this->dataRecord['domain'].".'"); |
| | | $data->oldDataRecord = $app->db->queryOneRecord("SELECT * FROM dns_slave WHERE origin = ?", $this->dataRecord['domain']."."); |
| | | if ($data->oldDataRecord) { |
| | | $data->dataRecord = array_merge($data->oldDataRecord, array('client_group_id' => $this->dataRecord["client_group_id"])); |
| | | $data->id = $data->dataRecord['id']; |
| | |
| | | } |
| | | |
| | | $app->tform->loadFormDef("../mail/form/mail_domain.tform.php"); |
| | | $data->oldDataRecord = $app->db->queryOneRecord("SELECT * FROM mail_domain WHERE domain = '".$this->dataRecord['domain']."'"); |
| | | $data->oldDataRecord = $app->db->queryOneRecord("SELECT * FROM mail_domain WHERE domain = ?", $this->dataRecord['domain']); |
| | | if ($data->oldDataRecord) { |
| | | $data->dataRecord = array_merge($data->oldDataRecord, array('client_group_id' => $this->dataRecord["client_group_id"])); |
| | | $data->id = $data->dataRecord['domain_id']; |
| | |
| | | } |
| | | |
| | | $app->tform->loadFormDef("../sites/form/web_vhost_domain.tform.php"); |
| | | $data->oldDataRecord = $app->db->queryOneRecord("SELECT * FROM web_domain WHERE domain = '".$this->dataRecord['domain']."'"); |
| | | $data->oldDataRecord = $app->db->queryOneRecord("SELECT * FROM web_domain WHERE domain = ?", $this->dataRecord['domain']); |
| | | if ($data->oldDataRecord) { |
| | | $data->dataRecord = array_merge($data->oldDataRecord, array('client_group_id' => $this->dataRecord["client_group_id"])); |
| | | $data->id = $data->dataRecord['domain_id']; |
| | |
| | | 'maxlength' => '255', |
| | | 'rows' => '', |
| | | 'cols' => '', |
| | | 'searchable' => 1 |
| | | 'searchable' => 1, |
| | | 'filters' => array( 0 => array( 'event' => 'SAVE', |
| | | 'type' => 'TRIM'), |
| | | ), |
| | | ), |
| | | 'contact_name' => array ( |
| | | 'datatype' => 'VARCHAR', |
| | |
| | | 'maxlength' => '255', |
| | | 'rows' => '', |
| | | 'cols' => '', |
| | | 'searchable' => 1 |
| | | 'searchable' => 1, |
| | | 'filters' => array( 0 => array( 'event' => 'SAVE', |
| | | 'type' => 'TRIM'), |
| | | ), |
| | | ), |
| | | 'customer_no' => array ( |
| | | 'datatype' => 'VARCHAR', |
| | |
| | | 2 => array( 'event' => 'SAVE', |
| | | 'type' => 'TOLOWER') |
| | | ), |
| | | 'validators' => array ( 0 => array ( 'type' => 'REGEX', |
| | | 'validators' => array ( |
| | | 0 => array ( 'type' => 'REGEX', |
| | | 'regex' => '/^(\w+[\w\.\-\+]*\w{0,}@\w+[\w.-]*\.[a-z\-]{2,10}){0,1}$/i', |
| | | 'errmsg'=> 'email_error_isemail'), |
| | | 1 => array ( 'type' => 'NOTEMPTY', |
| | | 'errmsg'=> 'email_error_empty'), |
| | | ), |
| | | 'default' => '', |
| | | 'value' => '', |
| | |
| | | 'class' => 'validate_client', |
| | | 'function' => 'check_vat_id', |
| | | 'errmsg'=> 'invalid_vat_id'), |
| | | ), |
| | | ), |
| | | 'filters' => array( 0 => array( 'event' => 'SAVE', |
| | | 'type' => 'TRIM'), |
| | | 1 => array( 'event' => 'SAVE', |
| | | 'type' => 'TOUPPER') |
| | | ), |
| | | ), |
| | | 'company_id' => array ( |
| | | 'datatype' => 'VARCHAR', |
| | |
| | | 'width' => '30', |
| | | 'maxlength' => '255', |
| | | 'rows' => '', |
| | | 'cols' => '' |
| | | 'cols' => '', |
| | | 'filters' => array( 0 => array( 'event' => 'SAVE', |
| | | 'type' => 'TRIM'), |
| | | 1 => array( 'event' => 'SAVE', |
| | | 'type' => 'TOUPPER') |
| | | ), |
| | | ), |
| | | 'bank_account_swift' => array ( |
| | | 'datatype' => 'VARCHAR', |
| | |
| | | 'width' => '30', |
| | | 'maxlength' => '255', |
| | | 'rows' => '', |
| | | 'cols' => '' |
| | | 'cols' => '', |
| | | 'filters' => array( 0 => array( 'event' => 'SAVE', |
| | | 'type' => 'TRIM'), |
| | | 1 => array( 'event' => 'SAVE', |
| | | 'type' => 'TOUPPER') |
| | | ), |
| | | ), |
| | | 'notes' => array ( |
| | | 'datatype' => 'TEXT', |
| | |
| | | '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_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', |
| | |
| | | '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_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', |
| | |
| | | 'maxlength' => '255', |
| | | 'rows' => '', |
| | | 'cols' => '', |
| | | 'searchable' => 1 |
| | | 'searchable' => 1, |
| | | 'filters' => array( 0 => array( 'event' => 'SAVE', |
| | | 'type' => 'TRIM'), |
| | | ), |
| | | ), |
| | | 'contact_name' => array ( |
| | | 'datatype' => 'VARCHAR', |
| | |
| | | 'maxlength' => '255', |
| | | 'rows' => '', |
| | | 'cols' => '', |
| | | 'searchable' => 1 |
| | | 'searchable' => 1, |
| | | 'filters' => array( 0 => array( 'event' => 'SAVE', |
| | | 'type' => 'TRIM'), |
| | | ), |
| | | ), |
| | | 'customer_no' => array ( |
| | | 'datatype' => 'VARCHAR', |
| | |
| | | 'email' => 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') |
| | | 'filters' => array( |
| | | 0 => array( 'event' => 'SAVE','type' => 'IDNTOASCII'), |
| | | 1 => array( 'event' => 'SHOW','type' => 'IDNTOUTF8'), |
| | | 2 => array( 'event' => 'SAVE','type' => 'TOLOWER') |
| | | ), |
| | | 'validators' => array ( |
| | | 0 => array ( 'type' => 'REGEX', |
| | | 'regex' => '/^(\w+[\w\.\-\+]*\w{0,}@\w+[\w.-]*\.[a-z\-]{2,10}){0,1}$/i', |
| | | 'errmsg'=> 'email_error_isemail'), |
| | | 1 => array ( 'type' => 'NOTEMPTY', |
| | | 'errmsg'=> 'email_error_empty'), |
| | | ), |
| | | 'default' => '', |
| | | 'value' => '', |
| | |
| | | 'class' => 'validate_client', |
| | | 'function' => 'check_vat_id', |
| | | 'errmsg'=> 'invalid_vat_id'), |
| | | ), |
| | | ), |
| | | 'filters' => array( 0 => array( 'event' => 'SAVE', |
| | | 'type' => 'TRIM'), |
| | | 1 => array( 'event' => 'SAVE', |
| | | 'type' => 'TOUPPER') |
| | | ), |
| | | ), |
| | | 'company_id' => array ( |
| | | 'datatype' => 'VARCHAR', |
| | |
| | | 'width' => '30', |
| | | 'maxlength' => '255', |
| | | 'rows' => '', |
| | | 'cols' => '' |
| | | 'cols' => '', |
| | | 'filters' => array( 0 => array( 'event' => 'SAVE', |
| | | 'type' => 'TRIM'), |
| | | 1 => array( 'event' => 'SAVE', |
| | | 'type' => 'TOUPPER') |
| | | ), |
| | | ), |
| | | 'bank_account_swift' => array ( |
| | | 'datatype' => 'VARCHAR', |
| | |
| | | 'width' => '30', |
| | | 'maxlength' => '255', |
| | | 'rows' => '', |
| | | 'cols' => '' |
| | | 'cols' => '', |
| | | 'filters' => array( 0 => array( 'event' => 'SAVE', |
| | | 'type' => 'TRIM'), |
| | | 1 => array( 'event' => 'SAVE', |
| | | 'type' => 'TOUPPER') |
| | | ), |
| | | ), |
| | | 'notes' => array ( |
| | | 'datatype' => 'TEXT', |
| | |
| | | '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_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', |
| | |
| | | $wb['added_date_txt'] = 'Added date'; |
| | | $wb['parent_client_id_txt'] = 'Client of reseller'; |
| | | $wb['none_txt'] = 'none'; |
| | | $wb["email_error_empty"] = "Email is empty"; |
| | | ?> |
| | |
| | | $wb['limit_domainmodule_txt'] = 'Domainmodule Limit'; |
| | | $wb['client_limits_txt'] = 'Client Limits'; |
| | | $wb['err_msg_master_tpl_set'] = 'All custom limit settings are ignored if any master template other than \\"custom\\" is selected.'; |
| | | $wb["btn_save_txt"] = "Save"; |
| | | $wb["btn_cancel_txt"] = "Cancel"; |
| | | $wb["email_error_empty"] = "Email is empty"; |
| | | ?> |
| | |
| | | $wb['added_date_txt'] = 'Added date'; |
| | | $wb['parent_client_id_txt'] = 'Client of reseller'; |
| | | $wb['none_txt'] = 'none'; |
| | | $wb["email_error_empty"] = "Email is empty"; |
| | | ?> |
| | |
| | | $wb['limit_domainmodule_txt'] = 'Domainmodule Limit'; |
| | | $wb['client_limits_txt'] = 'Client Limits'; |
| | | $wb['err_msg_master_tpl_set'] = 'All custom limit settings are ignored if any master template other than \\"custom\\" is selected.'; |
| | | $wb["btn_save_txt"] = "Save"; |
| | | $wb["btn_cancel_txt"] = "Cancel"; |
| | | $wb["email_error_empty"] = "Email is empty"; |
| | | ?> |
| | |
| | | $wb['added_date_txt'] = 'Added date'; |
| | | $wb['parent_client_id_txt'] = 'Client of reseller'; |
| | | $wb['none_txt'] = 'none'; |
| | | $wb["email_error_empty"] = "Email is empty"; |
| | | ?> |
| | |
| | | $wb['limit_domainmodule_txt'] = 'Domainmodule Limit'; |
| | | $wb['client_limits_txt'] = 'Client Limits'; |
| | | $wb['err_msg_master_tpl_set'] = 'All custom limit settings are ignored if any master template other than \\"custom\\" is selected.'; |
| | | $wb["btn_save_txt"] = "Save"; |
| | | $wb["btn_cancel_txt"] = "Cancel"; |
| | | $wb["email_error_empty"] = "Email is empty"; |
| | | ?> |
| | |
| | | $wb['added_date_txt'] = 'Datum vytvoření účtu'; |
| | | $wb['parent_client_id_txt'] = 'Přiřazení klienta k distributorovi (prodejci)'; |
| | | $wb['none_txt'] = 'Žádný'; |
| | | $wb["email_error_empty"] = "Email is empty"; |
| | | ?> |
| | | |
| | |
| | | $wb['limit_domainmodule_txt'] = 'Domainmodule Limit'; |
| | | $wb['client_limits_txt'] = 'Klientské limity'; |
| | | $wb['err_msg_master_tpl_set'] = 'Nelze nastavit vlastní limity, pokud chtete nastavit vlatní limity musí být \\"hlavní šablona\\" nastavena na volbu \\"Custom\\".'; |
| | | $wb["btn_save_txt"] = "Save"; |
| | | $wb["btn_cancel_txt"] = "Cancel"; |
| | | $wb["email_error_empty"] = "Email is empty"; |
| | | ?> |
| | | |
| | |
| | | $wb['btn_save_txt'] = 'Speichern'; |
| | | $wb['btn_cancel_txt'] = 'Abbrechen'; |
| | | $wb['invalid_vat_id'] = 'Die USt.-ID ist ungültig.'; |
| | | $wb["email_error_empty"] = "Email ist leer"; |
| | | ?> |
| | |
| | | $wb['client_limits_txt'] = 'Client Limits'; |
| | | $wb['err_msg_master_tpl_set'] = 'All custom limit settings are ignored if any master template other than \\"custom\\" is selected.'; |
| | | $wb['invalid_vat_id'] = 'Die USt.-ID ist ungültig.'; |
| | | $wb["btn_save_txt"] = "Speichern"; |
| | | $wb["btn_cancel_txt"] = "Abbrechen"; |
| | | $wb["email_error_empty"] = "Email ist leer"; |
| | | ?> |
| | |
| | | $wb['added_date_txt'] = 'Added date'; |
| | | $wb['parent_client_id_txt'] = 'Client of reseller'; |
| | | $wb['none_txt'] = 'none'; |
| | | $wb["email_error_empty"] = "Email is empty"; |
| | | ?> |
| | |
| | | $wb['limit_domainmodule_txt'] = 'Domainmodule Limit'; |
| | | $wb['client_limits_txt'] = 'Client Limits'; |
| | | $wb['err_msg_master_tpl_set'] = 'All custom limit settings are ignored if any master template other than \\"custom\\" is selected.'; |
| | | $wb["btn_save_txt"] = "Save"; |
| | | $wb["btn_cancel_txt"] = "Cancel"; |
| | | $wb["email_error_empty"] = "Email is empty"; |
| | | ?> |
| | |
| | | $wb["bank_account_swift_txt"] = 'BIC / Swift'; |
| | | $wb["web_limits_txt"] = 'Web Limits'; |
| | | $wb["email_limits_txt"] = 'Email Limits'; |
| | | $wb["xmpp_limits_txt"] = 'XMPP Limits'; |
| | | $wb["database_limits_txt"] = 'Database Limits'; |
| | | $wb["cron_job_limits_txt"] = 'Cron Job Limits'; |
| | | $wb["dns_limits_txt"] = 'DNS Limits'; |
| | |
| | | $wb["mail_servers_placeholder"] = 'Select mailservers'; |
| | | $wb['no_mail_server_error'] = 'At least one mailserver must be selected.'; |
| | | $wb['mail_servers_used'] = 'The server you are trying to remove from this client is used as a Mailserver. Be sure that this server is not used by this client before you remove it.'; |
| | | |
| | | $wb["xmpp_servers_txt"] = 'XMPP Servers'; |
| | | $wb["xmpp_servers_placeholder"] = 'Select XMPP Servers'; |
| | | $wb['no_xmpp_server_error'] = 'At least one XMPP Server must be selected.'; |
| | | $wb['xmpp_servers_used'] = 'The server you are trying to remove from this client is used as a XMPP Server. Be sure that this server is not used by this client before you remove it.'; |
| | | $wb['limit_xmpp_domain_error_notint'] = 'The XMPP domain limit must be a number.'; |
| | | $wb['limit_xmpp_user_error_notint'] = 'The XMPP user limit must be a number.'; |
| | | $wb['limit_xmpp_domain_txt'] = 'Max. number of XMPP domains'; |
| | | $wb['limit_xmpp_user_txt'] = 'Max. number of XMPP accounts'; |
| | | $wb['limit_xmpp_muc_txt'] = 'Multiuser chat available'; |
| | | $wb['limit_xmpp_pastebin_txt'] = 'Pastebin for MUC available'; |
| | | $wb['limit_xmpp_httparchive_txt'] = 'HTTP archive for MUC available'; |
| | | $wb['limit_xmpp_anon_txt'] = 'Anonymous host available'; |
| | | $wb['limit_xmpp_vjud_txt'] = 'VJUD user directory available'; |
| | | $wb['limit_xmpp_proxy_txt'] = 'Bytestream proxy available'; |
| | | $wb['limit_xmpp_status_txt'] = 'Status host available'; |
| | | |
| | | |
| | | $wb['added_by_txt'] = 'Added by'; |
| | | $wb['added_date_txt'] = 'Added date'; |
| | | $wb['parent_client_id_txt'] = 'Client of reseller'; |
| | |
| | | $wb['btn_save_txt'] = "Save"; |
| | | $wb['btn_cancel_txt'] = "Cancel"; |
| | | $wb['invalid_vat_id'] = 'The VAT ID is invalid.'; |
| | | $wb["email_error_empty"] = "Email is empty"; |
| | | ?> |
| | |
| | | $wb['client_limits_txt'] = 'Client Limits'; |
| | | $wb['limit_database_quota_txt'] = 'Database quota'; |
| | | $wb['limit_database_quota_error_notint'] = 'The database quota limit must be a number.'; |
| | | |
| | | $wb["xmpp_limits_txt"] = 'XMPP Limits'; |
| | | $wb["xmpp_servers_txt"] = 'XMPP Servers'; |
| | | $wb["xmpp_servers_placeholder"] = 'Select XMPP Servers'; |
| | | $wb['no_xmpp_server_error'] = 'At least one XMPP Server must be selected.'; |
| | | $wb['xmpp_servers_used'] = 'The server you are trying to remove from this client is used as a XMPP Server. Be sure that this server is not used by this client before you remove it.'; |
| | | $wb['limit_xmpp_domain_error_notint'] = 'The XMPP domain limit must be a number.'; |
| | | $wb['limit_xmpp_user_error_notint'] = 'The XMPP user limit must be a number.'; |
| | | $wb['limit_xmpp_domain_txt'] = 'Max. number of XMPP domains'; |
| | | $wb['limit_xmpp_user_txt'] = 'Max. number of XMPP accounts'; |
| | | $wb['limit_xmpp_muc_txt'] = 'Multiuser chat available'; |
| | | $wb['limit_xmpp_pastebin_txt'] = 'Pastebin for MUC available'; |
| | | $wb['limit_xmpp_httparchive_txt'] = 'HTTP archive for MUC available'; |
| | | $wb['limit_xmpp_anon_txt'] = 'Anonymous host available'; |
| | | $wb['limit_xmpp_vjud_txt'] = 'VJUD user directory available'; |
| | | $wb['limit_xmpp_proxy_txt'] = 'Bytestream proxy available'; |
| | | $wb['limit_xmpp_status_txt'] = 'Status host available'; |
| | | ?> |
| | |
| | | $wb['customer_no_template_error_regex_txt'] = 'The customer No. template contains invalid characters'; |
| | | $wb['customer_no_start_txt'] = 'Customer No. start value'; |
| | | $wb['customer_no_counter_txt'] = 'Customer No. counter'; |
| | | |
| | | $wb["xmpp_limits_txt"] = 'XMPP Limits'; |
| | | $wb["xmpp_servers_txt"] = 'XMPP Servers'; |
| | | $wb["xmpp_servers_placeholder"] = 'Select XMPP Servers'; |
| | | $wb['no_xmpp_server_error'] = 'At least one XMPP Server must be selected.'; |
| | | $wb['xmpp_servers_used'] = 'The server you are trying to remove from this client is used as a XMPP Server. Be sure that this server is not used by this client before you remove it.'; |
| | | $wb['limit_xmpp_domain_error_notint'] = 'The XMPP domain limit must be a number.'; |
| | | $wb['limit_xmpp_user_error_notint'] = 'The XMPP user limit must be a number.'; |
| | | $wb['limit_xmpp_domain_txt'] = 'Max. number of XMPP domains'; |
| | | $wb['limit_xmpp_user_txt'] = 'Max. number of XMPP accounts'; |
| | | $wb['limit_xmpp_muc_txt'] = 'Multiuser chat available'; |
| | | $wb['limit_xmpp_pastebin_txt'] = 'Pastebin for MUC available'; |
| | | $wb['limit_xmpp_httparchive_txt'] = 'HTTP archive for MUC available'; |
| | | $wb['limit_xmpp_anon_txt'] = 'Anonymous host available'; |
| | | $wb['limit_xmpp_vjud_txt'] = 'VJUD user directory available'; |
| | | $wb['limit_xmpp_proxy_txt'] = 'Bytestream proxy available'; |
| | | $wb['limit_xmpp_status_txt'] = 'Status host available'; |
| | | |
| | | $wb['added_by_txt'] = 'Added by'; |
| | | $wb['added_date_txt'] = 'Added date'; |
| | | $wb['limit_domainmodule_error_notint'] = 'Domainmodule limit must be a number.'; |
| | |
| | | $wb['client_limits_txt'] = 'Client Limits'; |
| | | $wb['err_msg_master_tpl_set'] = 'All custom limit settings are ignored if any master template other than "custom" is selected.'; |
| | | $wb['invalid_vat_id'] = 'The VAT ID is invalid.'; |
| | | $wb["btn_save_txt"] = "Save"; |
| | | $wb["btn_cancel_txt"] = "Cancel"; |
| | | $wb["email_error_empty"] = "Email is empty"; |
| | | ?> |
| | |
| | | $wb['limit_database_quota_txt'] = 'Cuota de base de datos'; |
| | | $wb['limit_database_quota_error_notint'] = 'Cuota de base de datos debe ser un número.'; |
| | | $wb['reseller_txt'] = 'Revendedor'; |
| | | $wb["email_error_empty"] = "Email is empty"; |
| | | ?> |
| | |
| | | $wb['limit_domainmodule_txt'] = 'Número máximo de dominios'; |
| | | $wb['client_limits_txt'] = 'Límites de Clientes'; |
| | | $wb['err_msg_master_tpl_set'] = 'Todas los límites personalizados se ignoran si se selecciona una plantilla principal distinta de \"custom\".'; |
| | | $wb["btn_save_txt"] = "Save"; |
| | | $wb["btn_cancel_txt"] = "Cancel"; |
| | | $wb["email_error_empty"] = "Email is empty"; |
| | | ?> |
| | |
| | | $wb['added_date_txt'] = 'Added date'; |
| | | $wb['parent_client_id_txt'] = 'Client of reseller'; |
| | | $wb['none_txt'] = 'none'; |
| | | $wb["email_error_empty"] = "Email is empty"; |
| | | ?> |
| | |
| | | $wb['limit_domainmodule_txt'] = 'Domainmodule Limit'; |
| | | $wb['client_limits_txt'] = 'Client Limits'; |
| | | $wb['err_msg_master_tpl_set'] = 'All custom limit settings are ignored if any master template other than \\"custom\\" is selected.'; |
| | | $wb["btn_save_txt"] = "Save"; |
| | | $wb["btn_cancel_txt"] = "Cancel"; |
| | | $wb["email_error_empty"] = "Email is empty"; |
| | | ?> |
| | |
| | | $wb['added_date_txt'] = 'Added date'; |
| | | $wb['parent_client_id_txt'] = 'Client of reseller'; |
| | | $wb['none_txt'] = 'none'; |
| | | $wb["email_error_empty"] = "Email is empty"; |
| | | ?> |
| | |
| | | $wb['limit_domainmodule_txt'] = 'Domainmodule Limit'; |
| | | $wb['client_limits_txt'] = 'Client Limits'; |
| | | $wb['err_msg_master_tpl_set'] = 'All custom limit settings are ignored if any master template other than \\"custom\\" is selected.'; |
| | | $wb["btn_save_txt"] = "Save"; |
| | | $wb["btn_cancel_txt"] = "Cancel"; |
| | | $wb["email_error_empty"] = "Email is empty"; |
| | | ?> |
| | |
| | | $wb['added_date_txt'] = 'Added date'; |
| | | $wb['parent_client_id_txt'] = 'Client of reseller'; |
| | | $wb['none_txt'] = 'none'; |
| | | $wb["email_error_empty"] = "Email is empty"; |
| | | ?> |
| | | |
| | | |
| | |
| | | $wb['limit_domainmodule_txt'] = 'Domain module Limit'; |
| | | $wb['client_limits_txt'] = 'Limiti klijenata'; |
| | | $wb['err_msg_master_tpl_set'] = 'All custom limit settings are ignored if any master template other than \\"custom\\" is selected.'; |
| | | $wb["btn_save_txt"] = "Save"; |
| | | $wb["btn_cancel_txt"] = "Cancel"; |
| | | $wb["email_error_empty"] = "Email is empty"; |
| | | ?> |
| | | |
| | | |
| | |
| | | $wb['added_date_txt'] = 'Added date'; |
| | | $wb['parent_client_id_txt'] = 'Client of reseller'; |
| | | $wb['none_txt'] = 'none'; |
| | | $wb["email_error_empty"] = "Email is empty"; |
| | | ?> |
| | |
| | | $wb['limit_domainmodule_txt'] = 'Domainmodule Limit'; |
| | | $wb['client_limits_txt'] = 'Client Limits'; |
| | | $wb['err_msg_master_tpl_set'] = 'All custom limit settings are ignored if any master template other than \\"custom\\" is selected.'; |
| | | $wb["btn_save_txt"] = "Save"; |
| | | $wb["btn_cancel_txt"] = "Cancel"; |
| | | $wb["email_error_empty"] = "Email is empty"; |
| | | ?> |
| | |
| | | $wb['added_date_txt'] = 'Added date'; |
| | | $wb['parent_client_id_txt'] = 'Client of reseller'; |
| | | $wb['none_txt'] = 'none'; |
| | | $wb["email_error_empty"] = "Email is empty"; |
| | | ?> |
| | |
| | | $wb['limit_domainmodule_txt'] = 'Domainmodule Limit'; |
| | | $wb['client_limits_txt'] = 'Client Limits'; |
| | | $wb['err_msg_master_tpl_set'] = 'All custom limit settings are ignored if any master template other than \\"custom\\" is selected.'; |
| | | $wb["btn_save_txt"] = "Save"; |
| | | $wb["btn_cancel_txt"] = "Cancel"; |
| | | $wb["email_error_empty"] = "Email is empty"; |
| | | ?> |
| | |
| | | $wb['added_date_txt'] = 'Added date'; |
| | | $wb['parent_client_id_txt'] = 'Client of reseller'; |
| | | $wb['none_txt'] = 'none'; |
| | | $wb["email_error_empty"] = "Email is empty"; |
| | | ?> |
| | |
| | | $wb['limit_domainmodule_txt'] = 'Domainmodule Limit'; |
| | | $wb['client_limits_txt'] = 'Client Limits'; |
| | | $wb['err_msg_master_tpl_set'] = 'All custom limit settings are ignored if any master template other than \\"custom\\" is selected.'; |
| | | $wb["btn_save_txt"] = "Save"; |
| | | $wb["btn_cancel_txt"] = "Cancel"; |
| | | $wb["email_error_empty"] = "Email is empty"; |
| | | ?> |
| | |
| | | $wb['added_date_txt'] = 'Added date'; |
| | | $wb['parent_client_id_txt'] = 'Client of reseller'; |
| | | $wb['none_txt'] = 'none'; |
| | | $wb["email_error_empty"] = "Email is empty"; |
| | | ?> |
| | |
| | | $wb['limit_domainmodule_txt'] = 'Domainmodule Limit'; |
| | | $wb['client_limits_txt'] = 'Client Limits'; |
| | | $wb['err_msg_master_tpl_set'] = 'All custom limit settings are ignored if any master template other than \\"custom\\" is selected.'; |
| | | $wb["btn_save_txt"] = "Save"; |
| | | $wb["btn_cancel_txt"] = "Cancel"; |
| | | $wb["email_error_empty"] = "Email is empty"; |
| | | ?> |
| | |
| | | $wb['added_date_txt'] = 'Added date'; |
| | | $wb['parent_client_id_txt'] = 'Client of reseller'; |
| | | $wb['none_txt'] = 'none'; |
| | | $wb["email_error_empty"] = "Email is empty"; |
| | | ?> |
| | |
| | | $wb['limit_domainmodule_txt'] = 'Domainmodule Limit'; |
| | | $wb['client_limits_txt'] = 'Client Limits'; |
| | | $wb['err_msg_master_tpl_set'] = 'All custom limit settings are ignored if any master template other than \\"custom\\" is selected.'; |
| | | $wb["btn_save_txt"] = "Save"; |
| | | $wb["btn_cancel_txt"] = "Cancel"; |
| | | $wb["email_error_empty"] = "Email is empty"; |
| | | ?> |
| | |
| | | $wb['added_date_txt'] = 'Added date'; |
| | | $wb['parent_client_id_txt'] = 'Client of reseller'; |
| | | $wb['none_txt'] = 'none'; |
| | | $wb["email_error_empty"] = "Email is empty"; |
| | | ?> |
| | |
| | | $wb['limit_domainmodule_txt'] = 'Domainmodule Limit'; |
| | | $wb['client_limits_txt'] = 'Client Limits'; |
| | | $wb['err_msg_master_tpl_set'] = 'All custom limit settings are ignored if any master template other than \\"custom\\" is selected.'; |
| | | $wb["btn_save_txt"] = "Save"; |
| | | $wb["btn_cancel_txt"] = "Cancel"; |
| | | $wb["email_error_empty"] = "Email is empty"; |
| | | ?> |
| | |
| | | $wb['added_date_txt'] = 'Added date'; |
| | | $wb['parent_client_id_txt'] = 'Client of reseller'; |
| | | $wb['none_txt'] = 'none'; |
| | | $wb["email_error_empty"] = "Email is empty"; |
| | | ?> |
| | |
| | | $wb['limit_domainmodule_txt'] = 'Domainmodule Limit'; |
| | | $wb['client_limits_txt'] = 'Client Limits'; |
| | | $wb['err_msg_master_tpl_set'] = 'All custom limit settings are ignored if any master template other than \\"custom\\" is selected.'; |
| | | $wb["btn_save_txt"] = "Save"; |
| | | $wb["btn_cancel_txt"] = "Cancel"; |
| | | $wb["email_error_empty"] = "Email is empty"; |
| | | ?> |
| | |
| | | $wb['added_date_txt'] = 'Added date'; |
| | | $wb['parent_client_id_txt'] = 'Client of reseller'; |
| | | $wb['none_txt'] = 'none'; |
| | | $wb["email_error_empty"] = "Email is empty"; |
| | | ?> |
| | |
| | | $wb['limit_domainmodule_txt'] = 'Domainmodule Limit'; |
| | | $wb['client_limits_txt'] = 'Client Limits'; |
| | | $wb['err_msg_master_tpl_set'] = 'All custom limit settings are ignored if any master template other than \\"custom\\" is selected.'; |
| | | $wb["btn_save_txt"] = "Save"; |
| | | $wb["btn_cancel_txt"] = "Cancel"; |
| | | $wb["email_error_empty"] = "Email is empty"; |
| | | ?> |
| | |
| | | $wb['added_date_txt'] = 'Added date'; |
| | | $wb['parent_client_id_txt'] = 'Client of reseller'; |
| | | $wb['none_txt'] = 'none'; |
| | | $wb["email_error_empty"] = "Email is empty"; |
| | | ?> |
| | |
| | | $wb['limit_domainmodule_txt'] = 'Domainmodule Limit'; |
| | | $wb['client_limits_txt'] = 'Client Limits'; |
| | | $wb['err_msg_master_tpl_set'] = 'All custom limit settings are ignored if any master template other than \\"custom\\" is selected.'; |
| | | $wb["btn_save_txt"] = "Save"; |
| | | $wb["btn_cancel_txt"] = "Cancel"; |
| | | $wb["email_error_empty"] = "Email is empty"; |
| | | ?> |
| | |
| | | $wb['added_date_txt'] = 'Tillagd datum'; |
| | | $wb['parent_client_id_txt'] = 'Kund till återförsäljare'; |
| | | $wb['none_txt'] = 'ingen'; |
| | | $wb["email_error_empty"] = "Email is empty"; |
| | | ?> |
| | |
| | | $wb['limit_domainmodule_txt'] = 'Domainmodule Limit'; |
| | | $wb['client_limits_txt'] = 'Client Limits'; |
| | | $wb['err_msg_master_tpl_set'] = 'All custom limit settings are ignored if any master template other than \\"custom\\" is selected.'; |
| | | $wb["btn_save_txt"] = "Save"; |
| | | $wb["btn_cancel_txt"] = "Cancel"; |
| | | $wb["email_error_empty"] = "Email is empty"; |
| | | ?> |
| | |
| | | $wb['added_date_txt'] = 'Added date'; |
| | | $wb['parent_client_id_txt'] = 'Client of reseller'; |
| | | $wb['none_txt'] = 'none'; |
| | | $wb["email_error_empty"] = "Email is empty"; |
| | | ?> |
| | |
| | | $wb['limit_domainmodule_txt'] = 'Domainmodule Limit'; |
| | | $wb['client_limits_txt'] = 'Client Limits'; |
| | | $wb['err_msg_master_tpl_set'] = 'All custom limit settings are ignored if any master template other than \\"custom\\" is selected.'; |
| | | $wb["btn_save_txt"] = "Save"; |
| | | $wb["btn_cancel_txt"] = "Cancel"; |
| | | $wb["email_error_empty"] = "Email is empty"; |
| | | ?> |
| | |
| | | $wb['added_date_txt'] = 'Added date'; |
| | | $wb['parent_client_id_txt'] = 'Client of reseller'; |
| | | $wb['none_txt'] = 'none'; |
| | | $wb["email_error_empty"] = "Email is empty"; |
| | | ?> |
| | |
| | | $wb['limit_domainmodule_txt'] = 'Domainmodule Limit'; |
| | | $wb['client_limits_txt'] = 'Client Limits'; |
| | | $wb['err_msg_master_tpl_set'] = 'All custom limit settings are ignored if any master template other than \\"custom\\" is selected.'; |
| | | $wb["btn_save_txt"] = "Save"; |
| | | $wb["btn_cancel_txt"] = "Cancel"; |
| | | $wb["email_error_empty"] = "Email is empty"; |
| | | ?> |
| | |
| | | $module["template"] = "module.tpl.htm"; |
| | | $module["startpage"] = "client/client_list.php"; |
| | | $module["tab_width"] = ''; |
| | | $module['order'] = '20'; |
| | | |
| | | |
| | | $items[] = array( 'title' => "Edit Client", |
| | |
| | | <?php |
| | | |
| | | $function_list['client_get_all,client_get,client_add,client_update,client_delete,client_get_sites_by_user,client_get_by_username,client_change_password,client_get_id,client_delete_everything,client_get_emailcontact'] = 'Client functions'; |
| | | $function_list['client_get_all,client_get,client_add,client_update,client_delete,client_get_sites_by_user,client_get_by_username,client_get_by_customer_no,client_change_password,client_get_id,client_delete_everything,client_get_emailcontact'] = 'Client functions'; |
| | | $function_list['domains_domain_get,domains_domain_add,domains_domain_delete,domains_get_all_by_user'] = 'Domaintool functions'; |
| | | $function_list['quota_get_by_user,trafficquota_get_by_user,mailquota_get_by_user,databasequota_get_by_user'] = 'Quota functions'; |
| | | |
| | |
| | | 'prefix' => "", |
| | | 'suffix' => "", |
| | | 'width' => "", |
| | | 'value' => array('y' => "<div id=\"ir-Yes\" class=\"swap\"><span>Yes</span></div>", 'n' => "<div class=\"swap\" id=\"ir-No\"><span>No</span></div>")); |
| | | 'value' => array('y' => "<div id=\"ir-Yes\" class=\"swap\"><span>".$app->lng('yes_txt')."</span></div>", 'n' => "<div class=\"swap\" id=\"ir-No\"><span>".$app->lng('no_txt')."</span></div>")); |
| | | |
| | | $liste["item"][] = array( 'field' => "circle_name", |
| | | 'datatype' => "VARCHAR", |
| | |
| | | // Check for duplicates |
| | | if($this->dataRecord['template_type'] == 'welcome') { |
| | | $client_group_id = $app->functions->intval($_SESSION["s"]["user"]["default_group"]); |
| | | $sql = "SELECT count(client_message_template_id) as number FROM client_message_template WHERE template_type = 'welcome' AND sys_groupid = ".$client_group_id; |
| | | $sql = "SELECT count(client_message_template_id) as number FROM client_message_template WHERE template_type = 'welcome' AND sys_groupid = ?"; |
| | | if($this->id > 0) { |
| | | $sql .= " AND client_message_template_id != ".$this->id; |
| | | $sql .= " AND client_message_template_id != ?"; |
| | | } |
| | | |
| | | $tmp = $app->db->queryOneRecord($sql); |
| | | $tmp = $app->db->queryOneRecord($sql, $client_group_id, $this->id); |
| | | if($tmp['number'] > 0) $app->tform->errorMessage .= $app->tform->lng('duplicate_welcome_error'); |
| | | } |
| | | |
| | |
| | | |
| | | $client_id = $app->functions->intval($this->dataRecord['client_id']); |
| | | |
| | | $tmp = $app->db->queryOneRecord("SELECT count(client_id) as number FROM client WHERE parent_client_id = ".$client_id); |
| | | $tmp = $app->db->queryOneRecord("SELECT count(client_id) as number FROM client WHERE parent_client_id = ?", $client_id); |
| | | if($tmp["number"] > 0) $app->error($app->lng('error_has_clients')); |
| | | |
| | | } |
| | |
| | | |
| | | // remove the group of the client from the resellers group |
| | | $parent_client_id = $app->functions->intval($this->dataRecord['parent_client_id']); |
| | | $parent_user = $app->db->queryOneRecord("SELECT userid FROM sys_user WHERE client_id = $parent_client_id"); |
| | | $client_group = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = $client_id"); |
| | | $parent_user = $app->db->queryOneRecord("SELECT userid FROM sys_user WHERE client_id = ?", $parent_client_id); |
| | | $client_group = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ?", $client_id); |
| | | $app->auth->remove_group_from_user($parent_user['userid'], $client_group['groupid']); |
| | | |
| | | // delete the group of the client |
| | | $app->db->query("DELETE FROM sys_group WHERE client_id = $client_id"); |
| | | $app->db->query("DELETE FROM sys_group WHERE client_id = ?", $client_id); |
| | | |
| | | // delete the sys user(s) of the client |
| | | $app->db->query("DELETE FROM sys_user WHERE client_id = $client_id"); |
| | | $app->db->query("DELETE FROM sys_user WHERE client_id = ?", $client_id); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | // Get the limits of the client |
| | | $client_group_id = $app->functions->intval($_SESSION["s"]["user"]["default_group"]); |
| | | $client = $app->db->queryOneRecord("SELECT limit_client FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); |
| | | $client = $app->db->queryOneRecord("SELECT limit_client 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 website. |
| | | if($client["limit_client"] >= 0) { |
| | | $tmp = $app->db->queryOneRecord("SELECT count(client_id) as number FROM client WHERE sys_groupid = $client_group_id"); |
| | | $tmp = $app->db->queryOneRecord("SELECT count(client_id) as number FROM client WHERE sys_groupid = ?", $client_group_id); |
| | | if($tmp["number"] >= $client["limit_client"]) { |
| | | $app->error($app->tform->wordbook["limit_client_txt"]); |
| | | } |
| | |
| | | |
| | | // Get the limits of the client |
| | | $client_group_id = $app->functions->intval($_SESSION["s"]["user"]["default_group"]); |
| | | $client = $app->db->queryOneRecord("SELECT limit_client FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); |
| | | $client = $app->db->queryOneRecord("SELECT limit_client 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 website. |
| | | if($client["limit_client"] >= 0) { |
| | | $tmp = $app->db->queryOneRecord("SELECT count(client_id) as number FROM client WHERE sys_groupid = $client_group_id"); |
| | | $tmp = $app->db->queryOneRecord("SELECT count(client_id) as number FROM client WHERE sys_groupid = ?", $client_group_id); |
| | | if($tmp["number"] >= $client["limit_client"]) { |
| | | $app->error($app->tform->wordbook["limit_client_txt"]); |
| | | } |
| | |
| | | } |
| | | |
| | | if($this->id != 0) { |
| | | $this->oldTemplatesAssigned = $app->db->queryAllRecords('SELECT * FROM `client_template_assigned` WHERE `client_id` = ' . $this->id); |
| | | $this->oldTemplatesAssigned = $app->db->queryAllRecords('SELECT * FROM `client_template_assigned` WHERE `client_id` = ?', $this->id); |
| | | if(!is_array($this->oldTemplatesAssigned) || count($this->oldTemplatesAssigned) < 1) { |
| | | // check previous type of storing templates |
| | | $tpls = explode('/', $this->oldDataRecord['template_additional']); |
| | |
| | | $app->tpl->setVar('tpl_add_select', $option); |
| | | |
| | | // check for new-style records |
| | | $result = $app->db->queryAllRecords('SELECT assigned_template_id, client_template_id FROM client_template_assigned WHERE client_id = ' . $this->id); |
| | | $result = $app->db->queryAllRecords('SELECT assigned_template_id, client_template_id FROM client_template_assigned WHERE client_id = ?', $this->id); |
| | | if($result && count($result) > 0) { |
| | | // new style |
| | | $items = array(); |
| | |
| | | unset($tmprec); |
| | | } else { |
| | | // old style |
| | | $sql = "SELECT template_additional FROM client WHERE client_id = " . $this->id; |
| | | $result = $app->db->queryOneRecord($sql); |
| | | $sql = "SELECT template_additional FROM client WHERE client_id = ?"; |
| | | $result = $app->db->queryOneRecord($sql, $this->id); |
| | | $tplAdd = explode("/", $result['template_additional']); |
| | | $text = ''; |
| | | foreach($tplAdd as $item){ |
| | |
| | | $customer_no = $app->functions->intval($system_config['misc']['customer_no_start']+$system_config['misc']['customer_no_counter']); |
| | | $customer_no_string = str_replace('[CUSTOMER_NO]',$customer_no,$system_config['misc']['customer_no_template']); |
| | | $app->tpl->setVar('customer_no',$customer_no_string); |
| | | |
| | | //* save new counter value |
| | | /* |
| | | $system_config['misc']['customer_no_counter']++; |
| | | $system_config_str = $app->ini_parser->get_ini_string($system_config); |
| | | $app->db->datalogUpdate('sys_ini', "config = '".$app->db->quote($system_config_str)."'", 'sysini_id', 1); |
| | | */ |
| | | } |
| | | } |
| | | |
| | |
| | | function onAfterInsert() { |
| | | global $app, $conf; |
| | | // Create the group for the reseller |
| | | $groupid = $app->db->datalogInsert('sys_group', "(name,description,client_id) VALUES ('".$app->db->quote($this->dataRecord["username"])."','',".$this->id.")", 'groupid'); |
| | | $groupid = $app->db->datalogInsert('sys_group', array("name" => $this->dataRecord["username"], "description" => '', "client_id" => $this->id), 'groupid'); |
| | | $groups = $groupid; |
| | | |
| | | $username = $app->db->quote($this->dataRecord["username"]); |
| | | $password = $app->db->quote($this->dataRecord["password"]); |
| | | $modules = $app->db->quote($conf['interface_modules_enabled'] . ',client'); |
| | | $username = $this->dataRecord["username"]; |
| | | $password = $this->dataRecord["password"]; |
| | | $modules = $conf['interface_modules_enabled'] . ',client'; |
| | | $startmodule = (stristr($modules, 'dashboard'))?'dashboard':'client'; |
| | | $usertheme = $app->db->quote($this->dataRecord["usertheme"]); |
| | | $usertheme = $this->dataRecord["usertheme"]; |
| | | $type = 'user'; |
| | | $active = 1; |
| | | $language = $app->db->quote($this->dataRecord["language"]); |
| | | $language = $this->dataRecord["language"]; |
| | | |
| | | $salt="$1$"; |
| | | $base64_alphabet='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; |
| | |
| | | |
| | | // Create the controlpaneluser for the reseller |
| | | $sql = "INSERT INTO sys_user (username,passwort,modules,startmodule,app_theme,typ,active,language,groups,default_group,client_id) |
| | | VALUES ('$username','$password','$modules','$startmodule','$usertheme','$type','$active','$language',$groups,$groupid,".$this->id.")"; |
| | | $app->db->query($sql); |
| | | VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; |
| | | $app->db->query($sql, $username, $password, $modules, $startmodule, $usertheme, $type, $active, $language, $groups, $groupid, $this->id); |
| | | |
| | | //* set the number of clients to 1 |
| | | $app->db->query("UPDATE client SET limit_client = 1 WHERE client_id = ".$this->id); |
| | | $app->db->query("UPDATE client SET limit_client = 1 WHERE client_id = ?", $this->id); |
| | | |
| | | //* Set the default servers |
| | | $tmp = $app->db->queryOneRecord('SELECT server_id FROM server WHERE mail_server = 1 LIMIT 0,1'); |
| | |
| | | $tmp = $app->db->queryOneRecord('SELECT server_id FROM server WHERE db_server = 1 LIMIT 0,1'); |
| | | $default_dbserver = $app->functions->intval($tmp['server_id']); |
| | | |
| | | $sql = "UPDATE client SET default_mailserver = $default_mailserver, default_webserver = $default_webserver, default_dnsserver = $default_dnsserver, default_slave_dnsserver = $default_dnsserver, default_dbserver = $default_dbserver WHERE client_id = ".$this->id; |
| | | $app->db->query($sql); |
| | | $sql = "UPDATE client SET default_mailserver = ?, default_webserver = ?, default_dnsserver = ?, default_slave_dnsserver = ?, default_dbserver = ? WHERE client_id = ?"; |
| | | $app->db->query($sql, $default_mailserver, $default_webserver, $default_dnsserver, $default_dnsserver, $default_dbserver, $this->id); |
| | | |
| | | if(isset($this->dataRecord['template_master'])) { |
| | | $app->uses('client_templates'); |
| | |
| | | //* save new counter value |
| | | $system_config['misc']['customer_no_counter']++; |
| | | $system_config_str = $app->ini_parser->get_ini_string($system_config); |
| | | $app->db->datalogUpdate('sys_ini', "config = '".$app->db->quote($system_config_str)."'", 'sysini_id', 1); |
| | | $app->db->datalogUpdate('sys_ini', array("config" => $system_config_str), 'sysini_id', 1); |
| | | |
| | | } |
| | | } |
| | | |
| | | //* Send welcome email |
| | | $client_group_id = $app->functions->intval($_SESSION["s"]["user"]["default_group"]); |
| | | $sql = "SELECT * FROM client_message_template WHERE template_type = 'welcome' AND sys_groupid = ".$client_group_id; |
| | | $email_template = $app->db->queryOneRecord($sql); |
| | | $sql = "SELECT * FROM client_message_template WHERE template_type = 'welcome' AND sys_groupid = ?"; |
| | | $email_template = $app->db->queryOneRecord($sql, $client_group_id); |
| | | $client = $app->tform->getDataRecord($this->id); |
| | | |
| | | if(is_array($email_template) && $client['email'] != '') { |
| | |
| | | $from = $system_config['admin_mail']; |
| | | } else { |
| | | $client_group_id = $app->functions->intval($_SESSION["s"]["user"]["default_group"]); |
| | | $reseller = $app->db->queryOneRecord("SELECT client.email FROM sys_group,client WHERE client.client_id = sys_group.client_id and sys_group.groupid = ".$client_group_id); |
| | | $reseller = $app->db->queryOneRecord("SELECT client.email FROM sys_group,client WHERE client.client_id = sys_group.client_id and sys_group.groupid = ?", $client_group_id); |
| | | $from = $reseller["email"]; |
| | | } |
| | | |
| | |
| | | |
| | | // username changed |
| | | if(isset($conf['demo_mode']) && $conf['demo_mode'] != true && isset($this->dataRecord['username']) && $this->dataRecord['username'] != '' && $this->oldDataRecord['username'] != $this->dataRecord['username']) { |
| | | $username = $app->db->quote($this->dataRecord["username"]); |
| | | $username = $this->dataRecord["username"]; |
| | | $client_id = $this->id; |
| | | $sql = "UPDATE sys_user SET username = '$username' WHERE client_id = $client_id"; |
| | | $app->db->query($sql); |
| | | $sql = "UPDATE sys_user SET username = ? WHERE client_id = ?"; |
| | | $app->db->query($sql, $username, $client_id); |
| | | |
| | | $tmp = $app->db->queryOneRecord("SELECT * FROM sys_group WHERE client_id = $client_id"); |
| | | $app->db->datalogUpdate("sys_group", "name = '$username'", 'groupid', $tmp['groupid']); |
| | | $tmp = $app->db->queryOneRecord("SELECT * FROM sys_group WHERE client_id = ?", $client_id); |
| | | $app->db->datalogUpdate("sys_group", array("name" => $username), 'groupid', $tmp['groupid']); |
| | | unset($tmp); |
| | | } |
| | | |
| | | // password changed |
| | | if(isset($conf['demo_mode']) && $conf['demo_mode'] != true && isset($this->dataRecord["password"]) && $this->dataRecord["password"] != '') { |
| | | $password = $app->db->quote($this->dataRecord["password"]); |
| | | $password = $this->dataRecord["password"]; |
| | | $client_id = $this->id; |
| | | $salt="$1$"; |
| | | $base64_alphabet='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; |
| | |
| | | } |
| | | $salt.="$"; |
| | | $password = crypt(stripslashes($password), $salt); |
| | | $sql = "UPDATE sys_user SET passwort = '$password' WHERE client_id = $client_id"; |
| | | $app->db->query($sql); |
| | | $sql = "UPDATE sys_user SET passwort = ? WHERE client_id = ?"; |
| | | $app->db->query($sql, $password, $client_id); |
| | | } |
| | | |
| | | // language changed |
| | | if(isset($conf['demo_mode']) && $conf['demo_mode'] != true && isset($this->dataRecord['language']) && $this->dataRecord['language'] != '' && $this->oldDataRecord['language'] != $this->dataRecord['language']) { |
| | | $language = $app->db->quote($this->dataRecord["language"]); |
| | | $language = $this->dataRecord["language"]; |
| | | $client_id = $this->id; |
| | | $sql = "UPDATE sys_user SET language = '$language' WHERE client_id = $client_id"; |
| | | $app->db->query($sql); |
| | | $sql = "UPDATE sys_user SET language = ? WHERE client_id = ?"; |
| | | $app->db->query($sql, $language, $client_id); |
| | | } |
| | | |
| | | // ensure that a reseller is not converted to a client in demo mode when client_id <= 2 |
| | | if(isset($conf['demo_mode']) && $conf['demo_mode'] == true && $this->id <= 2) { |
| | | if(isset($this->dataRecord["limit_client"]) && $this->dataRecord["limit_client"] != -1) { |
| | | $app->db->query('UPDATE client set limit_client = -1 WHERE client_id = '.$this->id); |
| | | $app->db->query('UPDATE client set limit_client = -1 WHERE client_id = ?', $this->id); |
| | | } |
| | | } |
| | | |
| | | // reseller status changed |
| | | if(isset($this->dataRecord["limit_client"]) && $this->dataRecord["limit_client"] != $this->oldDataRecord["limit_client"]) { |
| | | $modules = $app->db->quote($conf['interface_modules_enabled'] . ',client'); |
| | | $modules = $app->db->quote($modules); |
| | | $modules = $conf['interface_modules_enabled'] . ',client'; |
| | | $modules = $modules; |
| | | $client_id = $this->id; |
| | | $sql = "UPDATE sys_user SET modules = '$modules' WHERE client_id = $client_id"; |
| | | $app->db->query($sql); |
| | | $sql = "UPDATE sys_user SET modules = ? WHERE client_id = ?"; |
| | | $app->db->query($sql, $modules, $client_id); |
| | | } |
| | | |
| | | if(isset($this->dataRecord['template_master'])) { |
| | |
| | | <tmpl_if name="list_head_txt"> |
| | | <div class='page-header'> |
| | | <h1><tmpl_var name="list_head_txt"></h1> |
| | | </div> |
| | | <p><tmpl_var name="list_desc_txt"></p> |
| | | </tmpl_if> |
| | | <tmpl_if name="list_desc_txt"><p><tmpl_var name="list_desc_txt"></p></tmpl_if> |
| | | |
| | | |
| | | <legend>{tmpl_var name='circle_txt'}</legend> |
| | | <div class="form-group"> |
| | | <label for="circle_name" class="col-sm-3 control-label">{tmpl_var name='circle_name_txt'}*</label> |
| | | <div class="col-sm-9"><input type="text" name="circle_name" id="circle_name" value="{tmpl_var name='circle_name'}" class="form-control" /></div></div> |
| | |
| | | <td><a href="#" data-load-content="client/client_circle_edit.php?id={tmpl_var name='id'}">{tmpl_var name="circle_name"}</a></td> |
| | | <td><a href="#" data-load-content="client/client_circle_edit.php?id={tmpl_var name='id'}">{tmpl_var name="description"}</a></td> |
| | | <td class="text-right"> |
| | | <a class="btn btn-default formbutton-danger formbutton-narrow" href="javascript: ISPConfig.confirm_action('client/client_circle_del.php?id={tmpl_var name='id'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name='delete_confirmation'}');"><span class="icon icon-delete"></span></button> |
| | | <a class="btn btn-default formbutton-danger formbutton-narrow" href="javascript: ISPConfig.confirm_action('client/client_circle_del.php?id={tmpl_var name='id'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name='delete_confirmation'}');"><span class="icon icon-delete"></span></a> |
| | | </td> |
| | | </tr> |
| | | </tmpl_loop> |
| | |
| | | <label for="fax" class="col-sm-3 control-label">{tmpl_var name='fax_txt'}</label> |
| | | <div class="col-sm-9"><input type="text" name="fax" id="fax" value="{tmpl_var name='fax'}" class="form-control" /></div></div> |
| | | <div class="form-group"> |
| | | <label for="email" class="col-sm-3 control-label">{tmpl_var name='email_txt'}</label> |
| | | <label for="email" class="col-sm-3 control-label">{tmpl_var name='email_txt'}*</label> |
| | | <div class="col-sm-9"><input type="text" name="email" id="email" value="{tmpl_var name='email'}" class="form-control" /></div></div> |
| | | <div class="form-group"> |
| | | <label for="internet" class="col-sm-3 control-label">{tmpl_var name='internet_txt'}</label> |
| | |
| | | <div class="clear"><div class="right"> |
| | | <button class="btn btn-default formbutton-success" type="button" value="{tmpl_var name='btn_save_txt'}" data-submit-form="pageForm" data-form-action="client/client_edit.php">{tmpl_var name='btn_save_txt'}</button> |
| | | <button class="btn btn-default formbutton-default" type="button" value="{tmpl_var name='btn_cancel_txt'}" data-load-content="client/client_list.php">{tmpl_var name='btn_cancel_txt'}</button> |
| | | </div></div> |
| | | </div></div> |
| | |
| | | <tmpl_if name="list_head_txt"> |
| | | <div class='page-header'> |
| | | <h1><tmpl_var name="list_head_txt"></h1> |
| | | </div> |
| | | <p><tmpl_var name="list_desc_txt"></p> |
| | | </tmpl_if> |
| | | <tmpl_if name="list_desc_txt"><p><tmpl_var name="list_desc_txt"></p></tmpl_if> |
| | | |
| | | <div class="panel panel_client"> |
| | | |
| | | <div class="pnl_toolsarea"> |
| | | <p class="fieldset-legend">{tmpl_var name="toolsarea_head_txt"}</p> |
| | | <div class="buttons topbuttons"> |
| | | <button class="btn btn-default formbutton-success" type="button" value="{tmpl_var name='add_additional_template_txt'}" onclick="ISPConfig.addAdditionalTemplate();">{tmpl_var name='add_additional_template_txt'}</button> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | <div class="pnl_formsarea"> |
| | | <legend>Limits</legend> |
| | | |
| | | <div class="pnl_formsarea"> |
| | | <fieldset class="inlineLabels"><legend>Limits</legend> |
| | | <div class="form-group"> |
| | | <label for="template_master" class="col-sm-3 control-label">{tmpl_var name='template_master_txt'}</label> |
| | | <div class="col-sm-9"><select name="template_master" id="template_master" class="form-control"> |
| | |
| | | {tmpl_var name='tpl_add_select'} |
| | | </select></div> |
| | | </div> |
| | | <div class="clear"><div class="right"> |
| | | <button class="btn btn-default formbutton-success" type="button" onclick="ISPConfig.addAdditionalTemplate();">{tmpl_var name="add_additional_template_txt"}</button> |
| | | </div></div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">{tmpl_var name='active_template_additional_txt'}</label> |
| | | <div id="template_additional_list" class="multiField"> |
| | | <div id="template_additional_list" class="col-sm-9 col-text"> |
| | | <ul> |
| | | {tmpl_var name='template_additional_list'} |
| | | </ul> |
| | |
| | | <label for="limit_spamfilter_policy" class="col-sm-3 control-label">{tmpl_var name='limit_spamfilter_policy_txt'}</label> |
| | | <div class="col-sm-9"><input type="text" name="limit_spamfilter_policy" id="limit_spamfilter_policy" value="{tmpl_var name='limit_spamfilter_policy'}" class="form-control" /></div></div> |
| | | </div> |
| | | <div class="col-sm-3"></div><div class="col-sm-9"><button class="btn btn-default formbutton-default" type="button" data-toggle="collapse" data-target="#toggle-xmpp_limits" aria-expanded="false" aria-controls="toggle-xmpp_limits">{tmpl_var name='xmpp_limits_txt'}</button></div> |
| | | <div id="toggle-xmpp_limits" class="collapse"> |
| | | <div class="form-group"> |
| | | <label for="xmpp_servers" class="col-sm-3 control-label">{tmpl_var name='xmpp_servers_txt'}</label> |
| | | <div class="col-sm-9"><select data-placeholder="{tmpl_var name='xmpp_servers_placeholder'}" multiple name="xmpp_servers[]" id="xmpp_servers" class="form-control"> |
| | | {tmpl_var name='xmpp_servers'} |
| | | </select></div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label for="limit_xmpp_domain" class="col-sm-3 control-label">{tmpl_var name='limit_xmpp_domain_txt'}</label> |
| | | <div class="col-sm-9"><input type="text" name="limit_xmpp_domain" id="limit_xmpp_domain" value="{tmpl_var name='limit_xmpp_domain'}" class="form-control" /></div></div> |
| | | <div class="form-group"> |
| | | <label for="limit_xmpp_user" class="col-sm-3 control-label">{tmpl_var name='limit_xmpp_user_txt'}</label> |
| | | <div class="col-sm-9"><input type="text" name="limit_xmpp_user" id="limit_xmpp_user" value="{tmpl_var name='limit_xmpp_user'}" class="form-control" /></div></div> |
| | | <!--<div class="form-group"> |
| | | <label class="col-sm-3 control-label">{tmpl_var name='xmpp_auth_options_txt'}</label> |
| | | <div class="col-sm-9"> |
| | | {tmpl_var name='xmpp_auth_options'} |
| | | </div> |
| | | </div>--> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">{tmpl_var name='limit_xmpp_muc_txt'}</label> |
| | | <div class="col-sm-9"> |
| | | {tmpl_var name='limit_xmpp_muc'} |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">{tmpl_var name='limit_xmpp_pastebin_txt'}</label> |
| | | <div class="col-sm-9"> |
| | | {tmpl_var name='limit_xmpp_pastebin'} |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">{tmpl_var name='limit_xmpp_httparchive_txt'}</label> |
| | | <div class="col-sm-9"> |
| | | {tmpl_var name='limit_xmpp_httparchive'} |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">{tmpl_var name='limit_xmpp_anon_txt'}</label> |
| | | <div class="col-sm-9"> |
| | | {tmpl_var name='limit_xmpp_anon'} |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">{tmpl_var name='limit_xmpp_vjud_txt'}</label> |
| | | <div class="col-sm-9"> |
| | | {tmpl_var name='limit_xmpp_vjud'} |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">{tmpl_var name='limit_xmpp_proxy_txt'}</label> |
| | | <div class="col-sm-9"> |
| | | {tmpl_var name='limit_xmpp_proxy'} |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">{tmpl_var name='limit_xmpp_status_txt'}</label> |
| | | <div class="col-sm-9"> |
| | | {tmpl_var name='limit_xmpp_status'} |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | <div class="col-sm-3"></div><div class="col-sm-9"><button class="btn btn-default formbutton-default" type="button" data-toggle="collapse" data-target="#toggle-database_limits" aria-expanded="false" aria-controls="toggle-database_limits">{tmpl_var name='database_limits_txt'}</button></div> |
| | | <div id="toggle-database_limits" class="collapse"> |
| | | <div class="form-group"> |
| | |
| | | <div id="OKMsg"><p><tmpl_var name="okmsg"></p></div> |
| | | </tmpl_if> |
| | | <tmpl_if name="error"> |
| | | <div id="errorMsg"><h3>ERROR</h3><ol><tmpl_var name="error"></ol></div> |
| | | <div id="errorMsg"><h3><tmpl_var name="error_txt"></h3><ol><tmpl_var name="error"></ol></div> |
| | | </tmpl_if> |
| | | <div class="form-group"> |
| | | <label for="sender" class="col-sm-3 control-label">{tmpl_var name='sender_txt'}</label> |
| | |
| | | <td><a href="#" data-load-content="client/message_template_edit.php?id={tmpl_var name='id'}">{tmpl_var name="template_name"}</a></td> |
| | | <td class="text-right"> |
| | | <div class="buttons icons16"> |
| | | <a class="btn btn-default formbutton-danger formbutton-narrow" href="javascript: ISPConfig.confirm_action('client/message_template_del.php?id={tmpl_var name='id'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name='delete_confirmation'}');"><span class="icon icon-delete"></span></button> |
| | | <a class="btn btn-default formbutton-danger formbutton-narrow" href="javascript: ISPConfig.confirm_action('client/message_template_del.php?id={tmpl_var name='id'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name='delete_confirmation'}');"><span class="icon icon-delete"></span></a> |
| | | </div> |
| | | </td> |
| | | </tr> |
| | |
| | | <label for="limit_spamfilter_policy" class="col-sm-3 control-label">{tmpl_var name='limit_spamfilter_policy_txt'}</label> |
| | | <div class="col-sm-9"><input type="text" name="limit_spamfilter_policy" id="limit_spamfilter_policy" value="{tmpl_var name='limit_spamfilter_policy'}" class="form-control" /></div></div> |
| | | </div> |
| | | |
| | | <div class="col-sm-3"></div><div class="col-sm-9"><button class="btn btn-default formbutton-default" type="button" data-toggle="collapse" data-target="#toggle-xmpp_limits" aria-expanded="false" aria-controls="toggle-xmpp_limits">{tmpl_var name='xmpp_limits_txt'}</button></div> |
| | | <div id="toggle-xmpp_limits" class="collapse"> |
| | | <div class="form-group"> |
| | | <label for="xmpp_servers" class="col-sm-3 control-label">{tmpl_var name='xmpp_servers_txt'}</label> |
| | | <div class="col-sm-9"><select data-placeholder="{tmpl_var name='xmpp_servers_placeholder'}" multiple name="xmpp_servers[]" id="xmpp_servers" class="form-control"> |
| | | {tmpl_var name='xmpp_servers'} |
| | | </select></div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label for="limit_xmpp_domain" class="col-sm-3 control-label">{tmpl_var name='limit_xmpp_domain_txt'}</label> |
| | | <div class="col-sm-9"><input type="text" name="limit_xmpp_domain" id="limit_xmpp_domain" value="{tmpl_var name='limit_xmpp_domain'}" class="form-control" /></div></div> |
| | | <div class="form-group"> |
| | | <label for="limit_xmpp_user" class="col-sm-3 control-label">{tmpl_var name='limit_xmpp_user_txt'}</label> |
| | | <div class="col-sm-9"><input type="text" name="limit_xmpp_user" id="limit_xmpp_user" value="{tmpl_var name='limit_xmpp_user'}" class="form-control" /></div></div> |
| | | <!--<div class="form-group"> |
| | | <label class="col-sm-3 control-label">{tmpl_var name='xmpp_auth_options_txt'}</label> |
| | | <div class="col-sm-9"> |
| | | {tmpl_var name='xmpp_auth_options'} |
| | | </div> |
| | | </div>--> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">{tmpl_var name='limit_xmpp_muc_txt'}</label> |
| | | <div class="col-sm-9"> |
| | | {tmpl_var name='limit_xmpp_muc'} |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">{tmpl_var name='limit_xmpp_pastebin_txt'}</label> |
| | | <div class="col-sm-9"> |
| | | {tmpl_var name='limit_xmpp_pastebin'} |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">{tmpl_var name='limit_xmpp_httparchive_txt'}</label> |
| | | <div class="col-sm-9"> |
| | | {tmpl_var name='limit_xmpp_httparchive'} |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">{tmpl_var name='limit_xmpp_anon_txt'}</label> |
| | | <div class="col-sm-9"> |
| | | {tmpl_var name='limit_xmpp_anon'} |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">{tmpl_var name='limit_xmpp_vjud_txt'}</label> |
| | | <div class="col-sm-9"> |
| | | {tmpl_var name='limit_xmpp_vjud'} |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">{tmpl_var name='limit_xmpp_proxy_txt'}</label> |
| | | <div class="col-sm-9"> |
| | | {tmpl_var name='limit_xmpp_proxy'} |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">{tmpl_var name='limit_xmpp_status_txt'}</label> |
| | | <div class="col-sm-9"> |
| | | {tmpl_var name='limit_xmpp_status'} |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | <div class="col-sm-3"></div><div class="col-sm-9"><button class="btn btn-default formbutton-default" type="button" data-toggle="collapse" data-target="#toggle-database_limits" aria-expanded="false" aria-controls="toggle-database_limits">{tmpl_var name='database_limits_txt'}</button></div> |
| | | <div id="toggle-database_limits" class="collapse"> |
| | | <div class="form-group"> |
| | |
| | | <tmpl_if name="list_head_txt"> |
| | | <div class='page-header'> |
| | | <h1><tmpl_var name="list_head_txt"></h1> |
| | | </div> |
| | | <p><tmpl_var name="list_desc_txt"></p> |
| | | </tmpl_if> |
| | | <tmpl_if name="list_desc_txt"><p><tmpl_var name="list_desc_txt"></p></tmpl_if> |
| | | |
| | | |
| | | <legend>Template</legend> |
| | |
| | | <td><a href="#" data-load-content="client/client_template_edit.php?id={tmpl_var name='id'}">{tmpl_var name="template_type"}</a></td> |
| | | <td><a href="#" data-load-content="client/client_template_edit.php?id={tmpl_var name='id'}">{tmpl_var name="template_name"}</a></td> |
| | | <td class="text-right"> |
| | | <a class="btn btn-default formbutton-danger formbutton-narrow" href="javascript: ISPConfig.confirm_action('client/client_template_del.php?id={tmpl_var name='id'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name='delete_confirmation'}');"><span class="icon icon-delete"></span></button> |
| | | <a class="btn btn-default formbutton-danger formbutton-narrow" href="javascript: ISPConfig.confirm_action('client/client_template_del.php?id={tmpl_var name='id'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name='delete_confirmation'}');"><span class="icon icon-delete"></span></a> |
| | | </td> |
| | | </tr> |
| | | </tmpl_loop> |
| | |
| | | <td><a href="#" data-load-content="client/client_edit.php?id={tmpl_var name='id'}"><span class="flags flag-{tmpl_var name="countryiso"}">{tmpl_var name="country"}</span></a></td> |
| | | <td class="text-right"> |
| | | <tmpl_if name="is_admin"> |
| | | <a class="btn btn-default formbutton-success formbutton-narrow" data-load-content="login/login_as.php?cid={tmpl_var name='id'}"><span class="icon icon-loginas"></span></button> |
| | | <a class="btn btn-default formbutton-success formbutton-narrow" data-load-content="login/login_as.php?cid={tmpl_var name='id'}"><span class="icon icon-loginas"></span></a> |
| | | <tmpl_elseif name="is_reseller"> |
| | | <a class="btn btn-default formbutton-success formbutton-narrow" data-load-content="login/login_as.php?cid={tmpl_var name='id'}"><span class="icon icon-loginas"></span></button> |
| | | <a class="btn btn-default formbutton-success formbutton-narrow" data-load-content="login/login_as.php?cid={tmpl_var name='id'}"><span class="icon icon-loginas"></span></a> |
| | | </tmpl_if> |
| | | <a class="btn btn-default formbutton-danger formbutton-narrow" href="javascript: ISPConfig.confirm_action('client/client_del.php?id={tmpl_var name='id'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name='delete_confirmation'}');"><span class="icon icon-delete"></span></button> |
| | | <a class="btn btn-default formbutton-danger formbutton-narrow" href="javascript: ISPConfig.confirm_action('client/client_del.php?id={tmpl_var name='id'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name='delete_confirmation'}');"><span class="icon icon-delete"></span></a> |
| | | </td> |
| | | </tr> |
| | | </tmpl_loop> |
| | |
| | | <td><a href="#" data-load-content="client/domain_edit.php?id={tmpl_var name='id'}">{tmpl_var name="domain"}</a></td> |
| | | <td><a href="#" data-load-content="client/domain_edit.php?id={tmpl_var name='id'}">{tmpl_var name="sys_groupid"}</a></td> |
| | | <td class="text-right"> |
| | | <a class="btn btn-default formbutton-danger formbutton-narrow" href="javascript: ISPConfig.confirm_action('client/domain_del.php?id={tmpl_var name='id'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name='delete_confirmation'}');"><span class="icon icon-delete"></span></button> |
| | | <a class="btn btn-default formbutton-danger formbutton-narrow" href="javascript: ISPConfig.confirm_action('client/domain_del.php?id={tmpl_var name='id'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name='delete_confirmation'}');"><span class="icon icon-delete"></span></a> |
| | | </td> |
| | | </tr> |
| | | </tmpl_loop> |
| | |
| | | <div class="col-sm-9"><input type="text" name="template_name" id="template_name" value="{tmpl_var name='template_name'}" class="form-control" /></div></div> |
| | | <div class="form-group"> |
| | | <label for="subject" class="col-sm-3 control-label">{tmpl_var name='subject_txt'}</label> |
| | | <div class="col-sm-9"><input type="text" name="subject" id="subject" value="{tmpl_var name='subject'}" class="form-control" /></div><br clear="all">{tmpl_var name='variables_txt'}: {tmpl_var name="message_variables"} <br />{tmpl_var name='variables_description_txt'} |
| | | <div class="col-sm-9"><input type="text" name="subject" id="subject" value="{tmpl_var name='subject'}" class="form-control" /></div> |
| | | <div class="col-sm-3 col-text"></div><div class="col-sm-9 col-text">{tmpl_var name='variables_txt'}: {tmpl_var name="message_variables"} <br />{tmpl_var name='variables_description_txt'}</div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label for="message" class="col-sm-3 control-label">{tmpl_var name='message_txt'}</label> |
| | | <div class="col-sm-9"><textarea class="form-control" name="message" id="message" rows='' cols=''>{tmpl_var name='message'}</textarea></div> |
| | | <br clear="all">{tmpl_var name='variables_txt'}: {tmpl_var name="message_variables"} <br />{tmpl_var name='variables_description_txt'} |
| | | <div class="col-sm-9"><textarea class="form-control" name="message" id="message" style="height:300px">{tmpl_var name='message'}</textarea></div> |
| | | <div class="col-sm-3 col-text"></div><div class="col-sm-9 col-text">{tmpl_var name='variables_txt'}: {tmpl_var name="message_variables"} <br />{tmpl_var name='variables_description_txt'}</div> |
| | | </div> |
| | | <div class="clear"><div class="right"> |
| | | <button class="btn btn-default formbutton-success" type="button" value="{tmpl_var name='btn_save_txt'}" data-submit-form="pageForm" data-form-action="client/message_template_edit.php">{tmpl_var name='btn_save_txt'}</button> |
| | |
| | | <td><a href="#" data-load-content="billing/invoice_message_template_edit.php?id={tmpl_var name='id'}">{tmpl_var name="template_name"}</a></td>
|
| | | <td class="text-right"> |
| | | <div class="buttons icons16"> |
| | | <a class="btn btn-default formbutton-danger formbutton-narrow" href="javascript: ISPConfig.confirm_action('billing/invoice_message_template_del.php?id={tmpl_var name='id'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name='delete_confirmation'}');"><span class="icon icon-delete"></span></button> |
| | | <a class="btn btn-default formbutton-danger formbutton-narrow" href="javascript: ISPConfig.confirm_action('billing/invoice_message_template_del.php?id={tmpl_var name='id'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name='delete_confirmation'}');"><span class="icon icon-delete"></span></a> |
| | | </div> |
| | | </td> |
| | | </tr> |
| | |
| | | <label for="fax" class="col-sm-3 control-label">{tmpl_var name='fax_txt'}</label> |
| | | <div class="col-sm-9"><input type="text" name="fax" id="fax" value="{tmpl_var name='fax'}" class="form-control" /></div></div> |
| | | <div class="form-group"> |
| | | <label for="email" class="col-sm-3 control-label">{tmpl_var name='email_txt'}</label> |
| | | <label for="email" class="col-sm-3 control-label">{tmpl_var name='email_txt'}*</label> |
| | | <div class="col-sm-9"><input type="text" name="email" id="email" value="{tmpl_var name='email'}" class="form-control" /></div></div> |
| | | <div class="form-group"> |
| | | <label for="internet" class="col-sm-3 control-label">{tmpl_var name='internet_txt'}</label> |
| | |
| | | <div class="clear"><div class="right"> |
| | | <button class="btn btn-default formbutton-success" type="button" value="{tmpl_var name='btn_save_txt'}" data-submit-form="pageForm" data-form-action="client/reseller_edit.php">{tmpl_var name='btn_save_txt'}</button> |
| | | <button class="btn btn-default formbutton-default" type="button" value="{tmpl_var name='btn_cancel_txt'}" data-load-content="client/reseller_list.php">{tmpl_var name='btn_cancel_txt'}</button> |
| | | </div></div> |
| | | </div></div> |
| | |
| | | <tmpl_if name="list_head_txt"> |
| | | <div class='page-header'> |
| | | <h1><tmpl_var name="list_head_txt"></h1> |
| | | </div> |
| | | <p><tmpl_var name="list_desc_txt"></p> |
| | | </tmpl_if> |
| | | <tmpl_if name="list_desc_txt"><p><tmpl_var name="list_desc_txt"></p></tmpl_if> |
| | | |
| | | <div class="panel panel_client"> |
| | | |
| | | <tmpl_if name="is_admin"> |
| | | <div class="pnl_toolsarea"> |
| | | <p class="fieldset-legend">{tmpl_var name="toolsarea_head_txt"}</p> |
| | | <div class="buttons topbuttons"> |
| | | <button class="btn btn-default formbutton-success" type="button" value="{tmpl_var name='add_additional_template_txt'}" onclick="ISPConfig.addAdditionalTemplate();">{tmpl_var name='add_additional_template_txt'}</button> |
| | | </div> |
| | | |
| | | </div> |
| | | </tmpl_if> |
| | | |
| | | <div class="pnl_formsarea"> |
| | | <legend>Limits</legend> |
| | |
| | | {tmpl_var name='tpl_add_select'} |
| | | </select></div> |
| | | </div> |
| | | <tmpl_if name="is_admin"> |
| | | <div class="clear"><div class="right"> |
| | | <button class="btn btn-default formbutton-success" type="button" onclick="ISPConfig.addAdditionalTemplate();">{tmpl_var name="add_additional_template_txt"}</button> |
| | | </div></div> |
| | | </tmpl_if> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">{tmpl_var name='active_template_additional_txt'}</label> |
| | | <div id="template_additional_list" class="multiField"> |
| | | <div id="template_additional_list" class="col-sm-9 col-text"> |
| | | <ul> |
| | | {tmpl_var name='template_additional_list'} |
| | | </ul> |
| | |
| | | <label for="limit_spamfilter_policy" class="col-sm-3 control-label">{tmpl_var name='limit_spamfilter_policy_txt'}</label> |
| | | <div class="col-sm-9"><input type="text" name="limit_spamfilter_policy" id="limit_spamfilter_policy" value="{tmpl_var name='limit_spamfilter_policy'}" class="form-control" /></div></div> |
| | | </div> |
| | | <div class="col-sm-3"></div><div class="col-sm-9"><button class="btn btn-default formbutton-default" type="button" data-toggle="collapse" data-target="#toggle-xmpp_limits" aria-expanded="false" aria-controls="toggle-xmpp_limits">{tmpl_var name='xmpp_limits_txt'}</button></div> |
| | | <div id="toggle-xmpp_limits" class="collapse"> |
| | | <div class="form-group"> |
| | | <label for="xmpp_servers" class="col-sm-3 control-label">{tmpl_var name='xmpp_servers_txt'}</label> |
| | | <div class="col-sm-9"><select data-placeholder="{tmpl_var name='xmpp_servers_placeholder'}" multiple name="xmpp_servers[]" id="xmpp_servers" class="form-control"> |
| | | {tmpl_var name='xmpp_servers'} |
| | | </select></div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label for="limit_xmpp_domain" class="col-sm-3 control-label">{tmpl_var name='limit_xmpp_domain_txt'}</label> |
| | | <div class="col-sm-9"><input type="text" name="limit_xmpp_domain" id="limit_xmpp_domain" value="{tmpl_var name='limit_xmpp_domain'}" class="form-control" /></div></div> |
| | | <div class="form-group"> |
| | | <label for="limit_xmpp_user" class="col-sm-3 control-label">{tmpl_var name='limit_xmpp_user_txt'}</label> |
| | | <div class="col-sm-9"><input type="text" name="limit_xmpp_user" id="limit_xmpp_user" value="{tmpl_var name='limit_xmpp_user'}" class="form-control" /></div></div> |
| | | <!--<div class="form-group"> |
| | | <label class="col-sm-3 control-label">{tmpl_var name='xmpp_auth_options_txt'}</label> |
| | | <div class="col-sm-9"> |
| | | {tmpl_var name='xmpp_auth_options'} |
| | | </div> |
| | | </div>--> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">{tmpl_var name='limit_xmpp_muc_txt'}</label> |
| | | <div class="col-sm-9"> |
| | | {tmpl_var name='limit_xmpp_muc'} |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">{tmpl_var name='limit_xmpp_pastebin_txt'}</label> |
| | | <div class="col-sm-9"> |
| | | {tmpl_var name='limit_xmpp_pastebin'} |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">{tmpl_var name='limit_xmpp_httparchive_txt'}</label> |
| | | <div class="col-sm-9"> |
| | | {tmpl_var name='limit_xmpp_httparchive'} |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">{tmpl_var name='limit_xmpp_anon_txt'}</label> |
| | | <div class="col-sm-9"> |
| | | {tmpl_var name='limit_xmpp_anon'} |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">{tmpl_var name='limit_xmpp_vjud_txt'}</label> |
| | | <div class="col-sm-9"> |
| | | {tmpl_var name='limit_xmpp_vjud'} |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">{tmpl_var name='limit_xmpp_proxy_txt'}</label> |
| | | <div class="col-sm-9"> |
| | | {tmpl_var name='limit_xmpp_proxy'} |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">{tmpl_var name='limit_xmpp_status_txt'}</label> |
| | | <div class="col-sm-9"> |
| | | {tmpl_var name='limit_xmpp_status'} |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | <div class="col-sm-3"></div><div class="col-sm-9"><button class="btn btn-default formbutton-default" type="button" data-toggle="collapse" data-target="#toggle-database_limits" aria-expanded="false" aria-controls="toggle-database_limits">{tmpl_var name='database_limits_txt'}</button></div> |
| | | <div id="toggle-database_limits" class="collapse"> |
| | | <div class="form-group"> |
| | |
| | | <td><a href="#" data-load-content="client/reseller_edit.php?id={tmpl_var name='id'}">{tmpl_var name="city"}</a></td> |
| | | <td><a href="#" data-load-content="client/reseller_edit.php?id={tmpl_var name='id'}"><span class="flags flag-{tmpl_var name="countryiso"}">{tmpl_var name="country"}</span></a></td> |
| | | <td class="text-right"> |
| | | <a class="btn btn-default formbutton-success formbutton-narrow" data-load-content="login/login_as.php?cid={tmpl_var name='id'}"><span class="icon icon-loginas"></span></button> |
| | | <a class="btn btn-default formbutton-danger formbutton-narrow" href="javascript: ISPConfig.confirm_action('client/reseller_del.php?id={tmpl_var name='id'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name='delete_confirmation'}');"><span class="icon icon-delete"></span></button> |
| | | <a class="btn btn-default formbutton-success formbutton-narrow" data-load-content="login/login_as.php?cid={tmpl_var name='id'}"><span class="icon icon-loginas"></span></a> |
| | | <a class="btn btn-default formbutton-danger formbutton-narrow" href="javascript: ISPConfig.confirm_action('client/reseller_del.php?id={tmpl_var name='id'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name='delete_confirmation'}');"><span class="icon icon-delete"></span></a> |
| | | </td> |
| | | </tr> |
| | | </tmpl_loop> |
| | |
| | | |
| | | //if($_SESSION["s"]["user"]["typ"] == 'admin') { |
| | | |
| | | |
| | | /* TODO: change sql queries */ |
| | | if($type == 'globalsearch'){ |
| | | $q = $app->db->quote(trim($_GET["q"])); |
| | | $authsql = " AND ".$app->tform->getAuthSQL('r'); |
| | |
| | | $result[] = _search('client', 'reseller', "AND limit_client != 0"); |
| | | |
| | | // web sites |
| | | $result[] = _search('sites', 'web_domain', "AND type = 'vhost'"); |
| | | $result[] = _search('sites', 'web_vhost_domain', "AND type = 'vhost'"); |
| | | |
| | | // subdomains |
| | | $result[] = _search('sites', 'web_subdomain', "AND type = 'subdomain'"); |
| | | $result[] = _search('sites', 'web_childdomain', "AND type = 'subdomain'", 'type=subdomain'); |
| | | |
| | | // web site aliases |
| | | $result[] = _search('sites', 'web_aliasdomain', "AND type = 'alias'"); |
| | | $result[] = _search('sites', 'web_childdomain', "AND type = 'alias'", 'type=aliasdomain'); |
| | | |
| | | // vhostsubdomains |
| | | $result[] = _search('sites', 'web_vhost_subdomain', "AND type = 'vhostsubdomain'"); |
| | | $result[] = _search('sites', 'web_vhost_domain', "AND type = 'vhostsubdomain'", 'type=subdomain'); |
| | | |
| | | // vhostaliasdomains |
| | | $result[] = _search('sites', 'web_vhost_aliasdomain', "AND type = 'vhostalias'"); |
| | | $result[] = _search('sites', 'web_vhost_domain', "AND type = 'vhostalias'", 'type=aliasdomain'); |
| | | |
| | | // FTP users |
| | | $result[] = _search('sites', 'ftp_user'); |
| | |
| | | $result[] = _search('sites', 'shell_user'); |
| | | |
| | | // databases |
| | | /* |
| | | $result_databases = array('cheader' => array(), 'cdata' => array()); |
| | | if(in_array('sites', $modules)){ |
| | | $sql = "SELECT * FROM web_database WHERE database_name LIKE '%".$q."%' OR database_user LIKE '%".$q."%' OR remote_ips LIKE '%".$q."%'".$authsql." ORDER BY database_name"; |
| | | $results = $app->db->queryAllRecords($sql); |
| | | |
| | | if(is_array($results) && !empty($results)){ |
| | | $result_databases['cheader'] = array('title' => 'Databases', |
| | | 'total' => count($results), |
| | | 'limit' => count($results) |
| | | ); |
| | | foreach($results as $result){ |
| | | $description = 'Database User: '.$result['database_user'].' - Remote IPs: '.$result['remote_ips']; |
| | | $result_databases['cdata'][] = array('title' => $result['database_name'], |
| | | 'description' => $description, |
| | | 'onclick' => 'ISPConfig.capp(\'sites\',\'sites/database_edit.php?id='.$result['database_id'].'\');', |
| | | 'fill_text' => strtolower($result['database_name']) |
| | | ); |
| | | } |
| | | } |
| | | } |
| | | */ |
| | | $result[] = _search('sites', 'database'); |
| | | |
| | | // database users |
| | |
| | | |
| | | //} |
| | | |
| | | function _search($module, $section, $additional_sql = ''){ |
| | | function _search($module, $section, $additional_sql = '', $params = ''){ |
| | | global $app, $q, $authsql, $modules; |
| | | |
| | | $result_array = array('cheader' => array(), 'cdata' => array()); |
| | |
| | | $search_fields = array(); |
| | | $desc_fields = array(); |
| | | if(is_file('../'.$module.'/form/'.$section.'.tform.php')){ |
| | | include_once '../'.$module.'/form/'.$section.'.tform.php'; |
| | | include '../'.$module.'/form/'.$section.'.tform.php'; |
| | | |
| | | $category_title = $form["title"]; |
| | | if($params == 'type=subdomain' && $section == 'web_childdomain') $category_title = 'Subdomain'; |
| | | if($params == 'type=aliasdomain' && $section == 'web_childdomain') $category_title = 'Aliasdomain'; |
| | | if($params == 'type=subdomain' && $section == 'web_vhost_domain') $category_title = 'Subdomain (Vhost)'; |
| | | if($params == 'type=aliasdomain' && $section == 'web_vhost_domain') $category_title = 'Aliasdomain (Vhost)'; |
| | | $form_file = $form["action"]; |
| | | $db_table = $form["db_table"]; |
| | | $db_table_idx = $form["db_table_idx"]; |
| | |
| | | $order_clause = ''; |
| | | if($order_by != '') $order_clause = ' ORDER BY '.$order_by; |
| | | |
| | | $sql = "SELECT * FROM ".$db_table." WHERE ".$where_clause.$authsql.$order_clause." LIMIT 0,10"; |
| | | $results = $app->db->queryAllRecords($sql); |
| | | $sql = "SELECT * FROM ?? WHERE ".$where_clause.$authsql.$order_clause." LIMIT 0,10"; |
| | | $results = $app->db->queryAllRecords($sql, $db_table); |
| | | |
| | | if(is_array($results) && !empty($results)){ |
| | | $lng_file = '../'.$module.'/lib/lang/'.$_SESSION['s']['language'].'_'.$section.'.lng'; |
| | |
| | | |
| | | $result_array['cdata'][] = array('title' => $wb[$title_key.'_txt'].': '.$result[$title_key], |
| | | 'description' => $description, |
| | | 'onclick' => "ISPConfig.capp('".$module."','".$module."/".$form_file."?id=".$result[$db_table_idx]."');", |
| | | 'onclick' => "ISPConfig.capp('".$module."','".$module."/".$form_file.urlencode("?id=".$result[$db_table_idx]).($params != ''? urlencode('&'.$params) : '')."');", |
| | | 'fill_text' => strtolower($result[$title_key]) |
| | | ); |
| | | } |
| | |
| | | if($_SESSION['s']['user']['typ'] == 'admin') { |
| | | $name = $_SESSION['s']['user']['username']; |
| | | } else { |
| | | $tmp = $app->db->queryOneRecord("SELECT contact_name FROM client WHERE username = '".$app->db->quote($_SESSION['s']['user']['username'])."'"); |
| | | $tmp = $app->db->queryOneRecord("SELECT contact_name FROM client WHERE username = ?", $_SESSION['s']['user']['username']); |
| | | $name = $tmp['contact_name']; |
| | | } |
| | | |
| | |
| | | $dashlet_list = array(); |
| | | $handle = @opendir(ISPC_WEB_PATH.'/dashboard/dashlets'); |
| | | while ($file = @readdir($handle)) { |
| | | if ($file != '.' && $file != '..' && !is_dir($file)) { |
| | | if ($file != '.' && $file != '..' && !is_dir(ISPC_WEB_PATH.'/dashboard/dashlets/'.$file)) { |
| | | $dashlet_name = substr($file, 0, -4); |
| | | $dashlet_class = 'dashlet_'.$dashlet_name; |
| | | include_once ISPC_WEB_PATH.'/dashboard/dashlets/'.$file; |
| | |
| | | |
| | | if($user_is_admin == false) { |
| | | $client_group_id = $app->functions->intval($_SESSION["s"]["user"]["default_group"]); |
| | | $client = $app->db->queryOneRecord("SELECT * FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); |
| | | $client = $app->db->queryOneRecord("SELECT * FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id); |
| | | } |
| | | |
| | | $rows = array(); |
| | |
| | | function _get_limit_usage($limit) { |
| | | global $app; |
| | | |
| | | $sql = "SELECT count(sys_userid) as number FROM ".$app->db->quote($limit['db_table'])." WHERE "; |
| | | $sql = "SELECT count(sys_userid) as number FROM ?? WHERE "; |
| | | if($limit['db_where'] != '') $sql .= $limit['db_where']." AND "; |
| | | $sql .= $app->tform->getAuthSQL('r'); |
| | | $rec = $app->db->queryOneRecord($sql); |
| | | $rec = $app->db->queryOneRecord($sql, $limit['db_table']); |
| | | return $rec['number']; |
| | | |
| | | } |
| | |
| | | include_once '../' . $mt.'/lib/module.conf.php'; |
| | | /* We don't want to show the dashboard */ |
| | | if ($mt != 'dashboard') { |
| | | if($mt == 'dns'){ |
| | | $dns_servers = $app->db->queryOneRecord("SELECT COUNT(*) as cnt FROM server WHERE dns_server = 1 AND active = 1"); |
| | | if($dns_servers['cnt'] == 0) continue; |
| | | } |
| | | if($mt == 'mail'){ |
| | | $mail_servers = $app->db->queryOneRecord("SELECT COUNT(*) as cnt FROM server WHERE mail_server = 1 AND active = 1"); |
| | | if($mail_servers['cnt'] == 0) continue; |
| | | } |
| | | if($mt == 'sites'){ |
| | | $web_servers = $app->db->queryOneRecord("SELECT COUNT(*) as cnt FROM server WHERE web_server = 1 AND active = 1"); |
| | | if($web_servers['cnt'] == 0) continue; |
| | | } |
| | | |
| | | $module_title = $app->lng($module['title']); |
| | | if(function_exists('mb_strlen')) { |
| | | if(mb_strlen($module_title, "UTF-8") > 8) $module_title = mb_substr($module_title, 0, 7, "UTF-8").'..'; |
| | | } else { |
| | | if(strlen($module_title) > 8) $module_title = substr($module_title, 0, 7).'..'; |
| | | } |
| | | $mod[] = array( 'modules_title' => $module_title, |
| | | $mod[$module['order']] = array( 'modules_title' => $module_title, |
| | | 'modules_startpage' => $module['startpage'], |
| | | 'modules_name' => $module['name']); |
| | | } |
| | | } |
| | | } |
| | | |
| | | ksort($mod); |
| | | $tpl->setloop('modules', $mod); |
| | | } |
| | | |
| | |
| | | <div class='title'>{tmpl_var name='modules_title'}</div> |
| | | </div> |
| | | </div> |
| | | <div class='btn btn-default button'> |
| | | <a href='#' data-capp='{tmpl_var name="modules_name"}'>Go to {tmpl_var name='modules_title'}</a> |
| | | </div> |
| | | <a href='#' class='btn btn-default button' data-capp='{tmpl_var name="modules_name"}'>Go to {tmpl_var name='modules_title'}</a> |
| | | </li> |
| | | </tmpl_loop> |
| | | </ul> |
| | |
| | | $rows[] = array('title' => $item->get_title(), |
| | | 'link' => $item->get_link(), |
| | | 'content' => $item->get_content(), |
| | | 'date' => $item->get_date('Y-m-d') |
| | | 'date' => $item->get_date($app->lng('conf_format_dateshort')) |
| | | ); |
| | | } |
| | | $n++; |
| | |
| | | $module['template'] = 'dashboard.tpl.htm'; |
| | | $module['startpage'] = 'dashboard/dashboard.php'; |
| | | $module['tab_width'] = ''; |
| | | $module['order'] = '1'; |
| | | |
| | | //$items = array(); |
| | | // |
| | |
| | | //* Check permissions for module |
| | | $app->auth->check_module_permissions('dns'); |
| | | |
| | | //$app->uses('tform'); |
| | | |
| | | $type = $_GET["type"]; |
| | | |
| | | //if($_SESSION["s"]["user"]["typ"] == 'admin') { |
| | | |
| | | |
| | | if($type == 'get_ipv4'){ |
| | | //$q = $app->db->quote(trim($_GET["q"])); |
| | | //$authsql = " AND ".$app->tform->getAuthSQL('r'); |
| | | //$modules = explode(',', $_SESSION['s']['user']['modules']); |
| | | |
| | | $result = array(); |
| | | |
| | | // ipv4 |
| | | //$result[] = _search('admin', 'server_ip', "AND ip_type = 'IPv4' AND (client_id = 0 OR client_id=".$app->functions->intval($_SESSION['s']['user']['client_id']).")"); |
| | | $result[] = $app->functions->suggest_ips('IPv4'); |
| | | |
| | | $json = $app->functions->json_encode($result); |
| | | } |
| | | |
| | | if($type == 'get_ipv6'){ |
| | | //$q = $app->db->quote(trim($_GET["q"])); |
| | | //$authsql = " AND ".$app->tform->getAuthSQL('r'); |
| | | //$modules = explode(',', $_SESSION['s']['user']['modules']); |
| | | |
| | | $result = array(); |
| | | |
| | | // ipv6 |
| | | //$result[] = _search('admin', 'server_ip', "AND ip_type = 'IPv6' AND (client_id = 0 OR client_id=".$app->functions->intval($_SESSION['s']['user']['client_id']).")"); |
| | | $result[] = $app->functions->suggest_ips('IPv6'); |
| | | |
| | | $json = $app->functions->json_encode($result); |
| | | } |
| | | |
| | | //} |
| | | |
| | | /* |
| | | function _search($module, $section, $additional_sql = '', $unique = false){ |
| | | global $app, $q, $authsql, $modules; |
| | | |
| | | $result_array = array('cheader' => array(), 'cdata' => array()); |
| | | if(in_array($module, $modules) || ($module == 'admin' && $section == 'server_ip')){ |
| | | $search_fields = array(); |
| | | $desc_fields = array(); |
| | | if(is_file('../'.$module.'/form/'.$section.'.tform.php')){ |
| | | include_once('../'.$module.'/form/'.$section.'.tform.php'); |
| | | |
| | | $category_title = $form["title"]; |
| | | $form_file = $form["action"]; |
| | | $db_table = $form["db_table"]; |
| | | $db_table_idx = $form["db_table_idx"]; |
| | | $order_by = $db_table_idx; |
| | | |
| | | if(is_array($form["tabs"]) && !empty($form["tabs"])){ |
| | | foreach($form["tabs"] as $tab){ |
| | | if(is_array($tab['fields']) && !empty($tab['fields'])){ |
| | | foreach($tab['fields'] as $key => $val){ |
| | | if(isset($val['searchable']) && $val['searchable'] > 0){ |
| | | $search_fields[] = $key." LIKE '%".$q."%'"; |
| | | if($val['searchable'] == 1){ |
| | | $order_by = $key; |
| | | $title_key = $key; |
| | | } |
| | | if($val['searchable'] == 2){ |
| | | $desc_fields[] = $key; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | unset($form); |
| | | |
| | | $where_clause = ''; |
| | | if(!empty($search_fields)){ |
| | | $where_clause = implode(' OR ', $search_fields); |
| | | } else { |
| | | // valid SQL query which returns an empty result set |
| | | $where_clause = '1 = 0'; |
| | | } |
| | | if($where_clause != '') $where_clause = '('.$where_clause.')'; |
| | | if($additional_sql != '') $where_clause .= ' '.$additional_sql.' '; |
| | | $order_clause = ''; |
| | | if($order_by != '') $order_clause = ' ORDER BY '.$order_by; |
| | | |
| | | $sql = "SELECT * FROM ".$db_table." WHERE ".$where_clause.$authsql.$order_clause." LIMIT 0,10"; |
| | | $results = $app->db->queryAllRecords($sql); |
| | | |
| | | if(is_array($results) && !empty($results)){ |
| | | $lng_file = '../'.$module.'/lib/lang/'.$_SESSION['s']['language'].'_'.$section.'.lng'; |
| | | if(is_file($lng_file)) include($lng_file); |
| | | $result_array['cheader'] = array('title' => $category_title, |
| | | 'total' => count($results), |
| | | 'limit' => count($results) |
| | | ); |
| | | foreach($results as $result){ |
| | | $description = ''; |
| | | if(!empty($desc_fields)){ |
| | | $desc_items = array(); |
| | | foreach($desc_fields as $desc_field){ |
| | | if($result[$desc_field] != '') $desc_items[] = $wb[$desc_field.'_txt'].': '.$result[$desc_field]; |
| | | } |
| | | if(!empty($desc_items)) $description = implode(' - ', $desc_items); |
| | | } |
| | | |
| | | $result_array['cdata'][] = array( 'title' => $wb[$title_key.'_txt'].': '.$result[$title_key], |
| | | 'description' => $description, |
| | | 'onclick' => '', |
| | | 'fill_text' => $result[$title_key] |
| | | ); |
| | | } |
| | | if($unique === true){ |
| | | $result_array['cdata'] = array_unique($result_array['cdata']); |
| | | $result_array['cheader']['total'] = $result_array['cheader']['limit'] = count($result_array['cdata']); |
| | | } |
| | | } |
| | | } |
| | | return $result_array; |
| | | } |
| | | */ |
| | | |
| | | header('Content-type: application/json'); |
| | | echo $json; |
| | |
| | | |
| | | require_once '../../lib/config.inc.php'; |
| | | require_once '../../lib/app.inc.php'; |
| | | |
| | | //* Check permissions for module |
| | | $app->auth->check_module_permissions('dns'); |
| | | require_once './dns_edit_base.php'; |
| | | |
| | | // Loading classes |
| | | $app->uses('tpl,tform,tform_actions,validate_dns'); |
| | | $app->load('tform_actions'); |
| | | class page_action extends dns_page_action { |
| | | |
| | | class page_action extends tform_actions { |
| | | |
| | | function onShowNew() { |
| | | global $app, $conf; |
| | | |
| | | // we will check only users, not admins |
| | | if($_SESSION["s"]["user"]["typ"] == 'user') { |
| | | |
| | | // Get the limits of the client |
| | | $client_group_id = intval($_SESSION["s"]["user"]["default_group"]); |
| | | $client = $app->db->queryOneRecord("SELECT limit_dns_record 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 mailbox. |
| | | if($client["limit_dns_record"] >= 0) { |
| | | $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id"); |
| | | if($tmp["number"] >= $client["limit_dns_record"]) { |
| | | $app->error($app->tform->wordbook["limit_dns_record_txt"]); |
| | | } |
| | | } |
| | | } |
| | | |
| | | parent::onShowNew(); |
| | | } |
| | | |
| | | function onSubmit() { |
| | | global $app, $conf; |
| | | |
| | | // Get the parent soa record of the domain |
| | | $soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = '".$app->functions->intval($_POST["zone"])."' AND ".$app->tform->getAuthSQL('r')); |
| | | |
| | | // Check if Domain belongs to user |
| | | if($soa["id"] != $_POST["zone"]) $app->tform->errorMessage .= $app->tform->wordbook["no_zone_perm"]; |
| | | |
| | | // 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 = intval($_SESSION["s"]["user"]["default_group"]); |
| | | $client = $app->db->queryOneRecord("SELECT limit_dns_record 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 mailbox. |
| | | if($this->id == 0 && $client["limit_dns_record"] >= 0) { |
| | | $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id"); |
| | | if($tmp["number"] >= $client["limit_dns_record"]) { |
| | | $app->error($app->tform->wordbook["limit_dns_record_txt"]); |
| | | } |
| | | } |
| | | } // end if user is not admin |
| | | |
| | | protected function checkDuplicate() { |
| | | global $app; |
| | | //* Check for duplicates where IP and hostname are the same |
| | | $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE (type = 'A' AND name = '".$app->db->quote($this->dataRecord["name"])."' AND zone = '".$app->db->quote($this->dataRecord["zone"])."' and data = '".$app->db->quote($this->dataRecord["data"])."' and id != ".$this->id.") OR (type = 'CNAME' AND name = '".$app->db->quote($this->dataRecord["name"])."' AND zone = '".$app->db->quote($this->dataRecord["zone"])."' and id != ".$this->id.")"); |
| | | if($tmp['number'] > 0) $app->tform->errorMessage .= $app->tform->lng("data_error_duplicate")."<br>"; |
| | | unset($tmp); |
| | | |
| | | |
| | | // Set the server ID of the rr record to the same server ID as the parent record. |
| | | $this->dataRecord["server_id"] = $soa["server_id"]; |
| | | |
| | | // Update the serial number and timestamp of the RR record |
| | | $soa = $app->db->queryOneRecord("SELECT serial FROM dns_rr WHERE id = ".$this->id); |
| | | $this->dataRecord["serial"] = $app->validate_dns->increase_serial($soa["serial"]); |
| | | $this->dataRecord["stamp"] = date('Y-m-d H:i:s'); |
| | | |
| | | parent::onSubmit(); |
| | | $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE (type = 'A' AND name = ? AND zone = ? and data = ? and id != ?) OR (type = 'CNAME' AND name = ? AND zone = ? and id != ?)", $this->dataRecord["name"], $this->dataRecord["zone"], $this->dataRecord["data"], $this->id, $this->dataRecord["name"], $this->dataRecord["zone"], $this->id); |
| | | if($tmp['number'] > 0) return true; |
| | | return false; |
| | | } |
| | | |
| | | function onAfterInsert() { |
| | | global $app, $conf; |
| | | |
| | | //* Set the sys_groupid of the rr record to be the same then the sys_groupid of the soa record |
| | | $soa = $app->db->queryOneRecord("SELECT sys_groupid,serial FROM dns_soa WHERE id = '".$app->functions->intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r')); |
| | | $app->db->datalogUpdate('dns_rr', "sys_groupid = ".$soa['sys_groupid'], 'id', $this->id); |
| | | |
| | | //* Update the serial number of the SOA record |
| | | $soa_id = $app->functions->intval($_POST["zone"]); |
| | | $serial = $app->validate_dns->increase_serial($soa["serial"]); |
| | | $app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id); |
| | | } |
| | | |
| | | function onAfterUpdate() { |
| | | global $app, $conf; |
| | | |
| | | //* Update the serial number of the SOA record |
| | | $soa = $app->db->queryOneRecord("SELECT serial FROM dns_soa WHERE id = '".$app->functions->intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r')); |
| | | $soa_id = $app->functions->intval($_POST["zone"]); |
| | | $serial = $app->validate_dns->increase_serial($soa["serial"]); |
| | | $app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id); |
| | | } |
| | | |
| | | } |
| | | |
| | | $page = new page_action; |
| | |
| | | |
| | | require_once '../../lib/config.inc.php'; |
| | | require_once '../../lib/app.inc.php'; |
| | | |
| | | //* Check permissions for module |
| | | $app->auth->check_module_permissions('dns'); |
| | | require_once './dns_edit_base.php'; |
| | | |
| | | // Loading classes |
| | | $app->uses('tpl,tform,tform_actions,validate_dns'); |
| | | $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') { |
| | | |
| | | // Get the limits of the client |
| | | $client_group_id = $_SESSION["s"]["user"]["default_group"]; |
| | | $client = $app->db->queryOneRecord("SELECT limit_dns_record 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 mailbox. |
| | | if($client["limit_dns_record"] >= 0) { |
| | | $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id"); |
| | | if($tmp["number"] >= $client["limit_dns_record"]) { |
| | | $app->error($app->tform->wordbook["limit_dns_record_txt"]); |
| | | } |
| | | } |
| | | } |
| | | |
| | | parent::onShowNew(); |
| | | } |
| | | |
| | | function onSubmit() { |
| | | global $app, $conf; |
| | | |
| | | // Get the parent soa record of the domain |
| | | $soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = '".$app->functions->intval($_POST["zone"])."' AND ".$app->tform->getAuthSQL('r')); |
| | | |
| | | // Check if Domain belongs to user |
| | | if($soa["id"] != $_POST["zone"]) $app->tform->errorMessage .= $app->tform->wordbook["no_zone_perm"]; |
| | | |
| | | // 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 = intval($_SESSION["s"]["user"]["default_group"]); |
| | | $client = $app->db->queryOneRecord("SELECT limit_dns_record 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 mailbox. |
| | | if($this->id == 0 && $client["limit_dns_record"] >= 0) { |
| | | $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id"); |
| | | if($tmp["number"] >= $client["limit_dns_record"]) { |
| | | $app->error($app->tform->wordbook["limit_dns_record_txt"]); |
| | | } |
| | | } |
| | | } // end if user is not admin |
| | | |
| | | |
| | | // Set the server ID of the rr record to the same server ID as the parent record. |
| | | $this->dataRecord["server_id"] = $soa["server_id"]; |
| | | |
| | | // Update the serial number and timestamp of the RR record |
| | | $soa = $app->db->queryOneRecord("SELECT serial FROM dns_rr WHERE id = ".$this->id); |
| | | $this->dataRecord["serial"] = $app->validate_dns->increase_serial($soa["serial"]); |
| | | $this->dataRecord["stamp"] = date('Y-m-d H:i:s'); |
| | | |
| | | parent::onSubmit(); |
| | | } |
| | | |
| | | function onAfterInsert() { |
| | | global $app, $conf; |
| | | |
| | | //* Set the sys_groupid of the rr record to be the same then the sys_groupid of the soa record |
| | | $soa = $app->db->queryOneRecord("SELECT sys_groupid,serial FROM dns_soa WHERE id = '".$app->functions->intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r')); |
| | | $app->db->datalogUpdate('dns_rr', "sys_groupid = ".intval($soa['sys_groupid']), 'id', $this->id); |
| | | |
| | | //* Update the serial number of the SOA record |
| | | $soa_id = $app->functions->intval($_POST["zone"]); |
| | | $serial = $app->validate_dns->increase_serial($soa["serial"]); |
| | | $app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id); |
| | | } |
| | | |
| | | function onAfterUpdate() { |
| | | global $app, $conf; |
| | | |
| | | //* Update the serial number of the SOA record |
| | | $soa = $app->db->queryOneRecord("SELECT serial FROM dns_soa WHERE id = '".$app->functions->intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r')); |
| | | $soa_id = $app->functions->intval($_POST["zone"]); |
| | | $serial = $app->validate_dns->increase_serial($soa["serial"]); |
| | | $app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id); |
| | | } |
| | | class page_action extends dns_page_action { |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | require_once '../../lib/config.inc.php'; |
| | | require_once '../../lib/app.inc.php'; |
| | | |
| | | //* Check permissions for module |
| | | $app->auth->check_module_permissions('dns'); |
| | | require_once './dns_edit_base.php'; |
| | | |
| | | // Loading classes |
| | | $app->uses('tpl,tform,tform_actions,validate_dns'); |
| | | $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') { |
| | | |
| | | // Get the limits of the client |
| | | $client_group_id = intval($_SESSION["s"]["user"]["default_group"]); |
| | | $client = $app->db->queryOneRecord("SELECT limit_dns_record 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 mailbox. |
| | | if($client["limit_dns_record"] >= 0) { |
| | | $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id"); |
| | | if($tmp["number"] >= $client["limit_dns_record"]) { |
| | | $app->error($app->tform->wordbook["limit_dns_record_txt"]); |
| | | } |
| | | } |
| | | } |
| | | |
| | | parent::onShowNew(); |
| | | } |
| | | |
| | | function onSubmit() { |
| | | global $app, $conf; |
| | | |
| | | // Get the parent soa record of the domain |
| | | $soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = '".$app->functions->intval($_POST["zone"])."' AND ".$app->tform->getAuthSQL('r')); |
| | | |
| | | // Check if Domain belongs to user |
| | | if($soa["id"] != $_POST["zone"]) $app->tform->errorMessage .= $app->tform->wordbook["no_zone_perm"]; |
| | | |
| | | // 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 = intval($_SESSION["s"]["user"]["default_group"]); |
| | | $client = $app->db->queryOneRecord("SELECT limit_dns_record 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 mailbox. |
| | | if($client["limit_dns_record"] >= 0) { |
| | | $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id"); |
| | | if($tmp["number"] >= $client["limit_dns_record"]) { |
| | | $app->error($app->tform->wordbook["limit_dns_record_txt"]); |
| | | } |
| | | } |
| | | } // end if user is not admin |
| | | |
| | | |
| | | // Set the server ID of the rr record to the same server ID as the parent record. |
| | | $this->dataRecord["server_id"] = $soa["server_id"]; |
| | | |
| | | // Update the serial number and timestamp of the RR record |
| | | $soa = $app->db->queryOneRecord("SELECT serial FROM dns_rr WHERE id = ".$this->id); |
| | | $this->dataRecord["serial"] = $app->validate_dns->increase_serial($soa["serial"]); |
| | | $this->dataRecord["stamp"] = date('Y-m-d H:i:s'); |
| | | |
| | | parent::onSubmit(); |
| | | } |
| | | |
| | | function onAfterInsert() { |
| | | global $app, $conf; |
| | | |
| | | //* Set the sys_groupid of the rr record to be the same then the sys_groupid of the soa record |
| | | $soa = $app->db->queryOneRecord("SELECT sys_groupid,serial FROM dns_soa WHERE id = '".$app->functions->intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r')); |
| | | $app->db->datalogUpdate('dns_rr', "sys_groupid = ".$soa['sys_groupid'], 'id', $this->id); |
| | | |
| | | //* Update the serial number of the SOA record |
| | | $soa_id = $app->functions->intval($_POST["zone"]); |
| | | $serial = $app->validate_dns->increase_serial($soa["serial"]); |
| | | $app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id); |
| | | } |
| | | |
| | | function onAfterUpdate() { |
| | | global $app, $conf; |
| | | |
| | | //* Update the serial number of the SOA record |
| | | $soa = $app->db->queryOneRecord("SELECT serial FROM dns_soa WHERE id = '".$app->functions->intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r')); |
| | | $soa_id = $app->functions->intval($_POST["zone"]); |
| | | $serial = $app->validate_dns->increase_serial($soa["serial"]); |
| | | $app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id); |
| | | } |
| | | class page_action extends dns_page_action { |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | require_once '../../lib/config.inc.php'; |
| | | require_once '../../lib/app.inc.php'; |
| | | |
| | | //* Check permissions for module |
| | | $app->auth->check_module_permissions('dns'); |
| | | require_once './dns_edit_base.php'; |
| | | |
| | | // Loading classes |
| | | $app->uses('tpl,tform,tform_actions,validate_dns'); |
| | | $app->load('tform_actions'); |
| | | class page_action extends dns_page_action { |
| | | |
| | | class page_action extends tform_actions { |
| | | |
| | | function onShowNew() { |
| | | global $app, $conf; |
| | | |
| | | // we will check only users, not admins |
| | | if($_SESSION["s"]["user"]["typ"] == 'user') { |
| | | |
| | | // Get the limits of the client |
| | | $client_group_id = intval($_SESSION["s"]["user"]["default_group"]); |
| | | $client = $app->db->queryOneRecord("SELECT limit_dns_record 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 mailbox. |
| | | if($client["limit_dns_record"] >= 0) { |
| | | $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id"); |
| | | if($tmp["number"] >= $client["limit_dns_record"]) { |
| | | $app->error($app->tform->wordbook["limit_dns_record_txt"]); |
| | | } |
| | | } |
| | | } |
| | | |
| | | parent::onShowNew(); |
| | | } |
| | | |
| | | function onSubmit() { |
| | | global $app, $conf; |
| | | |
| | | // Get the parent soa record of the domain |
| | | $soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = '".$app->functions->intval($_POST["zone"])."' AND ".$app->tform->getAuthSQL('r')); |
| | | |
| | | // Check if Domain belongs to user |
| | | if($soa["id"] != $_POST["zone"]) $app->tform->errorMessage .= $app->tform->wordbook["no_zone_perm"]; |
| | | |
| | | // 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 = intval($_SESSION["s"]["user"]["default_group"]); |
| | | $client = $app->db->queryOneRecord("SELECT limit_dns_record 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 mailbox. |
| | | if($this->id == 0 && $client["limit_dns_record"] >= 0) { |
| | | $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id"); |
| | | if($tmp["number"] >= $client["limit_dns_record"]) { |
| | | $app->error($app->tform->wordbook["limit_dns_record_txt"]); |
| | | } |
| | | } |
| | | } // end if user is not admin |
| | | |
| | | protected function checkDuplicate() { |
| | | global $app; |
| | | //* Check for duplicates where IP and hostname are the same |
| | | $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE (type = 'A' AND name = '".$app->db->quote($this->dataRecord["name"])."' AND zone = '".$app->db->quote($this->dataRecord["zone"])."' and id != ".$this->id.") OR (type = 'CNAME' AND name = '".$app->db->quote($this->dataRecord["name"])."' AND zone = '".$app->db->quote($this->dataRecord["zone"])."' and id != ".$this->id.")"); |
| | | if($tmp['number'] > 0) $app->tform->errorMessage .= $app->tform->lng("data_error_duplicate")."<br>"; |
| | | unset($tmp); |
| | | |
| | | |
| | | // Set the server ID of the rr record to the same server ID as the parent record. |
| | | $this->dataRecord["server_id"] = $soa["server_id"]; |
| | | |
| | | // Update the serial number and timestamp of the RR record |
| | | $soa = $app->db->queryOneRecord("SELECT serial FROM dns_rr WHERE id = ".$this->id); |
| | | $this->dataRecord["serial"] = $app->validate_dns->increase_serial($soa["serial"]); |
| | | $this->dataRecord["stamp"] = date('Y-m-d H:i:s'); |
| | | |
| | | parent::onSubmit(); |
| | | } |
| | | |
| | | function onAfterInsert() { |
| | | global $app, $conf; |
| | | |
| | | //* Set the sys_groupid of the rr record to be the same then the sys_groupid of the soa record |
| | | $soa = $app->db->queryOneRecord("SELECT sys_groupid,serial FROM dns_soa WHERE id = '".$app->functions->intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r')); |
| | | $app->db->datalogUpdate('dns_rr', "sys_groupid = ".$soa['sys_groupid'], 'id', $this->id); |
| | | |
| | | //* Update the serial number of the SOA record |
| | | $soa_id = $app->functions->intval($_POST["zone"]); |
| | | $serial = $app->validate_dns->increase_serial($soa["serial"]); |
| | | $app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id); |
| | | } |
| | | |
| | | function onAfterUpdate() { |
| | | global $app, $conf; |
| | | |
| | | //* Update the serial number of the SOA record |
| | | $soa = $app->db->queryOneRecord("SELECT serial FROM dns_soa WHERE id = '".$app->functions->intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r')); |
| | | $soa_id = $app->functions->intval($_POST["zone"]); |
| | | $serial = $app->validate_dns->increase_serial($soa["serial"]); |
| | | $app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id); |
| | | $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE (type = 'A' AND name = ? AND zone = ? and id != ?) OR (type = 'CNAME' AND name = ? AND zone = ? and id != ?)", $this->dataRecord["name"], $this->dataRecord["zone"], $this->id, $this->dataRecord["name"], $this->dataRecord["zone"], $this->id); |
| | | if($tmp['number'] > 0) return true; |
| | | return false; |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | parent::onShowNew(); |
| | | |
| | | $soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = ? AND ?", $_GET['zone'], $app->tform->getAuthSQL('r')); |
| | | $sql=$app->db->queryOneRecord("SELECT dkim_public, dkim_selector FROM mail_domain WHERE domain = ? AND dkim = 'y' AND ?", substr_replace($soa['origin'],'',-1), $app->tform->getAuthSQL('r')); |
| | | $soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = ? AND " . $app->tform->getAuthSQL('r'), $_GET['zone']); |
| | | $sql=$app->db->queryOneRecord("SELECT dkim_public, dkim_selector FROM mail_domain WHERE domain = ? AND dkim = 'y' AND " . $app->tform->getAuthSQL('r'), substr_replace($soa['origin'],'',-1)); |
| | | $public_key=str_replace(array('-----BEGIN PUBLIC KEY-----','-----END PUBLIC KEY-----',"\r","\n"),'',$sql['dkim_public']); |
| | | $app->tpl->setVar('public_key', $public_key); |
| | | $app->tpl->setVar('selector', $sql['dkim_selector']); |
| | |
| | | function onSubmit() { |
| | | global $app, $conf; |
| | | // Get the parent soa record of the domain |
| | | $soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = ? AND ?", $_POST["zone"], $app->tform->getAuthSQL('r')); |
| | | $soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = ? AND " . $app->tform->getAuthSQL('r'), $_POST["zone"]); |
| | | // Check if Domain belongs to user |
| | | if($soa["id"] != $_POST["zone"]) $app->tform->errorMessage .= $app->tform->wordbook["no_zone_perm"]; |
| | | |
| | |
| | | global $app, $conf; |
| | | |
| | | //* Set the sys_groupid of the rr record to be the same then the sys_groupid of the soa record |
| | | $soa = $app->db->queryOneRecord("SELECT sys_groupid,serial FROM dns_soa WHERE id = ? AND ?", $this->dataRecord["zone"], $app->tform->getAuthSQL('r')); |
| | | $app->db->datalogUpdate('dns_rr', "sys_groupid = ".$soa['sys_groupid'], 'id', $this->id); |
| | | $soa = $app->db->queryOneRecord("SELECT sys_groupid,serial FROM dns_soa WHERE id = ? AND " . $app->tform->getAuthSQL('r'), $this->dataRecord["zone"]); |
| | | $app->db->datalogUpdate('dns_rr', array("sys_groupid" => $soa['sys_groupid']), 'id', $this->id); |
| | | |
| | | //* Update the serial number of the SOA record |
| | | $soa_id = $app->functions->intval($_POST["zone"]); |
| | | $serial = $app->validate_dns->increase_serial($soa["serial"]); |
| | | $app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id); |
| | | $app->db->datalogUpdate('dns_soa', array("serial" => $serial), 'id', $soa_id); |
| | | } |
| | | |
| | | function onAfterUpdate() { |
| | | global $app, $conf; |
| | | |
| | | //* Update the serial number of the SOA record |
| | | $soa = $app->db->queryOneRecord("SELECT serial FROM dns_soa WHERE id = ? AND ?", $this->dataRecord["zone"], $app->tform->getAuthSQL('r')); |
| | | $soa = $app->db->queryOneRecord("SELECT serial FROM dns_soa WHERE id = ? AND " . $app->tform->getAuthSQL('r'), $this->dataRecord["zone"]); |
| | | $soa_id = $app->functions->intval($_POST["zone"]); |
| | | $serial = $app->validate_dns->increase_serial($soa["serial"]); |
| | | $app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id); |
| | | $app->db->datalogUpdate('dns_soa', array("serial" => $serial), 'id', $soa_id); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | $zone = $app->functions->intval($_GET['zone']); |
| | | // get domain-name |
| | | $sql = "SELECT * FROM dns_soa WHERE id = ? AND ?"; |
| | | $rec = $app->db->queryOneRecord($sql, $zone, $app->tform->getAuthSQL('r')); |
| | | $sql = "SELECT * FROM dns_soa WHERE id = ? AND " . $app->tform->getAuthSQL('r'); |
| | | $rec = $app->db->queryOneRecord($sql, $zone); |
| | | $domain_name = rtrim($rec['origin'], '.'); |
| | | |
| | | // set defaults |
| | |
| | | $dmarc_sp = 'same'; |
| | | |
| | | //* check for an existing dmarc-record |
| | | $sql = "SELECT data, active FROM dns_rr WHERE data LIKE 'v=DMARC1%' AND zone = ? AND name = ? AND ?"; |
| | | $rec = $app->db->queryOneRecord($sql, $zone, '_dmarc.'.$domain_name.'.', $app->tform->getAuthSQL('r')); |
| | | $sql = "SELECT data, active FROM dns_rr WHERE data LIKE 'v=DMARC1%' AND zone = ? AND name = ? AND " . $app->tform->getAuthSQL('r'); |
| | | $rec = $app->db->queryOneRecord($sql, $zone, '_dmarc.'.$domain_name.'.'); |
| | | if ( isset($rec) && !empty($rec) ) { |
| | | $this->id = 1; |
| | | $old_data = strtolower($rec['data']); |
| | |
| | | global $app, $conf; |
| | | |
| | | // Get the parent soa record of the domain |
| | | $soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = ? AND ?", $_POST['zone'], $app->tform->getAuthSQL('r')); |
| | | $soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = ? AND " . $app->tform->getAuthSQL('r'), $_POST['zone']); |
| | | |
| | | // Check if Domain belongs to user |
| | | if($soa["id"] != $_POST["zone"]) $app->tform->errorMessage .= $app->tform->wordbook["no_zone_perm"]; |
| | |
| | | global $app, $conf; |
| | | |
| | | //* Set the sys_groupid of the rr record to be the same then the sys_groupid of the soa record |
| | | $soa = $app->db->queryOneRecord("SELECT sys_groupid,serial FROM dns_soa WHERE id = ? AND ?", $app->functions->intval($this->dataRecord["zone"]), $app->tform->getAuthSQL('r')); |
| | | $app->db->datalogUpdate('dns_rr', "sys_groupid = ".$soa['sys_groupid'], 'id', $this->id); |
| | | $soa = $app->db->queryOneRecord("SELECT sys_groupid,serial FROM dns_soa WHERE id = ? AND " . $app->tform->getAuthSQL('r'), $app->functions->intval($this->dataRecord["zone"])); |
| | | $app->db->datalogUpdate('dns_rr', array("sys_groupid" => $soa['sys_groupid']), 'id', $this->id); |
| | | |
| | | //* Update the serial number of the SOA record |
| | | $soa_id = $app->functions->intval($_POST["zone"]); |
| | | $serial = $app->validate_dns->increase_serial($soa["serial"]); |
| | | $app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id); |
| | | $app->db->datalogUpdate('dns_soa', array("serial" => $serial), 'id', $soa_id); |
| | | |
| | | } |
| | | |
| | |
| | | global $app, $conf; |
| | | |
| | | //* Update the serial number of the SOA record |
| | | $soa = $app->db->queryOneRecord("SELECT serial FROM dns_soa WHERE id = ? AND ?", $app->functions->intval($this->dataRecord["zone"]), $app->tform->getAuthSQL('r')); |
| | | $soa = $app->db->queryOneRecord("SELECT serial FROM dns_soa WHERE id = ? AND " . $app->tform->getAuthSQL('r'), $app->functions->intval($this->dataRecord["zone"])); |
| | | $soa_id = $app->functions->intval($_POST["zone"]); |
| | | $serial = $app->validate_dns->increase_serial($soa["serial"]); |
| | | $app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id); |
| | | $app->db->datalogUpdate('dns_soa', array("serial" => $serial), 'id', $soa_id); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | <?php |
| | | |
| | | /* |
| | | Copyright (c) 2007, Till Brehm, projektfarm Gmbh |
| | | 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. |
| | | */ |
| | | |
| | | require_once '../../lib/config.inc.php'; |
| | | require_once '../../lib/app.inc.php'; |
| | | |
| | | //* Check permissions for module |
| | | $app->auth->check_module_permissions('dns'); |
| | | |
| | | // Loading classes |
| | | $app->uses('tpl,tform,tform_actions,validate_dns'); |
| | | $app->load('tform_actions'); |
| | | |
| | | class dns_page_action extends tform_actions { |
| | | |
| | | protected function checkDuplicate() { |
| | | return false; |
| | | } |
| | | |
| | | function onShowNew() { |
| | | global $app, $conf; |
| | | |
| | | // we will check only users, not admins |
| | | if($_SESSION["s"]["user"]["typ"] == 'user') { |
| | | |
| | | // Get the limits of the client |
| | | $client_group_id = intval($_SESSION["s"]["user"]["default_group"]); |
| | | $client = $app->db->queryOneRecord("SELECT limit_dns_record 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 mailbox. |
| | | if($client["limit_dns_record"] >= 0) { |
| | | $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = ?", $client_group_id); |
| | | if($tmp["number"] >= $client["limit_dns_record"]) { |
| | | $app->error($app->tform->wordbook["limit_dns_record_txt"]); |
| | | } |
| | | } |
| | | } |
| | | |
| | | parent::onShowNew(); |
| | | } |
| | | |
| | | function onSubmit() { |
| | | global $app, $conf; |
| | | |
| | | // Get the parent soa record of the domain |
| | | $soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = ? AND " . $app->tform->getAuthSQL('r'), $_POST["zone"]); |
| | | |
| | | // Check if Domain belongs to user |
| | | if($soa["id"] != $_POST["zone"]) $app->tform->errorMessage .= $app->tform->wordbook["no_zone_perm"]; |
| | | |
| | | // 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 = intval($_SESSION["s"]["user"]["default_group"]); |
| | | $client = $app->db->queryOneRecord("SELECT limit_dns_record 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 mailbox. |
| | | if($this->id == 0 && $client["limit_dns_record"] >= 0) { |
| | | $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = ?", $client_group_id); |
| | | if($tmp["number"] >= $client["limit_dns_record"]) { |
| | | $app->error($app->tform->wordbook["limit_dns_record_txt"]); |
| | | } |
| | | } |
| | | } // end if user is not admin |
| | | |
| | | if($this->checkDuplicate()) $app->tform->errorMessage .= $app->tform->lng("data_error_duplicate")."<br>"; |
| | | |
| | | // Set the server ID of the rr record to the same server ID as the parent record. |
| | | $this->dataRecord["server_id"] = $soa["server_id"]; |
| | | |
| | | // Update the serial number and timestamp of the RR record |
| | | $soa = $app->db->queryOneRecord("SELECT serial FROM dns_rr WHERE id = ?", $this->id); |
| | | $this->dataRecord["serial"] = $app->validate_dns->increase_serial($soa["serial"]); |
| | | $this->dataRecord["stamp"] = date('Y-m-d H:i:s'); |
| | | |
| | | parent::onSubmit(); |
| | | } |
| | | |
| | | function onAfterInsert() { |
| | | global $app, $conf; |
| | | |
| | | //* Set the sys_groupid of the rr record to be the same then the sys_groupid of the soa record |
| | | $soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = ? AND " . $app->tform->getAuthSQL('r'), $this->dataRecord["zone"]); |
| | | $app->db->datalogUpdate('dns_rr', array("sys_groupid" => $soa['sys_groupid']), 'id', $this->id); |
| | | |
| | | //* Update the serial number of the SOA record |
| | | $soa_id = $app->functions->intval($_POST["zone"]); |
| | | $serial = $app->validate_dns->increase_serial($soa["serial"]); |
| | | $app->db->datalogUpdate('dns_soa', array("serial" => $serial), 'id', $soa_id); |
| | | } |
| | | |
| | | function onAfterUpdate() { |
| | | global $app, $conf; |
| | | |
| | | //* Update the serial number of the SOA record |
| | | $soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = ? AND " . $app->tform->getAuthSQL('r'), $this->dataRecord["zone"]); |
| | | $soa_id = $app->functions->intval($_POST["zone"]); |
| | | $serial = $app->validate_dns->increase_serial($soa["serial"]); |
| | | $app->db->datalogUpdate('dns_soa', array("serial" => $serial), 'id', $soa_id); |
| | | } |
| | | |
| | | } |
| | | |
| | | ?> |
| | |
| | | |
| | | require_once '../../lib/config.inc.php'; |
| | | require_once '../../lib/app.inc.php'; |
| | | |
| | | //* Check permissions for module |
| | | $app->auth->check_module_permissions('dns'); |
| | | require_once './dns_edit_base.php'; |
| | | |
| | | // Loading classes |
| | | $app->uses('tpl,tform,tform_actions,validate_dns'); |
| | | $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') { |
| | | |
| | | // Get the limits of the client |
| | | $client_group_id = intval($_SESSION["s"]["user"]["default_group"]); |
| | | $client = $app->db->queryOneRecord("SELECT limit_dns_record 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 mailbox. |
| | | if($client["limit_dns_record"] >= 0) { |
| | | $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id"); |
| | | if($tmp["number"] >= $client["limit_dns_record"]) { |
| | | $app->error($app->tform->wordbook["limit_dns_record_txt"]); |
| | | } |
| | | } |
| | | } |
| | | |
| | | parent::onShowNew(); |
| | | } |
| | | |
| | | function onSubmit() { |
| | | global $app, $conf; |
| | | |
| | | // Get the parent soa record of the domain |
| | | $soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = '".$app->functions->intval($_POST["zone"])."' AND ".$app->tform->getAuthSQL('r')); |
| | | |
| | | // Check if Domain belongs to user |
| | | if($soa["id"] != $_POST["zone"]) $app->tform->errorMessage .= $app->tform->wordbook["no_zone_perm"]; |
| | | |
| | | // 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 = intval($_SESSION["s"]["user"]["default_group"]); |
| | | $client = $app->db->queryOneRecord("SELECT limit_dns_record 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 mailbox. |
| | | if($this->id == 0 && $client["limit_dns_record"] >= 0) { |
| | | $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id"); |
| | | if($tmp["number"] >= $client["limit_dns_record"]) { |
| | | $app->error($app->tform->wordbook["limit_dns_record_txt"]); |
| | | } |
| | | } |
| | | } // end if user is not admin |
| | | |
| | | |
| | | // Set the server ID of the rr record to the same server ID as the parent record. |
| | | $this->dataRecord["server_id"] = $soa["server_id"]; |
| | | |
| | | // Update the serial number and timestamp of the RR record |
| | | $soa = $app->db->queryOneRecord("SELECT serial FROM dns_rr WHERE id = ".$this->id); |
| | | $this->dataRecord["serial"] = $app->validate_dns->increase_serial($soa["serial"]); |
| | | $this->dataRecord["stamp"] = date('Y-m-d H:i:s'); |
| | | |
| | | parent::onSubmit(); |
| | | } |
| | | |
| | | function onAfterInsert() { |
| | | global $app, $conf; |
| | | |
| | | //* Set the sys_groupid of the rr record to be the same then the sys_groupid of the soa record |
| | | $soa = $app->db->queryOneRecord("SELECT sys_groupid,serial FROM dns_soa WHERE id = '".$app->functions->intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r')); |
| | | $app->db->datalogUpdate('dns_rr', "sys_groupid = ".$soa['sys_groupid'], 'id', $this->id); |
| | | |
| | | //* Update the serial number of the SOA record |
| | | $soa_id = $app->functions->intval($_POST["zone"]); |
| | | $serial = $app->validate_dns->increase_serial($soa["serial"]); |
| | | $app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id); |
| | | } |
| | | |
| | | function onAfterUpdate() { |
| | | global $app, $conf; |
| | | |
| | | //* Update the serial number of the SOA record |
| | | $soa = $app->db->queryOneRecord("SELECT serial FROM dns_soa WHERE id = '".$app->functions->intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r')); |
| | | $soa_id = $app->functions->intval($_POST["zone"]); |
| | | $serial = $app->validate_dns->increase_serial($soa["serial"]); |
| | | $app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id); |
| | | } |
| | | class page_action extends dns_page_action { |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | // Get the limits of the client |
| | | $client_group_id = intval($_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 = $client_group_id"); |
| | | $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 = ?", $client_group_id); |
| | | |
| | | |
| | | // load the list of clients |
| | | $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 = ".intval($client['client_id'])." ORDER BY client.company_name, client.contact_name, sys_group.name"; |
| | | $clients = $app->db->queryAllRecords($sql); |
| | | $tmp = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ".intval($client['client_id'])); |
| | | $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']); |
| | | $tmp = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ?", $client['client_id']); |
| | | $client_select = '<option value="'.$tmp['groupid'].'">'.$client['contactname'].'</option>'; |
| | | if(is_array($clients)) { |
| | | foreach( $clients as $client) { |
| | |
| | | if($_SESSION["s"]["user"]["typ"] != 'admin') |
| | | { |
| | | $client_group_id = $_SESSION["s"]["user"]["default_group"]; |
| | | $client_dns = $app->db->queryOneRecord("SELECT dns_servers FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); |
| | | $client_dns = $app->db->queryOneRecord("SELECT dns_servers FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id); |
| | | |
| | | $client_dns['dns_servers_ids'] = explode(',', $client_dns['dns_servers']); |
| | | |
| | |
| | | $app->tpl->setVar('server_id_value', $client_dns['dns_servers_ids'][0]); |
| | | } |
| | | |
| | | $sql = "SELECT server_id, server_name FROM server WHERE server_id IN (" . $client_dns['dns_servers'] . ");"; |
| | | $dns_servers = $app->db->queryAllRecords($sql); |
| | | $sql = "SELECT server_id, server_name FROM server WHERE server_id IN ?"; |
| | | $dns_servers = $app->db->queryAllRecords($sql, $client_dns['dns_servers_ids']); |
| | | |
| | | $options_dns_servers = ""; |
| | | |
| | |
| | | if(isset($_FILES['file']['name']) && is_uploaded_file($_FILES['file']['tmp_name'])){ |
| | | $valid_zone_file = FALSE; |
| | | |
| | | $sql = "SELECT server_name FROM `server` WHERE server_id=".$app->functions->intval($server_id)." OR mirror_server_id=".$app->functions->intval($server_id)." ORDER BY server_name ASC"; |
| | | $servers = $app->db->queryAllRecords($sql); |
| | | $sql = "SELECT server_name FROM `server` WHERE server_id=? OR mirror_server_id=? ORDER BY server_name ASC"; |
| | | $servers = $app->db->queryAllRecords($sql, $server_id, $server_id); |
| | | for ($i=0;$i<count($servers);$i++) |
| | | { |
| | | if (substr($servers[$i]['server_name'], strlen($servers[$i]['server_name'])-1) != ".") |
| | |
| | | |
| | | // Insert the soa record |
| | | $sys_userid = $_SESSION['s']['user']['userid']; |
| | | $origin = $app->db->quote($soa['name']); |
| | | $ns = $app->db->quote($soa['ns']); |
| | | $mbox = $app->db->quote($soa['mbox']); |
| | | $refresh = $app->db->quote($soa['refresh']); |
| | | $retry = $app->db->quote($soa['retry']); |
| | | $expire = $app->db->quote($soa['expire']); |
| | | $minimum = $app->db->quote($soa['minimum']); |
| | | $ttl = $app->db->quote($soa['ttl']); |
| | | $xfer = $app->db->quote(''); |
| | | $serial = $app->db->quote($app->functions->intval($soa['serial'])+1); |
| | | $origin = $soa['name']; |
| | | $ns = $soa['ns']; |
| | | $mbox = $soa['mbox']; |
| | | $refresh = $soa['refresh']; |
| | | $retry = $soa['retry']; |
| | | $expire = $soa['expire']; |
| | | $minimum = $soa['minimum']; |
| | | $ttl = $soa['ttl']; |
| | | $xfer = ''; |
| | | $serial = $app->functions->intval($soa['serial']+1); |
| | | //print_r($soa); |
| | | //die(); |
| | | if($valid_zone_file){ |
| | | $insert_data = "(`sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `server_id`, `origin`, `ns`, `mbox`, `serial`, `refresh`, `retry`, `expire`, `minimum`, `ttl`, `active`, `xfer`) VALUES |
| | | ('$sys_userid', '$sys_groupid', 'riud', 'riud', '', '$server_id', '$origin', '$ns', '$mbox', '$serial', '$refresh', '$retry', '$expire', '$minimum', '$ttl', 'Y', '$xfer')"; |
| | | $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, |
| | | "origin" => $origin, |
| | | "ns" => $ns, |
| | | "mbox" => $mbox, |
| | | "serial" => $serial, |
| | | "refresh" => $refresh, |
| | | "retry" => $retry, |
| | | "expire" => $expire, |
| | | "minimum" => $minimum, |
| | | "ttl" => $ttl, |
| | | "active" => 'Y', |
| | | "xfer" => $xfer |
| | | ); |
| | | $dns_soa_id = $app->db->datalogInsert('dns_soa', $insert_data, 'id'); |
| | | |
| | | // Insert the dns_rr records |
| | |
| | | { |
| | | foreach($dns_rr as $rr) |
| | | { |
| | | $insert_data = "(`sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `server_id`, `zone`, `name`, `type`, `data`, `aux`, `ttl`, `active`) VALUES |
| | | ('$sys_userid', '$sys_groupid', 'riud', 'riud', '', '$server_id', '$dns_soa_id', '".$app->db->quote($rr['name'])."', '".$app->db->quote($rr['type'])."', '".$app->db->quote($rr['data'])."', '".$app->db->quote($rr['aux'])."', '".$app->db->quote($rr['ttl'])."', 'Y')"; |
| | | $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" => $rr['name'], |
| | | "type" => $rr['type'], |
| | | "data" => $rr['data'], |
| | | "aux" => $rr['aux'], |
| | | "ttl" => $rr['ttl'], |
| | | "active" => 'Y' |
| | | ); |
| | | $dns_rr_id = $app->db->datalogInsert('dns_rr', $insert_data, 'id'); |
| | | } |
| | | } |
| | |
| | | |
| | | require_once '../../lib/config.inc.php'; |
| | | require_once '../../lib/app.inc.php'; |
| | | |
| | | //* Check permissions for module |
| | | $app->auth->check_module_permissions('dns'); |
| | | require_once './dns_edit_base.php'; |
| | | |
| | | // Loading classes |
| | | $app->uses('tpl,tform,tform_actions,validate_dns'); |
| | | $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') { |
| | | |
| | | // Get the limits of the client |
| | | $client_group_id = intval($_SESSION["s"]["user"]["default_group"]); |
| | | $client = $app->db->queryOneRecord("SELECT limit_dns_record 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 mailbox. |
| | | if($client["limit_dns_record"] >= 0) { |
| | | $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id"); |
| | | if($tmp["number"] >= $client["limit_dns_record"]) { |
| | | $app->error($app->tform->wordbook["limit_dns_record_txt"]); |
| | | } |
| | | } |
| | | } |
| | | |
| | | parent::onShowNew(); |
| | | } |
| | | |
| | | function onSubmit() { |
| | | global $app, $conf; |
| | | |
| | | // Get the parent soa record of the domain |
| | | $soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = '".$app->functions->intval($_POST["zone"])."' AND ".$app->tform->getAuthSQL('r')); |
| | | |
| | | // Check if Domain belongs to user |
| | | if($soa["id"] != $_POST["zone"]) $app->tform->errorMessage .= $app->tform->wordbook["no_zone_perm"]; |
| | | |
| | | // 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 = intval($_SESSION["s"]["user"]["default_group"]); |
| | | $client = $app->db->queryOneRecord("SELECT limit_dns_record 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 mailbox. |
| | | if($this->id == 0 && $client["limit_dns_record"] >= 0) { |
| | | $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id"); |
| | | if($tmp["number"] >= $client["limit_dns_record"]) { |
| | | $app->error($app->tform->wordbook["limit_dns_record_txt"]); |
| | | } |
| | | } |
| | | } // end if user is not admin |
| | | |
| | | |
| | | // Set the server ID of the rr record to the same server ID as the parent record. |
| | | $this->dataRecord["server_id"] = $soa["server_id"]; |
| | | |
| | | // Update the serial number and timestamp of the RR record |
| | | $soa = $app->db->queryOneRecord("SELECT serial FROM dns_rr WHERE id = ".$this->id); |
| | | $this->dataRecord["serial"] = $app->validate_dns->increase_serial($soa["serial"]); |
| | | $this->dataRecord["stamp"] = date('Y-m-d H:i:s'); |
| | | |
| | | parent::onSubmit(); |
| | | } |
| | | class page_action extends dns_page_action { |
| | | |
| | | function onInsert() { |
| | | global $app, $conf; |
| | | |
| | | // Check if record is existing already |
| | | $duplicate_mx = $app->db->queryOneRecord("SELECT * FROM dns_rr WHERE zone = ".$app->functions->intval($this->dataRecord["zone"])." AND name = '".$app->db->quote($this->dataRecord["name"])."' AND type = '".$app->db->quote($this->dataRecord["type"])."' AND data = '".$app->db->quote($this->dataRecord["data"])."' AND ".$app->tform->getAuthSQL('r')); |
| | | $duplicate_mx = $app->db->queryOneRecord("SELECT * FROM dns_rr WHERE zone = ? AND name = ? AND type = ? AND data = ? AND ".$app->tform->getAuthSQL('r'), $this->dataRecord["zone"], $this->dataRecord["name"], $this->dataRecord["type"], $this->dataRecord["data"]); |
| | | |
| | | |
| | | if(is_array($duplicate_mx) && !empty($duplicate_mx)) $app->error($app->tform->wordbook["duplicate_mx_record_txt"]); |
| | | |
| | |
| | | global $app, $conf; |
| | | |
| | | // Check if record is existing already |
| | | $duplicate_mx = $app->db->queryOneRecord("SELECT * FROM dns_rr WHERE zone = ".$app->functions->intval($this->dataRecord["zone"])." AND name = '".$app->db->quote($this->dataRecord["name"])."' AND type = '".$app->db->quote($this->dataRecord["type"])."' AND data = '".$app->db->quote($this->dataRecord["data"])."' AND id != ".$app->functions->intval($this->dataRecord["id"])." AND ".$app->tform->getAuthSQL('r')); |
| | | $duplicate_mx = $app->db->queryOneRecord("SELECT * FROM dns_rr WHERE zone = ? AND name = ? AND type = ? AND data = ? AND id != ? AND ".$app->tform->getAuthSQL('r'), $this->dataRecord["zone"], $this->dataRecord["name"], $this->dataRecord["type"], $this->dataRecord["data"], $this->dataRecord["id"]); |
| | | |
| | | if(is_array($duplicate_mx) && !empty($duplicate_mx)) $app->error($app->tform->wordbook["duplicate_mx_record_txt"]); |
| | | |
| | | parent::onUpdate(); |
| | | } |
| | | |
| | | function onAfterInsert() { |
| | | global $app, $conf; |
| | | |
| | | //* Set the sys_groupid of the rr record to be the same then the sys_groupid of the soa record |
| | | $soa = $app->db->queryOneRecord("SELECT sys_groupid,serial FROM dns_soa WHERE id = '".$app->functions->intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r')); |
| | | $app->db->datalogUpdate('dns_rr', "sys_groupid = ".$soa['sys_groupid'], 'id', $this->id); |
| | | |
| | | //* Update the serial number of the SOA record |
| | | $soa_id = $app->functions->intval($_POST["zone"]); |
| | | $serial = $app->validate_dns->increase_serial($soa["serial"]); |
| | | $app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id); |
| | | } |
| | | |
| | | function onAfterUpdate() { |
| | | global $app, $conf; |
| | | |
| | | //* Update the serial number of the SOA record |
| | | $soa = $app->db->queryOneRecord("SELECT serial FROM dns_soa WHERE id = '".$app->functions->intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r')); |
| | | $soa_id = $app->functions->intval($_POST["zone"]); |
| | | $serial = $app->validate_dns->increase_serial($soa["serial"]); |
| | | $app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | require_once '../../lib/config.inc.php'; |
| | | require_once '../../lib/app.inc.php'; |
| | | |
| | | //* Check permissions for module |
| | | $app->auth->check_module_permissions('dns'); |
| | | require_once './dns_edit_base.php'; |
| | | |
| | | // Loading classes |
| | | $app->uses('tpl,tform,tform_actions,validate_dns'); |
| | | $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') { |
| | | |
| | | // Get the limits of the client |
| | | $client_group_id = intval($_SESSION["s"]["user"]["default_group"]); |
| | | $client = $app->db->queryOneRecord("SELECT limit_dns_record 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 mailbox. |
| | | if($client["limit_dns_record"] >= 0) { |
| | | $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id"); |
| | | if($tmp["number"] >= $client["limit_dns_record"]) { |
| | | $app->error($app->tform->wordbook["limit_dns_record_txt"]); |
| | | } |
| | | } |
| | | } |
| | | |
| | | parent::onShowNew(); |
| | | } |
| | | |
| | | function onSubmit() { |
| | | global $app, $conf; |
| | | |
| | | // Get the parent soa record of the domain |
| | | $soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = '".$app->functions->intval($_POST["zone"])."' AND ".$app->tform->getAuthSQL('r')); |
| | | |
| | | // Check if Domain belongs to user |
| | | if($soa["id"] != $_POST["zone"]) $app->tform->errorMessage .= $app->tform->wordbook["no_zone_perm"]; |
| | | |
| | | // 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 = intval($_SESSION["s"]["user"]["default_group"]); |
| | | $client = $app->db->queryOneRecord("SELECT limit_dns_record 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 mailbox. |
| | | if($this->id == 0 && $client["limit_dns_record"] >= 0) { |
| | | $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id"); |
| | | if($tmp["number"] >= $client["limit_dns_record"]) { |
| | | $app->error($app->tform->wordbook["limit_dns_record_txt"]); |
| | | } |
| | | } |
| | | } // end if user is not admin |
| | | |
| | | |
| | | // Set the server ID of the rr record to the same server ID as the parent record. |
| | | $this->dataRecord["server_id"] = $soa["server_id"]; |
| | | |
| | | // Update the serial number and timestamp of the RR record |
| | | $soa = $app->db->queryOneRecord("SELECT serial FROM dns_rr WHERE id = ".$this->id); |
| | | $this->dataRecord["serial"] = $app->validate_dns->increase_serial($soa["serial"]); |
| | | $this->dataRecord["stamp"] = date('Y-m-d H:i:s'); |
| | | |
| | | parent::onSubmit(); |
| | | } |
| | | |
| | | function onAfterInsert() { |
| | | global $app, $conf; |
| | | |
| | | //* Set the sys_groupid of the rr record to be the same then the sys_groupid of the soa record |
| | | $soa = $app->db->queryOneRecord("SELECT sys_groupid,serial FROM dns_soa WHERE id = '".$app->functions->intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r')); |
| | | $app->db->datalogUpdate('dns_rr', "sys_groupid = ".$soa['sys_groupid'], 'id', $this->id); |
| | | |
| | | //* Update the serial number of the SOA record |
| | | $soa_id = $app->functions->intval($_POST["zone"]); |
| | | $serial = $app->validate_dns->increase_serial($soa["serial"]); |
| | | $app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id); |
| | | } |
| | | |
| | | function onAfterUpdate() { |
| | | global $app, $conf; |
| | | |
| | | //* Update the serial number of the SOA record |
| | | $soa = $app->db->queryOneRecord("SELECT serial FROM dns_soa WHERE id = '".$app->functions->intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r')); |
| | | $soa_id = $app->functions->intval($_POST["zone"]); |
| | | $serial = $app->validate_dns->increase_serial($soa["serial"]); |
| | | $app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id); |
| | | } |
| | | class page_action extends dns_page_action { |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | require_once '../../lib/config.inc.php'; |
| | | require_once '../../lib/app.inc.php'; |
| | | |
| | | //* Check permissions for module |
| | | $app->auth->check_module_permissions('dns'); |
| | | require_once './dns_edit_base.php'; |
| | | |
| | | // Loading classes |
| | | $app->uses('tpl,tform,tform_actions,validate_dns'); |
| | | $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') { |
| | | |
| | | // Get the limits of the client |
| | | $client_group_id = intval($_SESSION["s"]["user"]["default_group"]); |
| | | $client = $app->db->queryOneRecord("SELECT limit_dns_record 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 mailbox. |
| | | if($client["limit_dns_record"] >= 0) { |
| | | $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id"); |
| | | if($tmp["number"] >= $client["limit_dns_record"]) { |
| | | $app->error($app->tform->wordbook["limit_dns_record_txt"]); |
| | | } |
| | | } |
| | | } |
| | | |
| | | parent::onShowNew(); |
| | | } |
| | | |
| | | function onSubmit() { |
| | | global $app, $conf; |
| | | |
| | | // Get the parent soa record of the domain |
| | | $soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = '".$app->functions->intval($_POST["zone"])."' AND ".$app->tform->getAuthSQL('r')); |
| | | |
| | | // Check if Domain belongs to user |
| | | if($soa["id"] != $_POST["zone"]) $app->tform->errorMessage .= $app->tform->wordbook["no_zone_perm"]; |
| | | |
| | | // 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 = intval($_SESSION["s"]["user"]["default_group"]); |
| | | $client = $app->db->queryOneRecord("SELECT limit_dns_record 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 mailbox. |
| | | if($this->id == 0 && $client["limit_dns_record"] >= 0) { |
| | | $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id"); |
| | | if($tmp["number"] >= $client["limit_dns_record"]) { |
| | | $app->error($app->tform->wordbook["limit_dns_record_txt"]); |
| | | } |
| | | } |
| | | } // end if user is not admin |
| | | |
| | | |
| | | // Set the server ID of the rr record to the same server ID as the parent record. |
| | | $this->dataRecord["server_id"] = $soa["server_id"]; |
| | | |
| | | // Update the serial number and timestamp of the RR record |
| | | $soa = $app->db->queryOneRecord("SELECT serial FROM dns_rr WHERE id = ".$this->id); |
| | | $this->dataRecord["serial"] = $app->validate_dns->increase_serial($soa["serial"]); |
| | | $this->dataRecord["stamp"] = date('Y-m-d H:i:s'); |
| | | |
| | | parent::onSubmit(); |
| | | } |
| | | |
| | | function onAfterInsert() { |
| | | global $app, $conf; |
| | | |
| | | //* Set the sys_groupid of the rr record to be the same then the sys_groupid of the soa record |
| | | $soa = $app->db->queryOneRecord("SELECT sys_groupid,serial FROM dns_soa WHERE id = '".$app->functions->intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r')); |
| | | $app->db->datalogUpdate('dns_rr', "sys_groupid = ".$soa['sys_groupid'], 'id', $this->id); |
| | | |
| | | //* Update the serial number of the SOA record |
| | | $soa_id = $app->functions->intval($_POST["zone"]); |
| | | $serial = $app->validate_dns->increase_serial($soa["serial"]); |
| | | $app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id); |
| | | } |
| | | |
| | | function onAfterUpdate() { |
| | | global $app, $conf; |
| | | |
| | | //* Update the serial number of the SOA record |
| | | $soa = $app->db->queryOneRecord("SELECT serial FROM dns_soa WHERE id = '".$app->functions->intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r')); |
| | | $soa_id = $app->functions->intval($_POST["zone"]); |
| | | $serial = $app->validate_dns->increase_serial($soa["serial"]); |
| | | $app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id); |
| | | } |
| | | class page_action extends dns_page_action { |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | require_once '../../lib/config.inc.php'; |
| | | require_once '../../lib/app.inc.php'; |
| | | |
| | | //* Check permissions for module |
| | | $app->auth->check_module_permissions('dns'); |
| | | require_once './dns_edit_base.php'; |
| | | |
| | | // Loading classes |
| | | $app->uses('tpl,tform,tform_actions,validate_dns'); |
| | | $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') { |
| | | |
| | | // Get the limits of the client |
| | | $client_group_id = $_SESSION["s"]["user"]["default_group"]; |
| | | $client = $app->db->queryOneRecord("SELECT limit_dns_record 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 mailbox. |
| | | if($client["limit_dns_record"] >= 0) { |
| | | $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id"); |
| | | if($tmp["number"] >= $client["limit_dns_record"]) { |
| | | $app->error($app->tform->wordbook["limit_dns_record_txt"]); |
| | | } |
| | | } |
| | | } |
| | | |
| | | parent::onShowNew(); |
| | | } |
| | | |
| | | function onSubmit() { |
| | | global $app, $conf; |
| | | |
| | | // Get the parent soa record of the domain |
| | | $soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = '".$app->functions->intval($_POST["zone"])."' AND ".$app->tform->getAuthSQL('r')); |
| | | |
| | | // Check if Domain belongs to user |
| | | if($soa["id"] != $_POST["zone"]) $app->tform->errorMessage .= $app->tform->wordbook["no_zone_perm"]; |
| | | |
| | | // 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 = intval($_SESSION["s"]["user"]["default_group"]); |
| | | $client = $app->db->queryOneRecord("SELECT limit_dns_record 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 mailbox. |
| | | if($this->id == 0 && $client["limit_dns_record"] >= 0) { |
| | | $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id"); |
| | | if($tmp["number"] >= $client["limit_dns_record"]) { |
| | | $app->error($app->tform->wordbook["limit_dns_record_txt"]); |
| | | } |
| | | } |
| | | } // end if user is not admin |
| | | |
| | | |
| | | // Set the server ID of the rr record to the same server ID as the parent record. |
| | | $this->dataRecord["server_id"] = $soa["server_id"]; |
| | | |
| | | // Update the serial number and timestamp of the RR record |
| | | $soa = $app->db->queryOneRecord("SELECT serial FROM dns_rr WHERE id = ".$this->id); |
| | | $this->dataRecord["serial"] = $app->validate_dns->increase_serial($soa["serial"]); |
| | | $this->dataRecord["stamp"] = date('Y-m-d H:i:s'); |
| | | |
| | | parent::onSubmit(); |
| | | } |
| | | |
| | | function onAfterInsert() { |
| | | global $app, $conf; |
| | | |
| | | //* Set the sys_groupid of the rr record to be the same then the sys_groupid of the soa record |
| | | $soa = $app->db->queryOneRecord("SELECT sys_groupid,serial FROM dns_soa WHERE id = '".$app->functions->intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r')); |
| | | $app->db->datalogUpdate('dns_rr', "sys_groupid = ".$soa['sys_groupid'], 'id', $this->id); |
| | | |
| | | //* Update the serial number of the SOA record |
| | | $soa_id = $app->functions->intval($_POST["zone"]); |
| | | $serial = $app->validate_dns->increase_serial($soa["serial"]); |
| | | $app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id); |
| | | } |
| | | |
| | | function onAfterUpdate() { |
| | | global $app, $conf; |
| | | |
| | | //* Update the serial number of the SOA record |
| | | $soa = $app->db->queryOneRecord("SELECT serial FROM dns_soa WHERE id = '".$app->functions->intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r')); |
| | | $soa_id = $app->functions->intval($_POST["zone"]); |
| | | $serial = $app->validate_dns->increase_serial($soa["serial"]); |
| | | $app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id); |
| | | } |
| | | class page_action extends dns_page_action { |
| | | |
| | | } |
| | | |
| | |
| | | global $app; $conf; |
| | | |
| | | //* Update the serial number of the SOA record |
| | | $soa = $app->db->queryOneRecord("SELECT serial FROM dns_soa WHERE id = '".$app->functions->intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r')); |
| | | $soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = ? AND " . $app->tform->getAuthSQL('r'), $this->dataRecord["zone"]); |
| | | $soa_id = $app->functions->intval($this->dataRecord["zone"]); |
| | | $serial = $app->validate_dns->increase_serial($soa["serial"]); |
| | | $app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id); |
| | | $app->db->datalogUpdate('dns_soa', array("serial" => $serial), 'id', $soa_id); |
| | | } |
| | | |
| | | } |
| | |
| | | if($app->tform->checkPerm($this->id, 'd') == false) $app->error($app->lng('error_no_delete_permission')); |
| | | |
| | | // Delete all records that belog to this zone. |
| | | $records = $app->db->queryAllRecords("SELECT id FROM dns_slave WHERE zone = '".$app->functions->intval($this->id)."'"); |
| | | $records = $app->db->queryAllRecords("SELECT id FROM dns_slave WHERE zone = ?", $this->id); |
| | | foreach($records as $rec) { |
| | | $app->db->datalogDelete('dns_slave', 'id', $rec['id']); |
| | | } |
| | |
| | | |
| | | // Get the limits of the client |
| | | $client_group_id = intval($_SESSION["s"]["user"]["default_group"]); |
| | | $client = $app->db->queryOneRecord("SELECT client.client_id, sys_group.name, 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 FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); |
| | | $client = $app->db->queryOneRecord("SELECT client.client_id, sys_group.name, 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 FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id); |
| | | |
| | | // 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 = ".$client['client_id']." ORDER BY client.company_name, client.contact_name, sys_group.name"; |
| | | $clients = $app->db->queryAllRecords($sql); |
| | | $tmp = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ".$client['client_id']); |
| | | $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']); |
| | | $tmp = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ?", $client['client_id']); |
| | | $client_select = '<option value="'.$tmp['groupid'].'">'.$client['contactname'].'</option>'; |
| | | //$tmp_data_record = $app->tform->getDataRecord($this->id); |
| | | if(is_array($clients)) { |
| | |
| | | if($_SESSION["s"]["user"]["typ"] != 'admin') { |
| | | // Get the limits of the client |
| | | $client_group_id = intval($_SESSION["s"]["user"]["default_group"]); |
| | | $client = $app->db->queryOneRecord("SELECT limit_dns_slave_zone, default_slave_dnsserver FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); |
| | | $client = $app->db->queryOneRecord("SELECT limit_dns_slave_zone, default_slave_dnsserver 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 dns_slave WHERE id = ".$app->functions->intval($this->id)); |
| | | $tmp = $app->db->queryOneRecord("SELECT server_id FROM dns_slave WHERE id = ?", $this->id); |
| | | $this->dataRecord["server_id"] = $tmp["server_id"]; |
| | | unset($tmp); |
| | | // When the record is inserted |
| | |
| | | if(strlen($this->dataRecord["origin"]) > 0 && substr($this->dataRecord["origin"], -1, 1) != '.') $this->dataRecord["origin"] .= '.'; |
| | | |
| | | //* Check if a primary zone with the same name already exists |
| | | $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_soa WHERE origin = \"".$app->db->quote($this->dataRecord["origin"])."\" AND server_id= \"".$app->db->quote($this->dataRecord["server_id"])."\""); |
| | | $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_soa WHERE origin = ? AND server_id = ?", $this->dataRecord["origin"], $this->dataRecord["server_id"]); |
| | | if($tmp["number"] > 0) { |
| | | $app->error($app->tform->wordbook["origin_error_unique"]); |
| | | } |
| | |
| | | global $app, $conf; |
| | | |
| | | // Check if record is existing already |
| | | $duplicate_slave = $app->db->queryOneRecord("SELECT * FROM dns_slave WHERE origin = '".$app->db->quote($this->dataRecord["origin"])."' AND server_id = ".$app->functions->intval($this->dataRecord["server_id"])." AND ".$app->tform->getAuthSQL('r')); |
| | | $duplicate_slave = $app->db->queryOneRecord("SELECT * FROM dns_slave WHERE origin = ? AND server_id = ? AND ".$app->tform->getAuthSQL('r'), $this->dataRecord["origin"], $this->dataRecord["server_id"]); |
| | | |
| | | if(is_array($duplicate_slave) && !empty($duplicate_slave)) $app->error($app->tform->wordbook["origin_error_unique"]); |
| | | |
| | |
| | | if($app->tform->checkPerm($this->id, 'd') == false) $app->error($app->lng('error_no_delete_permission')); |
| | | |
| | | // Delete all records that belog to this zone. |
| | | $records = $app->db->queryAllRecords("SELECT id FROM dns_rr WHERE zone = '".$app->functions->intval($this->id)."'"); |
| | | $records = $app->db->queryAllRecords("SELECT id FROM dns_rr WHERE zone = ?", $this->id); |
| | | foreach($records as $rec) { |
| | | $app->db->datalogDelete('dns_rr', 'id', $rec['id']); |
| | | } |
| | |
| | | |
| | | // Get the limits of the client |
| | | $client_group_id = intval($_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 = $client_group_id"); |
| | | $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 = ?", $client_group_id); |
| | | |
| | | // 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 = ".$client['client_id']." ORDER BY client.company_name, client.contact_name, sys_group.name"; |
| | | $clients = $app->db->queryAllRecords($sql); |
| | | $tmp = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ".$client['client_id']); |
| | | $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']); |
| | | $tmp = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ?", $client['client_id']); |
| | | $client_select = '<option value="'.$tmp['groupid'].'">'.$client['contactname'].'</option>'; |
| | | //$tmp_data_record = $app->tform->getDataRecord($this->id); |
| | | if(is_array($clients)) { |
| | |
| | | if($_SESSION["s"]["user"]["typ"] != 'admin') |
| | | { |
| | | $client_group_id = $_SESSION["s"]["user"]["default_group"]; |
| | | $client_dns = $app->db->queryOneRecord("SELECT dns_servers FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); |
| | | $client_dns = $app->db->queryOneRecord("SELECT dns_servers FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id); |
| | | |
| | | $client_dns['dns_servers_ids'] = explode(',', $client_dns['dns_servers']); |
| | | |
| | |
| | | $app->tpl->setVar('server_id_value', $client_dns['dns_servers_ids'][0]); |
| | | } |
| | | |
| | | $sql = "SELECT server_id, server_name FROM server WHERE server_id IN (" . $client_dns['dns_servers'] . ");"; |
| | | $dns_servers = $app->db->queryAllRecords($sql); |
| | | $sql = "SELECT server_id, server_name FROM server WHERE server_id IN ?"; |
| | | $dns_servers = $app->db->queryAllRecords($sql, $client_dns['dns_servers_ids']); |
| | | |
| | | $options_dns_servers = ""; |
| | | |
| | | foreach ($dns_servers as $dns_server) { |
| | | $options_dns_servers .= "<option value='$dns_server[server_id]'>$dns_server[server_name]</option>"; |
| | | $options_dns_servers .= '<option value="'.$dns_server['server_id'].'"'.($this->id > 0 && $this->dataRecord["server_id"] == $dns_server['server_id'] ? ' selected="selected"' : '').'>'.$dns_server['server_name'].'</option>'; |
| | | } |
| | | |
| | | $app->tpl->setVar("client_server_id", $options_dns_servers); |
| | |
| | | if($_SESSION["s"]["user"]["typ"] != 'admin') { |
| | | // Get the limits of the client |
| | | $client_group_id = $_SESSION["s"]["user"]["default_group"]; |
| | | $client = $app->db->queryOneRecord("SELECT limit_dns_zone, dns_servers FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); |
| | | $client = $app->db->queryOneRecord("SELECT limit_dns_zone, dns_servers FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id); |
| | | |
| | | $client['dns_servers_ids'] = explode(',', $client['dns_servers']); |
| | | |
| | |
| | | // 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 dns_soa WHERE id = ".$app->functions->intval($this->id)); |
| | | $tmp = $app->db->queryOneRecord("SELECT server_id FROM dns_soa WHERE id = ?", $this->id); |
| | | $this->dataRecord["server_id"] = $tmp["server_id"]; |
| | | unset($tmp); |
| | | // When the record is inserted |
| | | } else { |
| | | // Check if the user may add another maildomain. |
| | | if($client["limit_dns_zone"] >= 0) { |
| | | $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_soa WHERE sys_groupid = $client_group_id"); |
| | | $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_soa WHERE sys_groupid = ?", $client_group_id); |
| | | if($tmp["number"] >= $client["limit_dns_zone"]) { |
| | | $app->error($app->tform->wordbook["limit_dns_zone_txt"]); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /* |
| | | // Update the serial number of the SOA record |
| | | $soa = $app->db->queryOneRecord("SELECT serial FROM dns_soa WHERE id = ".$this->id); |
| | | $this->dataRecord["serial"] = $app->validate_dns->increase_serial($soa["serial"]); |
| | | */ |
| | | |
| | | |
| | | //* Check if soa, ns and mbox have a dot at the end |
| | | if(strlen($this->dataRecord["origin"]) > 0 && substr($this->dataRecord["origin"], -1, 1) != '.') $this->dataRecord["origin"] .= '.'; |
| | |
| | | |
| | | //* 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($_SESSION["s"]["user"]["typ"] != 'admin' && !$app->auth->has_clients($_SESSION['s']['user']['userid']) && isset($this->dataRecord['origin'])) { |
| | | //* We do not allow users to change a domain which has been created by the admin |
| | | $rec = $app->db->queryOneRecord("SELECT origin from dns_soa WHERE id = ".$this->id); |
| | | $drOrigin = (isset($this->dataRecord['origin'])) |
| | | ? $app->functions->idn_encode($this->dataRecord['origin']) |
| | | : false; |
| | | $rec = $app->db->queryOneRecord("SELECT origin from dns_soa WHERE id = ?", $this->id); |
| | | $drOrigin = $app->functions->idn_encode($this->dataRecord['origin']); |
| | | |
| | | if($rec['origin'] !== $drOrigin && $app->tform->checkPerm($this->id, 'u')) { |
| | | //* Add a error message and switch back to old server |
| | | $app->tform->errorMessage .= $app->lng('The Zone (soa) can not be changed. Please ask your Administrator if you want to change the Zone name.'); |
| | | $app->tform->errorMessage .= $app->tform->wordbook["soa_cannot_be_changed_txt"]; |
| | | $this->dataRecord["origin"] = $rec['origin']; |
| | | } |
| | | unset($rec); |
| | |
| | | |
| | | // Get the limits of the client |
| | | $client_group_id = intval($_SESSION["s"]["user"]["default_group"]); |
| | | $client = $app->db->queryOneRecord("SELECT limit_dns_record FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = =", $client_group_id); |
| | | $client = $app->db->queryOneRecord("SELECT limit_dns_record 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 mailbox. |
| | | if($client["limit_dns_record"] >= 0) { |
| | |
| | | $zone = $app->functions->intval($_GET['zone']); |
| | | |
| | | //* check for an existing spf-record |
| | | $sql = "SELECT data, active FROM dns_rr WHERE data LIKE 'v=spf1%' AND zone = ? AND ?"; |
| | | $rec = $app->db->queryOneRecord($sql, $zone, $app->tform->getAuthSQL('r')); |
| | | $sql = "SELECT data, active FROM dns_rr WHERE data LIKE 'v=spf1%' AND zone = ? AND " . $app->tform->getAuthSQL('r'); |
| | | $rec = $app->db->queryOneRecord($sql, $zone); |
| | | if ( isset($rec) && !empty($rec) ) { |
| | | $this->id = 1; |
| | | $old_data = strtolower($rec['data']); |
| | |
| | | |
| | | |
| | | // Get the parent soa record of the domain |
| | | $soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = ? AND ?", $app->functions->intval($_POST["zone"]), $app->tform->getAuthSQL('r')); |
| | | $soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = ? AND " . $app->tform->getAuthSQL('r'), $app->functions->intval($_POST["zone"])); |
| | | |
| | | // Check if Domain belongs to user |
| | | if($soa["id"] != $_POST["zone"]) $app->tform->errorMessage .= $app->tform->wordbook["no_zone_perm"]; |
| | |
| | | global $app, $conf; |
| | | |
| | | //* Set the sys_groupid of the rr record to be the same then the sys_groupid of the soa record |
| | | $soa = $app->db->queryOneRecord("SELECT sys_groupid,serial FROM dns_soa WHERE id = ? AND ?", $app->functions->intval($this->dataRecord["zone"]), $app->tform->getAuthSQL('r')); |
| | | $app->db->datalogUpdate('dns_rr', "sys_groupid = ".$soa['sys_groupid'], 'id', $this->id); |
| | | $soa = $app->db->queryOneRecord("SELECT sys_groupid,serial FROM dns_soa WHERE id = ? AND " . $app->tform->getAuthSQL('r'), $app->functions->intval($this->dataRecord["zone"])); |
| | | $app->db->datalogUpdate('dns_rr', array("sys_groupid" => $soa['sys_groupid']), 'id', $this->id); |
| | | |
| | | //* Update the serial number of the SOA record |
| | | $soa_id = $app->functions->intval($_POST["zone"]); |
| | | $serial = $app->validate_dns->increase_serial($soa["serial"]); |
| | | $app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id); |
| | | $app->db->datalogUpdate('dns_soa', array("serial" => $serial), 'id', $soa_id); |
| | | |
| | | } |
| | | |
| | |
| | | global $app, $conf; |
| | | |
| | | //* Update the serial number of the SOA record |
| | | $soa = $app->db->queryOneRecord("SELECT serial FROM dns_soa WHERE id = ? AND ?", $app->functions->intval($this->dataRecord["zone"]), $app->tform->getAuthSQL('r')); |
| | | $soa = $app->db->queryOneRecord("SELECT serial FROM dns_soa WHERE id = ? AND " . $app->tform->getAuthSQL('r'), $app->functions->intval($this->dataRecord["zone"])); |
| | | $soa_id = $app->functions->intval($_POST["zone"]); |
| | | $serial = $app->validate_dns->increase_serial($soa["serial"]); |
| | | $app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id); |
| | | $app->db->datalogUpdate('dns_soa', array("serial" => $serial), 'id', $soa_id); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | require_once '../../lib/config.inc.php'; |
| | | require_once '../../lib/app.inc.php'; |
| | | |
| | | //* Check permissions for module |
| | | $app->auth->check_module_permissions('dns'); |
| | | require_once './dns_edit_base.php'; |
| | | |
| | | // Loading classes |
| | | $app->uses('tpl,tform,tform_actions,validate_dns'); |
| | | $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') { |
| | | |
| | | // Get the limits of the client |
| | | $client_group_id = intval($_SESSION["s"]["user"]["default_group"]); |
| | | $client = $app->db->queryOneRecord("SELECT limit_dns_record 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 mailbox. |
| | | if($client["limit_dns_record"] >= 0) { |
| | | $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id"); |
| | | if($tmp["number"] >= $client["limit_dns_record"]) { |
| | | $app->error($app->tform->wordbook["limit_dns_record_txt"]); |
| | | } |
| | | } |
| | | } |
| | | |
| | | parent::onShowNew(); |
| | | } |
| | | class page_action extends dns_page_action { |
| | | |
| | | function onShowEnd() { |
| | | global $app, $conf; |
| | |
| | | |
| | | function onBeforeUpdate() { |
| | | $this->dataRecord['data'] = $this->dataRecord['weight'] .' '. $this->dataRecord['port'] .' '. $this->dataRecord['target']; |
| | | } |
| | | |
| | | function onSubmit() { |
| | | global $app, $conf; |
| | | |
| | | // Get the parent soa record of the domain |
| | | $soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = '".$app->functions->intval($_POST["zone"])."' AND ".$app->tform->getAuthSQL('r')); |
| | | |
| | | // Check if Domain belongs to user |
| | | if($soa["id"] != $_POST["zone"]) $app->tform->errorMessage .= $app->tform->wordbook["no_zone_perm"]; |
| | | |
| | | // 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 = $_SESSION["s"]["user"]["default_group"]; |
| | | $client = $app->db->queryOneRecord("SELECT limit_dns_record 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 mailbox. |
| | | if($this->id == 0 && $client["limit_dns_record"] >= 0) { |
| | | $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id"); |
| | | if($tmp["number"] >= $client["limit_dns_record"]) { |
| | | $app->error($app->tform->wordbook["limit_dns_record_txt"]); |
| | | } |
| | | } |
| | | } // end if user is not admin |
| | | |
| | | |
| | | // Set the server ID of the rr record to the same server ID as the parent record. |
| | | $this->dataRecord["server_id"] = $soa["server_id"]; |
| | | |
| | | // Update the serial number and timestamp of the RR record |
| | | $soa = $app->db->queryOneRecord("SELECT serial FROM dns_rr WHERE id = ".$this->id); |
| | | $this->dataRecord["serial"] = $app->validate_dns->increase_serial($soa["serial"]); |
| | | $this->dataRecord["stamp"] = date('Y-m-d H:i:s'); |
| | | |
| | | parent::onSubmit(); |
| | | } |
| | | |
| | | function onAfterInsert() { |
| | | global $app, $conf; |
| | | |
| | | //* Set the sys_groupid of the rr record to be the same then the sys_groupid of the soa record |
| | | $soa = $app->db->queryOneRecord("SELECT sys_groupid,serial FROM dns_soa WHERE id = '".$app->functions->intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r')); |
| | | $app->db->datalogUpdate('dns_rr', "sys_groupid = ".$soa['sys_groupid'], 'id', $this->id); |
| | | |
| | | //* Update the serial number of the SOA record |
| | | $soa_id = $app->functions->intval($_POST["zone"]); |
| | | $serial = $app->validate_dns->increase_serial($soa["serial"]); |
| | | $app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id); |
| | | } |
| | | |
| | | function onAfterUpdate() { |
| | | global $app, $conf; |
| | | |
| | | //* Update the serial number of the SOA record |
| | | $soa = $app->db->queryOneRecord("SELECT serial FROM dns_soa WHERE id = '".$app->functions->intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r')); |
| | | $soa_id = $app->functions->intval($_POST["zone"]); |
| | | $serial = $app->validate_dns->increase_serial($soa["serial"]); |
| | | $app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | require_once '../../lib/config.inc.php'; |
| | | require_once '../../lib/app.inc.php'; |
| | | |
| | | //* Check permissions for module |
| | | $app->auth->check_module_permissions('dns'); |
| | | require_once './dns_edit_base.php'; |
| | | |
| | | // Loading classes |
| | | $app->uses('tpl,tform,tform_actions,validate_dns'); |
| | | $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') { |
| | | |
| | | // Get the limits of the client |
| | | $client_group_id = intval($_SESSION["s"]["user"]["default_group"]); |
| | | $client = $app->db->queryOneRecord("SELECT limit_dns_record 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 mailbox. |
| | | if($client["limit_dns_record"] >= 0) { |
| | | $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id"); |
| | | if($tmp["number"] >= $client["limit_dns_record"]) { |
| | | $app->error($app->tform->wordbook["limit_dns_record_txt"]); |
| | | } |
| | | } |
| | | } |
| | | |
| | | parent::onShowNew(); |
| | | } |
| | | |
| | | function onSubmit() { |
| | | global $app, $conf; |
| | | |
| | | // Get the parent soa record of the domain |
| | | $soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = '".$app->functions->intval($_POST["zone"])."' AND ".$app->tform->getAuthSQL('r')); |
| | | |
| | | // Check if Domain belongs to user |
| | | if($soa["id"] != $_POST["zone"]) $app->tform->errorMessage .= $app->tform->wordbook["no_zone_perm"]; |
| | | |
| | | // 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 = intval($_SESSION["s"]["user"]["default_group"]); |
| | | $client = $app->db->queryOneRecord("SELECT limit_dns_record 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 mailbox. |
| | | if($this->id == 0 && $client["limit_dns_record"] >= 0) { |
| | | $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id"); |
| | | if($tmp["number"] >= $client["limit_dns_record"]) { |
| | | $app->error($app->tform->wordbook["limit_dns_record_txt"]); |
| | | } |
| | | } |
| | | } // end if user is not admin |
| | | |
| | | |
| | | // Set the server ID of the rr record to the same server ID as the parent record. |
| | | $this->dataRecord["server_id"] = $soa["server_id"]; |
| | | |
| | | // Update the serial number and timestamp of the RR record |
| | | $soa = $app->db->queryOneRecord("SELECT serial FROM dns_rr WHERE id = ".$this->id); |
| | | $this->dataRecord["serial"] = $app->validate_dns->increase_serial($soa["serial"]); |
| | | $this->dataRecord["stamp"] = date('Y-m-d H:i:s'); |
| | | |
| | | parent::onSubmit(); |
| | | } |
| | | |
| | | function onAfterInsert() { |
| | | global $app, $conf; |
| | | |
| | | //* Set the sys_groupid of the rr record to be the same then the sys_groupid of the soa record |
| | | $soa = $app->db->queryOneRecord("SELECT sys_groupid,serial FROM dns_soa WHERE id = '".$app->functions->intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r')); |
| | | $app->db->datalogUpdate('dns_rr', "sys_groupid = ".$soa['sys_groupid'], 'id', $this->id); |
| | | |
| | | //* Update the serial number of the SOA record |
| | | $soa_id = $app->functions->intval($_POST["zone"]); |
| | | $serial = $app->validate_dns->increase_serial($soa["serial"]); |
| | | $app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id); |
| | | } |
| | | |
| | | function onAfterUpdate() { |
| | | global $app, $conf; |
| | | |
| | | //* Update the serial number of the SOA record |
| | | $soa = $app->db->queryOneRecord("SELECT serial FROM dns_soa WHERE id = '".$app->functions->intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r')); |
| | | $soa_id = $app->functions->intval($_POST["zone"]); |
| | | $serial = $app->validate_dns->increase_serial($soa["serial"]); |
| | | $app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id); |
| | | } |
| | | class page_action extends dns_page_action { |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | // 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, 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->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 = ?", $client_group_id); |
| | | |
| | | |
| | | if ($domains_settings['use_domain_module'] != 'y') { |
| | | // load the list of clients |
| | | $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 = ".$app->functions->intval($client['client_id'])." ORDER BY client.company_name, client.contact_name, sys_group.name"; |
| | | $clients = $app->db->queryAllRecords($sql); |
| | | $tmp = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ".$app->functions->intval($client['client_id'])); |
| | | $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']); |
| | | $tmp = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ?", $client['client_id']); |
| | | $client_select = '<option value="'.$tmp['groupid'].'">'.$client['contactname'].'</option>'; |
| | | if(is_array($clients)) { |
| | | foreach( $clients as $client) { |
| | |
| | | if($_SESSION["s"]["user"]["typ"] != 'admin') |
| | | { |
| | | $client_group_id = $app->functions->intval($_SESSION["s"]["user"]["default_group"]); |
| | | $client_dns = $app->db->queryOneRecord("SELECT dns_servers FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); |
| | | $client_dns = $app->db->queryOneRecord("SELECT dns_servers FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id); |
| | | |
| | | $client_dns['dns_servers_ids'] = explode(',', $client_dns['dns_servers']); |
| | | |
| | |
| | | $app->tpl->setVar('server_id_value', $client_dns['dns_servers_ids'][0]); |
| | | } |
| | | |
| | | $sql = "SELECT server_id, server_name FROM server WHERE server_id IN (" . $client_dns['dns_servers'] . ");"; |
| | | $dns_servers = $app->db->queryAllRecords($sql); |
| | | $sql = "SELECT server_id, server_name FROM server WHERE server_id IN ?"; |
| | | $dns_servers = $app->db->queryAllRecords($sql, $client_dns['dns_servers_ids']); |
| | | |
| | | $options_dns_servers = ""; |
| | | |
| | | foreach ($dns_servers as $dns_server) { |
| | | $options_dns_servers .= "<option value='$dns_server[server_id]'>$dns_server[server_name]</option>"; |
| | | $options_dns_servers .= '<option value="'.$dns_server['server_id'].'"'.($_POST['server_id'] == $dns_server['server_id'] ? ' selected="selected"' : '').'>'.$dns_server['server_name'].'</option>'; |
| | | } |
| | | |
| | | $app->tpl->setVar("server_id", $options_dns_servers); |
| | |
| | | |
| | | } |
| | | |
| | | $template_record = $app->db->queryOneRecord("SELECT * FROM dns_template WHERE template_id = '".$app->functions->intval($template_id)."'"); |
| | | $template_record = $app->db->queryOneRecord("SELECT * FROM dns_template WHERE template_id = ?", $template_id); |
| | | $fields = explode(',', $template_record['fields']); |
| | | if(is_array($fields)) { |
| | | foreach($fields as $field) { |
| | |
| | | } |
| | | |
| | | if($_POST['create'] == 1) { |
| | | |
| | | |
| | | //* CSRF Check |
| | | $app->auth->csrf_token_check(); |
| | | |
| | | $error = ''; |
| | | |
| | | if ($post_server_id) |
| | | { |
| | | $client_group_id = $app->functions->intval($_SESSION["s"]["user"]["default_group"]); |
| | | $client = $app->db->queryOneRecord("SELECT dns_servers FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); |
| | | $client = $app->db->queryOneRecord("SELECT dns_servers FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id); |
| | | |
| | | $client['dns_servers_ids'] = explode(',', $client['dns_servers']); |
| | | |
| | |
| | | if($section == 'dns_records') { |
| | | $parts = explode('|', $row); |
| | | $dns_rr[] = array( |
| | | 'name' => $app->db->quote($parts[1]), |
| | | 'type' => $app->db->quote($parts[0]), |
| | | 'data' => $app->db->quote($parts[2]), |
| | | 'aux' => $app->db->quote($parts[3]), |
| | | 'ttl' => $app->db->quote($parts[4]) |
| | | 'name' => $parts[1], |
| | | 'type' => $parts[0], |
| | | 'data' => $parts[2], |
| | | 'aux' => $parts[3], |
| | | 'ttl' => $parts[4] |
| | | ); |
| | | } |
| | | } |
| | |
| | | if($error == '') { |
| | | // Insert the soa record |
| | | $sys_userid = $_SESSION['s']['user']['userid']; |
| | | $origin = $app->db->quote($vars['origin']); |
| | | $ns = $app->db->quote($vars['ns']); |
| | | $mbox = $app->db->quote(str_replace('@', '.', $vars['mbox'])); |
| | | $refresh = $app->db->quote($vars['refresh']); |
| | | $retry = $app->db->quote($vars['retry']); |
| | | $expire = $app->db->quote($vars['expire']); |
| | | $minimum = $app->db->quote($vars['minimum']); |
| | | $ttl = $app->db->quote($vars['ttl']); |
| | | $xfer = $app->db->quote($vars['xfer']); |
| | | $also_notify = $app->db->quote($vars['also_notify']); |
| | | $update_acl = $app->db->quote($vars['update_acl']); |
| | | $origin = $vars['origin']; |
| | | $ns = $vars['ns']; |
| | | $mbox = str_replace('@', '.', $vars['mbox']); |
| | | $refresh = $vars['refresh']; |
| | | $retry = $vars['retry']; |
| | | $expire = $vars['expire']; |
| | | $minimum = $vars['minimum']; |
| | | $ttl = $vars['ttl']; |
| | | $xfer = $vars['xfer']; |
| | | $also_notify = $vars['also_notify']; |
| | | $update_acl = $vars['update_acl']; |
| | | $serial = $app->validate_dns->increase_serial(0); |
| | | |
| | | $insert_data = "(`sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `server_id`, `origin`, `ns`, `mbox`, `serial`, `refresh`, `retry`, `expire`, `minimum`, `ttl`, `active`, `xfer`, `also_notify`, `update_acl`) VALUES |
| | | ('$sys_userid', '$sys_groupid', 'riud', 'riud', '', '$server_id', '$origin', '$ns', '$mbox', '$serial', '$refresh', '$retry', '$expire', '$minimum', '$ttl', 'Y', '$xfer', '$also_notify', '$update_acl')"; |
| | | $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, |
| | | "origin" => $origin, |
| | | "ns" => $ns, |
| | | "mbox" => $mbox, |
| | | "serial" => $serial, |
| | | "refresh" => $refresh, |
| | | "retry" => $retry, |
| | | "expire" => $expire, |
| | | "minimum" => $minimum, |
| | | "ttl" => $ttl, |
| | | "active" => 'Y', |
| | | "xfer" => $xfer, |
| | | "also_notify" => $also_notify, |
| | | "update_acl" => $update_acl |
| | | ); |
| | | $dns_soa_id = $app->db->datalogInsert('dns_soa', $insert_data, 'id'); |
| | | |
| | | // Insert the dns_rr records |
| | | if(is_array($dns_rr) && $dns_soa_id > 0) { |
| | | foreach($dns_rr as $rr) { |
| | | $insert_data = "(`sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `server_id`, `zone`, `name`, `type`, `data`, `aux`, `ttl`, `active`) VALUES |
| | | ('$sys_userid', '$sys_groupid', 'riud', 'riud', '', '$server_id', '$dns_soa_id', '$rr[name]', '$rr[type]', '$rr[data]', '$rr[aux]', '$rr[ttl]', 'Y')"; |
| | | $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" => $rr['name'], |
| | | "type" => $rr['type'], |
| | | "data" => $rr['data'], |
| | | "aux" => $rr['aux'], |
| | | "ttl" => $rr['ttl'], |
| | | "active" => 'Y' |
| | | ); |
| | | $dns_rr_id = $app->db->datalogInsert('dns_rr', $insert_data, 'id'); |
| | | } |
| | | } |
| | |
| | | |
| | | $app->tpl->setVar("title", 'DNS Wizard'); |
| | | |
| | | //* SET csrf token |
| | | $csrf_token = $app->auth->csrf_token_get('dns_wizard'); |
| | | $app->tpl->setVar('_csrf_id',$csrf_token['csrf_id']); |
| | | $app->tpl->setVar('_csrf_key',$csrf_token['csrf_key']); |
| | | |
| | | $lng_file = 'lib/lang/'.$_SESSION['s']['language'].'_dns_wizard.lng'; |
| | | include $lng_file; |
| | | $app->tpl->setVar($wb); |
| | |
| | | 'range' => '60:', |
| | | 'errmsg'=> 'ttl_range_error'), |
| | | ), |
| | | 'default' => '86400', |
| | | 'default' => '3600', |
| | | 'value' => '', |
| | | 'width' => '10', |
| | | 'maxlength' => '10' |
| | |
| | | 'range' => '60:', |
| | | 'errmsg'=> 'ttl_range_error'), |
| | | ), |
| | | 'default' => '86400', |
| | | 'default' => '3600', |
| | | 'value' => '', |
| | | 'width' => '10', |
| | | 'maxlength' => '10' |
| | |
| | | 'range' => '60:', |
| | | 'errmsg'=> 'ttl_range_error'), |
| | | ), |
| | | 'default' => '86400', |
| | | 'default' => '3600', |
| | | 'value' => '', |
| | | 'width' => '10', |
| | | 'maxlength' => '10' |
| | |
| | | 'type' => 'TOLOWER') |
| | | ), |
| | | 'validators' => array ( 0 => array ( 'type' => 'REGEX', |
| | | 'regex' => '/^[a-zA-Z0-9\.\-\*]{0,255}$/', |
| | | 'regex' => '/^[a-zA-Z0-9\.\-\*\_]{0,255}$/', |
| | | 'errmsg'=> 'name_error_regex'), |
| | | ), |
| | | 'default' => '', |
| | |
| | | 'range' => '60:', |
| | | 'errmsg'=> 'ttl_range_error'), |
| | | ), |
| | | 'default' => '86400', |
| | | 'default' => '3600', |
| | | 'value' => '', |
| | | 'width' => '10', |
| | | 'maxlength' => '10' |
| | |
| | | 'range' => '60:', |
| | | 'errmsg'=> 'ttl_range_error'), |
| | | ), |
| | | 'default' => '86400', |
| | | 'default' => '3600', |
| | | 'value' => '', |
| | | 'width' => '10', |
| | | 'maxlength' => '10' |
| | |
| | | 'range' => '60:', |
| | | 'errmsg'=> 'ttl_range_error'), |
| | | ), |
| | | 'default' => '86400', |
| | | 'default' => '3600', |
| | | 'value' => '', |
| | | 'width' => '10', |
| | | 'maxlength' => '10' |
| | |
| | | 'range' => '60:', |
| | | 'errmsg'=> 'ttl_range_error'), |
| | | ), |
| | | 'default' => '86400', |
| | | 'default' => '3600', |
| | | 'value' => '', |
| | | 'width' => '10', |
| | | 'maxlength' => '10' |
| | |
| | | 'range' => '60:', |
| | | 'errmsg'=> 'ttl_range_error'), |
| | | ), |
| | | 'default' => '86400', |
| | | 'default' => '3600', |
| | | 'value' => '', |
| | | 'width' => '10', |
| | | 'maxlength' => '10' |
| | |
| | | 'range' => '60:', |
| | | 'errmsg'=> 'ttl_range_error'), |
| | | ), |
| | | 'default' => '86400', |
| | | 'default' => '3600', |
| | | 'value' => '', |
| | | 'width' => '10', |
| | | 'maxlength' => '10' |
| | |
| | | 'range' => '60:', |
| | | 'errmsg'=> 'ttl_range_error'), |
| | | ), |
| | | 'default' => '86400', |
| | | 'default' => '3600', |
| | | 'value' => '', |
| | | 'width' => '10', |
| | | 'maxlength' => '10' |
| | |
| | | 'range' => '60:', |
| | | 'errmsg'=> 'minimum_range_error'), |
| | | ), |
| | | 'default' => '86400', |
| | | 'default' => '3600', |
| | | 'value' => '', |
| | | 'width' => '10', |
| | | 'maxlength' => '10' |
| | |
| | | 'range' => '60:', |
| | | 'errmsg'=> 'ttl_range_error'), |
| | | ), |
| | | 'default' => '86400', |
| | | 'default' => '3600', |
| | | 'value' => '', |
| | | 'width' => '10', |
| | | 'maxlength' => '10' |
| | |
| | | 'range' => '60:', |
| | | 'errmsg'=> 'ttl_range_error'), |
| | | ), |
| | | 'default' => '86400', |
| | | 'default' => '3600', |
| | | 'value' => '', |
| | | 'width' => '10', |
| | | 'maxlength' => '10' |
| | |
| | | 'range' => '60:', |
| | | 'errmsg'=> 'ttl_range_error'), |
| | | ), |
| | | 'default' => '86400', |
| | | 'default' => '3600', |
| | | 'value' => '', |
| | | 'width' => '10', |
| | | 'maxlength' => '10' |
| | |
| | | $wb['dmarc_pct_txt'] = 'Apply Policy to this Percentage'; |
| | | $wb['dmarc_pct_note_txt'] = '% (100 default). Messages in percent from the domain you want ISPs to check.'; |
| | | $wb['dmarc_ri_txt'] = 'Reporting Interval'; |
| | | $wb['dmarc_ri_note_txt'] = 'Seconds (default=86400). The time in seconds that aggregate reports should be generate (86400 repersents 1 day).'; |
| | | $wb['dmarc_ri_note_txt'] = 'Seconds (default=86400). The time in seconds that aggregate reports should be generate (86400 represents 1 day).'; |
| | | $wb['dmarc_sp_txt'] = 'Subdomain Policy (Defaults to same as domain).'; |
| | | $wb['dmarc_sp_same_txt'] = 'same as domain'; |
| | | $wb['dmarc_sp_none_txt'] = 'none'; |
| | |
| | | $wb['dmarc_pct_txt'] = 'Apply Policy to this Percentage'; |
| | | $wb['dmarc_pct_note_txt'] = '% (100 default). Messages in percent from the domain you want ISPs to check.'; |
| | | $wb['dmarc_ri_txt'] = 'Reporting Interval'; |
| | | $wb['dmarc_ri_note_txt'] = 'Seconds (default=86400). The time in seconds that aggregate reports should be generate (86400 repersents 1 day).'; |
| | | $wb['dmarc_ri_note_txt'] = 'Seconds (default=86400). The time in seconds that aggregate reports should be generate (86400 represents 1 day).'; |
| | | $wb['dmarc_sp_txt'] = 'Subdomain Policy (Defaults to same as domain).'; |
| | | $wb['dmarc_sp_same_txt'] = 'same as domain'; |
| | | $wb['dmarc_sp_none_txt'] = 'none'; |
| | |
| | | $wb['dmarc_pct_txt'] = 'Apply Policy to this Percentage'; |
| | | $wb['dmarc_pct_note_txt'] = '% (100 default). Messages in percent from the domain you want ISPs to check.'; |
| | | $wb['dmarc_ri_txt'] = 'Reporting Interval'; |
| | | $wb['dmarc_ri_note_txt'] = 'Seconds (default=86400). The time in seconds that aggregate reports should be generate (86400 repersents 1 day).'; |
| | | $wb['dmarc_ri_note_txt'] = 'Seconds (default=86400). The time in seconds that aggregate reports should be generate (86400 represents 1 day).'; |
| | | $wb['dmarc_sp_txt'] = 'Subdomain Policy (Defaults to same as domain).'; |
| | | $wb['dmarc_sp_same_txt'] = 'same as domain'; |
| | | $wb['dmarc_sp_none_txt'] = 'none'; |
| | |
| | | $wb['dmarc_pct_txt'] = 'Apply Policy to this Percentage'; |
| | | $wb['dmarc_pct_note_txt'] = '% (100 default). Messages in percent from the domain you want ISPs to check.'; |
| | | $wb['dmarc_ri_txt'] = 'Reporting Interval'; |
| | | $wb['dmarc_ri_note_txt'] = 'Seconds (default=86400). The time in seconds that aggregate reports should be generate (86400 repersents 1 day).'; |
| | | $wb['dmarc_ri_note_txt'] = 'Seconds (default=86400). The time in seconds that aggregate reports should be generate (86400 represents 1 day).'; |
| | | $wb['dmarc_sp_txt'] = 'Subdomain Policy (Defaults to same as domain).'; |
| | | $wb['dmarc_sp_same_txt'] = 'same as domain'; |
| | | $wb['dmarc_sp_none_txt'] = 'none'; |
interface/web/dns/lib/lang/de_dns_soa.lng
interface/web/dns/lib/lang/el_dns_dmarc.lng
interface/web/dns/lib/lang/en_dns_dmarc.lng
interface/web/dns/lib/lang/en_dns_soa.lng
interface/web/dns/lib/lang/es_dns_dmarc.lng
interface/web/dns/lib/lang/fi_dns_dmarc.lng
interface/web/dns/lib/lang/fr_dns_dmarc.lng
interface/web/dns/lib/lang/hr_dns_dmarc.lng
interface/web/dns/lib/lang/hu_dns_dmarc.lng
interface/web/dns/lib/lang/id_dns_dmarc.lng
interface/web/dns/lib/lang/it_dns_dmarc.lng
interface/web/dns/lib/lang/ja_dns_dmarc.lng
interface/web/dns/lib/lang/nl_dns_dmarc.lng
interface/web/dns/lib/lang/pl_dns_dmarc.lng
interface/web/dns/lib/lang/pt_dns_dmarc.lng
interface/web/dns/lib/lang/ro_dns_dmarc.lng
interface/web/dns/lib/lang/ru_dns_dmarc.lng
interface/web/dns/lib/lang/se_dns_dmarc.lng
interface/web/dns/lib/lang/sk_dns_dmarc.lng
interface/web/dns/lib/lang/tr_dns_dmarc.lng
interface/web/dns/lib/module.conf.php
interface/web/dns/list/dns_a.list.php
interface/web/dns/list/dns_slave.list.php
interface/web/dns/list/dns_soa.list.php
interface/web/dns/list/dns_template.list.php
interface/web/dns/templates/dns_a_list.htm
interface/web/dns/templates/dns_dmarc_edit.htm
interface/web/dns/templates/dns_import.htm
interface/web/dns/templates/dns_slave_admin_list.htm
interface/web/dns/templates/dns_slave_list.htm
interface/web/dns/templates/dns_soa_admin_list.htm
interface/web/dns/templates/dns_soa_list.htm
interface/web/dns/templates/dns_spf_edit.htm
interface/web/dns/templates/dns_template_list.htm
interface/web/dns/templates/dns_wizard.htm
interface/web/help/faq_list.php
interface/web/help/form/support_message.tform.php
interface/web/help/support_message_edit.php
interface/web/help/templates/faq_manage_questions_list.htm
interface/web/help/templates/help_faq_list.htm
interface/web/help/templates/help_faq_sections_list.htm
interface/web/help/templates/support_message_list.htm
interface/web/index.php
interface/web/js/uni-form/uni-form.jquery.js (deleted)
interface/web/js/xmpp_domain_muc.js
interface/web/js/xmpp_domain_registration.js
interface/web/login/index.php
interface/web/login/lib/module.conf.php
interface/web/login/login_as.php
interface/web/login/logout.php
interface/web/login/password_reset.php
interface/web/login/templates/index.htm
interface/web/login/templates/password_reset.htm
interface/web/mail/form/mail_get.tform.php
interface/web/mail/form/mail_relay_recipient.tform.php
interface/web/mail/form/xmpp_domain.tform.php
interface/web/mail/form/xmpp_user.tform.php
interface/web/mail/lib/lang/en_xmpp_domain.lng
interface/web/mail/lib/lang/en_xmpp_domain_admin_list.lng
interface/web/mail/lib/lang/en_xmpp_domain_list.lng
interface/web/mail/lib/lang/en_xmpp_user.lng
interface/web/mail/lib/lang/en_xmpp_user_list.lng
interface/web/mail/lib/module.conf.php
interface/web/mail/list/mail_alias.list.php
interface/web/mail/list/mail_aliasdomain.list.php
interface/web/mail/list/mail_blacklist.list.php
interface/web/mail/list/mail_content_filter.list.php
interface/web/mail/list/mail_domain.list.php
interface/web/mail/list/mail_domain_catchall.list.php
interface/web/mail/list/mail_forward.list.php
interface/web/mail/list/mail_get.list.php
interface/web/mail/list/mail_relay_recipient.list.php
interface/web/mail/list/mail_spamfilter.list.php
interface/web/mail/list/mail_transport.list.php
interface/web/mail/list/mail_user.list.php
interface/web/mail/list/mail_whitelist.list.php
interface/web/mail/list/spamfilter_blacklist.list.php
interface/web/mail/list/spamfilter_policy.list.php
interface/web/mail/list/spamfilter_users.list.php
interface/web/mail/list/spamfilter_whitelist.list.php
interface/web/mail/list/xmpp_domain.list.php
interface/web/mail/list/xmpp_user.list.php
interface/web/mail/mail_alias_edit.php
interface/web/mail/mail_aliasdomain_edit.php
interface/web/mail/mail_blacklist_edit.php
interface/web/mail/mail_content_filter_edit.php
interface/web/mail/mail_domain_catchall_edit.php
interface/web/mail/mail_domain_del.php
interface/web/mail/mail_domain_edit.php
interface/web/mail/mail_forward_edit.php
interface/web/mail/mail_get_edit.php
interface/web/mail/mail_mailinglist_edit.php
interface/web/mail/mail_spamfilter_edit.php
interface/web/mail/mail_transport_edit.php
interface/web/mail/mail_user_del.php
interface/web/mail/mail_user_edit.php
interface/web/mail/mail_user_filter_del.php
interface/web/mail/mail_user_filter_edit.php
interface/web/mail/mail_user_stats.php
interface/web/mail/mail_whitelist_edit.php
interface/web/mail/mailinglist.php
interface/web/mail/spamfilter_blacklist_edit.php
interface/web/mail/spamfilter_config_edit.php
interface/web/mail/spamfilter_policy_edit.php
interface/web/mail/spamfilter_users_edit.php
interface/web/mail/spamfilter_whitelist_edit.php
interface/web/mail/templates/mail_alias_list.htm
interface/web/mail/templates/mail_aliasdomain_list.htm
interface/web/mail/templates/mail_blacklist_list.htm
interface/web/mail/templates/mail_content_filter_list.htm
interface/web/mail/templates/mail_domain_admin_list.htm
interface/web/mail/templates/mail_domain_catchall_list.htm
interface/web/mail/templates/mail_domain_edit.htm
interface/web/mail/templates/mail_domain_list.htm
interface/web/mail/templates/mail_forward_list.htm
interface/web/mail/templates/mail_get_list.htm
interface/web/mail/templates/mail_mailinglist_list.htm
interface/web/mail/templates/mail_relay_recipient_list.htm
interface/web/mail/templates/mail_transport_list.htm
interface/web/mail/templates/mail_user_autoresponder_edit.htm
interface/web/mail/templates/mail_user_backup_list.htm
interface/web/mail/templates/mail_user_filter_edit.htm
interface/web/mail/templates/mail_user_filter_list.htm
interface/web/mail/templates/mail_user_list.htm
interface/web/mail/templates/mail_whitelist_list.htm
interface/web/mail/templates/spamfilter_blacklist_list.htm
interface/web/mail/templates/spamfilter_config_list.htm
interface/web/mail/templates/spamfilter_policy_list.htm
interface/web/mail/templates/spamfilter_users_list.htm
interface/web/mail/templates/xmpp_domain_admin_list.htm
interface/web/mail/templates/xmpp_domain_edit.htm
interface/web/mail/templates/xmpp_domain_edit_modules.htm
interface/web/mail/templates/xmpp_domain_edit_muc.htm
interface/web/mail/templates/xmpp_domain_edit_ssl.htm
interface/web/mail/templates/xmpp_domain_list.htm
interface/web/mail/templates/xmpp_user_edit.htm
interface/web/mail/templates/xmpp_user_list.htm
interface/web/mail/user_quota_stats.php
interface/web/mail/webmailer.php
interface/web/mail/xmpp_domain_del.php
interface/web/mail/xmpp_domain_edit.php
interface/web/mail/xmpp_domain_list.php
interface/web/mail/xmpp_user_del.php
interface/web/mail/xmpp_user_edit.php
interface/web/mail/xmpp_user_list.php
interface/web/mailuser/index.php
interface/web/mailuser/mail_user_filter_edit.php
interface/web/mailuser/mail_user_spamfilter_edit.php
interface/web/mailuser/templates/mail_user_filter_list.htm
interface/web/monitor/lib/module.conf.php
interface/web/monitor/list/datalog.list.php
interface/web/monitor/list/log.list.php
interface/web/monitor/log_del.php
interface/web/monitor/show_log.php
interface/web/monitor/show_sys_state.php
interface/web/monitor/templates/datalog_list.htm
interface/web/monitor/templates/syslog_list.htm
interface/web/nav.php
interface/web/remote/monitor.php
interface/web/sites/ajax_get_ip.php
interface/web/sites/ajax_get_json.php
interface/web/sites/aps_do_operation.php
interface/web/sites/aps_install_package.php
interface/web/sites/aps_installedpackages_list.php
interface/web/sites/aps_packagedetails_show.php
interface/web/sites/cron_edit.php
interface/web/sites/database_edit.php
interface/web/sites/database_phpmyadmin.php
interface/web/sites/database_user_del.php
interface/web/sites/database_user_edit.php
interface/web/sites/form/web_childdomain.tform.php
interface/web/sites/form/web_vhost_domain.tform.php
interface/web/sites/ftp_user_edit.php
interface/web/sites/lib/lang/ar_shell_user.lng
interface/web/sites/lib/lang/ar_web_vhost_domain.lng
interface/web/sites/lib/lang/bg_web_vhost_domain.lng
interface/web/sites/lib/lang/br_web_vhost_domain.lng
interface/web/sites/lib/lang/cz_web_vhost_domain.lng
interface/web/sites/lib/lang/de_shell_user.lng
interface/web/sites/lib/lang/de_web_vhost_domain.lng
interface/web/sites/lib/lang/el_web_vhost_domain.lng
interface/web/sites/lib/lang/en_shell_user.lng
interface/web/sites/lib/lang/en_web_vhost_domain.lng
interface/web/sites/lib/lang/es_web_vhost_domain.lng
interface/web/sites/lib/lang/fi_web_vhost_domain.lng
interface/web/sites/lib/lang/fr_web_vhost_domain.lng
interface/web/sites/lib/lang/hr_web_vhost_domain.lng
interface/web/sites/lib/lang/hu_web_vhost_domain.lng
interface/web/sites/lib/lang/id_web_vhost_domain.lng
interface/web/sites/lib/lang/it_web_vhost_domain.lng
interface/web/sites/lib/lang/ja_web_vhost_domain.lng
interface/web/sites/lib/lang/nl_web_vhost_domain.lng
interface/web/sites/lib/lang/pl_web_vhost_domain.lng
interface/web/sites/lib/lang/pt_web_vhost_domain.lng
interface/web/sites/lib/lang/ro_web_vhost_domain.lng
interface/web/sites/lib/lang/ru_web_vhost_domain.lng
interface/web/sites/lib/lang/se_web_vhost_domain.lng
interface/web/sites/lib/lang/sk_web_vhost_domain.lng
interface/web/sites/lib/lang/tr_web_vhost_domain.lng
interface/web/sites/lib/module.conf.php
interface/web/sites/list/cron.list.php
interface/web/sites/list/database.list.php
interface/web/sites/list/ftp_user.list.php
interface/web/sites/list/shell_user.list.php
interface/web/sites/list/web_childdomain.list.php
interface/web/sites/list/web_folder.list.php
interface/web/sites/list/web_folder_user.list.php
interface/web/sites/list/web_vhost_domain.list.php
interface/web/sites/list/webdav_user.list.php
interface/web/sites/shell_user_edit.php
interface/web/sites/templates/cron_list.htm
interface/web/sites/templates/database_admin_list.htm
interface/web/sites/templates/database_list.htm
interface/web/sites/templates/database_quota_stats_list.htm
interface/web/sites/templates/database_user_admin_list.htm
interface/web/sites/templates/database_user_list.htm
interface/web/sites/templates/ftp_user_advanced.htm
interface/web/sites/templates/ftp_user_advanced_client.htm
interface/web/sites/templates/shell_user_list.htm
interface/web/sites/templates/web_backup_list.htm
interface/web/sites/templates/web_childdomain_list.htm
interface/web/sites/templates/web_folder_list.htm
interface/web/sites/templates/web_folder_user_list.htm
interface/web/sites/templates/web_vhost_domain_admin_list.htm
interface/web/sites/templates/web_vhost_domain_edit.htm
interface/web/sites/templates/web_vhost_domain_list.htm
interface/web/sites/templates/web_vhost_domain_redirect.htm
interface/web/sites/templates/web_vhost_domain_ssl.htm
interface/web/sites/templates/webdav_user_list.htm
interface/web/sites/user_quota_stats.php
interface/web/sites/web_childdomain_edit.php
interface/web/sites/web_folder_del.php
interface/web/sites/web_folder_edit.php
interface/web/sites/web_folder_user_edit.php
interface/web/sites/web_sites_stats.php
interface/web/sites/web_vhost_domain_del.php
interface/web/sites/web_vhost_domain_edit.php
interface/web/sites/webdav_user_edit.php
interface/web/themes/blue/css/styles.css (deleted)
interface/web/themes/blue/icons/x32_sprite.png (deleted)
interface/web/themes/blue/images/ajax-loader.gif (deleted)
interface/web/themes/blue/images/header_bg.png (deleted)
interface/web/themes/blue/images/lists_tfoot_bg.png (deleted)
interface/web/themes/blue/images/lists_thead_bg.png (deleted)
interface/web/themes/blue/ispconfig_version (deleted)
interface/web/themes/blue/templates/main.tpl.htm (deleted)
interface/web/themes/default/assets/javascripts/bootstrap-datetimepicker.min.js
interface/web/themes/default/assets/javascripts/ispconfig.js
interface/web/themes/default/assets/javascripts/ispconfig.min.js
interface/web/themes/default/assets/stylesheets/bootstrap-datetimepicker.min.css
interface/web/themes/default/assets/stylesheets/ispconfig.css
interface/web/themes/default/assets/stylesheets/ispconfig.min.css
interface/web/themes/default/assets/stylesheets/login.css
interface/web/themes/default/assets/stylesheets/select2.css
interface/web/themes/default/templates/error.tpl.htm
interface/web/themes/default/templates/form.tpl.htm
interface/web/themes/default/templates/main.tpl.htm
interface/web/themes/default/templates/sidenav.tpl.htm
interface/web/themes/default/templates/tabbed_form.tpl.htm
interface/web/themes/default_64_navimg/css/additional.css (deleted)
interface/web/themes/default_64_navimg/icons/x16/arrow.png (deleted)
interface/web/themes/default_64_navimg/icons/x16/arrow_180.png (deleted)
interface/web/themes/default_64_navimg/icons/x16/arrow_stop.png (deleted)
interface/web/themes/default_64_navimg/icons/x16/arrow_stop_180.png (deleted)
interface/web/themes/default_64_navimg/ispconfig_version (deleted)
interface/web/themes/default_64_navimg/templates/main.tpl.htm (deleted)
interface/web/themes/default_combobox/css/additional.css (deleted)
interface/web/themes/default_combobox/icons/x16/arrow.png (deleted)
interface/web/themes/default_combobox/icons/x16/arrow_180.png (deleted)
interface/web/themes/default_combobox/icons/x16/arrow_stop.png (deleted)
interface/web/themes/default_combobox/icons/x16/arrow_stop_180.png (deleted)
interface/web/themes/default_combobox/images/ui-image.png (deleted)
interface/web/themes/default_combobox/ispconfig_version (deleted)
interface/web/themes/default_combobox/templates/main.tpl.htm (deleted)
interface/web/themes/default_no_navimg/css/additional.css (deleted)
interface/web/themes/default_no_navimg/icons/x16/arrow.png (deleted)
interface/web/themes/default_no_navimg/icons/x16/arrow_180.png (deleted)
interface/web/themes/default_no_navimg/icons/x16/arrow_stop.png (deleted)
interface/web/themes/default_no_navimg/icons/x16/arrow_stop_180.png (deleted)
interface/web/themes/default_no_navimg/ispconfig_version (deleted)
interface/web/themes/default_no_navimg/templates/main.tpl.htm (deleted)
interface/web/tools/dns_import_tupa.php
interface/web/tools/form/interface_settings.tform.php
interface/web/tools/import_ispconfig.php
interface/web/tools/import_plesk.php (deleted)
interface/web/tools/import_vpopmail.php
interface/web/tools/lib/lang/ar_resync.lng
interface/web/tools/lib/lang/bg_resync.lng
interface/web/tools/lib/lang/br_resync.lng
interface/web/tools/lib/lang/cz_resync.lng
interface/web/tools/lib/lang/de_resync.lng
interface/web/tools/lib/lang/el_resync.lng
interface/web/tools/lib/lang/en_resync.lng
interface/web/tools/lib/lang/es_resync.lng
interface/web/tools/lib/lang/fi_resync.lng
interface/web/tools/lib/lang/fr_resync.lng
interface/web/tools/lib/lang/hr_resync.lng
interface/web/tools/lib/lang/hu_resync.lng
interface/web/tools/lib/lang/id_resync.lng
interface/web/tools/lib/lang/it_resync.lng
interface/web/tools/lib/lang/ja_resync.lng
interface/web/tools/lib/lang/nl_resync.lng
interface/web/tools/lib/lang/pl_resync.lng
interface/web/tools/lib/lang/pt_resync.lng
interface/web/tools/lib/lang/ro_resync.lng
interface/web/tools/lib/lang/ru_resync.lng
interface/web/tools/lib/lang/se_resync.lng
interface/web/tools/lib/lang/sk_resync.lng
interface/web/tools/lib/lang/tr_resync.lng
interface/web/tools/lib/module.conf.php
interface/web/tools/resync.php
interface/web/tools/templates/dns_import_tupa.htm
interface/web/tools/templates/import_ispconfig.htm
interface/web/tools/templates/import_plesk.htm
interface/web/tools/templates/import_vpopmail.htm
interface/web/tools/templates/resync.htm
interface/web/tools/user_settings.php
interface/web/vm/ajax_get_ip.php
interface/web/vm/form/openvz_template.tform.php
interface/web/vm/form/openvz_vm.tform.php
interface/web/vm/lib/lang/ar_openvz_template.lng
interface/web/vm/lib/lang/ar_openvz_vm.lng
interface/web/vm/lib/lang/bg_openvz_template.lng
interface/web/vm/lib/lang/bg_openvz_vm.lng
interface/web/vm/lib/lang/br_openvz_template.lng
interface/web/vm/lib/lang/br_openvz_vm.lng
interface/web/vm/lib/lang/cz_openvz_template.lng
interface/web/vm/lib/lang/cz_openvz_vm.lng
interface/web/vm/lib/lang/de_openvz_template.lng
interface/web/vm/lib/lang/de_openvz_vm.lng
interface/web/vm/lib/lang/el_openvz_template.lng
interface/web/vm/lib/lang/el_openvz_vm.lng
interface/web/vm/lib/lang/en_openvz_template.lng
interface/web/vm/lib/lang/en_openvz_vm.lng
interface/web/vm/lib/lang/es_openvz_template.lng
interface/web/vm/lib/lang/es_openvz_vm.lng
interface/web/vm/lib/lang/fi_openvz_template.lng
interface/web/vm/lib/lang/fi_openvz_vm.lng
interface/web/vm/lib/lang/fr_openvz_template.lng
interface/web/vm/lib/lang/fr_openvz_vm.lng
interface/web/vm/lib/lang/hr_openvz_template.lng
interface/web/vm/lib/lang/hr_openvz_vm.lng
interface/web/vm/lib/lang/hu_openvz_template.lng
interface/web/vm/lib/lang/hu_openvz_vm.lng
interface/web/vm/lib/lang/id_openvz_template.lng
interface/web/vm/lib/lang/id_openvz_vm.lng
interface/web/vm/lib/lang/it_openvz_template.lng
interface/web/vm/lib/lang/it_openvz_vm.lng
interface/web/vm/lib/lang/ja_openvz_template.lng
interface/web/vm/lib/lang/ja_openvz_vm.lng
interface/web/vm/lib/lang/nl_openvz_template.lng
interface/web/vm/lib/lang/nl_openvz_vm.lng
interface/web/vm/lib/lang/pl_openvz_template.lng
interface/web/vm/lib/lang/pl_openvz_vm.lng
interface/web/vm/lib/lang/pt_openvz_template.lng
interface/web/vm/lib/lang/pt_openvz_vm.lng
interface/web/vm/lib/lang/ro_openvz_template.lng
interface/web/vm/lib/lang/ro_openvz_vm.lng
interface/web/vm/lib/lang/ru_openvz_template.lng
interface/web/vm/lib/lang/ru_openvz_vm.lng
interface/web/vm/lib/lang/se_openvz_template.lng
interface/web/vm/lib/lang/se_openvz_vm.lng
interface/web/vm/lib/lang/sk_openvz_template.lng
interface/web/vm/lib/lang/sk_openvz_vm.lng
interface/web/vm/lib/lang/tr_openvz_template.lng
interface/web/vm/lib/lang/tr_openvz_vm.lng
interface/web/vm/lib/module.conf.php
interface/web/vm/openvz_action.php
interface/web/vm/openvz_template_edit.php
interface/web/vm/openvz_vm_edit.php
interface/web/vm/templates/openvz.conf.tpl
interface/web/vm/templates/openvz_action.htm
interface/web/vm/templates/openvz_ip_list.htm
interface/web/vm/templates/openvz_ostemplate_list.htm
interface/web/vm/templates/openvz_template_advanced_edit.htm
interface/web/vm/templates/openvz_template_list.htm
interface/web/vm/templates/openvz_vm_advanced_edit.htm
interface/web/vm/templates/openvz_vm_edit.htm
interface/web/vm/templates/openvz_vm_list.htm
remoting_client/examples/dns_a_add.php
remoting_client/examples/dns_aaaa_add.php
remoting_client/examples/dns_alias_add.php
remoting_client/examples/dns_cname_add.php
remoting_client/examples/dns_hinfo_add.php
remoting_client/examples/dns_mx_add.php
remoting_client/examples/dns_ns_add.php
remoting_client/examples/dns_ptr_add.php
remoting_client/examples/dns_rp_add.php
remoting_client/examples/dns_srv_add.php
remoting_client/examples/dns_txt_add.php
remoting_client/examples/dns_zone_add.php
server/conf/hhvm_monit.master
server/conf/hhvm_starter.master
server/conf/metronome_conf_global.master
server/conf/metronome_conf_host.master
server/conf/metronome_conf_main.master
server/conf/metronome_conf_ssl.master
server/conf/metronome_conf_status.master
server/conf/nginx_vhost.conf.master
server/conf/php_fpm_pool.conf.master
server/conf/vhost.conf.master
server/cron.php
server/cron.sh
server/lib/app.inc.php
server/lib/classes/aps_installer.inc.php
server/lib/classes/cron.d/100-mailbox_stats.inc.php
server/lib/classes/cron.d/100-monitor_clamav_log.inc.php
server/lib/classes/cron.d/100-monitor_cpu.inc.php
server/lib/classes/cron.d/100-monitor_database_size.inc.php
server/lib/classes/cron.d/100-monitor_disk_usage.inc.php
server/lib/classes/cron.d/100-monitor_email_quota.inc.php
server/lib/classes/cron.d/100-monitor_fail2ban.inc.php
server/lib/classes/cron.d/100-monitor_hd_quota.inc.php
server/lib/classes/cron.d/100-monitor_iptables.inc.php
server/lib/classes/cron.d/100-monitor_ispconfig_log.inc.php
server/lib/classes/cron.d/100-monitor_ispconfig_version.inc.php
server/lib/classes/cron.d/100-monitor_mail_log.inc.php
server/lib/classes/cron.d/100-monitor_mail_queue.inc.php
server/lib/classes/cron.d/100-monitor_mem_usage.inc.php
server/lib/classes/cron.d/100-monitor_mongodb.inc.php
server/lib/classes/cron.d/100-monitor_openvz.inc.php
server/lib/classes/cron.d/100-monitor_os_version.inc.php
server/lib/classes/cron.d/100-monitor_raid.inc.php
server/lib/classes/cron.d/100-monitor_rkhunter.inc.php
server/lib/classes/cron.d/100-monitor_server.inc.php
server/lib/classes/cron.d/100-monitor_services.inc.php
server/lib/classes/cron.d/100-monitor_syslog.inc.php
server/lib/classes/cron.d/100-monitor_system_update.inc.php
server/lib/classes/cron.d/150-awstats.inc.php
server/lib/classes/cron.d/150-webalizer.inc.php
server/lib/classes/cron.d/200-logfiles.inc.php
server/lib/classes/cron.d/300-quota_notify.inc.php
server/lib/classes/cron.d/400-openvz.inc.php
server/lib/classes/cron.d/500-backup.inc.php
server/lib/classes/cron.d/500-backup_mail.inc.php
server/lib/classes/cron.d/600-cleanup.inc.php
server/lib/classes/cron.d/600-purge_mailboxes.inc.php
server/lib/classes/cronjob.inc.php
server/lib/classes/db_mysql.inc.php
server/lib/classes/file.inc.php
server/lib/classes/functions.inc.php
server/lib/classes/getconf.inc.php
server/lib/classes/modules.inc.php
server/lib/classes/monitor_tools.inc.php
server/lib/classes/system.inc.php
server/mods-available/remoteaction_core_module.inc.php
server/mods-available/xmpp_module.inc.php
server/plugins-available/apache2_plugin.inc.php
server/plugins-available/backup_plugin.inc.php
server/plugins-available/bind_dlz_plugin.inc.php
server/plugins-available/bind_plugin.inc.php
server/plugins-available/cron_jailkit_plugin.inc.php
server/plugins-available/cron_plugin.inc.php
server/plugins-available/firewall_plugin.inc.php
server/plugins-available/ftpuser_base_plugin.inc.php
server/plugins-available/mail_plugin.inc.php
server/plugins-available/mail_plugin_dkim.inc.php
server/plugins-available/maildeliver_plugin.inc.php
server/plugins-available/mailman_plugin.inc.php
server/plugins-available/mongo_clientdb_plugin.inc.php
server/plugins-available/mysql_clientdb_plugin.inc.php
server/plugins-available/network_settings_plugin.inc.php
server/plugins-available/nginx_plugin.inc.php
server/plugins-available/nginx_reverseproxy_plugin.inc.php
server/plugins-available/openvz_plugin.inc.php
server/plugins-available/pma_symlink_plugin.inc.php
server/plugins-available/postfix_filter_plugin.inc.php
server/plugins-available/postfix_server_plugin.inc.php
server/plugins-available/powerdns_plugin.inc.php
server/plugins-available/shelluser_base_plugin.inc.php
server/plugins-available/shelluser_jailkit_plugin.inc.php
server/plugins-available/software_update_plugin.inc.php
server/plugins-available/webmail_symlink_plugin.inc.php
server/plugins-available/webserver_plugin.inc.php
server/plugins-available/xmpp_plugin.inc.php
server/scripts/ispconfig_patch
server/scripts/ispconfig_update.sh
server/scripts/run-getmail.sh
server/scripts/update_from_dev.sh
server/scripts/update_from_tgz.sh
server/server.php
server/server.sh |