当前位置: 首页>>代码示例>>PHP>>正文


PHP api::nextValidation方法代码示例

本文整理汇总了PHP中api::nextValidation方法的典型用法代码示例。如果您正苦于以下问题:PHP api::nextValidation方法的具体用法?PHP api::nextValidation怎么用?PHP api::nextValidation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在api的用法示例。


在下文中一共展示了api::nextValidation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: makePreferences


//.........这里部分代码省略.........
    $page .= "<input type=\"hidden\" name=\"check\" value=\"check\">";
    $page .= "<input type=\"hidden\" name=\"action\" value=\"optIn\"></form>";
    $page .= "<form action=\"index.php\" method=\"POST\">";
    $page .= $sir_table->flush();
    $page .= "<input type=\"hidden\" name=\"check\" value=\"check\">";
    $page .= "<input type=\"hidden\" name=\"action\" value=\"sirchange\"></form>";
    if ($MySelf->canChangeEmail()) {
        $page .= "<form action=\"index.php\" method=\"post\">";
        $page .= $email_table->flush();
        $page .= "<input type=\"hidden\" name=\"action\" value=\"changeemail\">";
        $page .= "<input type=\"hidden\" name=\"check\" value=\"check\">";
        $page .= "</form>";
    }
    if ($MySelf->canChangePwd()) {
        $page .= "<form action=\"index.php\" method=\"post\">";
        $page .= $password_table->flush();
        $page .= "<input type=\"hidden\" name=\"action\" value=\"changepw\">";
        $page .= "<input type=\"hidden\" name=\"check\" value=\"check\">";
        $page .= "<input type=\"hidden\" name=\"username\" value=\"%%USERNAME%%\">";
        $page .= "</form>";
    }
    // Api Keys
    // Load possible current keys.
    $api = new api($MySelf->getID());
    $api_key = $api->getApiKey();
    $api_id = $api->getApiID();
    if (!$api->valid()) {
        $api->authorizeApi();
    }
    // Do the api table.
    $api_table = new table(2, true);
    $api_table->addHeader(">> Api key management");
    $api_table->addRow();
    $api_table->addCol("Here you can supply your limited-access API-Key. Its used for quick-login for now.", array("colspan" => 2));
    if ($api_id && $api->valid()) {
        $s1 = "<input type =\"hidden\" name=\"apiID\" value=\"{$api_id}\">{$api_id}";
    } else {
        $s1 = "<input type=\"text\" name=\"apiID\" value=\"{$api_id}\">";
        $doApiLink = true;
    }
    if ($api_key && $api->valid()) {
        $s2 = "<input type =\"hidden\" name=\"apiKey\" value=\"{$api_key}\">{$api_key}";
    } else {
        $s2 = "<input type=\"text\" size=\"80\" name=\"apiKey\" value=\"{$api_key}\">";
        $doApiLink = true;
    }
    $api_table->addRow();
    $api_table->addCol("API ID:");
    $api_table->addCol($s1);
    $api_table->addRow();
    $api_table->addCol("Verification Code:");
    $api_table->addCol($s2);
    // Add the API link to eve online.
    global $IGB;
    global $IGB_VISUAL;
    if ($doApiLink && (!$IGB || $IGB && $IGB_VISUAL)) {
        $api_table->addRow();
        $api_table->addCol("Get your API key here:");
        $api_table->addCol("<a href=\"http://support.eveonline.com/api/default.asp\">http://support.eveonline.com/api/default.asp</a>");
    }
    if ($api_key) {
        $api_table->addRow();
        $api_table->addCol("API Key validated:");
        if (!$api->valid()) {
            $hint = " (If your key is not validated, hit update API key button.)";
        }
        $api_table->addCol(yesno($api->valid(), yes) . $hint);
        if ($api->valid()) {
            $api_table->addRow();
            $api_table->addCol("Validated on:");
            $api_table->addCol(date("d.m.Y H:i:s", $api->validatedOn()));
            $api_table->addRow();
            $api_table->addCol("Next verification at:");
            $api_table->addCol(date("d.m.Y H:i:s", $api->nextValidation()));
            $api_table->addRow();
            $api_table->addCol("API keys are valid for:");
            $days = getConfig("api_keys_valid");
            if ($days <= 1) {
                $days = "1 day.";
            } else {
                $days = $days . " days.";
            }
            $api_table->addCol($days);
            $api_table->addRow();
            $api_table->addCol("Character ID:");
            $api_table->addCol($api->getCharacterID());
        }
        $api_table->addRow();
        $api_table->addCol("Remove Key:");
        $api_table->addCol("<input type=\"checkbox\" name=\"deleteKey\" value=\"true\"> Tick box to remove the API key from the Database.");
    }
    $api_table->addHeaderCentered("<input type=\"submit\" name=\"update_api\" value=\"Update API Key\">");
    $api_form .= "<form action=\"index.php\" method=\"POST\">";
    $api_form .= $api_table->flush();
    $api_form .= "<input type=\"hidden\" name=\"action\" value=\"update_api\">";
    $api_form .= "<input type=\"hidden\" name=\"check\" value=\"check\"></form>";
    $page .= $api_form;
    // We are done here.
    return $page;
}
开发者ID:nuxi,项目名称:MiningBuddy,代码行数:101,代码来源:makePreferences.php


注:本文中的api::nextValidation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。