diff -urN p2ex-050121-0225.orig/p2/conf/conf_user.php p2ex-050121-0225.curl/p2/conf/conf_user.php --- p2ex-050121-0225.orig/p2/conf/conf_user.php 2005-01-21 02:25:02.000000000 +0900 +++ p2ex-050121-0225.curl/p2/conf/conf_user.php 2005-01-21 16:51:56.000000000 +0900 @@ -79,6 +79,7 @@ $_conf['join_favrank'] = 1; // (1) お気にスレ共有に参加(する:1, しない:0) $_conf['c_enable_menu_new'] = 0; // (0) 板メニューに新着数を表示(する:1, しない:0, お気に板のみ:2) $_conf['c_menu_refresh_time'] = 0; // (0) 板メニュー部分の自動更新間隔(分指定。0なら自動更新しない。) +$_conf['phpcurl'] = 0; // (0) curlを使う時、コマンドライン版と関数版どちらを使うか。(コマンドライン:0, 関数:1) $proxy['use'] = 0; // (0) プロキシを利用(する:1, しない:0) $proxy['host'] = ""; // ("") プロキシホスト ex)"127.0.0.1", "www.p2proxy.com" diff -urN p2ex-050121-0225.orig/p2/lib/login2ch.inc.php p2ex-050121-0225.curl/p2/lib/login2ch.inc.php --- p2ex-050121-0225.orig/p2/lib/login2ch.inc.php 2005-01-21 02:25:02.000000000 +0900 +++ p2ex-050121-0225.curl/p2/lib/login2ch.inc.php 2005-01-21 16:51:56.000000000 +0900 @@ -14,6 +14,13 @@ { global $_conf, $prefdir, $idpw2ch_php, $sid2ch_php, $proxy; global $_info_msg_ht, $pass_perm, $crypt_xor_key; + $curl_failed= + "
p2 info: 2ちゃんねるへの●IDログインを行うには、". + "以下のどちらかが使用可能になっている必要があります。". + "
p2 info: 2ちゃんねるへの●IDログインを行うには、systemでcurlコマンドが使用可能であるか、PHPのCURL関数が有効である必要があります。
"; + // ●「systemコマンドのcurl」(証明書検証あり)で無理だったなら、(証明書検証なし)で再チャレンジ + if ($curlrtn != 0) { + $curlcmd = "curl -H \"{$x_2ch_ua}\" -A {$dolib2ch} -d ID={$login2chID} -d PW={$login2chPW} -o {$tempfile}{$with_proxy} -k {$auth2ch_url}"; + system($curlcmd, $curlrtn); + } + if ($curlrtn != 0) { + $_info_msg_ht .= $curl_failed; } } @@ -84,9 +88,9 @@ if (!$r = FileCtl::get_file_contents($tempfile)) { if (file_exists($sid2ch_php)) { unlink($sid2ch_php); } if ($php_curl_done_flag) { - $setsumei = "(「systemのcurlコマンド」「PHPのcurl」の両方とも実行失敗しました)"; + $setsumei = "(「phpのcurl関数」実行失敗。)"; } else { - $setsumei = "(「systemのcurlコマンド」で実行失敗。「PHPのcurl」は使えないようです)"; + $setsumei = "(「コマンドライン版curl」実行失敗。)"; } $_info_msg_ht .= "p2 Error: 2chログイン処理に失敗しました。{$setsumei}
"; return false;