Änderungen

Wechseln zu: Navigation, Suche

Scoring-Module erstellen

14 Byte hinzugefügt, 08:26, 10. Okt. 2018
public function getSettings() {
return Array(
"apikey" => Array("type" => "password", "name" => "API-Schlüssel"),
);
}
public function check($u) {
global $db, $CFG;
// Select last IP address $sql = $db->query("SELECT * FROM " . $CFG['DB']['PREFIX'] . "client_log WHERE user = " . $u->get()['ID'] . " AND ip != 'Admin' ORDER BY ID DESC, time DESC LIMIT 1"); if ($sql->num_rows > 0 && is_object($info = $sql->fetch_object()) && filter_var($info->ip, FILTER_VALIDATE_IP)) { $c = file_get_contents("https://www.abuseipdb.com/check/" . urlencode($info->ip) . "/json?key=" . urlencode($this->options->apikey));
if ($c != '[]') { return Array("AbuseIPDB-Eintrag vorhanden", "F", "<a href='https://www.abuseipdb.com/check/" . urlencode($info->ip) . "' target='_blank'>Details aufrufen</a>"); } else { return Array("Kein Eintrag bei AbuseIPDB", "D", ""); } }
}
}
</source>