'FunnyDot', 'description' => 'Schutz vor Spam-Bots', 'author' => 'Pierre Schmitz', 'url' => 'http://www.archlinux.de', ); class FunnyDot { public static function addAntiSpamCheck($editpage, $outputpage) { global $wgAntiSpamHash, $wgUser; if (!$wgUser->isLoggedIn()) { $outputpage->addHTML('
'); $time = time(); $hash = sha1($time.$wgAntiSpamHash); setCookie('AlternateAntiSpamTime', $time); setCookie('AlternateAntiSpamHashTail', substr($hash, 4)); $outputpage->addHTML(' '); } return true; } public static function checkAntiSpamHash($editpage, $text, $section, $error) { global $wgAntiSpamHash, $wgAntiSpamTimeout, $wgAntiSpamWait, $wgUser; if (!$wgUser->isLoggedIn()) { if (!empty($_COOKIE['AntiSpamTime']) && !empty($_COOKIE['AntiSpamHash'])) { $time = $_COOKIE['AntiSpamTime']; $hash = $_COOKIE['AntiSpamHash']; } elseif (!empty($_COOKIE['AlternateAntiSpamTime']) && !empty($_COOKIE['AlternateAntiSpamHashTail']) && !empty($_POST['AlternateAntiSpamHashHead'])) { $time = $_COOKIE['AlternateAntiSpamTime']; $hash = $_POST['AlternateAntiSpamHashHead'].$_COOKIE['AlternateAntiSpamHashTail']; } else { sleep($wgAntiSpamWait); $error = '