Ejemplo n.º 1
0
 /**
  * DATをダウンロードする
  */
 public function downloadDat()
 {
     global $_conf;
     // まちBBS
     if (P2Util::isHostMachiBbs($this->host)) {
         DownloadDatMachiBbs::invoke($this);
         // JBBS@したらば
     } elseif (P2Util::isHostJbbsShitaraba($this->host)) {
         if (!function_exists('shitarabaDownload')) {
             include P2_LIB_DIR . '/read_shitaraba.inc.php';
         }
         shitarabaDownload($this);
         // 2ch系
     } else {
         $this->getDatBytesFromLocalDat();
         // $aThread->length をset
         // 2ch bbspink●読み
         if (P2Util::isHost2chs($this->host) && !empty($_GET['maru'])) {
             // ログインしてなければ or ログイン後、24時間以上経過していたら自動再ログイン
             if (!file_exists($_conf['sid2ch_php']) || !empty($_REQUEST['relogin2ch']) || filemtime($_conf['sid2ch_php']) < time() - 60 * 60 * 24) {
                 if (!function_exists('login2ch')) {
                     include P2_LIB_DIR . '/login2ch.inc.php';
                 }
                 if (!login2ch()) {
                     $this->getdat_error_msg_ht .= $this->get2chDatError();
                     $this->diedat = true;
                     return false;
                 }
             }
             include $_conf['sid2ch_php'];
             $this->_downloadDat2chMaru($uaMona, $SID2ch);
             // 2ch bbspink モリタポ読み
         } elseif (P2Util::isHost2chs($this->host) && !empty($_GET['moritapodat']) && $_conf['p2_2ch_mail'] && $_conf['p2_2ch_pass']) {
             if (!array_key_exists('csrfid', $_GET) || $this->_getCsrfIdForMoritapoDat() != $_GET['csrfid']) {
                 p2die('不正なリクエストです');
             }
             $this->_downloadDat2chMoritapo();
             // 2chの過去ログ倉庫読み
         } elseif (!empty($_GET['kakolog']) && !empty($_GET['kakoget'])) {
             if ($_GET['kakoget'] == 1) {
                 $ext = '.dat.gz';
             } elseif ($_GET['kakoget'] == 2) {
                 $ext = '.dat';
             }
             $this->_downloadDat2chKako($_GET['kakolog'], $ext);
             // 2ch or 2ch互換
         } else {
             // DATを差分DLする
             $this->_downloadDat2ch($this->length);
         }
     }
 }
Ejemplo n.º 2
0
 /**
  * DATをダウンロード保存する
  *
  * @access  public
  * @return  boolean
  */
 function downloadDat()
 {
     global $_conf;
     // まちBBS
     if (P2Util::isHostMachiBbs($this->host)) {
         require_once P2_LIB_DIR . '/downloadDatMachiBbs.func.php';
         downloadDatMachiBbs($this);
         // JBBS@したらば
     } elseif (P2Util::isHostJbbsShitaraba($this->host)) {
         require_once P2_LIB_DIR . '/downloadDatShitaraba.func.php';
         downloadDatShitaraba($this);
         /*
         // cha2.net(→2ch互換として扱ってみる)
         } elseif (P2Util::isHostCha2($this->host)) {
             require_once P2_LIB_DIR . '/downloadDatCha2.func.php';
             downloadDatCha2($this);
         */
         // 2ch系
     } else {
         $this->getDatBytesFromLocalDat();
         // $aThread->length をset
         // 2ch bbspink●読み
         if (P2Util::isHost2chs($this->host) && !empty($_GET['maru'])) {
             // ログインしてなければ or ログイン後、24時間以上経過していたら自動再ログイン
             if (!file_exists($_conf['sid2ch_php']) || !empty($_REQUEST['relogin2ch']) or filemtime($_conf['sid2ch_php']) < time() - 60 * 60 * 24) {
                 require_once P2_LIB_DIR . '/login2ch.func.php';
                 if (!login2ch()) {
                     $this->pushDownloadDatErrorMsgHtml($this->get2chDatError());
                     $this->diedat = true;
                     return false;
                 }
             }
             $this->downloadDat2chMaru();
             // 2chの過去ログ倉庫読み
         } elseif (!empty($_GET['kakolog']) && !empty($_GET['kakoget'])) {
             if ($_GET['kakoget'] == 1) {
                 $ext = '.dat.gz';
             } elseif ($_GET['kakoget'] == 2) {
                 $ext = '.dat';
             }
             $this->downloadDat2chKako($_GET['kakolog'], $ext);
             // 2ch or 2ch互換
         } else {
             // DATを差分DLする
             $this->downloadDat2ch($this->length);
         }
     }
     return true;
 }
Ejemplo n.º 3
0
    $checked_dirs[] = $_conf['idx_dir'];
}
if (!in_array($_conf['pref_dir'], $checked_dirs)) {
    P2Util::checkDirWritable($_conf['pref_dir']);
    $checked_dirs[] = $_conf['pref_dir'];
}
// }}}
//=========================================================
// 前処理
//=========================================================
// ●ID 2ch オートログイン
if ($array = P2Util::readIdPw2ch()) {
    list($login2chID, $login2chPW, $autoLogin2ch) = $array;
    if ($autoLogin2ch) {
        require_once P2_LIB_DIR . '/login2ch.inc.php';
        login2ch();
    }
}
//=========================================================
// プリント設定
//=========================================================
// 最新版チェック
$newversion_found = '';
if (!empty($_conf['updatan_haahaa'])) {
    $newversion_found = checkUpdatan();
}
// ログインユーザ情報
$htm['auth_user'] = "******" . date("Y/m/d (D) G:i") . "</p>\n";
// (携帯)ログイン用URL
$base_url = rtrim(dirname(P2Util::getMyUrl()), '/') . '/';
$url_b = $base_url . '?user='******'&b=';