當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Authenticator::generate方法代碼示例

本文整理匯總了PHP中Authenticator::generate方法的典型用法代碼示例。如果您正苦於以下問題:PHP Authenticator::generate方法的具體用法?PHP Authenticator::generate怎麽用?PHP Authenticator::generate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Authenticator的用法示例。


在下文中一共展示了Authenticator::generate方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: db_iconv

$strregion[23] = "EU";
$auth_moren = 0;
if ($logincheck == 0) {
    $authaddbyservererrorid = 3;
} else {
    if (check_data("letters_code")) {
        $postcode = db_iconv("letters_code");
        if (md5(strtolower($postcode)) == $_SESSION['letters_code']) {
            if (check_data('authname') && check_data('region') && check_data('selectpic')) {
                $region = db_iconv('region', "post", TRUE, true);
                $authname = db_iconv('authname', "post", TRUE, true);
                $selectpic = db_iconv('selectpic', "post", TRUE, true);
                if (checkauthname($authname) && checkauthregion($region) && checkauthselectpic($selectpic)) {
                    $region = $strregion[$region];
                    try {
                        $auth = @Authenticator::generate($region);
                        $authserial = $auth->serial();
                        $authserect = $auth->secret();
                        $authrestorecode = $auth->restore_code();
                        if (isset($_POST['morenauthset'])) {
                            if ($_POST['morenauthset'] == "on") {
                                $sql = "UPDATE `authdata` SET `auth_moren`=0 WHERE `user_id`='{$user_id}' AND `auth_moren`=1";
                                update($sql);
                                $auth_moren = 1;
                            }
                        }
                        if (queryValue("SELECT COUNT(*) FROM `authdata` WHERE `user_id`='{$user_id}' AND `auth_moren`=1") == 0) {
                            $auth_moren = 1;
                        }
                        if (is_null($authserial)) {
                            $authaddbyservererrorid = 5;
開發者ID:wooberlong,項目名稱:myauth.us,代碼行數:31,代碼來源:authadd_byserver.php

示例2: usage

<?php

require_once 'classes/Authenticator.php';
function usage()
{
    echo "Usage:\r\n";
    echo "\tphp php-bma.php new region\r\n";
    echo "\tphp php-bma.php generate serial secret\r\n";
    echo "\tphp php-bma.php restore serial restore_code\r\n\r\n";
}
$auth = false;
$method = isset($argv[1]) ? $argv[1] : null;
switch ($method) {
    case "new":
        if (count($argv) == 3) {
            $auth = Authenticator::generate($argv[2]);
            $message = "New Authenticator requested";
        }
        break;
    case "generate":
        if (count($argv) == 4) {
            $auth = Authenticator::factory($argv[2], $argv[3]);
            $message = "Generate codes";
        }
        break;
    case "restore":
        if (count($argv) == 4) {
            $auth = Authenticator::restore($argv[2], $argv[3]);
            $message = "Restore requested";
        }
        break;
開發者ID:FelipeSouzaRamos,項目名稱:php-bma,代碼行數:31,代碼來源:php-bma.php


注:本文中的Authenticator::generate方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。