本文整理汇总了PHP中api::getApiKey方法的典型用法代码示例。如果您正苦于以下问题:PHP api::getApiKey方法的具体用法?PHP api::getApiKey怎么用?PHP api::getApiKey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类api
的用法示例。
在下文中一共展示了api::getApiKey方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: listUser
//.........这里部分代码省略.........
$table->addCol("This account has <b>not</b> been confirmed yet.");
$table->addRow();
$table->addCol("Confirm account:");
$table->addCol("<input type=\"checkbox\" name=\"confirm\" value=\"true\"> Tick box to confirm account. <br><br>This is a one-way action only. Once an account" . " has been confirmed you can not unconfirm it. Tho you can block or delete it." . " Be careful not to confirm an account by accident - you could allow a non-authorized third party to access your MiningBuddy!");
$table->addRow();
$table->addCol("Account confirmed:");
// Give a red light if user has not even verified himself.
if ("{$row['emailvalid']}" == "0") {
$table->addCol("<b>WARNING!</b><br> The User has not yet verified this email yet! If you choose to enable" . " this account at this time, be very sure that you know the person requesting the account!", array("bgcolor" => "#662222"));
} else {
$table->addCol("<br><br><b>The user validated the email address.</b><br>");
}
} 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 {
示例2: makePreferences
//.........这里部分代码省略.........
}
// Assemble the html.
$page = "<h2>Your Preferences</h2>";
$page .= "<form action=\"index.php\" method=\"POST\">";
$page .= $cantimer_table->flush();
$page .= "<input type=\"hidden\" name=\"action\" value=\"changecanpage\">";
$page .= "<input type=\"hidden\" name=\"check\" value=\"check\"></form>";
$page .= "<form action=\"index.php\" method=\"POST\">";
$page .= $opt_table->flush();
$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();