Ejemplo n.º 1
0
Archivo: login.php Proyecto: 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 {
Ejemplo n.º 2
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;
}
Ejemplo n.º 3
0
Archivo: Login.php Proyecto: poppen/p2
 /**
  * 携帯用端末IDの認証登録をセットする
  *
  * @access  public
  */
 function registKtaiId()
 {
     global $_conf;
     // {{{ 認証登録処理 EZweb
     if (!empty($_REQUEST['ctl_regist_ez'])) {
         if ($_REQUEST['regist_ez'] == '1') {
             if (!empty($_SERVER['HTTP_X_UP_SUBNO'])) {
                 $this->registAuthCarrier('EZWEB', $_SERVER['HTTP_X_UP_SUBNO']);
             } else {
                 P2Util::pushInfoHtml('<p class="infomsg">×EZweb用サブスクライバIDでの認証登録はできませんでした</p>');
             }
         } else {
             $this->removeRegistedAuthCarrier('EZWEB');
         }
         // }}}
         // {{{ 認証登録処理 SoftBank
     } elseif (!empty($_REQUEST['ctl_regist_jp'])) {
         if ($_REQUEST['regist_jp'] == '1') {
             if (HostCheck::isAddrSoftBank() && ($sn = P2Util::getSoftBankID())) {
                 $this->registAuthCarrier('SOFTBANK', $sn);
             } else {
                 P2Util::pushInfoHtml('<p class="infomsg">×SoftBank用固有IDでの認証登録はできませんでした</p>');
             }
         } else {
             $this->removeRegistedAuthCarrier('SOFTBANK');
         }
         // }}}
         // {{{ 認証登録処理 docomo
     } elseif (!empty($_REQUEST['ctl_regist_docomo'])) {
         if ($_REQUEST['regist_docomo'] == '1') {
             // UAに含まれるシリアルIDを取得(utn)
             if ($sn = P2Util::getDocomoUtnId()) {
                 $this->registAuthCarrier('DOCOMO', $sn);
             } else {
                 P2Util::pushInfoHtml('<p class="infomsg">×docomo用固有IDでの認証登録はできませんでした</p>');
             }
         } else {
             $this->removeRegistedAuthCarrier('DOCOMO');
         }
     }
     // }}}
 }