Esempio n. 1
0
/**
 * @return  string  HTML
 */
function _getAuthSubInputHtml($mobile)
{
    $auth_sub_input_ht = '';
    // EZ認証
    if (!empty($_SERVER['HTTP_X_UP_SUBNO'])) {
        //if (!$_login->hasRegistedAuthCarrier('EZWEB')) {
        $auth_sub_input_ht = '<input type="hidden" name="ctl_regist_ez" value="1">' . "\n" . '<input type="checkbox" name="regist_ez" value="1" checked>EZ端末IDで認証を登録<br>';
        //}
        // SoftBank認証
        // http://www.dp.j-phone.com/dp/tool_dl/web/useragent.php
    } elseif (HostCheck::isAddrSoftBank() and P2Util::getSoftBankID()) {
        //if (!$_login->hasRegistedAuthCarrier('SOFTBANK')) {
        $auth_sub_input_ht = '<input type="hidden" name="ctl_regist_jp" value="1">' . "\n" . '<input type="checkbox" name="regist_jp" value="1" checked>SoftBank端末IDで認証を登録<br>';
        //}
        // docomo認証
    } elseif ($mobile->isDoCoMo()) {
        //if (!$_login->hasRegistedAuthCarrier('DOCOMO')) {
        $auth_sub_input_ht = '<input type="hidden" name="ctl_regist_docomo" value="1">' . "\n" . '<input type="checkbox" name="regist_docomo" value="1" checked>docomo端末IDで認証を登録<br>';
        //}
        // Cookie認証
    } else {
        $regist_cookie_checked = ' checked';
        if (isset($_POST['submit_newuser']) || isset($_POST['submit_userlogin'])) {
            if (empty($_POST['regist_cookie'])) {
                $regist_cookie_checked = '';
            }
        }
        $ignore_cip_checked = '';
        if (isset($_POST['submit_newuser']) || isset($_POST['submit_userlogin'])) {
            if (geti($_POST['ignore_cip']) == '1') {
                $ignore_cip_checked = ' checked';
            }
        } else {
            if (geti($_COOKIE['ignore_cip']) == '1') {
                $ignore_cip_checked = ' checked';
            }
        }
        $auth_sub_input_ht = '<input type="hidden" name="ctl_regist_cookie" value="1">' . sprintf('<input type="checkbox" id="regist_cookie" name="regist_cookie" value="1"%s><label for="regist_cookie">ログイン情報をCookieに保存する(推奨)</label><br>', $regist_cookie_checked) . sprintf('<input type="checkbox" id="ignore_cip" name="ignore_cip" value="1"%s><label for="ignore_cip">Cookie認証時にIPの同一性をチェックしない</label><br>', $ignore_cip_checked);
    }
    return $auth_sub_input_ht;
}
Esempio n. 2
0
File: Login.php Progetto: poppen/p2
 /**
  * md5_encrypt, md5_decrypt のための password(salt) を得る
  * (クッキーのcidの生成に利用している)
  *
  * @static
  * @access  private
  * @return  string
  */
 function getMd5CryptPassForCid()
 {
     //return md5($_SERVER['SERVER_NAME'] . $_SERVER['HTTP_USER_AGENT'] . $_SERVER['SERVER_SOFTWARE']);
     //$seed = $_SERVER['SERVER_NAME'] . $_SERVER['SERVER_SOFTWARE'];
     $seed = $_SERVER['SERVER_SOFTWARE'];
     require_once P2_LIB_DIR . '/HostCheck.php';
     // ローカルチェックをして、HostCheck::isAddrDocomo() などでホスト名を引く機会を減らす
     $notK = (bool) (HostCheck::isAddrLocal() || HostCheck::isAddrPrivate());
     // 携帯判定された場合は、 IPチェックなし
     if (!$notK and UA::isK(geti($_SERVER['HTTP_USER_AGENT'])) || HostCheck::isAddrDocomo() || HostCheck::isAddrAu() || HostCheck::isAddrSoftBank() || HostCheck::isAddrWillcom() || HostCheck::isAddrJigWeb() || HostCheck::isAddrJig() || HostCheck::isAddrIbis()) {
     } elseif (!empty($_COOKIE['ignore_cip'])) {
     } else {
         $now_ips = explode('.', $_SERVER['REMOTE_ADDR']);
         $seed .= $now_ips[0];
     }
     return md5($seed);
 }
Esempio n. 3
0
File: login.php Progetto: poppen/p2
$auth_cookie_html = '';
$mobile =& Net_UserAgent_Mobile::singleton();
require_once P2_LIB_DIR . '/HostCheck.php';
// EZ認証
if (!empty($_SERVER['HTTP_X_UP_SUBNO'])) {
    if ($_login->hasRegistedAuthCarrier('EZWEB')) {
        $atag = P2View::tagA(UriUtil::buildQueryUri($_SERVER['SCRIPT_NAME'], array('ctl_regist_ez' => '1', UA::getQueryKey() => UA::getQueryValue())), '解除');
        $auth_ctl_html = sprintf('EZ端末ID認証登録済[%s]<br>', $atag);
    } else {
        if ($_login->pass_x) {
            $atag = P2View::tagA(UriUtil::buildQueryUri($_SERVER['SCRIPT_NAME'], array('ctl_regist_ez' => '1', 'regist_ez' => '1', UA::getQueryKey() => UA::getQueryValue())), 'EZ端末IDで認証を登録');
            $auth_ctl_html = sprintf('[%s]<br>', $atag);
        }
    }
    // SoftBank認証
} elseif (HostCheck::isAddrSoftBank() && P2Util::getSoftBankID()) {
    if ($_login->hasRegistedAuthCarrier('SOFTBANK')) {
        $atag = P2View::tagA(UriUtil::buildQueryUri($_SERVER['SCRIPT_NAME'], array('ctl_regist_jp' => '1', UA::getQueryKey() => UA::getQueryValue())), '解除');
        $auth_ctl_html = sprintf('SoftBank端末ID認証登録済[%s]<br>', $atag);
    } else {
        if ($_login->pass_x) {
            $atag = P2View::tagA(UriUtil::buildQueryUri($_SERVER['SCRIPT_NAME'], array('ctl_regist_jp' => '1', 'regist_jp' => '1', UA::getQueryKey() => UA::getQueryValue())), 'SoftBank端末IDで認証を登録');
            $auth_ctl_html = sprintf('[%s]<br>', $atag);
        }
    }
    // docomo認証
} elseif ($mobile->isDoCoMo()) {
    if ($_login->hasRegistedAuthCarrier('DOCOMO')) {
        $atag = P2View::tagA(UriUtil::buildQueryUri($_SERVER['SCRIPT_NAME'], array('ctl_regist_docomo' => '1', UA::getQueryKey() => UA::getQueryValue())), '解除');
        $auth_ctl_html = sprintf('docomo端末ID認証登録済[%s]<br>', $atag);
    } else {
Esempio n. 4
0
 /**
  * IPがBBQチェック対象外かどうか
  *
  * @static
  * @access  public
  * @return  boolean
  */
 function isAddrBurnedNoCheck($addr = null)
 {
     if (HostCheck::isAddrDocomo($addr) || HostCheck::isAddrAu($addr) || HostCheck::isAddrSoftBank($addr) || HostCheck::isAddrJig($addr) || HostCheck::isAddrIbis($addr)) {
         return true;
     }
     return false;
 }