rtoss - Diff between revs 38 and 160

Subversion Repositories:
Rev:
Show entire file - Ignore whitespace
Rev 38 Rev 160
Line 20... Line 20...
20         if(isset($_SERVER['HTTP_X_FORWARDED_FOR'])){ 20         if(isset($_SERVER['HTTP_X_FORWARDED_FOR'])){
21                 $tmp = preg_split('/[ ,]+/', $_SERVER['HTTP_X_FORWARDED_FOR']); 21                 $tmp = preg_split('/[ ,]+/', $_SERVER['HTTP_X_FORWARDED_FOR']);
22                 return $tmp[0]; 22                 return $tmp[0];
23         } 23         }
24         return $_SERVER['REMOTE_ADDR']; 24         return $_SERVER['REMOTE_ADDR'];
-   25 }
-   26
-   27 function reCAPTCHA($title,$desc) {
-   28         global $key,$FROM1,$mail,$subject,$MESSAGE,$c_pass;
-   29         require_once './recaptchalib.php';
-   30         $publickey = ""; // you got this from the signup page
-   31         $privatekey = ""; // (same as above)
-   32         $error = '';
-   33
-   34         if($_POST["recaptcha_response_field"]) {
-   35         $resp = recaptcha_check_answer ($privatekey,
-   36                                         $_SERVER["REMOTE_ADDR"],
-   37                                         $_POST["recaptcha_challenge_field"],
-   38                                         $_POST["recaptcha_response_field"]);
-   39
-   40         if ($resp->is_valid)
-   41                 return true;
-   42         else
-   43             $error = $resp->error;
-   44         }
-   45         echo '<html><head><title>'.$title.'</title>
-   46 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-   47 <body>'.$desc.'
-   48 <form method="post" action="'.$_SERVER['PHP_SELF'].'">
-   49 <input type="hidden" name="key" value="'.$key.'"><input type="hidden" name="nick" value="'.$FROM1.'"><input type="hidden" name="mail" value="'.$mail.'"><br>
-   50 <input type="hidden" name="subject" value="'.$subject.'">
-   51 <input type="hidden" name="content" value="'.$MESSAGE.'"><input type="hidden" name="url" value="">
-   52 <input type="hidden" name="delk" value="'.$c_pass.'">';
-   53         echo recaptcha_get_html($publickey, $error);
-   54         echo '<input type="submit" value="確認">
-   55 </form>
-   56 </body></html>';
-   57         return false;
25 } 58 }
26 59
27 $subject = CleanStr($_REQUEST['subject']); 60 $subject = CleanStr($_REQUEST['subject']);
28 $FROM1 = $_REQUEST['nick']; 61 $FROM1 = $_REQUEST['nick'];
29 $FROM = CleanStr($_REQUEST['nick']); 62 $FROM = CleanStr($_REQUEST['nick']);
Line 41... Line 74...
41 if ($key == "" && (ereg("^( | |\t)*$", $subject))) { 74 if ($key == "" && (ereg("^( | |\t)*$", $subject))) {
42         error("サブジェクトが存在しません!", $FROM, $mail, $HOST, $MESSAGE); 75         error("サブジェクトが存在しません!", $FROM, $mail, $HOST, $MESSAGE);
43 } 76 }
44 if (!isset($_REQUEST['url']) || (isset($_REQUEST['url']) && $_REQUEST['url']!="")) { 77 if (!isset($_REQUEST['url']) || (isset($_REQUEST['url']) && $_REQUEST['url']!="")) {
45         error("投稿が禁止されています", $FROM, $mail, $HOST, $MESSAGE); 78         error("投稿が禁止されています", $FROM, $mail, $HOST, $MESSAGE);
-   79 }
-   80
-   81
-   82 // reCAPTCHA
-   83 if(!$key) {
-   84         if(reCAPTCHA('スレッド作成','スレッド作成のは CAPTCHA 認証が必要です。') === false) exit;
46 } 85 }
47 86
48 // ホスト、禁止ホスト 87 // ホスト、禁止ホスト
49 $IsBanned=false; 88 $IsBanned=false;
50 $killip = file("killip.cgi"); 89 $killip = file("killip.cgi");