Advertisement
Guest User

Untitled

a guest
Mar 3rd, 2015
437
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 2.07 KB | None | 0 0
  1. diff --git a/conf/conf_user_def.inc.php b/conf/conf_user_def.inc.php
  2. index 01f9f5e..7451ce4 100644
  3. --- a/conf/conf_user_def.inc.php
  4. +++ b/conf/conf_user_def.inc.php
  5. @@ -390,6 +390,9 @@ $conf_user_def['2chapi_appkey'] = ""; // ("")
  6.  // HMKey
  7.  $conf_user_def['2chapi_hmkey'] = ""; // ("")
  8.  
  9. +// 2chAPI User-Agent
  10. +$conf_user_def['2chapi_user_agent'] = ""; // ("")
  11. +
  12.  // }}}
  13.  // {{{ ETC
  14.  
  15. diff --git a/lib/ThreadRead.php b/lib/ThreadRead.php
  16. index 1da0d43..89cd0d3 100644
  17. --- a/lib/ThreadRead.php
  18. +++ b/lib/ThreadRead.php
  19. @@ -179,7 +179,7 @@ class ThreadRead extends Thread
  20.          $message = '/v1/'.$serverName[0].'/'.$this->bbs.'/'.$this->key.$sid.$AppKey;
  21.          $HB = hash_hmac("sha256", $message, $HMKey);
  22.  
  23. -        $headers = "User-Agent: Mozilla/3.0 (compatible; JaneStyle/3.80β)\r\n";
  24. +        $headers = "User-Agent: Mozilla/3.0 (compatible; " . $_conf['2chapi_user_agent'] . ")\r\n";
  25.          $headers .= "Connection: close\r\n";
  26.          $headers .= "Content-Type: application/x-www-form-urlencoded\r\n";
  27.  
  28. diff --git a/lib/auth2chapi.inc.php b/lib/auth2chapi.inc.php
  29. index dc697b8..da0d073 100644
  30. --- a/lib/auth2chapi.inc.php
  31. +++ b/lib/auth2chapi.inc.php
  32. @@ -37,7 +37,7 @@
  33.              'method' => 'POST',
  34.              'header' => implode("\r\n", array(
  35.                  'User-Agent: Monazilla/1.3',
  36. -                'X-2ch-UA: JaneStyle/3.80',
  37. +                'X-2ch-UA: ' . $_conf['2chapi_user_agent'],
  38.                  'Content-Type: application/x-www-form-urlencoded',
  39.              )),
  40.              'content' => http_build_query($values),
  41. diff --git a/rep2/edit_conf_user.php b/rep2/edit_conf_user.php
  42. index 49586fe..8dc65a5 100644
  43. --- a/rep2/edit_conf_user.php
  44. +++ b/rep2/edit_conf_user.php
  45. @@ -373,6 +373,7 @@ if ($flags & P2_EDIT_CONF_USER_SKIPPED) {
  46.          array('2chapi_rounin','2ch API 認証時に●(浪人)IDを送信する(人柱機能)'),
  47.          array('2chapi_appkey','AppKey'),
  48.          array('2chapi_hmkey','HMkey'),
  49. +        array('2chapi_user_agent','User-Agent'),
  50.      );
  51.      printEditConfGroupHtml($groupname, $conflist, $flags);
  52.  }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement