if (file_exists("../config/config.php"))
die(json_encode(["error" => "Configuration file exists."]));
-if (!isset($_GET) || empty($_GET))
+if (!isset($_POST) || empty($_POST))
die(json_encode(["error" => "Incorrect parameters"]));
-foreach($_GET as $key => $str)
+foreach($_POST as $key => $str)
${$key} = $str;
if ($method == "sql")
if (isset($config['unrealircd']) && empty($config['unrealircd']['host']))
die(json_encode(["error" => "Already configured."]));
-if (!isset($_GET) || empty($_GET))
+if (!isset($_POST) || empty($_POST))
die(json_encode(["error" => "Incorrect parameters"]));
-foreach($_GET as $key => $str)
+foreach($_POST as $key => $str)
${$key} = $str;
if ($method == "rpc")
sql_test_conn.addEventListener('click', e => {
sql_test_conn.classList.add('disabled');
sql_test_conn.innerHTML = "Checking...";
- fetch(BASE_URL + 'api/installation.php?method=sql&host='+encodeURIComponent(sql_host.value)+'&database='+encodeURIComponent(sql_db.value)+'&user='+encodeURIComponent(sql_user.value)+'&password='+encodeURIComponent(sql_pass.value))
+ fetch(BASE_URL + 'api/installation.php', {
+ method:'POST',
+ headers: {'Content-Type':'application/x-www-form-urlencoded'},
+ body: 'method=sql&'+
+ 'host='+encodeURIComponent(sql_host.value)+
+ '&database='+encodeURIComponent(sql_db.value)+
+ '&user='+encodeURIComponent(sql_user.value)+
+ '&password='+encodeURIComponent(sql_pass.value)
+ })
.then(response => response.json())
.then(data => {
if (data.success)
test_conn.addEventListener('click', e => {
test_conn.classList.add('disabled');
test_conn.innerHTML = "Checking...";
- fetch(BASE_URL + 'api/installation2.php?method=rpc&host='+encodeURIComponent(rpc_host.value)+'&port='+encodeURIComponent(rpc_port.value)+'&user='+encodeURIComponent(rpc_user.value)+'&password='+encodeURIComponent(rpc_pass.value)+'&tls_verify='+rpc_tls.checked)
+ fetch(BASE_URL + 'api/installation2.php', {
+ method:'POST',
+ headers: {'Content-Type':'application/x-www-form-urlencoded'},
+ body: 'method=rpc&'+
+ 'host='+encodeURIComponent(rpc_host.value)+
+ '&port='+encodeURIComponent(rpc_port.value)+
+ '&user='+encodeURIComponent(rpc_user.value)+
+ '&password='+encodeURIComponent(rpc_pass.value)+
+ '&tls_verify='+rpc_tls.checked
+ })
.then(response => response.json())
.then(data => {
if (data.success)