Skip to content

Commit 67c4b39

Browse files
committed
Fixed a problem with apache user and group field in the admin settings.
1 parent 257cd78 commit 67c4b39

File tree

5 files changed

+35
-5
lines changed

5 files changed

+35
-5
lines changed

install/lib/installer_base.lib.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,8 @@ public function add_database_server_record() {
212212
$tpl_ini_array['web']['website_symlinks'] = $conf['web']['website_symlinks'];
213213
$tpl_ini_array['cron']['crontab_dir'] = $conf['cron']['crontab_dir'];
214214
$tpl_ini_array['web']['security_level'] = 20;
215-
$tpl_ini_array['web']['user'] = $conf['web']['user'];
216-
$tpl_ini_array['web']['group'] = $conf['web']['group'];
215+
$tpl_ini_array['web']['user'] = $conf['apache']['user'];
216+
$tpl_ini_array['web']['group'] = $conf['apache']['group'];
217217

218218
$server_ini_content = array_to_ini($tpl_ini_array);
219219
$server_ini_content = mysql_real_escape_string($server_ini_content);

interface/lib/classes/tform.inc.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,33 @@ function applyValueLimit($limit,$values) {
276276
}
277277
}
278278

279+
//* values are limited to a field in the reseller settings
280+
if($limit_parts[0] == 'reseller') {
281+
if($_SESSION["s"]["user"]["typ"] == 'admin') {
282+
return $values;
283+
} else {
284+
//* Get the limits of the client that is currently logged in
285+
$client_group_id = $_SESSION["s"]["user"]["default_group"];
286+
$client = $app->db->queryOneRecord("SELECT parent_client_id FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
287+
//echo "SELECT parent_client_id FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id";
288+
//* If the client belongs to a reseller, we will check against the reseller Limit too
289+
if($client['parent_client_id'] != 0) {
290+
291+
//* first we need to know the groups of this reseller
292+
$tmp = $app->db->queryOneRecord("SELECT userid, groups FROM sys_user WHERE client_id = ".$client['parent_client_id']);
293+
$reseller_groups = $tmp["groups"];
294+
$reseller_userid = $tmp["userid"];
295+
296+
// Get the limits of the reseller of the logged in client
297+
$client_group_id = $_SESSION["s"]["user"]["default_group"];
298+
$reseller = $app->db->queryOneRecord("SELECT ".$limit_parts[1]." as lm FROM client WHERE client_id = ".$client['parent_client_id']);
299+
$allowed = explode(',',$reseller['lm']);
300+
} else {
301+
return $values;
302+
}
303+
} // end if admin
304+
} // end if reseller
305+
279306
//* values are limited to a field in the system settings
280307
if($limit_parts[0] == 'system') {
281308
$app->uses('getconf');

interface/web/admin/lib/lang/en_server_config.lng

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,6 @@ $wb["config_dir_txt"] = 'Config directory';
4343
$wb["init_script_txt"] = 'Cron init script name';
4444
$wb["crontab_dir_txt"] = 'Path for individual crontabs';
4545
$wb["wget_txt"] = 'Path to wget program';
46-
$wb["security_level_txt"] = 'Security level';
46+
$wb["web_user_txt"] = 'Apache user';
47+
$wb["web_group_txt"] = 'Apache group';
4748
?>

interface/web/admin/templates/server_config_web_edit.htm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ <h2><tmpl_var name="list_head_txt"></h2>
3434
</div>
3535
</div>
3636
<div class="ctrlHolder">
37-
<label for="user">{tmpl_var name='user_txt'}</label>
37+
<label for="user">{tmpl_var name='web_user_txt'}</label>
3838
<input name="user" id="user" value="{tmpl_var name='user'}" size="40" maxlength="255" type="text" class="textInput" />
3939
</div>
4040
<div class="ctrlHolder">
41-
<label for="group">{tmpl_var name='group_txt'}</label>
41+
<label for="group">{tmpl_var name='web_group_txt'}</label>
4242
<input name="group" id="group" value="{tmpl_var name='group'}" size="40" maxlength="255" type="text" class="textInput" />
4343
</div>
4444
</fieldset>

interface/web/client/form/client.tform.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,7 @@
520520
'formtype' => 'CHECKBOXARRAY',
521521
'default' => '',
522522
'separator' => ',',
523+
'valuelimit' => 'client:web_php_options',
523524
'value' => array('no' => 'Disabled', 'fast-cgi' => 'Fast-CGI', 'cgi' => 'CGI', 'mod' => 'Mod-PHP', 'suphp' => 'SuPHP')
524525
),
525526
'limit_web_aliasdomain' => array (
@@ -583,6 +584,7 @@
583584
'formtype' => 'CHECKBOXARRAY',
584585
'default' => '',
585586
'separator' => ',',
587+
'valuelimit' => 'client:ssh_chroot',
586588
'value' => array('no' => 'None', 'jailkit' => 'Jailkit')
587589
),
588590
'default_dnsserver' => array (

0 commit comments

Comments
 (0)