Skip to content

Commit dcff571

Browse files
author
pedro_morgan
committed
* Using new ISPC_*_PATH constants
* Adding new data schema (to be moved shortly * no more $conf['classpath']
1 parent d46afe8 commit dcff571

File tree

5 files changed

+127
-61
lines changed

5 files changed

+127
-61
lines changed

interface/lib/app.inc.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,13 @@ public function __construct()
6767

6868
public function uses($classes)
6969
{
70-
$cl = explode(',',$classes);
70+
$cl = explode(',', $classes);
7171
if(is_array($cl)) {
7272
foreach($cl as $classname){
7373
$classname = trim($classname);
7474
//* Class is not loaded so load it
7575
if(!array_key_exists($classname, $this->_loaded_classes)){
76-
require_once($this->_conf['classpath'] . '/'.$classname.'.inc.php');
76+
include_once(ISPC_CLASS_PATH."/$classname.inc.php");
7777
$this->$classname = new $classname();
7878
$this->_loaded_classes[$classname] = true;
7979
}
@@ -87,7 +87,7 @@ public function load($files)
8787
if(is_array($fl)) {
8888
foreach($fl as $file){
8989
$file = trim($file);
90-
include_once($this->_conf['classpath'] . '/'.$file.'.inc.php');
90+
include_once(ISPC_CLASS_PATH."/$file.inc.php");
9191
}
9292
}
9393
}
@@ -145,8 +145,9 @@ public function lng($text)
145145
{
146146
if($this->_language_inc != 1) {
147147
//* loading global and module Wordbook
148-
@include_once($this->_conf['rootpath'].'/lib/lang/'.$_SESSION['s']['language'].'.lng');
149-
@include_once($this->_conf['rootpath'].'/web/'.$_SESSION['s']['module']['name'].'/lib/lang/'.$_SESSION['s']['language'].'.lng');
148+
// TODO: this need to be made clearer somehow - pedro
149+
@include_once(ISPC_ROOT_PATH.'/lib/lang/'.$_SESSION['s']['language'].'.lng');
150+
@include_once(ISPC_ROOT_PATH.'/web/'.$_SESSION['s']['module']['name'].'/lib/lang/'.$_SESSION['s']['language'].'.lng');
150151
$this->_wb = $wb;
151152
$this->_language_inc = 1;
152153
}

interface/lib/classes/tpl.inc.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@
2222
//
2323
// $Id: class.tpl.inc.php,v 1.1 2003/07/08 12:31:10 platinum Exp $
2424

25-
//** check to avoid multiple including of class
25+
//** check and avoid multiple loading of class
2626
if (!defined('vlibTemplateClassLoaded')) {
27+
2728
define('vlibTemplateClassLoaded', 1);
28-
global $conf;
29-
include_once ($conf['classpath'].'/tpl_error.inc.php');
30-
include_once ($conf['classpath'].'/tpl_ini.inc.php');
29+
include_once (ISPC_CLASS_PATH.'/tpl_error.inc.php');
30+
include_once (ISPC_CLASS_PATH.'/tpl_ini.inc.php');
3131

3232
class tpl{
3333

@@ -1361,8 +1361,8 @@ function setCacheLifeTime() {vlibTemplateError::raiseError('VT_WARNING_NOT_CACH
13611361
function setCacheExtension() {vlibTemplateError::raiseError('VT_WARNING_NOT_CACHE_OBJ', WARNING, 'setCacheExtension()');}
13621362
} // << end class Def
13631363

1364-
//include_once ($conf['classpath'].'/vlibTemplate/debug.php');
1365-
include_once ($conf['classpath'].'/tpl_cache.inc.php');
1364+
//include_once (ISPC_CLASS_PATH.'/vlibTemplate/debug.php');
1365+
include_once (ISPC_CLASS_PATH.'/tpl_cache.inc.php');
13661366

13671367
} // << end if(!defined())..
13681368
?>

interface/lib/classes/tpl_error.inc.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
//
1111
// $Id: error.php,v 1.1 2003/07/08 12:32:06 platinum Exp $
1212

13-
define('FATAL', E_USER_ERROR);
13+
define('FATAL', E_USER_ERROR);
1414
define('WARNING', E_USER_WARNING);
15-
define('NOTICE', E_USER_NOTICE);
16-
define('KILL', -1); // used for killing inside parsing.
15+
define('NOTICE', E_USER_NOTICE);
16+
define('KILL', -1); // used for killing inside parsing.
1717

1818
/**
1919
* Class is used by vlibTemplate.

interface/lib/config.inc.php

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@
3535
//* TODO: Js caching - pedro
3636

3737
//** Key paramaters
38+
define('ISPC_APP_TITLE', 'ISPConfig');
3839
$conf['app_title'] = 'ISPConfig';
40+
define('ISPC_APP_VERSION', '3.0.0');
3941
$conf['app_version'] = '3.0.0';
4042
$conf['modules_available'] = 'admin,mail,sites,monitor,client,dns';
4143

@@ -84,20 +86,14 @@
8486
$conf['db_database'] = 'ispconfig3';
8587
}
8688

87-
/* Dynamic constants are another technique as well as key files as constants.
88-
The base root directory is the interface/ directory which is the top level for php
89-
From this eveything else is be defined underneath as constants
90-
The constants are directory paths with no trailing /
91-
This should do away with the $conf['rootpath'] etc
92-
The $conf['fs_div'] is unnecessary if only / is used, will work on windoze also
93-
94-
*/
95-
//** The main ROOT is the parent directory to this file, ie interface
96-
define('ISPC_ROOT', realpath('../'));
97-
define('ISPC_CLASS_PATH', ISPC_ROOT.'/lib/classes');
98-
define('ISPC_TEMP_PATH', ISPC_ROOT.'/temp');
99-
define('ISPC_CACHE_PATH', ISPC_ROOT.'/cache');
100-
//<< End pedro rfc block
89+
90+
//** The main ROOT is the parent directory to this file, ie Interface/. NO trailing slashes.
91+
define('ISPC_ROOT_PATH', realpath(dirname(__FILE__).'/../'));
92+
define('ISPC_LIB_PATH', ISPC_ROOT_PATH.'/lib');
93+
define('ISPC_CLASS_PATH', ISPC_ROOT_PATH.'/lib/classes');
94+
define('ISPC_TEMP_PATH', ISPC_ROOT_PATH.'/temp');
95+
define('ISPC_CACHE_PATH', ISPC_ROOT_PATH.'/cache');
96+
10197

10298
//** Database Settings
10399
/* See above
@@ -110,23 +106,19 @@
110106

111107
$conf['rootpath'] = substr(dirname(__FILE__),0,-4);
112108
$conf['fs_div'] = '/'; // File system divider, \\ on windows and / on linux and unix
113-
$conf['classpath'] = $conf['rootpath'].$conf['fs_div'].'lib'.$conf['fs_div'].'classes';
114109
$conf['temppath'] = $conf['rootpath'].$conf['fs_div'].'temp';
115110
// predro notes: not sure this is the right thing ?
116111
$conf['cache_dir'] = $conf['rootpath'].$conf['fs_div'].'/cache';
117112

118-
define('DIR_TRENNER', $conf['fs_div']);
119-
define('SERVER_ROOT', $conf['rootpath']);
120-
define('INCLUDE_ROOT', SERVER_ROOT.DIR_TRENNER.'lib');
121-
define('CLASSES_ROOT', INCLUDE_ROOT.DIR_TRENNER.'classes');
122113

123-
/* pedro notes ? this stuff is REALLY not necessay, can leak everywhere */
114+
/* pedro notes ? this stuff is REALLY not necessay, can leak everywhere
115+
Don think this lot is being used so commented out
124116
define('DB_TYPE', $conf['db_type']);
125117
define('DB_HOST', $conf['db_host']);
126118
define('DB_DATABASE',$conf['db_database']);
127119
define('DB_USER', $conf['db_user']);
128120
define('DB_PASSWORD', $conf['db_password']);
129-
121+
*/
130122

131123
//** External programs
132124
//$conf["programs"]["convert"] = "/usr/bin/convert";
Lines changed: 99 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,105 @@
11
<?php
22

3+
//*************************************************************************************
4+
// DNS
5+
//*************************************************************************************
36

7+
//TODO - Enum
8+
$tables['dns_rr'] = "
9+
`id` I unsigned NOTNULL AUTO PRIMARY,
10+
`sys_userid` I NOTNULL,
11+
`sys_groupid` I NOTNULL,
12+
`sys_perm_user` C(5) NOTNULL,
13+
`sys_perm_group` C(5) NOTNULL,
14+
`sys_perm_other` C(5) NOTNULL,
15+
`server_id` I NOTNULL DEFAULT '1',
16+
`zone` I unsigned NOTNULL,
17+
`name` C(64) NOTNULL,
18+
`type` enum('A','AAAA','ALIAS','CNAME','HINFO','MX','NAPTR','NS','PTR','RP','SRV','TXT') ,
19+
`data` char(128) NOTNULL,
20+
`aux` I unsigned NOTNULL DEFAULT '0',
21+
`ttl` I unsigned NOTNULL DEFAULT '86400',
22+
`active` enum('N','Y') NOTNULL DEFAULT 'Y'
23+
";
24+
25+
//TODO char(255)
26+
$tables['dns_soa'] = "
27+
`id` I unsigned NOTNULL AUTO PRIMARY,
28+
`sys_userid` I NOTNULL,
29+
`sys_groupid` I NOTNULL,
30+
`sys_perm_user` C(5) NOTNULL,
31+
`sys_perm_group` C(5) NOTNULL,
32+
`sys_perm_other` C(5) NOTNULL,
33+
`server_id` I NOTNULL DEFAULT '1',
34+
`origin` char(255) NOTNULL,
35+
`ns` char(255) NOTNULL,
36+
`mbox` char(255) NOTNULL,
37+
`serial` I NOTNULL DEFAULT '1',
38+
`refresh` I NOTNULL DEFAULT '28800',
39+
`retry` I NOTNULL DEFAULT '7200',
40+
`expire` I NOTNULL DEFAULT '604800',
41+
`minimum` I NOTNULL DEFAULT '86400',
42+
`ttl` I unsigned NOTNULL DEFAULT '86400',
43+
`active` enum('Y','N') NOTNULL,
44+
`xfer` char(255) NOTNULL
45+
";
46+
47+
48+
//*************************************************************************************
49+
// Ftp Related
50+
//*************************************************************************************
51+
52+
$tables['ftp_user'] = "
53+
`ftp_user_id` I8 NOTNULL AUTO PRIMARY,
54+
`sys_userid` I NOTNULL DEFAULT '0',
55+
`sys_groupid` I NOTNULL DEFAULT '0',
56+
`sys_perm_user` C(5),
57+
`sys_perm_group` C(5),
58+
`sys_perm_other` C(5),
59+
`server_id` I NOTNULL DEFAULT '0',
60+
`parent_domain_id` I NOTNULL DEFAULT '0',
61+
`username` C(255),
62+
`password` C(255),
63+
`quota_size` I NOTNULL DEFAULT '-1',
64+
`active` C(255) NOTNULL DEFAULT 'y',
65+
`uid` C(255),
66+
`gid` C(255),
67+
`dir` C(255),
68+
`quota_files` I NOTNULL DEFAULT '-1',
69+
`ul_ratio` I NOTNULL DEFAULT '-1',
70+
`dl_ratio` I NOTNULL DEFAULT '-1',
71+
`ul_bandwidth` I NOTNULL DEFAULT '-1',
72+
`dl_bandwidth` I NOTNULL DEFAULT '-1'
73+
";
74+
75+
//*************************************************************************************
76+
// Web Domain
77+
//*************************************************************************************
478

579
$tables['web_domain'] = "
6-
`domain_id` bigint(20) NOTNULL AUTO PRIMARY,
7-
`sys_userid` I NOTNULL DEFAULT '0',
8-
`sys_groupid` I NOTNULL DEFAULT '0',
9-
`sys_perm_user` C(5) ,
10-
`sys_perm_group` C(5) ,
11-
`sys_perm_other` C(5) ,
12-
`server_id` I NOTNULL DEFAULT '0',
13-
`ip_address` C(15) ,
14-
`domain` C(255) ,
15-
`type` C(255) NOTNULL DEFAULT 'y',
16-
`parent_domain_id` I NOTNULL DEFAULT '0',
17-
`vhost_type` C(255) ,
18-
`document_root` C(255) ,
19-
`system_user` C(255) ,
20-
`system_group` C(255) ,
21-
`hd_quota` I NOTNULL DEFAULT '0',
22-
`traffic_quota` I NOTNULL DEFAULT '0',
23-
`cgi` C(255) NOTNULL DEFAULT 'y',
24-
`ssi` C(255) NOTNULL DEFAULT 'y',
25-
`suexec` C(255) NOTNULL DEFAULT 'y',
26-
`php` C(255) NOTNULL DEFAULT 'y',
27-
`redirect_type` C(255) ,
28-
`redirect_path` C(255) ,
29-
`active` C(255) NOTNULL DEFAULT 'y',
30-
PRIMARY KEY (`domain_id`)
31-
) ;
80+
`domain_id` I8 NOTNULL AUTO PRIMARY,
81+
`sys_userid` I NOTNULL DEFAULT '0',
82+
`sys_groupid` I NOTNULL DEFAULT '0',
83+
`sys_perm_user` C(5),
84+
`sys_perm_group` C(5),
85+
`sys_perm_other` C(5),
86+
`server_id` I NOTNULL DEFAULT '0',
87+
`ip_address` C(15) ,
88+
`domain` C(255) ,
89+
`type` C(255) NOTNULL DEFAULT 'y',
90+
`parent_domain_id` I NOTNULL DEFAULT '0',
91+
`vhost_type` C(255),
92+
`document_root` C(255),
93+
`system_user` C(255),
94+
`system_group` C(255),
95+
`hd_quota` I NOTNULL DEFAULT '0',
96+
`traffic_quota` I NOTNULL DEFAULT '0',
97+
`cgi` C(255) NOTNULL DEFAULT 'y',
98+
`ssi` C(255) NOTNULL DEFAULT 'y',
99+
`suexec` C(255) NOTNULL DEFAULT 'y',
100+
`php` C(255) NOTNULL DEFAULT 'y',
101+
`redirect_type` C(255),
102+
`redirect_path` C(255),
103+
`active` C(255) NOTNULL DEFAULT 'y'
104+
";
32105
?>

0 commit comments

Comments
 (0)