[Web] Opt-In for third party ip_check

This commit is contained in:
FreddleSpl0it
2023-01-06 12:09:15 +01:00
parent dd9296ffc2
commit 1e98784eee
8 changed files with 76 additions and 15 deletions

View File

@@ -1544,18 +1544,15 @@ if (isset($_GET['query'])) {
}
else if ($extra == "ip") {
// get public ips
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'http://ipv4.mailcow.email');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_POST, 0);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($curl, CURLOPT_TIMEOUT, 15);
curl_setopt($curl, CURLOPT_URL, 'http://ipv4.mailcow.email');
$ipv4 = curl_exec($curl);
curl_setopt($curl, CURLOPT_URL, 'http://ipv6.mailcow.email');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_POST, 0);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
$ipv6 = curl_exec($curl);
$ips = array(
"ipv4" => $ipv4,
@@ -1917,6 +1914,9 @@ if (isset($_GET['query'])) {
case "ui_texts":
process_edit_return(customize('edit', 'ui_texts', $attr));
break;
case "ip_check":
process_edit_return(customize('edit', 'ip_check', $attr));
break;
case "self":
if ($_SESSION['mailcow_cc_role'] == "domainadmin") {
process_edit_return(domain_admin('edit', $attr));