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


PHP api::validatedOn方法代码示例

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


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

示例1: listUser


//.........这里部分代码省略.........
            }
        } else {
            $table->addRow();
            $table->addCol("This account has been confirmed.");
            if ("{$row['emailvalid']}" == "0") {
                $table->addCol("<font color=\"#ff0000\">WARNING!</b></font><br> The User has not verified this email but the account has been confirmed!");
                // Add a "confirm email" checkbox.
                $table->addRow();
                $table->addCol("Mark users email as valid:");
                $table->addCol("<input type=\"checkbox\" name=\"SetEmailValid\" value=\"true\">");
            } else {
                $table->addCol("The user validated the supplied email address.");
            }
        }
        /*
         * API Goodness
         */
        $api = new api($row[id], true);
        $apit = new table(2, true);
        $apit->addHeader(">> Api information for " . ucfirst($row[username]));
        $apit->addRow();
        $apit->addCol("API Key in database:");
        if ($api->getApiID() && $api->getApiKey()) {
            $apit->addCol(yesno(1, true));
            $apit->addRow();
            $apit->addCol("API valid:");
            $apit->addCol(yesno($api->valid(), true));
            if ($api->valid()) {
                $apit->addRow();
                $apit->addCol("Character ID:");
                $apit->addCol($api->getCharacterID());
                $apit->addRow();
                $apit->addCol("Validated on:");
                $apit->addCol(date("d.m.Y H:i:s", $api->validatedOn()));
            }
            $apit->addRow();
            $apit->addCol("Remove API key from database:");
            $apit->addCol("[<a href=\"index.php?action=delapi&id={$id}\">delete api key</a>]");
        } else {
            $apit->addCol(yesno(0));
        }
        // Permissions matrix
        $perms = array("canLogin" => "log in", "canJoinRun" => "join mining Ops", "canCreateRun" => "create new mining Ops", "canCloseRun" => "close mining Ops", "canDeleteRun" => "delete mining Ops", "canAddHaul" => "haul from/to mining Ops", "canSeeEvents" => "view scheduled events", "canDeleteEvents" => "can delete events", "canEditEvents" => "add and delete scheduled events", "canChangePwd" => "change his own password", "canChangeEmail" => "change his own email", "canChangeOre" => "manage ore prices and enable/disable them.", "canAddUser" => "add new accounts", "canSeeUsers" => "see other accounts", "canDeleteUser" => "delete other accounts.", "canEditRank" => "edit other peoples ranks.", "canManageUser" => "grant and take permissions.", "isOfficial" => "create official mining runs (with payout).", "isAdmin" => "edit site settings.", "isLottoOfficial" => "administrate the lottery", "canPlayLotto" => "play Lotto!", "isAccountant" => "edit other users credits.", "optIn" => "User has opt-in to eMails.");
        // Create a seperate permissions table.
        $perm_table = new table(2, true);
        $perm_table->addHeader(">> " . ucfirst($row[username]) . " has permission to... ");
        $perm_keys = array_keys($perms);
        $LoR = 1;
        foreach ($perm_keys as $key) {
            if ($LoR) {
                $perm_table->addRow();
            }
            if ($row[$key]) {
                $perm_table->addCol("<input type=\"checkbox\" name=\"{$key}\" checked> " . $perms[$key]);
            } else {
                $perm_table->addCol("<input type=\"checkbox\" name=\"{$key}\"> " . $perms[$key]);
            }
            $LoR = 1 - $LoR;
        }
        if (!$LoR) {
            $perm_table->addCol();
        }
        // Delete User
        $perm_table->addRow();
        $perm_table->addCol("<hr>", array("colspan" => 2));
        $perm_table->addRow();
开发者ID:nuxi,项目名称:MiningBuddy,代码行数:67,代码来源:listUser.php

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