Skip to content

Commit 5f97596

Browse files
committed
updatded server part
1 parent cef90d2 commit 5f97596

File tree

4 files changed

+121
-19
lines changed

4 files changed

+121
-19
lines changed

interface/lib/classes/tform.inc.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,12 @@ function datalogSave($action,$primary_id,$record_new) {
810810
$server_id = ($record_old["server_id"] > 0)?$record_old["server_id"]:0;
811811

812812
if(count($diffrec) > 0) {
813-
$diffstr = $app->db->quote(serialize($diffrec));
813+
814+
// We need the full records in ISPConfig, not only the diffs
815+
$diffrec = array( 'old' => $record_old,
816+
'new' => $record_new);
817+
818+
$diffstr = $app->db->quote(serialize($diffrec));
814819
$username = $app->db->quote($_SESSION["s"]["user"]["username"]);
815820
$dbidx = $this->formDef['db_table_idx'].":".$primary_id;
816821
$action = ($action == 'INSERT')?'i':'u';

server/lib/app.inc.php

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,19 @@ function app() {
4141
}
4242

4343
function uses($classes) {
44-
global $conf;
45-
46-
$cl = explode(',',$classes);
47-
if(is_array($cl)) {
48-
foreach($cl as $classname) {
49-
if(!is_object($this->$classname)) {
50-
include_once($conf['classpath'] . "/".$classname.".inc.php");
51-
$this->$classname = new $classname;
52-
}
53-
}
54-
}
55-
44+
global $conf;
45+
46+
$cl = explode(',',$classes);
47+
if(is_array($cl)) {
48+
foreach($cl as $classname) {
49+
if(!is_object($this->$classname)) {
50+
if(is_file($conf['classpath'] . "/".$classname.".inc.php") && !is_link($conf['classpath'] . "/".$classname.".inc.php")) {
51+
include_once($conf['classpath'] . "/".$classname.".inc.php");
52+
$this->$classname = new $classname;
53+
}
54+
}
55+
}
56+
}
5657
}
5758

5859
function load($files) {
@@ -61,7 +62,9 @@ function load($files) {
6162
$fl = explode(',',$files);
6263
if(is_array($fl)) {
6364
foreach($fl as $file) {
65+
if(is_file($conf['classpath'] . "/".$classname.".inc.php") && !is_link($conf['classpath'] . "/".$classname.".inc.php")) {
6466
include_once($conf['classpath'] . "/".$file.".inc.php");
67+
}
6568
}
6669
}
6770

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<?php
2+
3+
/*
4+
Copyright (c) 2006, Till Brehm, projektfarm Gmbh
5+
All rights reserved.
6+
7+
Redistribution and use in source and binary forms, with or without modification,
8+
are permitted provided that the following conditions are met:
9+
10+
* Redistributions of source code must retain the above copyright notice,
11+
this list of conditions and the following disclaimer.
12+
* Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
* Neither the name of ISPConfig nor the names of its contributors
16+
may be used to endorse or promote products derived from this software without
17+
specific prior written permission.
18+
19+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22+
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
23+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
24+
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
26+
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
28+
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29+
*/
30+
31+
class mail_base {
32+
33+
var $current_record = array();
34+
35+
function write_config() {
36+
37+
38+
39+
}
40+
41+
/*
42+
Domain Alias
43+
*/
44+
45+
function domain_add($domain) {
46+
47+
}
48+
49+
function domain_update($domain_old, $domain_new) {
50+
51+
}
52+
53+
function domain_delete($domain) {
54+
55+
}
56+
57+
/*
58+
Domain Alias
59+
*/
60+
61+
function domain_alias_add($domain, $destination) {
62+
63+
}
64+
65+
function domain_alias_update($domain_old, $domain_new) {
66+
67+
}
68+
69+
function domain_alias_delete($domain) {
70+
71+
}
72+
73+
74+
}
75+
76+
?>

server/server.php

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,27 +68,45 @@
6868

6969
// Run the configuration modules
7070
if($server_db_record["mail_server"] == 1) {
71-
$app->uses('mod_mail_'.$conf["serverconfig"]["mail"]["module"]);
71+
$app->load('mod_mail_base');
72+
$mail_module_name = 'mod_mail_'.$conf["serverconfig"]["mail"]["module"];
73+
$app->uses($mail_module_name);
74+
$app->$mail_module_name->write_config();
7275
}
7376

7477
if($server_db_record["web_server"] == 1) {
75-
$app->uses('mod_web_'.$conf["serverconfig"]["web"]["module"]);
78+
$app->load('mod_web_base');
79+
$web_module_name = 'mod_web_'.$conf["serverconfig"]["web"]["module"];
80+
$app->uses($web_module_name);
81+
$app->$web_module_name->write_config();
7682
}
7783

7884
if($server_db_record["dns_server"] == 1) {
79-
$app->uses('mod_dns_'.$conf["serverconfig"]["dns"]["module"]);
85+
$app->load('mod_dns_base');
86+
$dns_module_name = 'mod_dns_'.$conf["serverconfig"]["dns"]["module"];
87+
$app->uses($dns_module_name);
88+
$app->$dns_module_name->write_config();
8089
}
8190

8291
if($server_db_record["file_server"] == 1) {
83-
$app->uses('mod_file_'.$conf["serverconfig"]["file"]["module"]);
92+
$app->load('mod_file_base');
93+
$file_module_name = 'mod_file_'.$conf["serverconfig"]["file"]["module"];
94+
$app->uses($file_module_name);
95+
$app->$file_module_name->write_config();
8496
}
8597

8698
if($server_db_record["db_server"] == 1) {
87-
$app->uses('mod_db_'.$conf["serverconfig"]["db"]["module"]);
99+
$app->load('mod_db_base');
100+
$db_module_name = 'mod_db_'.$conf["serverconfig"]["db"]["module"];
101+
$app->uses($db_module_name);
102+
$app->$db_module_name->write_config();
88103
}
89104

90105
if($server_db_record["vserver_server"] == 1) {
91-
$app->uses('mod_vserver_'.$conf["serverconfig"]["vserver"]["module"]);
106+
$app->load('mod_vserver_base');
107+
$vserver_module_name = 'mod_vserver_'.$conf["serverconfig"]["vserver"]["module"];
108+
$app->uses($vserver_module_name);
109+
$app->$vserver_module_name->write_config();
92110
}
93111

94112
// Remove lock

0 commit comments

Comments
 (0)