Skip to content

Commit cea1e5d

Browse files
committed
Fixed: FS#2346 - doveadm request disabledoveadm column in mail_user table
- Added missing sys_tpl table to ispconfig3.sql and moved the definition of the table to the upd_0035.sql file as new tables cant be added in existing update files. - added new ssl_key field to web_domain table. - cleaned up unused code from apache plugin.
1 parent a8ccf60 commit cea1e5d

File tree

6 files changed

+58
-40
lines changed

6 files changed

+58
-40
lines changed

install/sql/incremental/upd_0034.sql

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -67,20 +67,6 @@ CREATE TABLE IF NOT EXISTS `aps_settings` (
6767

6868
-- --------------------------------------------------------
6969

70-
--
71-
-- Table structure for table `sys_theme`
72-
--
73-
74-
CREATE TABLE IF NOT EXISTS `sys_theme` (
75-
`var_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
76-
`tpl_name` varchar(32) NOT NULL,
77-
`username` varchar(64) NOT NULL,
78-
`logo_url` varchar(255) NOT NULL,
79-
PRIMARY KEY (`var_id`)
80-
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
81-
82-
-- --------------------------------------------------------
83-
8470
--
8571
-- Dumping data for table `aps_settings`
8672
--
@@ -90,7 +76,4 @@ INSERT INTO `aps_settings` (`id`, `name`, `value`) VALUES(2, 'ignore-php-configu
9076
INSERT INTO `aps_settings` (`id`, `name`, `value`) VALUES(3, 'ignore-webserver-module', '');
9177

9278
ALTER TABLE `client` ADD `limit_aps` int(11) NOT NULL DEFAULT '0' AFTER `limit_webdav_user`;
93-
ALTER TABLE `client_template` ADD `limit_aps` int(11) NOT NULL DEFAULT '0' AFTER `limit_webdav_user`;
94-
95-
INSERT INTO `dbispconfig`.`sys_theme` (`var_id`, `tpl_name`, `username`, `logo_url`) VALUES (NULL, 'default', 'global', 'themes/default/images/header_logo.png');
96-
INSERT INTO `dbispconfig`.`sys_theme` (`var_id`, `tpl_name`, `username`, `logo_url`) VALUES (NULL, 'default-v2', 'global', 'themes/default-v2/images/header_logo.png');
79+
ALTER TABLE `client_template` ADD `limit_aps` int(11) NOT NULL DEFAULT '0' AFTER `limit_webdav_user`;
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
-- --------------------------------------------------------
2+
3+
--
4+
-- Table structure for table `sys_theme`
5+
--
6+
7+
CREATE TABLE IF NOT EXISTS `sys_theme` (
8+
`var_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
9+
`tpl_name` varchar(32) NOT NULL,
10+
`username` varchar(64) NOT NULL,
11+
`logo_url` varchar(255) NOT NULL,
12+
PRIMARY KEY (`var_id`)
13+
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
14+
15+
-- --------------------------------------------------------
16+
17+
INSERT INTO `sys_theme` (`var_id`, `tpl_name`, `username`, `logo_url`) VALUES (NULL, 'default', 'global', 'themes/default/images/header_logo.png');
18+
INSERT INTO `sys_theme` (`var_id`, `tpl_name`, `username`, `logo_url`) VALUES (NULL, 'default-v2', 'global', 'themes/default-v2/images/header_logo.png');
19+
20+
-- --------------------------------------------------------
21+
22+
ALTER TABLE `web_domain` ADD `ssl_key` MEDIUMTEXT NOT NULL AFTER `ssl_bundle`;
23+
ALTER TABLE `mail_user` ADD `disabledoveadm` enum('n','y') NOT NULL default 'n' AFTER `disablelda`
24+
25+

install/sql/ispconfig3.sql

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,7 @@ CREATE TABLE `mail_user` (
789789
`disablesmtp` enum('n','y') NOT NULL default 'n',
790790
`disablesieve` enum('n','y') NOT NULL default 'n',
791791
`disablelda` enum('n','y') NOT NULL default 'n',
792+
`disabledoveadm` enum('n','y') NOT NULL default 'n',
792793
PRIMARY KEY (`mailuser_id`),
793794
KEY `server_id` (`server_id`,`email`),
794795
KEY `email_access` (`email`,`access`)
@@ -1500,6 +1501,20 @@ CREATE TABLE `sys_session` (
15001501

15011502
-- --------------------------------------------------------
15021503

1504+
--
1505+
-- Table structure for table `sys_theme`
1506+
--
1507+
1508+
CREATE TABLE IF NOT EXISTS `sys_theme` (
1509+
`var_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
1510+
`tpl_name` varchar(32) NOT NULL,
1511+
`username` varchar(64) NOT NULL,
1512+
`logo_url` varchar(255) NOT NULL,
1513+
PRIMARY KEY (`var_id`)
1514+
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
1515+
1516+
-- --------------------------------------------------------
1517+
15031518
--
15041519
-- Table structure for table `sys_user`
15051520
--
@@ -1641,6 +1656,7 @@ CREATE TABLE `web_domain` (
16411656
`ssl_request` mediumtext NULL,
16421657
`ssl_cert` mediumtext NULL,
16431658
`ssl_bundle` mediumtext NULL,
1659+
`ssl_key` mediumtext NULL,
16441660
`ssl_action` varchar(16) NULL,
16451661
`stats_password` varchar(255) default NULL,
16461662
`stats_type` varchar(255) default 'webalizer',
@@ -2057,6 +2073,15 @@ INSERT INTO `sys_ini` (`sysini_id`, `config`) VALUES (1, '');
20572073
-- Dumping data for table `sys_user`
20582074
--
20592075

2076+
INSERT INTO `sys_theme` (`var_id`, `tpl_name`, `username`, `logo_url`) VALUES (NULL, 'default', 'global', 'themes/default/images/header_logo.png');
2077+
INSERT INTO `sys_theme` (`var_id`, `tpl_name`, `username`, `logo_url`) VALUES (NULL, 'default-v2', 'global', 'themes/default-v2/images/header_logo.png');
2078+
2079+
-- --------------------------------------------------------
2080+
2081+
--
2082+
-- Dumping data for table `sys_user`
2083+
--
2084+
20602085
INSERT INTO `sys_user` (`userid`, `sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `username`, `passwort`, `modules`, `startmodule`, `app_theme`, `typ`, `active`, `language`, `groups`, `default_group`, `client_id`) VALUES (1, 1, 0, 'riud', 'riud', '', 'admin', '21232f297a57a5a743894a0e4a801fc3', 'dashboard,admin,client,mail,monitor,sites,dns,vm,tools,help', 'dashboard', 'default', 'admin', 1, 'en', '1,2', 1, 0);
20612086

20622087
-- --------------------------------------------------------

interface/web/mail/mail_user_edit.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ function onAfterInsert() {
251251
$disabledeliver = ($this->dataRecord["postfix"] == 'y')?'n':'y';
252252
$disablesmtp = ($this->dataRecord["postfix"] == 'y')?'n':'y';
253253

254-
$sql = "UPDATE mail_user SET disableimap = '$disableimap', disablesieve = '$disableimap', disablepop3 = '$disablepop3', disablesmtp = '$disablesmtp', disabledeliver = '$disabledeliver', disablelda = '$disabledeliver' WHERE mailuser_id = ".$this->id;
254+
$sql = "UPDATE mail_user SET disableimap = '$disableimap', disablesieve = '$disableimap', disablepop3 = '$disablepop3', disablesmtp = '$disablesmtp', disabledeliver = '$disabledeliver', disablelda = '$disabledeliver', disabledoveadm = '$disableimap' WHERE mailuser_id = ".$this->id;
255255
$app->db->query($sql);
256256
}
257257
}
@@ -292,7 +292,7 @@ function onAfterUpdate() {
292292
$disabledeliver = ($this->dataRecord["postfix"] == 'y')?'n':'y';
293293
$disablesmtp = ($this->dataRecord["postfix"] == 'y')?'n':'y';
294294

295-
$sql = "UPDATE mail_user SET disableimap = '$disableimap', disablesieve = '$disableimap', disablepop3 = '$disablepop3', disablesmtp = '$disablesmtp', disabledeliver = '$disabledeliver', disablelda = '$disabledeliver' WHERE mailuser_id = ".$this->id;
295+
$sql = "UPDATE mail_user SET disableimap = '$disableimap', disablesieve = '$disableimap', disablepop3 = '$disablepop3', disablesmtp = '$disablesmtp', disabledeliver = '$disabledeliver', disablelda = '$disabledeliver', disabledoveadm = '$disableimap' WHERE mailuser_id = ".$this->id;
296296
$app->db->query($sql);
297297
}
298298

server/lib/classes/system.inc.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ class system{
4141
* @return system
4242
*/
4343
public function system(){
44-
global $go_info;
45-
$this->server_id = $go_info['isp']['server_id'];
46-
$this->server_conf = $go_info['isp']['server_conf'];
44+
//global $go_info;
45+
//$this->server_id = $go_info['isp']['server_id'];
46+
//$this->server_conf = $go_info['isp']['server_conf'];
4747
$this->server_conf['passwd_datei'] = '/etc/passwd';
4848
$this->server_conf['shadow_datei'] = '/etc/shadow';
4949
$this->server_conf['group_datei'] = '/etc/group';

server/plugins-available/apache2_plugin.inc.php

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
Copyright (c) 2007 - 2009, Till Brehm, projektfarm Gmbh
4+
Copyright (c) 2007 - 2012, Till Brehm, projektfarm Gmbh
55
All rights reserved.
66
77
Redistribution and use in source and binary forms, with or without modification,
@@ -458,21 +458,6 @@ function update($event_name,$data) {
458458
if(is_link($data['old']['document_root'].'/log')) $app->system->unlink($data['old']['document_root'].'/log');
459459
}
460460

461-
/*
462-
// Create the symlink for the logfiles
463-
if(!is_dir('/var/log/ispconfig/httpd/'.$data['new']['domain'])) $app->system->mkdirpath('/var/log/ispconfig/httpd/'.$data['new']['domain']);
464-
if(!is_link($data['new']['document_root'].'/log')) {
465-
// exec("ln -s /var/log/ispconfig/httpd/".$data["new"]["domain"]." ".$data["new"]["document_root"]."/log");
466-
if ($web_config["website_symlinks_rel"] == 'y') {
467-
$this->create_relative_link("/var/log/ispconfig/httpd/".$data["new"]["domain"], $data["new"]["document_root"]."/log");
468-
} else {
469-
exec("ln -s /var/log/ispconfig/httpd/".$data["new"]["domain"]." ".$data["new"]["document_root"]."/log");
470-
}
471-
472-
$app->log('Creating symlink: ln -s /var/log/ispconfig/httpd/'.$data['new']['domain'].' '.$data['new']['document_root'].'/log',LOGLEVEL_DEBUG);
473-
}
474-
*/
475-
476461
//* Create the log dir if nescessary and mount it
477462
if(!is_dir($data['new']['document_root'].'/log') || is_link($data['new']['document_root'].'/log')) {
478463
if(is_link($data['new']['document_root'].'/log')) unlink($data['new']['document_root'].'/log');
@@ -651,7 +636,7 @@ function update($event_name,$data) {
651636
// make tmp directory writable for Apache and the website users
652637
$app->system->chmod($data['new']['document_root'].'/tmp',0777);
653638

654-
// Set Log symlink to 755 to make the logs accessible by the FTP user
639+
// Set Log directory to 755 to make the logs accessible by the FTP user
655640
if(realpath($data['new']['document_root'].'/log') == '/var/log/ispconfig/httpd/'.$data['new']['domain'].'/error.log') {
656641
$app->system->chmod($data['new']['document_root'].'/log',0755);
657642
}

0 commit comments

Comments
 (0)