Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/conf/conf_user_def.inc.php b/conf/conf_user_def.inc.php
- index 01f9f5e..7451ce4 100644
- --- a/conf/conf_user_def.inc.php
- +++ b/conf/conf_user_def.inc.php
- @@ -390,6 +390,9 @@ $conf_user_def['2chapi_appkey'] = ""; // ("")
- // HMKey
- $conf_user_def['2chapi_hmkey'] = ""; // ("")
- +// 2chAPI User-Agent
- +$conf_user_def['2chapi_user_agent'] = ""; // ("")
- +
- // }}}
- // {{{ ETC
- diff --git a/lib/ThreadRead.php b/lib/ThreadRead.php
- index 1da0d43..89cd0d3 100644
- --- a/lib/ThreadRead.php
- +++ b/lib/ThreadRead.php
- @@ -179,7 +179,7 @@ class ThreadRead extends Thread
- $message = '/v1/'.$serverName[0].'/'.$this->bbs.'/'.$this->key.$sid.$AppKey;
- $HB = hash_hmac("sha256", $message, $HMKey);
- - $headers = "User-Agent: Mozilla/3.0 (compatible; JaneStyle/3.80β)\r\n";
- + $headers = "User-Agent: Mozilla/3.0 (compatible; " . $_conf['2chapi_user_agent'] . ")\r\n";
- $headers .= "Connection: close\r\n";
- $headers .= "Content-Type: application/x-www-form-urlencoded\r\n";
- diff --git a/lib/auth2chapi.inc.php b/lib/auth2chapi.inc.php
- index dc697b8..da0d073 100644
- --- a/lib/auth2chapi.inc.php
- +++ b/lib/auth2chapi.inc.php
- @@ -37,7 +37,7 @@
- 'method' => 'POST',
- 'header' => implode("\r\n", array(
- 'User-Agent: Monazilla/1.3',
- - 'X-2ch-UA: JaneStyle/3.80',
- + 'X-2ch-UA: ' . $_conf['2chapi_user_agent'],
- 'Content-Type: application/x-www-form-urlencoded',
- )),
- 'content' => http_build_query($values),
- diff --git a/rep2/edit_conf_user.php b/rep2/edit_conf_user.php
- index 49586fe..8dc65a5 100644
- --- a/rep2/edit_conf_user.php
- +++ b/rep2/edit_conf_user.php
- @@ -373,6 +373,7 @@ if ($flags & P2_EDIT_CONF_USER_SKIPPED) {
- array('2chapi_rounin','2ch API 認証時に●(浪人)IDを送信する(人柱機能)'),
- array('2chapi_appkey','AppKey'),
- array('2chapi_hmkey','HMkey'),
- + array('2chapi_user_agent','User-Agent'),
- );
- printEditConfGroupHtml($groupname, $conflist, $flags);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement