Skip to content

Commit 652c0b9

Browse files
author
Till Brehm
committed
Merge branch 'stable-3.1' into 'stable-3.1'
Stable 3.1 See merge request ispconfig/ispconfig3!681
2 parents c8f8fee + 3dd4c11 commit 652c0b9

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

install/install.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -551,8 +551,9 @@
551551

552552
//** Customise the port ISPConfig runs on
553553
$ispconfig_vhost_port = $inst->free_query('ISPConfig Port', '8080','ispconfig_port');
554-
$conf['interface_password'] = $inst->free_query('Admin password', 'admin','ispconfig_admin_password');
555-
if($conf['interface_password'] != 'admin') {
554+
$temp_admin_password = str_shuffle(bin2hex(openssl_random_pseudo_bytes(4)));
555+
$conf['interface_password'] = $inst->free_query('Admin password', $temp_admin_password, 'ispconfig_admin_password');
556+
if($conf['interface_password'] != $temp_admin_password) {
556557
$check = false;
557558
do {
558559
unset($temp_password);
@@ -563,6 +564,7 @@
563564
}
564565
unset($check);
565566
unset($temp_password);
567+
unset($temp_admin_password);
566568
if($conf['apache']['installed'] == true) $conf['apache']['vhost_port'] = $ispconfig_vhost_port;
567569
if($conf['nginx']['installed'] == true) $conf['nginx']['vhost_port'] = $ispconfig_vhost_port;
568570
unset($ispconfig_vhost_port);
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-

interface/web/remote/json.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@
44
$conf['start_session'] = false;
55
require_once '../../lib/app.inc.php';
66

7-
$app->load('json_handler');
7+
if($conf['demo_mode'] == true) $app->error('This function is disabled in demo mode.');
8+
9+
$app->load('json_handler,getconf');
10+
11+
$security_config = $app->getconf->get_security_config('permissions');
12+
if($security_config['remote_api_allowed'] != 'yes') die('Remote API is disabled in security settings.');
13+
814
$json_handler = new ISPConfigJSONHandler();
915
$json_handler->run();
1016

0 commit comments

Comments
 (0)