本文整理汇总了PHP中P2Util::header_nocache方法的典型用法代码示例。如果您正苦于以下问题:PHP P2Util::header_nocache方法的具体用法?PHP P2Util::header_nocache怎么用?PHP P2Util::header_nocache使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类P2Util
的用法示例。
在下文中一共展示了P2Util::header_nocache方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ic2_display
//.........这里部分代码省略.........
$qf = new HTML_QuickForm('imgmaker', 'get', 'ic2_mkthumb.php');
$qf->setConstants($_constants);
$qf->setDefaults($_defaults);
$qf->addElement('hidden', 't');
$qf->addElement('hidden', 'u');
$qf->addElement('hidden', 'v');
$qf->addElement('text', 'x', '高さ', $qa);
$qf->addElement('text', 'y', '横幅', $qa);
$qf->addElement('text', 'q', '品質', $qa);
$qf->addElement('select', 'p', 'プリセット', $_presets);
$qf->addElement('select', 'r', '回転', array('0' => 'なし', '90' => '右に90°', '270' => '左に90°', '180' => '180°'));
$qf->addElement('checkbox', 'w', 'トリム');
$qf->addElement('checkbox', 'z', 'DL');
$qf->addElement('submit', 's');
$qf->addElement('submit', 'o');
// FlexyとQurickForm_Rendererの初期化
$_flexy_options = array('locale' => 'ja', 'charset' => 'cp932', 'compileDir' => $_conf['compile_dir'] . DIRECTORY_SEPARATOR . 'ic2', 'templateDir' => P2EX_LIB_DIR . '/ic2/templates', 'numberFormat' => '');
$flexy = new HTML_Template_Flexy($_flexy_options);
$rdr = new HTML_QuickForm_Renderer_ObjectFlexy($flexy);
$qf->accept($rdr);
// 表示
$flexy->setData('p2vid', P2_VERSION_ID);
$flexy->setData('title', 'IC2::Cached');
$flexy->setData('pc', !$_conf['ktai']);
$flexy->setData('iphone', $_conf['iphone']);
if (!$_conf['ktai']) {
$flexy->setData('skin', $GLOBALS['skin_name']);
//$flexy->setData('stylesheets', array('css'));
//$flexy->setData('javascripts', array('js'));
} else {
$flexy->setData('k_color', array('c_bgcolor' => !empty($_conf['mobile.background_color']) ? $_conf['mobile.background_color'] : '#ffffff', 'c_text' => !empty($_conf['mobile.text_color']) ? $_conf['mobile.text_color'] : '#000000', 'c_link' => !empty($_conf['mobile.link_color']) ? $_conf['mobile.link_color'] : '#0000ff', 'c_vlink' => !empty($_conf['mobile.vlink_color']) ? $_conf['mobile.vlink_color'] : '#9900ff'));
}
$rank = isset($params['rank']) ? $params['rank'] : 0;
if ($_conf['iphone']) {
$img_dir = 'img/iphone/';
$img_ext = '.png';
} else {
$img_dir = 'img/';
$img_ext = $_conf['ktai'] ? '.gif' : '.png';
}
$stars = array();
$stars[-1] = $img_dir . ($rank == -1 ? 'sn1' : 'sn0') . $img_ext;
//$stars[0] = $img_dir . (($rank == 0) ? 'sz1' : 'sz0') . $img_ext;
$stars[0] = $img_dir . ($_conf['iphone'] ? 'sz0' : 'sz1') . $img_ext;
for ($i = 1; $i <= 5; $i++) {
$stars[$i] = $img_dir . ($rank >= $i ? 's1' : 's0') . $img_ext;
}
$k_at_a = str_replace('&', '&', $_conf['k_at_a']);
$setrank_url = "ic2.php?{$img_q}&t={$thumb}&r=0{$k_at_a}";
$flexy->setData('stars', $stars);
$flexy->setData('params', $params);
if ($thumb == 2 && $rank >= 0) {
if ($ini['General']['inline'] == 1) {
$t = 2;
$link = null;
} else {
$t = 1;
$link = $path;
}
$r = $ini['General']['redirect'] == 1 ? 1 : 2;
$preview = "{$_SERVER['SCRIPT_NAME']}?o=1&r={$r}&t={$t}&{$img_q}{$k_at_a}";
$flexy->setData('preview', $preview);
$flexy->setData('link', $link);
$flexy->setData('info', null);
} else {
$flexy->setData('preview', null);
$flexy->setData('link', $path);
$flexy->setData('info', null);
}
if (!$_conf['ktai'] || $_conf['iphone']) {
$flexy->setData('backto', null);
} elseif (isset($_REQUEST['from'])) {
$flexy->setData('backto', $_REQUEST['from']);
$setrank_url .= '&from=' . rawurlencode($_REQUEST['from']);
} elseif (isset($_SERVER['HTTP_REFERER'])) {
$flexy->setData('backto', $_SERVER['HTTP_REFERER']);
} else {
$flexy->setData('backto', null);
}
$flexy->setData('stars', $stars);
$flexy->setData('sertank', $setrank_url . '&rank=');
if ($_conf['iphone']) {
$_conf['extra_headers_ht'] .= <<<EOP
<link rel="stylesheet" type="text/css" href="css/ic2_iphone.css?{$_conf['p2_version_id']}">
EOP;
$_conf['extra_headers_xht'] .= <<<EOP
<link rel="stylesheet" type="text/css" href="css/ic2_iphone.css?{$_conf['p2_version_id']}" />
EOP;
}
$flexy->setData('edit', extension_loaded('gd') && $rank >= 0);
$flexy->setData('form', $rdr->toObject());
$flexy->setData('doctype', $_conf['doctype']);
$flexy->setData('extra_headers', $_conf['extra_headers_ht']);
$flexy->setData('extra_headers_x', $_conf['extra_headers_xht']);
$flexy->compile('preview.tpl.html');
P2Util::header_nocache();
$flexy->output();
}
exit;
}
示例2: printLoginFirst
//.........这里部分代码省略.........
{$docomo_auth_ht}
<form id="login" method="POST" action="{$hd['REQUEST_URI']}" target="_self"{$utn}>
{$_conf['k_input_ht']}
{$p_str['user']}: <input type="text" name="form_login_id" value="{$hd['form_login_id']}"{$k_roman_input_at}{$k_input_size_at}><br>
{$p_str['password']}: <input type="{$type}" name="form_login_pass" value="{$hd['form_login_pass']}"{$k_roman_input_at}><br>
{$auth_sub_input_ht}
<br>
{$submit_ht}
</form>
EOP;
// }}}
//=================================================================
// 新規ユーザ登録処理
//=================================================================
if (!file_exists($_conf['auth_user_file']) && !$_login_failed_flag and !empty($_POST['submit_new']) && !empty($_POST['form_login_id']) && !empty($_POST['form_login_pass'])) {
// {{{ 入力エラーをチェック、判定
if (!preg_match('/^[0-9A-Za-z_]+$/', $_POST['form_login_id']) || !preg_match('/^[0-9A-Za-z_]+$/', $_POST['form_login_pass'])) {
P2Util::pushInfoHtml("<p class=\"info-msg\">rep2 error: 「{$p_str['user']}」名と「{$p_str['password']}」は半角英数字で入力して下さい。</p>");
$show_login_form_flag = true;
// }}}
// {{{ 登録処理
} else {
$_login->makeUser($_POST['form_login_id'], $_POST['form_login_pass']);
// 新規登録成功
$hd['form_login_id'] = htmlspecialchars($_POST['form_login_id'], ENT_QUOTES);
$body_ht .= "<p class=\"info-msg\">○ 認証{$p_str['user']}「{$hd['form_login_id']}」を登録しました</p>";
$body_ht .= "<p><a href=\"{$myname}?form_login_id={$hd['form_login_id']}{$_conf['k_at_a']}\">rep2 start</a></p>";
$_login->setUser($_POST['form_login_id']);
$_login->pass_x = sha1($_POST['form_login_pass']);
// セッションが利用されているなら、セッションを更新
if (isset($_p2session)) {
// ユーザ名とパスXを更新
$_SESSION['login_user'] = $_login->user_u;
$_SESSION['login_pass_x'] = $_login->pass_x;
}
// 要求があれば、補助認証を登録
$_login->registCookie();
$_login->registKtaiId();
}
// }}}
// {{{ ログインエラーがある
} else {
if (isset($_POST['form_login_id']) || isset($_POST['form_login_pass'])) {
$info_msg_ht = '<p class="info-msg">';
if (!$_POST['form_login_id']) {
$info_msg_ht .= "rep2 error: 「{$p_str['user']}」が入力されていません。<br>";
}
if (!$_POST['form_login_pass']) {
$info_msg_ht .= "rep2 error: 「{$p_str['password']}」が入力されていません。";
}
$info_msg_ht .= '</p>';
P2Util::pushInfoHtml($info_msg_ht);
}
$show_login_form_flag = true;
}
// }}}
//=========================================================
// HTMLプリント
//=========================================================
P2Util::header_nocache();
echo $_conf['doctype'];
echo <<<EOP
<html lang="ja">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta name="ROBOTS" content="NOINDEX, NOFOLLOW">
{$_conf['extra_headers_ht']}
<title>{$ptitle}</title>
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
EOP;
if (!$_conf['ktai']) {
echo <<<EOP
<style type="text/css">
/* <![CDATA[ */
EOP;
include P2_STYLE_DIR . '/style_css.inc';
include P2_STYLE_DIR . '/login_first_css.inc';
echo <<<EOP
/* ]]> */
</style>
EOP;
}
echo "</head><body>\n";
echo "<h3>{$ptitle}</h3>\n";
// 情報表示
P2Util::printInfoHtml();
echo $body_ht;
if (!empty($show_login_form_flag)) {
echo $login_form_ht;
}
echo '</body></html>';
return true;
}
示例3: setFavIta
// お気に板の追加・削除
if (isset($_GET['setfavita'])) {
require_once P2_LIB_DIR . '/setfavita.inc.php';
setFavIta();
}
//================================================================
// ■メイン
//================================================================
$aShowBrdMenuPc = new ShowBrdMenuPc();
//============================================================
// ■ヘッダ
//============================================================
$reloaded_time = date('n/j G:i:s');
// 更新時刻
$ptitle = 'p2 - menu';
P2Util::header_nocache();
echo $_conf['doctype'];
echo <<<EOP
<html lang="ja">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta name="ROBOTS" content="NOINDEX, NOFOLLOW">
{$_conf['extra_headers_ht']}
EOP;
// 自動更新
if ($_conf['menu_refresh_time']) {
$refresh_time_s = $_conf['menu_refresh_time'] * 60;
echo <<<EOP
示例4: printLoginFirst
//.........这里部分代码省略.........
$show_login_form_flag = true;
// }}}
// {{{ 登録処理
} else {
$_login->makeUser($_POST['form_login_id'], $_POST['form_login_pass']);
// 新規登録成功
$hd['form_login_id'] = p2h($_POST['form_login_id']);
$body_ht .= "<p class=\"info-msg\">○ 認証{$p_str['user']}「{$hd['form_login_id']}」を登録しました</p>";
$body_ht .= "<p><a href=\"{$myname}?form_login_id={$hd['form_login_id']}{$_conf['k_at_a']}\">rep2 start</a></p>";
$_login->setUser($_POST['form_login_id']);
$_login->pass_x = sha1($_POST['form_login_pass']);
// セッションが利用されているなら、セッションを更新
if (isset($_p2session)) {
// ユーザ名とパスXを更新
$_SESSION['login_user'] = $_login->user_u;
$_SESSION['login_pass_x'] = $_login->pass_x;
}
// 要求があれば、補助認証を登録
$_login->registerCookie();
}
// }}}
// {{{ ログインエラーがある
} else {
if (isset($_POST['form_login_id']) || isset($_POST['form_login_pass'])) {
$info_msg_ht = '<p class="info-msg">';
if (!$_POST['form_login_id']) {
$info_msg_ht .= "rep2 error: 「{$p_str['user']}」が入力されていません。<br>";
}
if (!$_POST['form_login_pass']) {
$info_msg_ht .= "rep2 error: 「{$p_str['password']}」が入力されていません。";
}
$info_msg_ht .= '</p>';
P2Util::pushInfoHtml($info_msg_ht);
}
$show_login_form_flag = true;
}
// }}}
//=========================================================
// HTMLプリント
//=========================================================
P2Util::header_nocache();
echo $_conf['doctype'];
echo <<<EOP
<html lang="ja">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta name="ROBOTS" content="NOINDEX, NOFOLLOW">
{$_conf['extra_headers_ht']}
<title>{$ptitle}</title>
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
EOP;
if (!$_conf['ktai']) {
echo <<<EOP
<style type="text/css">
/* <![CDATA[ */
EOP;
include P2_STYLE_DIR . '/style_css.inc';
include P2_STYLE_DIR . '/login_first_css.inc';
echo <<<EOP
/* ]]> */
</style>
EOP;
}
if ($_conf['iphone']) {
echo <<<EOP
<script type="text/javascript">
// <![CDATA[
function setDevicePixelRatio()
{
if (typeof window.devicePixelRatio === 'number') {
var dpr = document.getElementById('device_pixel_ratio');
if (dpr) {
dpr.value = window.devicePixelRatio;
}
}
}
// ]]>
</script>
</head>
<body onload="setDevicePixelRatio()">
EOP;
} else {
echo "</head><body>\n";
}
echo "<h3>{$ptitle}</h3>\n";
// 情報表示
P2Util::printInfoHtml();
echo $body_ht;
if (!empty($show_login_form_flag)) {
echo $login_form_ht;
}
echo '</body></html>';
return true;
}
示例5: index_print_k
/**
* p2 - 携帯用インデックスをHTMLプリントする関数
*/
function index_print_k()
{
global $_conf, $_login;
$newtime = date('gis');
$body = "";
$ptitle = "rep2phone";
// ログインユーザ情報
$htm['auth_user'] = "<p>ユーザー: {$_login->user_u} - " . date("Y/m/d (D) G:i:s") . "</p>\n";
// p2ログイン用URL
$login_url = rtrim(dirname(P2Util::getMyUrl()), '/') . '/';
$login_url_pc = $login_url . '?b=pc';
$login_url_pc_hs = hs($login_url_pc);
$login_url_k = $login_url . '?b=k&user=' . $_login->user_u;
$login_url_k_hs = hs($login_url_k);
// 前回のログイン情報
if ($_conf['login_log_rec'] && $_conf['last_login_log_show']) {
if (($log = P2Util::getLastAccessLog($_conf['login_log_file'])) !== false) {
$log_hd = array_map('htmlspecialchars', $log);
$htm['last_login'] = <<<EOP
<font color="#888888">
前回のログイン情報 - {$log_hd['date']}<br>
ユーザ: {$log_hd['user']}<br>
IP: {$log_hd['ip']}<br>
HOST: {$log_hd['host']}<br>
UA: {$log_hd['ua']}<br>
REFERER: {$log_hd['referer']}
</font>
EOP;
}
}
// 古いセッションIDがキャッシュされていることを考慮して、ユーザ情報を付加しておく
// (リファラを考慮して、つけないほうがいい場合もあるので注意)
$user_at_a = '&user=' . $_login->user_u;
$user_at_q = '?user=' . $_login->user_u;
require_once P2_LIB_DIR . '/brdctl.class.php';
$search_form_htm = BrdCtl::getMenuKSearchFormHtml('menu_k.php');
//=========================================================
// 携帯用 HTML プリント
//=========================================================
P2Util::header_nocache();
echo $_conf['doctype'];
echo <<<EOP
<html>
<head>
{$_conf['meta_charset_ht']}
<meta name="ROBOTS" content="NOINDEX, NOFOLLOW">
<script type="text/javascript">
<!--
window.onload = function() {
setTimeout(scrollTo, 100, 0, 1);
}
// -->
</script>
<style type="text/css" media="screen">@import "./iui/iui.css";@import "./iui/index.css";</style>
<title>{$ptitle}</title>
</head>
<body>
<div class="toolbar">
<h1 id="pageTitle">{$ptitle}</h1>
<a class="button" href="editpref_i.php?dummy=1{$user_at_a}{$_conf['k_at_a']}">設定管理 </a>
</div>
EOP;
P2Util::printInfoHtml();
echo <<<EOP
<ul id="other" class="hidden">
<li class="group">その他</li>
<li><a href="subject.php?spmode=res_hist{$_conf['k_at_a']}{$user_at_a}">書込履歴</a> </li>
<li><a href="read_res_hist.php?nt={$newtime}{$_conf['k_at_a']}">ログ</a></li>
<li><a href="subject.php?spmode=palace&norefresh=1{$_conf['k_at_a']}{$user_at_a}">スレの殿堂</a></li>
<li><a href="editfavita_i.php?k=1">お気に入り編集</a></li>
<li><a href="setting.php?dummy=1{$user_at_a}{$_conf['k_at_a']}">ログイン管理</a></li>
<li class="group">板検索</li>
{$search_form_htm}
</ul>
<ul id="fav" class="hidden">
EOP;
printFavItaHtml();
echo <<<EOP
</ul>
<ul id="home">
<li class="group">メニュー</li>
<li><a href="menu_k.php?view=cate{$_conf['k_at_a']}{$user_at_a}">板リスト</a></li>
<li><a href="subject.php?spmode=fav&norefresh=1{$_conf['k_at_a']}{$user_at_a}">お気にスレの全て</a></li>
<li><a href="subject.php?spmode=fav&sb_view=shinchaku{$_conf['k_at_a']}{$user_at_a}">お気にスレの新着</a></li>
<li><a href="subject.php?spmode=recent&sb_view=shinchaku{$_conf['k_at_a']}{$user_at_a}">最近読んだスレの新着</a></li>
<li><a href="subject.php?spmode=recent&norefresh=1{$_conf['k_at_a']}{$user_at_a}">最近読んだスレの全て</a></li>
</ul>
<div id="foot">
<div class="foot_index">
<span class="top"><a onclick="all.item('home').style.visibility='visible';all.item('other').style.visibility='hidden';all.item('fav').style.visibility='hidden'">Top</a></span>
<span class="fav"><a onclick="all.item('fav').style.visibility='visible';all.item('home').style.visibility='hidden';all.item('other').style.visibility='hidden'">Top</a></span>
<span class="other"><a onclick="all.item('other').style.visibility='visible';all.item('home').style.visibility='hidden';all.item('fav').style.visibility='hidden'">Top</a></span>
</div>
</div>
</body>
//.........这里部分代码省略.........
示例6: index_print_k
/**
* 携帯用インデックスプリント
*/
function index_print_k()
{
global $_conf, $_login;
$info_msg_ht = P2Util::getInfoHtml();
$newtime = date('gis');
$body = "";
$ptitle = "rep2モバイル";
// 認証ユーザ情報
$htm['auth_user'] = "<p>ログインユーザ: {$_login->user_u} - " . date("Y/m/d (D) G:i:s") . "</p>\n";
// 前回のログイン情報
if ($_conf['login_log_rec'] && $_conf['last_login_log_show']) {
if (($log = P2Util::getLastAccessLog($_conf['login_log_file'])) !== false) {
$log_hd = array_map('htmlspecialchars', $log);
$htm['last_login'] = <<<EOP
前回のログイン情報 - {$log_hd['date']}<br>
ユーザ: {$log_hd['user']}<br>
IP: {$log_hd['ip']}<br>
HOST: {$log_hd['host']}<br>
UA: {$log_hd['ua']}<br>
REFERER: {$log_hd['referer']}
EOP;
}
}
$rss_k_ht = '';
$iv2_k_ht = '';
if ($_conf['expack.rss.enabled']) {
$rss_k_ht = "<a href=\"menu_k.php?view=rss{$m_rss_set_a}{$_conf['k_at_a']}\">RSS</a><br>";
}
if ($_conf['expack.ic2.enabled'] == 2 || $_conf['expack.ic2.enabled'] == 3) {
$iv2_k_ht = "<a href=\"iv2.php?reset_filter=1{$_conf['k_at_a']}\">画像キャッシュ一覧</a><br>";
}
//=========================================================
// 携帯用 HTML プリント
//=========================================================
P2Util::header_nocache();
echo $_conf['doctype'];
echo <<<EOP
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
<meta name="ROBOTS" content="NOINDEX, NOFOLLOW">
{$_conf['extra_headers_ht']}
<title>{$ptitle}</title>
</head>
<body{$_conf['k_colors']}>
<h1>{$ptitle}</h1>
{$info_msg_ht}
<div>
<a href="subject.php?spmode=fav&sb_view=shinchaku{$_conf['k_at_a']}"{$_conf['k_accesskey_at'][1]}>{$_conf['k_accesskey_st'][1]}お気にスレの新着</a><br>
<a href="subject.php?spmode=fav{$_conf['k_at_a']}"{$_conf['k_accesskey_at'][2]}>{$_conf['k_accesskey_st'][2]}お気にスレの全て</a><br>
<a href="menu_k.php?view=favita{$_conf['k_at_a']}"{$_conf['k_accesskey_at'][3]}>{$_conf['k_accesskey_st'][3]}お気に板</a><br>
<a href="menu_k.php?view=cate{$_conf['k_at_a']}"{$_conf['k_accesskey_at'][4]}>{$_conf['k_accesskey_st'][4]}板リスト</a><br>
<a href="subject.php?spmode=recent&sb_view=shinchaku{$_conf['k_at_a']}"{$_conf['k_accesskey_at'][5]}>{$_conf['k_accesskey_st'][5]}最近読んだスレの新着</a><br>
<a href="subject.php?spmode=recent{$_conf['k_at_a']}"{$_conf['k_accesskey_at'][6]}>{$_conf['k_accesskey_st'][6]}最近読んだスレの全て</a><br>
<a href="subject.php?spmode=res_hist{$_conf['k_at_a']}"{$_conf['k_accesskey_at'][7]}>{$_conf['k_accesskey_st'][7]}書込履歴</a> <a href="read_res_hist.php?nt={$newtime}{$_conf['k_at_a']}">ログ</a><br>
<a href="subject.php?spmode=palace&norefresh=1{$_conf['k_at_a']}"{$_conf['k_accesskey_at'][8]}>{$_conf['k_accesskey_st'][8]}スレの殿堂</a><br>
<a href="setting.php?nt={$newtime}{$_conf['k_at_a']}"{$_conf['k_accesskey_at'][9]}>{$_conf['k_accesskey_st'][9]}ログイン管理</a><br>
<a href="editpref.php?nt={$newtime}{$_conf['k_at_a']}"{$_conf['k_accesskey_at'][0]}>{$_conf['k_accesskey_st'][0]}設定管理</a><br>
{$rss_k_ht}
<a href="tgrepc.php{$_conf['k_at_q']}">スレタイ検索</a><br>
{$iv2_k_ht}
</div>
<hr>
{$htm['auth_user']}
{$htm['last_login']}
</body>
</html>
EOP;
}
示例7: aas_ttfErrorHandler
/**
* imagettftext(), imagettfbbox() の入力文字列が大きすぎたときのエラー処理
*/
function aas_ttfErrorHandler($errno, $errstr, $errfile, $errline)
{
P2Util::header_nocache();
echo '<html>';
echo '<head><title>AAS Error</title></head>';
echo '<body>';
echo '<p><b>AAS Error</b></p>';
echo '<p>文字数が多すぎるようです。<br>';
printf('(%sバイト)<br>', number_format(strlen($GLOBALS['text'])));
echo '現在のバージョンでは表\示できません。</p>';
echo '</body>';
echo '</html>';
exit;
}
示例8: printLoginFirst
//.........这里部分代码省略.........
$submit_ht = '<input type="submit" name="submit_member" value="ユーザログイン">';
} else {
$submit_ht = '<input type="submit" name="submit_new" value="新規登録">';
}
$login_form_ht = <<<EOP
{$docomo_utn_ht}
<form id="login" method="POST" action="{$REQUEST_URI_hs}" target="_self" utn>
{$_conf['k_input_ht']}
{$p_str['user']}: <input type="text" name="form_login_id" value="{$form_login_id_hs}" istyle="3"><br>
{$p_str['password']}: <input type="{$type}" name="form_login_pass" value="{$form_login_pass_hs}" istyle="3"><br>
{$auth_sub_input_ht}
<br>
{$submit_ht}
</form>
EOP;
// }}}
//=================================================================
// 新規ユーザ登録処理
//=================================================================
if (!file_exists($_conf['auth_user_file']) && !$_login_failed_flag and !empty($_POST['submit_new']) && $post['form_login_id'] && $post['form_login_pass']) {
// {{{ 入力エラーをチェック、判定
if (!preg_match('/^[0-9a-zA-Z_]+$/', $post['form_login_id']) || !preg_match('/^[0-9a-zA-Z_]+$/', $post['form_login_pass'])) {
$_info_msg_ht .= "<p class=\"infomsg\">rep2 error: 「{$p_str['user']}」名と「{$p_str['password']}」は半角英数字で入力して下さい。</p>";
$show_login_form_flag = true;
// }}}
// {{{ 登録処理
} else {
$_login->makeUser($post['form_login_id'], $post['form_login_pass']);
// 新規登録成功
$form_login_id_hs = hs($post['form_login_id']);
$body_ht .= "<p class=\"infomsg\">○ 認証{$p_str['user']}「{$form_login_id_hs}」を登録しました</p>";
$body_ht .= "<p><a href=\"{$myname}?form_login_id={$form_login_id_hs}{$_conf['k_at_a']}\">rep2 start</a></p>";
$_login->setUser($post['form_login_id']);
$_login->pass_x = sha1($post['form_login_pass']);
// セッションが利用されているなら、セッションを更新
if (isset($_p2session)) {
// ユーザ名とパスXを更新
$_SESSION['login_user'] = $_login->user_u;
$_SESSION['login_pass_x'] = $_login->pass_x;
}
// 要求があれば、補助認証を登録
$_login->registCookie();
$_login->registKtaiId();
}
// }}}
// {{{ ログインエラーがある
} else {
if (isset($post['form_login_id']) || isset($post['form_login_pass'])) {
$msg_ht .= '<p class="infomsg">';
if (!$post['form_login_id']) {
$msg_ht .= "p2 error: 「{$p_str['user']}」が入力されていません。" . "<br>";
}
if (!$post['form_login_pass']) {
$msg_ht .= "p2 error: 「{$p_str['password']}」が入力されていません。";
}
$msg_ht .= '</p>';
P2Util::pushInfoHtml($msg_ht);
}
$show_login_form_flag = true;
}
// }}}
//=========================================================
// HTML表示出力
//=========================================================
P2Util::header_nocache();
echo $_conf['doctype'];
echo <<<EOP
<html lang="ja">
<head>
{$_conf['meta_charset_ht']}
<meta name="ROBOTS" content="NOINDEX, NOFOLLOW">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<title>{$ptitle}</title>
EOP;
if (!$_conf['ktai']) {
include_once "./style/style_css.inc";
include_once "./style/login_first_css.inc";
} else {
//携帯でないなら=iPhoneなら
echo '<style type="text/css" media="screen">@import "./iui/iui.css";</style>';
}
echo "</head><body>\n";
echo "<div class=\"toolbar\"><h1 id=\"pageTitle\">{$ptitle}</h1></div>\n";
if ($_conf['ktai']) {
//iPhone用
echo '<div id="usage" class="panel"><filedset>';
}
P2Util::printInfoHtml();
echo $body_ht;
if ($show_login_form_flag) {
echo $login_form_ht;
}
if ($_conf['ktai']) {
//iPhone用
echo "<br><br><br><br><br><br><br>\n</filedset></div>\n";
}
echo '</body></html>';
}