root/tags/omega-1.0.0-rc3/gui/include/ispcp-lib.php

Revision 900, 6.4 KB (checked in by raphael, 14 months ago)

The "there are still some really bogus code around" commit:
Fixed a typo in postfix/main.cf and re-arranged the config file
Made last changes for #825: Improvements for Postfix against SPAM
Fixed #860: permit_sasl_authenticated must match before reject_unauth_destination in smtpd_recipient_restrictions
Made some cronjobs run at @daily
Fixed logrotate/ispcp so it runs ispcp-vrl-traff before rotating apache user logs instead of ispcp-srv-traff
Added missing removal of custom http config files when sub/domain/alias is deleted
A subdomain and an alias can now share the same mountpoint (alias must be created first)
Added todisable/toenable email accounts status
Fixed an error where log data containing a < symbol would be parsed when not desired when counting quota amounts
Fixed #865: malformed generated cron.d/ispcp because of new line
Added soft(old method)/hard(ne method, default) mail accounts suspension
Fixed #833: Error displayed when adding domain alias

Line 
1<?php
2/**
3 *  ispCP ω (OMEGA) a Virtual Hosting Control Panel
4 *
5 *  @copyright     2001-2006 by moleSoftware GmbH
6 *  @copyright     2006-2007 by ispCP | http://isp-control.net
7 *  @link         http://isp-control.net
8 *  @author        ispCP Team (2007)
9 *
10 *  @license
11 *  This program is free software; you can redistribute it and/or modify it under
12 *  the terms of the MPL General Public License as published by the Free Software
13 *  Foundation; either version 1.1 of the License, or (at your option) any later
14 *  version.
15 *  You should have received a copy of the MPL Mozilla Public License along with
16 *  this program; if not, write to the Open Source Initiative (OSI)
17 *  http://opensource.org | osi@opensource.org
18 *
19 **/
20
21define('INCLUDEPATH', realpath(dirname(__FILE__)));
22require_once(INCLUDEPATH.'/ispcp-config.php');
23
24session_name('ispCP');
25
26if (!isset($_SESSION))
27    session_start();
28
29// Error handling and debug
30//error_reporting(0);
31// setting for development edition - see all error messages
32error_reporting(E_ALL);
33
34require_once(INCLUDEPATH.'/spGzip.php');
35require_once(INCLUDEPATH.'/class.pTemplate.php');
36require_once(INCLUDEPATH.'/i18n.php');
37require_once(INCLUDEPATH.'/system-message.php');
38require_once(INCLUDEPATH.'/ispcp-db-keys.php');
39require_once(INCLUDEPATH.'/sql.php');
40
41// variable for developmetn edition => shows all php variables under the pages
42// false = disable, true = enable
43$cfg['DUMP_GUI_DEBUG'] = false;
44
45// session timeout in minutes
46$cfg['SESSION_TIMEOUT'] = 30;
47// Item states
48$cfg['ITEM_ADD_STATUS'] = 'toadd';
49$cfg['ITEM_OK_STATUS'] = 'ok';
50$cfg['ITEM_CHANGE_STATUS'] = 'change';
51$cfg['ITEM_DELETE_STATUS'] = 'delete';
52$cfg['ITEM_DISABLED_STATUS'] = 'disabled';
53$cfg['ITEM_RESTORE_STATUS'] = 'restore';
54$cfg['ITEM_TOENABLE_STATUS'] = 'toenable';
55$cfg['ITEM_TODISABLED_STATUS'] = 'todisable';
56$cfg['ITEM_ORDERED_STATUS'] = 'ordered';
57// SQL variables
58$cfg['MAX_SQL_DATABASE_LENGTH'] = 64;
59$cfg['MAX_SQL_USER_LENGTH'] = 16;
60$cfg['MAX_SQL_PASS_LENGTH'] = 32;
61// Template pathes
62$cfg['ROOT_TEMPLATE_PATH'] = 'themes/';
63$cfg['LOGIN_TEMPLATE_PATH'] = $cfg['ROOT_TEMPLATE_PATH'].$cfg['USER_INITIAL_THEME'];
64$cfg['ADMIN_TEMPLATE_PATH'] = '../'.$cfg['ROOT_TEMPLATE_PATH'].$cfg['USER_INITIAL_THEME'].'/admin';
65$cfg['RESELLER_TEMPLATE_PATH'] = '../'.$cfg['ROOT_TEMPLATE_PATH'].$cfg['USER_INITIAL_THEME'].'/reseller';
66$cfg['CLIENT_TEMPLATE_PATH'] = '../'.$cfg['ROOT_TEMPLATE_PATH'].$cfg['USER_INITIAL_THEME'].'/client';
67$cfg['IPS_LOGO_PATH'] = '../themes/user_logos';
68$cfg['PURCHASE_TEMPLATE_PATH'] = '../'.$cfg['ROOT_TEMPLATE_PATH'].$cfg['USER_INITIAL_THEME'].'/orderpanel';
69
70// the following variables are overriden via admin cp
71$cfg['DOMAIN_ROWS_PER_PAGE'] = 10;
72// 'admin' => hosting plans are available only in admin level, reseller can not make custom changes
73// 'reseller' => hosting plans are available only in reseller level
74$cfg['HOSTING_PLANS_LEVEL'] = 'reseller';
75$cfg['USER_INITIAL_LANG'] = 'lang_English';
76
77// enable or disable supportsystem
78// false = disable, true = enable
79$cfg['ISPCP_SUPPORT_SYSTEM'] = true;
80
81// enable or disable lostpassword function
82// false = disable, true = enable
83$cfg['LOSTPASSWORD'] = true;
84
85// uniqkeytimeout in minuntes
86$cfg['LOSTPASSWORD_TIMEOUT'] = 30;
87// captcha imagehigh
88$cfg['LOSTPASSWORD_CAPTCHA_HEIGHT'] = 65;
89// captcha imagewidth
90$cfg['LOSTPASSWORD_CAPTCHA_WIDTH'] = 210;
91// captcha background color
92$cfg['LOSTPASSWORD_CAPTCHA_BGCOLOR'] = array(229,243,252);
93// captcha text color
94$cfg['LOSTPASSWORD_CAPTCHA_TEXTCOLOR'] = array(0,53,92);
95// captcha ttf fontfile
96$cfg['LOSTPASSWORD_CAPTCHA_FONT'] = $cfg['LOGIN_TEMPLATE_PATH'].'/font/cap.ttf';
97
98// enable or disable bruteforcedetection
99// false = disable, true = enable
100$cfg['BRUTEFORCE'] = true;
101// blocktime in minutes
102$cfg['BRUTEFORCE_BLOCK_TIME'] = 30;
103// max login before block
104$cfg['BRUTEFORCE_MAX_LOGIN'] = 3;
105// max captcha failed attempts before block
106$cfg['BRUTEFORCE_MAX_CAPTCHA'] = 5;
107// enable or disable time between logins
108// true = disable, false = enable
109$cfg['BRUTEFORCE_BETWEEN'] = true;
110// time between logins in seconds
111$cfg['BRUTEFORCE_BETWEEN_TIME'] = 30;
112
113// enable or disable maintenance mode
114// true = disable, false = enable
115$cfg['MAINTENANCEMODE'] = false;
116// servicemode message
117$cfg['MAINTENANCEMODE_MESSAGE'] = tr("We are sorry, but the system is currently under maintenance.\nPlease try again later.");
118curlang(null, true); //restore language auto detection
119
120// password chars
121$cfg['PASSWD_CHARS'] = 6;
122// enable or disable strong passwords
123// false = disable, true = enable
124$cfg['PASSWD_STRONG'] = true;
125
126// The virtual host file from Apache which contains our virtual host entries
127$cfg['SERVER_VHOST_FILE'] = $cfg['APACHE_SITES_DIR'] . '/ispcp.conf';
128
129// The minimum level for a message to be sent to DEFAULT_ADMIN_ADDRESS
130// PHP's E_USER_* values are used for simplicity:
131// E_USER_NOTICE: logins, and all info that isn't very relevant
132// E_USER_WARNING: switching to an other account, etc
133// E_USER_ERROR: "admin MUST know" messages
134$cfg['LOG_LEVEL'] = E_USER_NOTICE;
135
136// Set to false to disable creation of webmaster, postmaster and abuse forwarders when domain/alias/subdomain is created
137$cfg['CREATE_DEFAULT_EMAIL_ADDRESSES'] = true;
138
139// Use hard mail suspension when suspending a domain:
140// true: email accounts are hard suspended (completely unreachable)
141// false: email accounts are soft suspended (passwords are modified so user can't access the accounts)
142$cfg['HARD_MAIL_SUSPENSION'] = true;
143
144
145require_once(INCLUDEPATH.'/date-functions.php');
146require_once(INCLUDEPATH.'/input-checks.php');
147require_once(INCLUDEPATH.'/debug.php');
148require_once(INCLUDEPATH.'/calc-functions.php');
149require_once(INCLUDEPATH.'/login-functions.php');
150require_once(INCLUDEPATH.'/login.php');
151require_once(INCLUDEPATH.'/client-functions.php');
152require_once(INCLUDEPATH.'/admin-functions.php');
153require_once(INCLUDEPATH.'/reseller-functions.php');
154require_once(INCLUDEPATH.'/ispcp-functions.php');
155require_once(INCLUDEPATH.'/idna.php');
156require_once(INCLUDEPATH.'/lostpassword-functions.php');
157require_once(INCLUDEPATH.'/emailtpl-functions.php');
158require_once(INCLUDEPATH.'/layout-functions.php');
159
160if ($_SERVER['SCRIPT_NAME'] != '/client/sql_execute_query.php') {
161    check_query();
162} else {
163    check_query(array('sql_query'));
164}
165
166$query = <<<SQL
167    SELECT
168        name, value
169    FROM
170        config
171SQL;
172
173if (!$res = exec_query($sql, $query, array())) {
174    system_message(tr('Could not get config from database'));
175} else {
176    while($row = $res -> FetchRow()) {
177        $cfg[$row['name']] = $row['value'];
178    }
179}
180
181?>
Note: See TracBrowser for help on using the browser.