Skip to content

Commit 7374887

Browse files
author
pedro_morgan
committed
* Idea of constants for digestion
* Small tweaks and a warning TODO
1 parent d00272c commit 7374887

File tree

2 files changed

+30
-4
lines changed

2 files changed

+30
-4
lines changed

interface/lib/app.inc.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public function error($msg, $next_link = '', $stop = true, $priority = 1)
124124
<table width="100%" border="0" cellspacing="0" cellpadding="2">
125125
<tr>
126126
<td class="error"><b>Error:</b><br>'.$msg;
127-
if($next_link != "") $msg .= '<a href="'.$next_link.'">Next</a><br>';
127+
if($next_link != '') $msg .= '<a href="'.$next_link.'">Next</a><br>';
128128
$msg .= '</td>
129129
</tr>
130130
</table>
@@ -165,6 +165,8 @@ public function tpl_defaults()
165165
}
166166
$this->tpl->setVar('app_title', $this->_conf['app_title']);
167167
$this->tpl->setVar('delete_confirmation', $this->lng('delete_confirmation'));
168+
//TODO: Silence this notice
169+
//print_r($_SESSION);
168170
$this->tpl->setVar('app_module', $_SESSION['s']['module']['name']);
169171
if(isset($_SESSION['s']['user']) && $_SESSION['s']['user']['typ'] == 'admin') {
170172
$this->tpl->setVar('is_admin', 1);

interface/lib/config.inc.php

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@
4040
$conf['modules_available'] = 'admin,mail,sites,monitor,client,dns';
4141

4242

43-
//** Future Code - pedro - rfc
43+
//********************************************************************************
44+
//** Future Code idea - pedro - rfc
45+
//** >>>>
4446
/* Database connection
4547
The only time paramaters are needed is to connect, otherwise the variables
4648
are not required "around" the application. ie Connected and done.
@@ -82,8 +84,30 @@
8284
$conf['db_database'] = 'ispconfig3';
8385
}
8486

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
101+
102+
//** Database Settings
103+
/* See above
104+
$conf['db_type'] = 'mysql';
105+
$conf['db_host'] = 'localhost';
106+
$conf['db_user'] = 'root';
107+
$conf['db_password'] = '';
108+
$conf['db_database'] = 'ispconfig3';
109+
*/
85110

86-
//** Path Settings (Do not change!)
87111
$conf['rootpath'] = substr(dirname(__FILE__),0,-4);
88112
$conf['fs_div'] = '/'; // File system divider, \\ on windows and / on linux and unix
89113
$conf['classpath'] = $conf['rootpath'].$conf['fs_div'].'lib'.$conf['fs_div'].'classes';
@@ -96,7 +120,7 @@
96120
define('INCLUDE_ROOT', SERVER_ROOT.DIR_TRENNER.'lib');
97121
define('CLASSES_ROOT', INCLUDE_ROOT.DIR_TRENNER.'classes');
98122

99-
/* pedro notes ? this stuff is REALLY not necessay */
123+
/* pedro notes ? this stuff is REALLY not necessay, can leak everywhere */
100124
define('DB_TYPE', $conf['db_type']);
101125
define('DB_HOST', $conf['db_host']);
102126
define('DB_DATABASE',$conf['db_database']);

0 commit comments

Comments
 (0)