Beispiel #1
0
/**
 * ファイル内容を読み込んで表示する関数
 *
 * @return  void
 */
function viewTxtFile($file, $encode)
{
    global $_info_msg_ht;
    if ($file == '') {
        die('Error: file が指定されていません');
    }
    $filename = basename($file);
    $ptitle = $filename;
    $cont = file_get_contents($file);
    if ($encode == "EUC-JP") {
        $cont = mb_convert_encoding($cont, 'SJIS-win', 'eucJP-win');
    }
    $cont_area = htmlspecialchars($cont, ENT_QUOTES);
    // HTMLプリント
    ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="ja">
<head>
<?php 
    P2View::printExtraHeadersHtml();
    ?>
	<title><?php 
    eh($ptitle);
    ?>
</title>
</head>
<body onLoad="top.document.title=self.document.title;">
<?php 
    P2Util::printInfoHtml();
    ?>
<pre>
<?php 
    echo $cont_area;
    ?>
</pre>
</body></html>
<?php 
}
Beispiel #2
0
    /**
     * @static
     * @access  public
     * @return  void  HTML出力
     */
    function printIncludeCssHtml($css)
    {
        global $_conf, $_login;
        $href = UriUtil::buildQueryUri('css.php', array('css' => $css, 'user' => $_login->user_u, 'skin' => $_conf['skin']));
        ?>
<link rel="stylesheet" type="text/css" href="<?php 
        eh($href);
        ?>
"><?php 
    }
Beispiel #3
0
  </div>
</div>
<?php 
}
?>

<hr>
<form id="myform" class="well" method="post" action="<?php 
eh(url('thread/write'));
?>
">
  <label>Your name</label>
  <input type="text" class="span2" name="username" value="<?php 
eh(Param::get('username'));
?>
" required />
  <label>Comment</label>
  <textarea name="body" class="required"><?php 
eh(Param::get('body'));
?>
</textarea>
  <br />
  <input type="hidden" name="thread_id" value="<?php 
eh($thread->id);
?>
">
  <input type="hidden" name="page_next" value="write_end">
  <button type="submit" class="btn btn-primary">Submit</button>
</form>
<a class="btn btn-large btn-primary" href="/thread/index">back</a>
Beispiel #4
0
"><?php 
eh($comment->user->username);
?>
</a></strong>
                    <span class='pad'>
                        created at:
                        <?php 
eh($comment->created_at);
?>
                    </span>
                <?php 
if ($comment->created_at != $comment->modified_at) {
    ?>
                    modified at:
                    <?php 
    eh($comment->modified_at);
    ?>
                <?php 
}
?>
            </small>
        </div>
        <div>
            <?php 
echo readable_text($comment->body);
?>
        </div>
    </div>
</div>

Beispiel #5
0
<script type="text/javascript"> 
<!-- 
window.onload = function() { 
setTimeout(scrollTo, 100, 0, 1); 
} 
// --> 
</script> 
<title><?php 
eh($aThreadList->ptitle);
?>
</title>
</head>
<body>
<div class="toolbar">
<h1 id="pageTitle"><?php 
eh($aThreadList->ptitle);
?>
</h1>
</div>
<?php 
P2Util::printInfoHtml();
echo $filter_form_ht;
echo $hit_ht;
require_once P2_LIB_DIR . '/sb_toolbar_k.funcs.php';
// getShinchakuMatomeATag()
?>
<p><?php 
echo getShinchakuMatomeATag($aThreadList, $shinchaku_num);
?>
</p>
<?php 
Beispiel #6
0
    ?>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon"><?php 
}
?>
</head>
<body<?php 
echo P2View::getBodyAttrK();
echo $parent_reload;
?>
>
<?php 
if (!$_conf['ktai']) {
    //<p id="pan_menu"><a href="setting.php">設定</a> &gt; {$ptitle}</p>
    ?>
<p id="pan_menu"><?php 
    eh($ptitle);
    ?>
</p><?php 
}
P2Util::printInfoHtml();
$aborn_res_txt = $_conf['pref_dir'] . '/p2_aborn_res.txt';
$aborn_name_txt = $_conf['pref_dir'] . '/p2_aborn_name.txt';
$aborn_mail_txt = $_conf['pref_dir'] . '/p2_aborn_mail.txt';
$aborn_msg_txt = $_conf['pref_dir'] . '/p2_aborn_msg.txt';
$aborn_id_txt = $_conf['pref_dir'] . '/p2_aborn_id.txt';
$ng_name_txt = $_conf['pref_dir'] . '/p2_ng_name.txt';
$ng_mail_txt = $_conf['pref_dir'] . '/p2_ng_mail.txt';
$ng_msg_txt = $_conf['pref_dir'] . '/p2_ng_msg.txt';
$ng_id_txt = $_conf['pref_dir'] . '/p2_ng_id.txt';
?>
<p> ・<?php 
Beispiel #7
0
">

<table id="header" width="100%" style="padding:0px 10px 0px 0px;">
	<tr>
		<td>
			<h3 class="thread_title"><?php 
    eh($ptitle);
    ?>
</h3>
		</td>
		<td><span style="font-size:small">容量 <?php 
    eh($logSizeSt);
    if ($maxLogSize) {
        ?>
(最大<?php 
        eh($maxLogSizeSt);
        ?>
)<?php 
    }
    ?>
</span></td>
		<td align="right"><?php 
    echo $toolbar_ht;
    ?>
</td>
		<td align="right" style="padding-left:12px;"><a href="#footer">▼</a></td>
	</tr>
</table>
<?php 
}
//==================================================================
Beispiel #8
0
<?php

$title = 'こんにちわ';
?>

<h2><?php 
eh($thread->title);
?>
</h2>
<p class="alert alert-success">
  You successfully wrote this comment.
</p>
<a href="<?php 
eh(url('thread/view', array('thread_id' => $thread->id)));
?>
">
  &larr; Back to thread
</a>
Beispiel #9
0
<?php

$title = 'Hello';
?>

<h1><?php 
eh($message);
?>
</h1>
<p>Use this code as a way to quick start any new project.</p>
Beispiel #10
0
">
            </div>
            <div class="six columns">
                <label for="last_name">Last name</label>
                <input class='u-full-width' type="text" name="last_name" id="last_name" value="<?php 
eh($auth_user->last_name);
?>
">
            </div>
        </div>
        <div class="row">
            <div class="six columns">
                <label for="password">Password</label>
                <input class='u-full-width' type="password" name="password" id="password" value="">
            </div>
            <div class="six columns">
                <label for="new_password">New Password</label>
                <input class='u-full-width' type="password" name="new_password" id="new_password" value="">
            </div>
        </div>
        <div class="row">
            <input type="hidden" name="page_next" value="edit_end">
            <button class='btn btn-primary' type="submit">Save</button> or
            <a href="<?php 
eh(url(VIEW_USER_URL));
?>
">cancel</a>
        </div>
    </form>
</div>
Beispiel #11
0
<div class="row">
    <h3>Delete comment?</h3>
</div>
<div class="row">
    <p>
        Are you sure you want to delete this comment?
    </p>
    <a href="<?php 
eh(url(DELETE_COMMENT_URL, array('id' => $comment->id, 'page_next' => 'delete_end')));
?>
">Yes</a>
    <a href="<?php 
eh(url(VIEW_COMMENT_URL, array('id' => $comment->id)));
?>
">No</a>
</div>
Beispiel #12
0
        ?>
                    </a></li>
                <?php 
    }
    ?>
            <?php 
}
?>
        </ul>
    </div>
    <div class="four columns">
        <h5 class="top-margin">Following</h5>
        <ul>
            <?php 
foreach ($follows as $follow) {
    ?>
                <li><a href="<?php 
    eh(url(VIEW_THREAD_URL, array('id' => $follow->thread_id)));
    ?>
">
                    <?php 
    eh($follow->thread_title);
    ?>
                </a></li>
            <?php 
}
?>
        </ul>
    </div>
</div>
Beispiel #13
0
		<td align="left" valign="middle" nowrap>
			<?php 
echo $filter_form_ht;
?>
		</td>
		<td align="left" valign="middle" nowrap>
			<?php 
echo $edit_ht;
?>
		</td>
		<td align="right" valign="middle" nowrap>
			<?php 
echo getSbToolbarShinchakuMatomeHtml($aThreadList, $shinchaku_num);
?>
			<span class="time"><?php 
eh($reloaded_time);
?>
</span>
			<?php 
echo getSbToolAnchorHtml($sb_tool_i);
?>
		</td>
	</tr>
</table>
<?php 
/*
 * Local Variables:
 * mode: php
 * coding: cp932
 * tab-width: 4
 * c-basic-offset: 4
Beispiel #14
0
<?php 
eh($client_host_st);
?>
: <?php 
eh(P2Util::getRemoteHost());
?>
<br>
<?php 
eh($client_ip_st);
?>
: <?php 
eh($_SERVER['REMOTE_ADDR']);
?>
<br>
<?php 
eh($browser_ua_st);
?>
: <?php 
ehi($_SERVER['HTTP_USER_AGENT']);
?>
<br>
</p>
<?php 
// フッタHTML表示
if (UA::isK()) {
    echo $hr . P2View::getBackToIndexKATag() . "\n";
}
?>
</body></html>
<?php 
exit;
Beispiel #15
0
" action="<?php 
eh($action_uri);
?>
" method="post">
スレ:<br>
<input type="text" name="dummy_ttitle" value="<?php 
eh($ttitle);
?>
"><br>
<input type="text" name="dummy_moto_url" value="<?php 
eh($moto_url);
?>
"><br>
<?php 
echo $moto_url_k_ht;
eh($resid);
?>
:<br>

<?php 
if ($_GET['ktool_name'] != 'copy') {
    // $name_txt, $mail_txt, $date_txt は既に実体参照を含んでいる場合がある。タグは除去されている。
    ?>
<input type="text" name="dummy_name" value="<?php 
    echo $name_txt;
    ?>
"><br>
<input type="text" name="dummy_mail" value="<?php 
    echo $mail_txt;
    ?>
"><br>
Beispiel #16
0
<form action="<?php 
e($html->url('/test/hello_world'));
?>
" method="post">
	<p>Name: <input type="text" name="data[name]"/></p>
	<button type="submit">Set name</button>
</form>

<p><?php 
if ($name == '') {
    ?>
	Enter your name above
<?php 
} else {
    ?>
	Hello, <em><?php 
    eh($name);
    ?>
</em>!
<?php 
}
?>
</p>
Beispiel #17
0
<!--
var filerstart = document.getElementById('filerstart');
if (filerstart) {
    filerstart.style.backgroundColor = 'yellow';
    filerstart.style.fontWeight = 'bold';
}
-->
</script>
<?php 
        if ($GLOBALS['_filter_hits'] > 5) {
            ?>
<p><b class="filtering"><?php 
            eh($all);
            ?>
レス中 <?php 
            eh($GLOBALS['_filter_hits']);
            ?>
レスがヒット</b></p><?php 
        }
    }
    // フッタHTML 表示
    if (UA::isIPhoneGroup()) {
        require_once P2_IPHONE_LIB_DIR . '/read_footer.inc.php';
    } else {
        require_once P2_LIB_DIR . '/read_footer.inc.php';
    }
}
//=================================
// 後処理
//=================================
// {{{ idxの値を設定、記録
Beispiel #18
0
/**
 * ファイル内容を読み込んで編集のためのHTMLを表示する
 *
 * @return  void
 */
function _printEditFileHtml($path, $encode)
{
    global $_conf, $modori_url, $rows, $cols;
    $info_msg_ht = P2Util::getInfoHtml();
    if ($path == '') {
        die('Error: path が指定されていません');
    }
    $filename = basename($path);
    $ptitle = "Edit: " . $filename;
    if (false === FileCtl::make_datafile($path)) {
        die(sprintf("Error: cannot make file. ( %s )", hs($path)));
    }
    $cont = file_get_contents($path);
    if ($encode == 'EUC-JP') {
        $cont = mb_convert_encoding($cont, 'SJIS-win', 'eucJP-win');
    }
    $cont_area_ht = htmlspecialchars($cont, ENT_QUOTES);
    $modori_url_ht = '';
    if ($modori_url) {
        $modori_url_ht = sprintf('<p><a href="%s">Back</a></p>', hs($modori_url));
    }
    ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="ja">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
    <meta name="ROBOTS" content="NOINDEX, NOFOLLOW">
    <title><?php 
    eh($ptitle);
    ?>
</title>
</head>
<body onLoad="top.document.title=self.document.title;">

<?php 
    echo $modori_url_ht;
    ?>
Edit: <?php 
    eh($path);
    ?>
<form action="<?php 
    eh($_SERVER['SCRIPT_NAME']);
    ?>
" method="post" accept-charset="<?php 
    eh($_conf['accept_charset']);
    ?>
">
    <input type="hidden" name="detect_hint" value="◎◇">
    <input type="hidden" name="path" value="<?php 
    eh($path);
    ?>
">
    <input type="hidden" name="modori_url" value="<?php 
    eh($modori_url);
    ?>
">
    <input type="hidden" name="encode" value="<?php 
    eh($encode);
    ?>
">
    <input type="hidden" name="rows" value="<?php 
    eh($rows);
    ?>
">
    <input type="hidden" name="cols" value="<?php 
    eh($cols);
    ?>
">
    <input type="submit" name="submit" value="Save"> <?php 
    echo $info_msg_ht;
    ?>
<br>
    <textarea style="font-size:9pt;" id="filecont" name="filecont" rows="<?php 
    eh($rows);
    ?>
" cols="<?php 
    eh($cols);
    ?>
" wrap="off"><?php 
    eh($cont);
    ?>
</textarea>
</form>

</body></html>
<?php 
}
Beispiel #19
0
 characters
                    in length.
                </div>
            <?php 
    }
    ?>
        </div>
    <?php 
}
?>
</div>
<div class="row">
    <!--Comment form-->
    <form action="<?php 
eh(url('', array('id' => $comment->id)));
?>
" method="post">
        <label for="body">Edit Comment</label>
        <textarea class='u-full-width' id='body' name="body"><?php 
eh($comment->body);
?>
</textarea>
        <input type="hidden" name="page_next" value="edit_end">
        <button type="submit">Save</button> or
        <a href="<?php 
eh(url(VIEW_THREAD_URL, array('id' => $thread->id)));
?>
">cancel</a>
    </form>
</div>
Beispiel #20
0
/**
 * @return  void  HTML出力
 */
function _printGoToFormHtml($aThread)
{
    global $_conf;
    ?>
<form method="get" action="<?php 
    eh($_conf['read_php']);
    ?>
" class="inline-form">
	<input type="hidden" name="host" value="<?php 
    eh($aThread->host);
    ?>
">
	<input type="hidden" name="bbs" value="<?php 
    eh($aThread->bbs);
    ?>
">
	<input type="hidden" name="key" value="<?php 
    eh($aThread->key);
    ?>
">
	<input type="text" size="7" name="ls" value="<?php 
    eh($aThread->ls);
    ?>
">
	<?php 
    echo $_conf['k_input_ht'];
    ?>
	<input type="submit" value="go">
</form>
<?php 
}
Beispiel #21
0
eh($_SERVER['SCRIPT_NAME']);
?>
" target="_self">
    <input type="hidden" name="csrfid" value="<?php 
eh($csrfid);
?>
">
    <?php 
eh($p_str['password']);
?>
の変更<br>
    <?php 
echo P2View::getInputHiddenKTag();
?>
    新しい<?php 
eh($p_str['password']);
?>
: <input type="password" name="form_login_pass">
    <br>
    <input type="submit" name="submit" value="変更登録">
</form>

<?php 
if (UA::isK()) {
    echo "{$hr}\n";
    echo P2View::getBackToIndexKATag();
}
?>
</body></html>
<?php 
exit;
Beispiel #22
0
<?php 
foreach ($menuKLinkHtmls as $code => $html) {
    echo <<<EOP
\t<tr>
\t\t<td>{$html}</td>
\t\t<td><a class="te" href="{$_SERVER['SCRIPT_NAME']}?code={$code}&amp;set=top{$_conf['k_at_a']}" title="一番上に移動">▲</a></td>
\t\t<td><a class="te" href="{$_SERVER['SCRIPT_NAME']}?code={$code}&amp;set=up{$_conf['k_at_a']}" title="一つ上に移動">↑</a></td>
\t\t<td><a class="te" href="{$_SERVER['SCRIPT_NAME']}?code={$code}&amp;set=down{$_conf['k_at_a']}" title="一つ下に移動">↓</a></td>
\t\t<td><a class="te" href="{$_SERVER['SCRIPT_NAME']}?code={$code}&amp;set=bottom{$_conf['k_at_a']}" title="一番下に移動">▼</a></td>
\t</tr>
EOP;
}
?>
</table>
<a class='whiteButton' href="<?php 
eh($_SERVER['SCRIPT_NAME']);
?>
?setdef=1<?php 
echo $_conf['k_at_a'];
?>
">デフォルトに戻す</a>
</filedset>
</div>
<?php 
// フッタHTMLを表示する
if (UA::isK() && !UA::isIPhoneGroup()) {
    echo $hr . P2View::getBackToIndexKATag();
}
?>
</body></html><?php 
exit;
Beispiel #23
0
//==================================================================
// ページフッタ HTML表示
//==================================================================
$_newthre_num++;
if (!$aThreadList->num) {
    $GLOBALS['_is_matome_shinchaku_naipo'] = true;
    ?>
新着レスはないぽ<?php 
}
$index_uri = UriUtil::buildQueryUri('index.php', array(UA::getQueryKey() => UA::getQueryValue()));
?>
<div id="footbar01">
<div class="footbar">
<ul>
<li class="home"><a name="ntt_bt1" href="<?php 
eh($index_uri);
?>
">TOP</a></li>
<li class="other"><a onclick="all.item('footbar02').style.visibility='visible';">その他</a></li>
<?php 
if (!isset($GLOBALS['rnum_all_range']) or $GLOBALS['rnum_all_range'] > 0 or !empty($GLOBALS['limit_to_eq_to'])) {
    if (!empty($GLOBALS['limit_to_eq_to'])) {
        $str = '新着まとめの更新or続き';
    } else {
        $str = '新まとめを更新';
    }
    echo <<<EOP
    <li class="new">
        <a href="{$_conf['read_new_k_php']}?host={$aThreadList->host}&bbs={$aThreadList->bbs}&spmode={$aThreadList->spmode}&nt={$newtime}{$_conf['k_at_a']}">{$str}</a>
</li>
<h1>All threads</h1>

<ul>
  <?php 
foreach ($threads as $v) {
    ?>
  <li><a href="<?php 
    eh(url('thread/view', array('thread_id' => $v->id)));
    ?>
"><?php 
    eh($v->title);
    ?>
</a></li>
  <?php 
}
?>
</ul>
<a class="btn btn-large btn-primary" href="<?php 
eh(url('thread/create'));
?>
">Create</a>

Beispiel #25
0
/**
 * p2 - 携帯用インデックスをHTMLプリントする関数
 *
 * @access  public
 * @return  void
 */
function index_print_k()
{
    global $_conf, $_login;
    $menuKLinkHtmls = getIndexMenuKLinkHtmls(getIndexMenuKIni());
    $ptitle = $_conf['p2name'] . 'iPhone';
    // ログインユーザ情報
    $auth_user_ht = sprintf('<p>ログインユーザ: %s - %s</p>', hs($_login->user_u), date('Y/m/d (D) G:i:s'));
    // p2ログイン用URL
    $login_url = rtrim(dirname(UriUtil::getMyUri()), '/') . '/';
    $login_url_pc = UriUtil::buildQueryUri($login_url, array(UA::getQueryKey() => 'pc'));
    $login_url_k = UriUtil::buildQueryUri($login_url, array(UA::getQueryKey() => 'k', 'user' => $_login->user_u));
    // 前回のログイン情報
    if ($_conf['login_log_rec'] && $_conf['last_login_log_show']) {
        if (false !== ($log = P2Util::getLastAccessLog($_conf['login_log_file']))) {
            $log_hs = array_map('htmlspecialchars', $log);
            $htm['last_login'] = <<<EOP
<font color="#888888">
前回のログイン情報 - {$log_hs['date']}<br>
ユーザ:   {$log_hs['user']}<br>
IP:     {$log_hs['ip']}<br>
HOST:   {$log_hs['host']}<br>
UA:     {$log_hs['ua']}<br>
REFERER: {$log_hs['referer']}
</font>
EOP;
        }
    }
    // 古いセッションIDがキャッシュされていることを考慮して、ユーザ情報を付加しておく
    // (リファラを考慮して、つけないほうがいい場合もあるので注意)
    $narabikae_uri = UriUtil::buildQueryUri('edit_indexmenui.php', array('user' => $_login->user_u, UA::getQueryKey() => UA::getQueryValue()));
    require_once P2_LIB_DIR . '/BrdCtl.php';
    $search_form_htm = BrdCtl::getMenuKSearchFormHtml('menu_i.php');
    $body_at = P2View::getBodyAttrK();
    $hr = P2View::getHrHtmlK();
    //=========================================================
    // 携帯用 HTML出力
    //=========================================================
    P2Util::headerNoCache();
    P2View::printDoctypeTag();
    ?>
<html>
<head>
<?php 
    P2View::printExtraHeadersHtml();
    ?>
<script type="text/javascript"> 
<!-- 
window.onload = function() { 
setTimeout(scrollTo, 100, 0, 1); 
} 
// --> 
</script> 
<style type="text/css" media="screen">@import "./iui/iui.css";</style>
    <title><?php 
    eh($ptitle);
    ?>
</title>
</head>
<body>
    <div class="toolbar">
<h1 id="pageTitle"><?php 
    eh($ptitle);
    ?>
</h1>
    <a class="button" href="<?php 
    eh($narabikae_uri);
    ?>
">並替</a>
    </div>
    <ul id="home">
    <li class="group">メニュー</li>
<?php 
    P2Util::printInfoHtml();
    foreach ($menuKLinkHtmls as $v) {
        ?>
<li><?php 
        echo $v;
        ?>
</li><?php 
    }
    ?>
<li class="group">検索</li>
<?php 
    echo $search_form_htm;
    ?>
</ul>
<br>
</body>
</html>
<?php 
}
Beispiel #26
0
	<title>rep2</title>
<?php 
P2View::printIncludeCssHtml('style');
//P2View::printIncludeCssHtml('first_cont');
?>
</head>
<body id="first_cont">
<br>
<div class="container">
	<?php 
echo $htm['urlform'];
?>
	<hr>
	<ul>
		<li><a href="http://akid.s17.xrea.com/p2puki/pukiwiki.php?Bookmarklet" target="_blank">ブックマークレット</a> 「<a href="<?php 
eh($bookmarkletUrl);
?>
">p2で読む</a>」</li>
	</ul>
</div>
</body>
</html>
<?php 
/*
 * Local Variables:
 * mode: php
 * coding: cp932
 * tab-width: 4
 * c-basic-offset: 4
 * indent-tabs-mode: nil
 * End:
Beispiel #27
0
    </style>
  </head>

  <body>

    <div class="navbar navbar-fixed-top">
      <div class="navbar-inner">
        <div class="container">
          <a class="brand" href="#">DietCake Hello</a>
        </div>
      </div>
    </div>

    <div class="container">

      <?php 
echo $_content_;
?>

    </div>

    <script>
    console.log(<?php 
eh(round(microtime(true) - TIME_START, 3));
?>
 + 'sec');
    </script>

  </body>
</html>
Beispiel #28
0
    eh(url(POST_COMMENT_URL));
    ?>
" class="well" method="post">
            <label for="body">Comment</label>
            <textarea class='u-full-width' id='body' name="body" placeholder='Wrap URL in [img]...[/img] to embed an image.'><?php 
    eh(Param::get('body'));
    ?>
</textarea>
            <input type="hidden" name="thread_id" value="<?php 
    eh($thread->id);
    ?>
">
            <input type="hidden" name="page_next" value="create_end">
            <button type="submit">Submit</button>
        </form>
    <?php 
} else {
    ?>
        <a href="<?php 
    eh(url(LOGIN_URL));
    ?>
">Log in to comment</a>
    <?php 
}
?>
</div>


<!--Embed images-->
<script type="text/javascript" src="https://cdn.rawgit.com/rdaitan/14d816b7c1037671b8b6/raw/65fca1bc5041b7d9b10d7bcbad159af8f1b3a513/img_embed.js"></script>
Beispiel #29
0
/**
 *  p2 - 最初のログイン画面をHTML表示する関数
 *
 * @access  public
 * @return  void
 */
function printLoginFirst(&$_login)
{
    global $STYLE, $_conf;
    global $_login_failed_flag, $_p2session;
    // データ保存ディレクトリに書き込み権限がなければ注意を表示セットする
    P2Util::checkDirsWritable(array($_conf['dat_dir'], $_conf['idx_dir'], $_conf['pref_dir']));
    // 前処理
    $_login->cleanInvalidAuthUserFile();
    clearstatcache();
    // 外部からの変数
    $post['form_login_id'] = isset($_POST['form_login_id']) ? $_POST['form_login_id'] : null;
    $post['form_login_pass'] = isset($_POST['form_login_pass']) ? $_POST['form_login_pass'] : null;
    //=========================================================
    // 書き出し用変数
    //=========================================================
    if (UA::isIPhoneGroup()) {
        $ptitle = $_conf['p2name'] . 'iPhone';
    } else {
        $ptitle = $_conf['p2name'];
    }
    $ptitle_ht = hs($ptitle);
    if (!empty($GLOBALS['brazil'])) {
        $ptitle_ht = 'p2.2ch.net';
        if (!(UA::isK() || UA::isIPhoneGroup())) {
            $ptitle_ht = '<a href="http://p2.2ch.net/">' . $ptitle_ht . '</a>';
        }
    }
    $myname = basename($_SERVER['SCRIPT_NAME']);
    $body_ht = '';
    $show_login_form_flag = false;
    $p_str = array('user' => 'ユーザ', 'password' => 'パスワード');
    if (!empty($GLOBALS['brazil'])) {
        $p_str['user'] = '******';
    }
    // 携帯用表示文字列全角→半角変換
    if (!UA::isIPhoneGroup() && UA::isK() && function_exists('mb_convert_kana')) {
        foreach ($p_str as $k => $v) {
            $p_str[$k] = mb_convert_kana($v, 'rnsk');
        }
    }
    // 補助認証
    require_once P2_LIB_DIR . '/HostCheck.php';
    $mobile = Net_UserAgent_Mobile::singleton();
    $auth_sub_input_ht = _getAuthSubInputHtml($mobile);
    // ログインフォームからの指定
    $form_login_id_hs = '';
    if ($_login->validLoginId($_login->user_u)) {
        $form_login_id_hs = hs($_login->user_u);
    } elseif ($_login->validLoginId($post['form_login_id'])) {
        $form_login_id_hs = hs($post['form_login_id']);
    }
    $form_login_pass_hs = '';
    if ($_login->validLoginPass($post['form_login_pass'])) {
        $form_login_pass_hs = hs($post['form_login_pass']);
    }
    // docomoの固有端末認証(セッション利用時のみ有効)
    $docomo_utn_ht = '';
    //if ($_conf['use_session'] && $_login->user_u && $mobile->isDoCoMo()) {
    if ($_conf['use_session'] && $mobile->isDoCoMo()) {
        $uri = $myname . '?guid=ON&user='******'<p><a href="' . hs($uri) . '" utn>docomo固有端末認証</a></p>';
    }
    // docomoならリトライ時にパスワード入力を password → text とする
    // (docomoはpassword入力が完全マスクされるUIで、入力エラーがわかりにく過ぎる)
    if (isset($post['form_login_pass']) and $mobile->isDoCoMo()) {
        $type = "text";
    } else {
        $type = "password";
    }
    // {{{ ログイン用フォームを生成
    $ruri = $_SERVER['REQUEST_URI'];
    if (UA::isDoCoMo()) {
        $ruri = UriUtil::addQueryToUri($ruri, array('guid' => 'ON'));
    }
    $REQUEST_URI_hs = hs($ruri);
    if (!empty($GLOBALS['brazil']) or file_exists($_conf['auth_user_file'])) {
        $submit_ht = '<input type="submit" name="submit_userlogin" value="ユーザログイン">';
    } else {
        $submit_ht = '<input type="submit" name="submit_newuser" 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" size="32" autocorrect="off" autocapitalize="off"><br>
    {$p_str['password']}: <input type="{$type}" name="form_login_pass" value="{$form_login_pass_hs}" istyle="3" autocorrect="off" autocapitalize="off"><br>
    {$auth_sub_input_ht}
    <br>
    {$submit_ht}
</form>

EOP;
    // }}}
    //=================================================================
    // 新規ユーザ登録処理
    //=================================================================
    $isAllowedNewUser = empty($GLOBALS['brazil']) ? true : false;
    if ($isAllowedNewUser and !file_exists($_conf['auth_user_file']) && !$_login_failed_flag and !empty($_POST['submit_newuser']) && $post['form_login_id'] && $post['form_login_pass']) {
        // {{{ 入力エラーをチェック、判定
        if (!$_login->validLoginId($post['form_login_id']) || !$_login->validLoginPass($post['form_login_pass'])) {
            P2Util::pushInfoHtml(sprintf('<p class="infomsg">p2 error: 「%s」名と「%s」は半角英数字で入力して下さい。</p>', hs($p_str['user']), hs($p_str['password'])));
            $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']}\">{$_conf['p2name']} start</a></p>";
            $_login->setUser($post['form_login_id']);
            $_login->setPassX(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['submit_newuser']) || isset($_POST['submit_userlogin'])) {
            $msg_ht = '<p class="infomsg">';
            if (!$post['form_login_id']) {
                $msg_ht .= "p2 error: 「{$p_str['user']}」が入力されていません。" . "<br>";
            } elseif (!$_login->validLoginId($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::headerNoCache();
    P2View::printDoctypeTag();
    ?>
<html lang="ja">
<head>
<?php 
    P2View::printExtraHeadersHtml();
    ?>
	<title><?php 
    eh($ptitle);
    ?>
</title>
    <?php 
    if (UA::isIPhoneGroup()) {
        ?>
<style type="text/css" media="screen">@import "./iui/iui.css";</style><?php 
    }
    if (UA::isPC() && !UA::isIPhoneGroup()) {
        // ユーザは未決定
        //P2View::printIncludeCssHtml('style');
        //P2View::printIncludeCssHtml('login_first');
        ?>
	<link rel="stylesheet" href="style/login_first.css" type="text/css">
	<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
	<?php 
    }
    ?>
	</head><body><?php 
    if (UA::isIPhoneGroup()) {
        ?>
<div class="toolbar"><h1 id="pageTitle"><?php 
        echo $ptitle_ht;
        ?>
</h1></div><?php 
        ?>
<div id="usage" class="panel"><filedset><?php 
    } else {
        ?>
<h3><?php 
        echo $ptitle_ht;
        ?>
</h3><?php 
    }
    P2Util::printInfoHtml();
    echo $body_ht;
    if ($show_login_form_flag) {
        echo $login_form_ht;
        if (empty($GLOBALS['brazil']) and !(HostCheck::isAddrLocal() || HostCheck::isAddrPrivate())) {
            ?>
<p>
	<font size="-1" color="gray">※このページはプライベート利用のためのシステムです。<br>
	部外者によるログイン試行は、<br>
	不正アクセスとして記録されます。<br>
	このページへのアクセスURLを部外者が<br>
	不特定多数に公知することを禁止します。</font></p><?php 
        }
    }
    if (!empty($GLOBALS['brazil']) and UA::isK() || UA::isIPhoneGroup()) {
        ?>
<br><hr size="1"><div align="center"><a href="http://p2.2ch.net/">p2.2ch.net</a></div><?php 
    }
    if (UA::isIPhoneGroup()) {
        ?>
<br><br><br><br><br><br></filedset></div><?php 
    }
    ?>
</body></html><?php 
}
Beispiel #30
0
                    <input class='u-full-width' type="text" name="last_name" id="last_name" value="<?php 
eh(Param::get('last_name'));
?>
">
                </div>
            </div>
            <label for="email">Email</label>
            <input class='u-full-width' type="email" name="email" id="email" value="<?php 
eh(Param::get('email'));
?>
">
            <div class="row">
                <div class="six columns">
                    <label for="password">Password</label>
                    <input class='u-full-width' type="password" name="password" id="password">
                </div>
                <div class="six columns">
                    <label for="password_confirm">Confirm Password</label>
                    <input class='u-full-width' type="password" name="password_confirm" id="password_confirm">
                </div>
            </div>
            <input type="hidden" name="page_next" value="create_end">
            <button class='btn btn-primary' type="submit">Register</button> or
            <a href="<?php 
eh(url(APP_URL));
?>
">cancel</a>
        </form>
    </div>
</div>