Esempio n. 1
0
    $conf_save = array('.' => $_conf['p2expack']);
    $conf_save['p2custom-ver'] = $_conf['p2custom'];
    foreach ($conf_user_def as $k => $v) {
        $conf_save[$k] = $_conf[$k];
    }
    $cont = serialize($conf_save);
    FileCtl::make_datafile($_conf['conf_user_file'], $_conf['conf_user_perm']);
    if (FileCtl::file_write_contents($_conf['conf_user_file'], $cont) === false) {
        $dispname = '$_conf[\'pref_dir\']/' . basename($_conf['conf_user_file']);
        p2die("ユーザー設定ファイル {$dispname} に書き込めませんでした。");
    }
}
// }}}
// {{{ ホストチェック
if (!($_conf['secure']['auth_host_only_http'] && !empty($_SERVER['HTTPS']))) {
    if ($_conf['secure']['auth_host'] && !HostCheck::getHostAuth()) {
        HostCheck::forbidden();
    }
    if ($_conf['secure']['auth_bbq'] && HostCheck::getHostBurned()) {
        HostCheck::forbidden();
    }
}
// }}}
// {{{ リクエスト変数の検証と文字コード変換
/**
 * 日本語を入力する可能性のあるフォームには隠し要素で
 * エンコーディング判定用の文字列を仕込んでいる
 *
 * $_COOKIE は $_REQUEST に含めない
 */
if (!empty($_GET) || !empty($_POST)) {
Esempio n. 2
0
define('P2_PREF_DIR_REAL_PATH', File_Util::realPath($_conf['pref_dir']));
$_conf['matome_cache_path'] = P2_PREF_DIR_REAL_PATH . DIRECTORY_SEPARATOR . 'matome_cache';
$_conf['matome_cache_ext'] = '.htm';
$_conf['matome_cache_max'] = 3;
// 予備キャッシュの数
// {{{ ありえない引数のエラー
// 新規ログインとメンバーログインの同時指定はありえないので、エラー出す
if (isset($_POST['submit_newuser']) && isset($_POST['submit_userlogin'])) {
    P2Util::printSimpleHtml("p2 Error: 無効なURLです。");
    die;
}
// }}}
// {{{ ホストチェック
if ($_conf['secure']['auth_host'] || $_conf['secure']['auth_bbq']) {
    require_once P2_LIB_DIR . '/HostCheck.php';
    if ($_conf['secure']['auth_host'] && HostCheck::getHostAuth() == FALSE || $_conf['secure']['auth_bbq'] && HostCheck::getHostBurned() == TRUE) {
        HostCheck::forbidden();
    }
}
// }}}
// セッションの開始
$_p2session = _startSession();
// ログインクラスのインスタンス生成(ログインユーザが指定されていなければ、この時点でログインフォーム表示に)
// ([todo]この処理を上に持って行きたいが、ユーザーログインか新規登録どうかの区別ができなくなる。
// login_first.inc.phpのfile_exists($_conf['auth_user_file']) で新規登録かどうかを判定しているのを改める必要がある)
$_login = new Login();
// このファイル内での処理はここまで
//=============================================================================
// 関数(このファイル内でのみ利用)
//=============================================================================
/**