Skip to content

Commit 7b47c0a

Browse files
committed
Merged revisions 4069-4117 from stable branch.
1 parent 2332b22 commit 7b47c0a

File tree

532 files changed

+3832
-1134
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

532 files changed

+3832
-1134
lines changed

install/dist/lib/fedora.lib.php

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,23 @@ function configure_postfix($options = '')
163163
if(!is_group($cf['vmail_groupname'])) caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
164164

165165
$command = 'useradd -g '.$cf['vmail_groupname'].' -u '.$cf['vmail_userid'].' '.$cf['vmail_username'].' -d '.$cf['vmail_mailbox_base'].' -m';
166-
if(!is_user($cf['vmail_username'])) caselog("$command &> /dev/null", __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
166+
if(!is_user($cf['vmail_username'])) caselog("$command &> /dev/null", __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
167+
168+
//* These postconf commands will be executed on installation and update
169+
$server_ini_rec = $this->db->queryOneRecord("SELECT config FROM server WHERE server_id = ".$conf['server_id']);
170+
$server_ini_array = ini_to_array(stripslashes($server_ini_rec['config']));
171+
unset($server_ini_rec);
172+
173+
//* If there are RBL's defined, format the list and add them to smtp_recipient_restrictions to prevent removeal after an update
174+
$rbl_list = '';
175+
if (@isset($server_ini_array['mail']['realtime_blackhole_list']) && $server_ini_array['mail']['realtime_blackhole_list'] != '') {
176+
$rbl_hosts = explode(",",str_replace(" ", "", $server_ini_array['mail']['realtime_blackhole_list']));
177+
foreach ($rbl_hosts as $key => $value) {
178+
$rbl_list .= ", reject_rbl_client ". $value;
179+
}
180+
}
181+
unset($rbl_hosts);
182+
unset($server_ini_array);
167183

168184
//* These postconf commands will be executed on installation and update
169185
$postconf_placeholders = array('{config_dir}' => $config_dir,

install/dist/lib/opensuse.lib.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,22 @@ function configure_postfix($options = '')
178178

179179
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']);
180180

181+
//* These postconf commands will be executed on installation and update
182+
$server_ini_rec = $this->db->queryOneRecord("SELECT config FROM server WHERE server_id = ".$conf['server_id']);
183+
$server_ini_array = ini_to_array(stripslashes($server_ini_rec['config']));
184+
unset($server_ini_rec);
185+
186+
//* If there are RBL's defined, format the list and add them to smtp_recipient_restrictions to prevent removeal after an update
187+
$rbl_list = '';
188+
if (@isset($server_ini_array['mail']['realtime_blackhole_list']) && $server_ini_array['mail']['realtime_blackhole_list'] != '') {
189+
$rbl_hosts = explode(",",str_replace(" ", "", $server_ini_array['mail']['realtime_blackhole_list']));
190+
foreach ($rbl_hosts as $key => $value) {
191+
$rbl_list .= ", reject_rbl_client ". $value;
192+
}
193+
}
194+
unset($rbl_hosts);
195+
unset($server_ini_array);
196+
181197
//* These postconf commands will be executed on installation and update
182198
$postconf_placeholders = array('{config_dir}' => $config_dir,
183199
'{vmail_mailbox_base}' => $cf['vmail_mailbox_base'],

install/install.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,8 @@
571571
}*/
572572

573573
//** Configure ISPConfig :-)
574-
if(strtolower($inst->simple_query('Install ISPConfig Web Interface',array('y','n'),'y')) == 'y') {
574+
$install_ispconfig_interface_default = ($conf['mysql']['master_slave_setup'] == 'y')?'n':'y';
575+
if(strtolower($inst->simple_query('Install ISPConfig Web Interface',array('y','n'),$install_ispconfig_interface_default)) == 'y') {
575576
swriteln('Installing ISPConfig');
576577

577578
//** We want to check if the server is a module or cgi based php enabled server

install/lib/installer_base.lib.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ public function grant_master_database_rights($verbose = false) {
400400
$this->warning('Unable to set rights of user in master database: '.$value['db']."\n Query: ".$query."\n Error: ".$this->dbmaster->errorMessage);
401401
}
402402

403-
$query = "GRANT SELECT, UPDATE(`status`) ON ".$value['db'].".`sys_datalog` TO '".$value['user']."'@'".$host."' ";
403+
$query = "GRANT SELECT, UPDATE(`status`, `error`) ON ".$value['db'].".`sys_datalog` TO '".$value['user']."'@'".$host."' ";
404404
if ($verbose){
405405
echo $query ."\n";
406406
}
@@ -2094,8 +2094,8 @@ public function install_crontab() {
20942094
}
20952095

20962096
$root_cron_jobs = array(
2097-
"* * * * * ".$install_dir."/server/server.sh > /dev/null 2>> ".$conf['ispconfig_log_dir']."/cron.log",
2098-
"30 00 * * * ".$install_dir."/server/cron_daily.sh > /dev/null 2>> ".$conf['ispconfig_log_dir']."/cron.log"
2097+
"* * * * * ".$install_dir."/server/server.sh 2>&1 > /dev/null | while read line; do echo `/bin/date` \"\$line\" >> ".$conf['ispconfig_log_dir']."/cron.log; done",
2098+
"30 00 * * * ".$install_dir."/server/cron_daily.sh 2>&1 > /dev/null | while read line; do echo `/bin/date` \"\$line\" >> ".$conf['ispconfig_log_dir']."/cron.log; done"
20992099
);
21002100

21012101
if ($conf['nginx']['installed'] == true) {

install/lib/mysql.lib.php

Lines changed: 31 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class db
3535
var $dbUser = ""; // database authorized user
3636
var $dbPass = ""; // user's password
3737
var $dbCharset = ""; // what charset comes and goes to mysql: utf8 / latin1
38-
var $linkId = 0; // last result of mysql_connect()
38+
var $linkId = false; // last result of mysql_connect()
3939
var $queryId = 0; // last result of mysql_query()
4040
var $record = array(); // last record fetched
4141
var $autoCommit = 1; // Autocommit Transactions
@@ -61,8 +61,8 @@ function db()
6161
// error handler
6262
function updateError($location)
6363
{
64-
$this->errorNumber = mysql_errno();
65-
$this->errorMessage = mysql_error();
64+
$this->errorNumber = mysqli_errno($this->linkId);
65+
$this->errorMessage = mysqli_error($this->linkId);
6666
$this->errorLocation = $location;
6767
if($this->errorNumber && $this->show_error_messages)
6868
{
@@ -73,16 +73,16 @@ function updateError($location)
7373

7474
function connect()
7575
{
76-
if($this->linkId == 0)
76+
if(!$this->linkId)
7777
{
78-
$this->linkId = mysql_connect($this->dbHost, $this->dbUser, $this->dbPass);
78+
$this->linkId = mysqli_connect($this->dbHost, $this->dbUser, $this->dbPass);
7979

8080
if(!$this->linkId)
8181
{
82-
$this->updateError('DB::connect()<br />mysql_connect');
82+
$this->updateError('DB::connect()<br />mysqli_connect');
8383
return false;
8484
}
85-
$this->queryId = @mysql_query('SET NAMES '.$this->dbCharset, $this->linkId);
85+
$this->queryId = @mysqli_query($this->linkId, 'SET NAMES '.$this->dbCharset);
8686
}
8787
return true;
8888
}
@@ -94,14 +94,14 @@ function query($queryString)
9494
return false;
9595
}
9696
if($this->dbName != '') {
97-
if(!mysql_select_db($this->dbName, $this->linkId))
97+
if(!mysqli_select_db($this->linkId, $this->dbName))
9898
{
99-
$this->updateError('DB::connect()<br />mysql_select_db');
99+
$this->updateError('DB::connect()<br />mysqli_select_db');
100100
return false;
101101
}
102102
}
103-
$this->queryId = @mysql_query($queryString, $this->linkId);
104-
$this->updateError('DB::query('.$queryString.')<br />mysql_query');
103+
$this->queryId = @mysqli_query($this->linkId, $queryString);
104+
$this->updateError('DB::query('.$queryString.')<br />mysqli_query');
105105
if(!$this->queryId)
106106
{
107107
return false;
@@ -138,8 +138,8 @@ function queryOneRecord($queryString)
138138
// returns the next record in an array
139139
function nextRecord()
140140
{
141-
$this->record = mysql_fetch_assoc($this->queryId);
142-
$this->updateError('DB::nextRecord()<br />mysql_fetch_array');
141+
$this->record = mysqli_fetch_assoc($this->queryId);
142+
$this->updateError('DB::nextRecord()<br />mysqli_fetch_array');
143143
if(!$this->record || !is_array($this->record))
144144
{
145145
return false;
@@ -151,18 +151,18 @@ function nextRecord()
151151
// returns number of rows returned by the last select query
152152
function numRows()
153153
{
154-
return mysql_num_rows($this->queryId);
154+
return mysqli_num_rows($this->queryId);
155155
}
156156

157157
function affectedRows()
158158
{
159-
return mysql_affected_rows($this->linkId);
159+
return mysqli_affected_rows($this->linkId);
160160
}
161161

162162
// returns mySQL insert id
163163
function insertID()
164164
{
165-
return mysql_insert_id($this->linkId);
165+
return mysqli_insert_id($this->linkId);
166166
}
167167

168168
// Check der variablen
@@ -175,7 +175,7 @@ function check($formfield)
175175
// Check der variablen
176176
function quote($formfield)
177177
{
178-
return mysql_real_escape_string($formfield);
178+
return mysqli_real_escape_string($this->linkId, $formfield);
179179
}
180180

181181
// Check der variablen
@@ -359,11 +359,22 @@ function getTables($database_name = '') {
359359
if($database_name == ''){
360360
$database_name = $this->dbName;
361361
}
362-
$result = mysql_query("SHOW TABLES FROM `$database_name`");
362+
363+
$tables = $this->queryAllRecords("SHOW TABLES FROM `$database_name`");
364+
$tb_names = array();
365+
if(is_array($tables) && !empty($tables)){
366+
for($i = 0; $i < sizeof($tables); $i++){
367+
$tb_names[$i] = $tables[$i]['Tables_in_'.$database_name];
368+
}
369+
}
370+
371+
/*
372+
$result = mysqli_query("SHOW TABLES FROM `$database_name`");
363373
$tb_names = array();
364-
for ($i = 0; $i < mysql_num_rows($result); $i++) {
374+
for ($i = 0; $i < mysqli_num_rows($result); $i++) {
365375
$tb_names[$i] = mysql_tablename($result, $i);
366376
}
377+
*/
367378
return $tb_names;
368379
}
369380

@@ -438,35 +449,7 @@ function tableInfo($table_name) {
438449
} else {
439450
return false;
440451
}
441-
442-
443-
//$this->createTable('tester',$columns);
444-
445-
/*
446-
$result = mysql_list_fields($go_info["server"]["db_name"],$table_name);
447-
$fields = mysql_num_fields ($result);
448-
$i = 0;
449-
$table = mysql_field_table ($result, $i);
450-
while ($i < $fields) {
451-
$name = mysql_field_name ($result, $i);
452-
$type = mysql_field_type ($result, $i);
453-
$len = mysql_field_len ($result, $i);
454-
$flags = mysql_field_flags ($result, $i);
455-
print_r($flags);
456-
457-
$columns = array(name => $name,
458-
type => "",
459-
defaultValue => "",
460-
isnull => 1,
461-
option => "");
462-
$returnvar[] = $columns;
463-
464-
$i++;
465-
}
466-
*/
467-
468-
469-
452+
470453
}
471454

472455
function mapType($metaType,$typeValue) {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
ALTER TABLE `web_backup` CHANGE `backup_type` `backup_type` enum('web','mongodb','mysql') NOT NULL DEFAULT 'web';
22
ALTER TABLE `web_database_user` ADD `database_password_mongo` varchar(32) DEFAULT NULL AFTER `database_password`;
3+
ALTER TABLE `sys_datalog` ADD `error` MEDIUMTEXT NULL DEFAULT NULL;
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
CREATE TABLE `client_template_assigned` (
2+
`assigned_template_id` bigint(20) NOT NULL auto_increment,
3+
`client_id` bigint(11) NOT NULL DEFAULT '0',
4+
`client_template_id` int(11) NOT NULL DEFAULT '0',
5+
PRIMARY KEY (`assigned_template_id`),
6+
KEY `client_id` (`client_id`)
7+
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
8+
9+
ALTER TABLE `client` ADD `gender` enum('','m','f') NOT NULL DEFAULT '' AFTER `company_id`,
10+
ADD `locked` enum('n','y') NOT NULL DEFAULT 'n' AFTER `created_at`,
11+
ADD `canceled` enum('n','y') NOT NULL DEFAULT 'n' AFTER `locked`,
12+
ADD `tmp_data` mediumblob AFTER `canceled` ;

install/sql/ispconfig3.sql

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ CREATE TABLE `client` (
145145
`sys_perm_other` varchar(5) DEFAULT NULL,
146146
`company_name` varchar(64) DEFAULT NULL,
147147
`company_id` varchar(30) DEFAULT NULL,
148+
`gender` enum('','m','f') NOT NULL DEFAULT '',
148149
`contact_name` varchar(64) DEFAULT NULL,
149150
`customer_no` varchar(64) DEFAULT NULL,
150151
`vat_id` varchar(64) DEFAULT NULL,
@@ -225,6 +226,9 @@ CREATE TABLE `client` (
225226
`template_master` int(11) unsigned NOT NULL DEFAULT '0',
226227
`template_additional` text NOT NULL DEFAULT '',
227228
`created_at` bigint(20) DEFAULT NULL,
229+
`locked` enum('n','y') NOT NULL DEFAULT 'n',
230+
`canceled` enum('n','y') NOT NULL DEFAULT 'n',
231+
`tmp_data` mediumblob,
228232
`id_rsa` varchar(2000) NOT NULL DEFAULT '',
229233
`ssh_rsa` varchar(600) NOT NULL DEFAULT '',
230234
PRIMARY KEY (`client_id`)
@@ -315,6 +319,19 @@ CREATE TABLE `client_template` (
315319

316320
-- --------------------------------------------------------
317321

322+
--
323+
-- Table structure for table `client_template_assigned`
324+
--
325+
326+
CREATE TABLE `client_template_assigned` (
327+
`assigned_template_id` bigint(20) NOT NULL auto_increment,
328+
`client_id` bigint(11) NOT NULL DEFAULT '0',
329+
`client_template_id` int(11) NOT NULL DEFAULT '0',
330+
PRIMARY KEY (`assigned_template_id`),
331+
KEY `client_id` (`client_id`)
332+
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
333+
-- --------------------------------------------------------
334+
318335
--
319336
-- Table structure for table `country`
320337
--
@@ -1428,6 +1445,7 @@ CREATE TABLE `sys_datalog` (
14281445
`user` varchar(255) NOT NULL default '',
14291446
`data` longtext NOT NULL,
14301447
`status` set('pending','ok','warning','error') NOT NULL default 'ok',
1448+
`error` mediumtext,
14311449
PRIMARY KEY (`datalog_id`),
14321450
KEY `server_id` (`server_id`,`status`)
14331451
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
@@ -2179,6 +2197,6 @@ INSERT INTO `sys_user` (`userid`, `sys_userid`, `sys_groupid`, `sys_perm_user`,
21792197
-- Dumping data for table `sys_config`
21802198
--
21812199

2182-
INSERT INTO sys_config VALUES ('1','db','db_version','3.0.5.2');
2200+
INSERT INTO sys_config VALUES ('1','db','db_version','3.0.5.3');
21832201

21842202
SET FOREIGN_KEY_CHECKS = 1;

install/tpl/config.inc.php.master

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ $revision = str_replace(array('Revision:','$',' '), '', $svn_revision);
5656

5757
//** Application
5858
define('ISPC_APP_TITLE', 'ISPConfig');
59-
define('ISPC_APP_VERSION', '3.0.5.2');
59+
define('ISPC_APP_VERSION', '3.0.5.3');
6060
define('DEVSYSTEM', 0);
6161

6262

install/tpl/system.ini.master

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,9 @@ tab_change_warning=n
4141
use_loadindicator=y
4242
use_combobox=y
4343
maintenance_mode=n
44+
admin_dashlets_left=
45+
admin_dashlets_right=
46+
reseller_dashlets_left=
47+
reseller_dashlets_right=
48+
client_dashlets_left=
49+
client_dashlets_right=

0 commit comments

Comments
 (0)