Skip to content

Commit 3398c25

Browse files
author
vogelor
committed
enhanced handling of local config file
1 parent 6099604 commit 3398c25

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

install/tpl/config.inc.php.master

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ $conf["server_id"] = "{server_id}";
113113

114114

115115
//** Interface
116-
define('ISPC_INTERFACE_MODULES_ENABLED', 'dashboard,mail,sites,dns,tools');
116+
$conf['interface_modules_enabled'] = 'dashboard,mail,sites,dns,tools';
117117

118118

119119
//** Logging

interface/lib/config.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101

102102

103103
//** Interface
104-
define('ISPC_INTERFACE_MODULES_ENABLED', 'mail,sites,dns,tools');
104+
$conf['interface_modules_enabled'] = 'dashboard,mail,sites,dns,tools';
105105

106106

107107
//** Logging

interface/web/client/client_edit.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,14 +134,14 @@ function onShowEnd() {
134134
the data was successful inserted in the database.
135135
*/
136136
function onAfterInsert() {
137-
global $app;
137+
global $app, $conf;
138138
// Create the group for the client
139139
$groupid = $app->db->datalogInsert('sys_group', "(name,description,client_id) VALUES ('".mysql_real_escape_string($this->dataRecord["username"])."','',".$this->id.")", 'groupid');
140140
$groups = $groupid;
141141

142142
$username = $app->db->quote($this->dataRecord["username"]);
143143
$password = $app->db->quote($this->dataRecord["password"]);
144-
$modules = ISPC_INTERFACE_MODULES_ENABLED;
144+
$modules = $conf['interface_modules_enabled'];
145145
if($this->dataRecord["limit_client"] > 0) $modules .= ',client';
146146
$startmodule = 'mail';
147147
$usertheme = $app->db->quote($this->dataRecord["usertheme"]);
@@ -207,7 +207,7 @@ function onAfterUpdate() {
207207

208208
// reseller status changed
209209
if(isset($this->dataRecord["limit_client"]) && $this->dataRecord["limit_client"] != $this->oldDataRecord["limit_client"]) {
210-
$modules = ISPC_INTERFACE_MODULES_ENABLED;
210+
$modules = $conf['interface_modules_enabled'];
211211
if($this->dataRecord["limit_client"] > 0) $modules .= ',client';
212212
$modules = $app->db->quote($modules);
213213
$client_id = $this->id;

interface/web/client/reseller_edit.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,14 @@ function onShowEnd() {
136136
the data was successful inserted in the database.
137137
*/
138138
function onAfterInsert() {
139-
global $app;
139+
global $app, $conf;
140140
// Create the group for the reseller
141141
$groupid = $app->db->datalogInsert('sys_group', "(name,description,client_id) VALUES ('".mysql_real_escape_string($this->dataRecord["username"])."','',".$this->id.")", 'groupid');
142142
$groups = $groupid;
143143

144144
$username = $app->db->quote($this->dataRecord["username"]);
145145
$password = $app->db->quote($this->dataRecord["password"]);
146-
$modules = ISPC_INTERFACE_MODULES_ENABLED.',client';
146+
$modules = $conf['interface_modules_enabled'] . ',client';
147147
$startmodule = 'client';
148148
$usertheme = $app->db->quote($this->dataRecord["usertheme"]);
149149
$type = 'user';
@@ -170,7 +170,7 @@ function onAfterInsert() {
170170
the data was successful updated in the database.
171171
*/
172172
function onAfterUpdate() {
173-
global $app;
173+
global $app, $conf;
174174

175175
// username changed
176176
if(isset($this->dataRecord['username']) && $this->dataRecord['username'] != '' && $this->oldDataRecord['username'] != $this->dataRecord['username']) {
@@ -202,7 +202,7 @@ function onAfterUpdate() {
202202

203203
// reseller status changed
204204
if(isset($this->dataRecord["limit_client"]) && $this->dataRecord["limit_client"] != $this->oldDataRecord["limit_client"]) {
205-
$modules = ISPC_INTERFACE_MODULES_ENABLED.',client';
205+
$modules = $conf['interface_modules_enabled'] . ',client';
206206
$modules = $app->db->quote($modules);
207207
$client_id = $this->id;
208208
$sql = "UPDATE sys_user SET modules = '$modules' WHERE client_id = $client_id";

0 commit comments

Comments
 (0)