本文整理汇总了PHP中BoincUser::lookup_auth方法的典型用法代码示例。如果您正苦于以下问题:PHP BoincUser::lookup_auth方法的具体用法?PHP BoincUser::lookup_auth怎么用?PHP BoincUser::lookup_auth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BoincUser
的用法示例。
在下文中一共展示了BoincUser::lookup_auth方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: login_with_auth
function login_with_auth($authenticator, $next_url, $perm)
{
$user = BoincUser::lookup_auth($authenticator);
if (!$user) {
page_head("Login failed");
echo "There is no account with that authenticator.\n Please <a href=get_passwd.php>try again</a>.\n ";
page_tail();
} else {
if (substr($user->authenticator, 0, 1) == 'x') {
error_page("This account has been administratively disabled.");
} else {
Header("Location: {$next_url}");
send_cookie('auth', $authenticator, $perm);
}
}
}
示例2: check_get_args
// BOINC is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
// Users are taken here after creating an account via the Wizard.
// They've already entered an email address and password.
// Now get a name, country, and zip code
require_once '../inc/boinc_db.inc';
require_once '../inc/util.inc';
require_once '../inc/countries.inc';
check_get_args(array("auth"));
$auth = get_str("auth");
$user = BoincUser::lookup_auth($auth);
if (!$user) {
error_page("no such account");
}
page_head(tra("Finish account setup"));
echo "\n <form action=account_finish_action.php method=post>\n";
start_table();
row2(tra("Name") . "<br><span class=\"description\">" . tra("Identifies you on our web site. Use your real name or a nickname.") . "</span>", "<input name=\"name\" size=\"30\" value=\"{$user->name}\">");
row2_init(tra("Country") . "<br><span class=\"description\">" . tra("Select the country you want to represent, if any.") . "</span>", "<select name=\"country\">");
print_country_select();
echo "</select></td></tr>\n";
row2(tra("Postal or ZIP Code") . "<br><span class=\"description\">" . tra("Optional") . "</span>", "<input name=\"postal_code\" size=\"20\">");
row2("", "<input type=\"submit\" value=\"OK\">");
end_table();
echo "\n <input type=hidden name=auth value={$auth}>\n </form>\n";
page_tail();
示例3: get_int
}
BoincDb::get(true);
if ($xml) {
$creditonly = get_int('creditonly', true);
xml_header();
$retval = db_init_xml();
if ($retval) {
xml_error($retval);
}
$teamid = get_int("teamid");
$team = BoincTeam::lookup_id($teamid);
if (!$team) {
xml_error(ERR_DB_NOT_FOUND);
}
$account_key = get_str('account_key', true);
$user = BoincUser::lookup_auth($account_key);
$show_email = $user && is_team_founder($user, $team);
echo "<users>\n";
$users = BoincUser::enum_fields("id, email_addr, send_email, name, total_credit, expavg_credit, expavg_time, has_profile, donated, country, cross_project_id, create_time, url", "teamid={$team->id}");
//$users = BoincUser::enum("teamid=$team->id");
foreach ($users as $user) {
show_team_member($user, $show_email, $creditonly);
}
echo "</users>\n";
exit;
}
$user = get_logged_in_user();
$teamid = get_int("teamid");
$plain = get_int("plain", true);
$team = BoincTeam::lookup_id($teamid);
if (!$team) {
示例4: tra
// as published by the Free Software Foundation,
// either version 3 of the License, or (at your option) any later version.
//
// BOINC is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
require_once "../inc/util.inc";
require_once "../inc/forum.inc";
require_once "../inc/image.inc";
// Avatar scaling
if (post_str("account_key", true) != null) {
$user = BoincUser::lookup_auth(post_str("account_key"));
$rpc = true;
} else {
$user = get_logged_in_user();
$rpc = false;
}
BoincForumPrefs::lookup($user);
if (post_str("action", true) == "reset_confirm") {
page_head(tra("Confirm reset"));
echo tra("This action will erase any changes you have made in your community preferences. To cancel, click your browser's Back button.") . "\n <p>\n <form action=edit_forum_preferences_action.php method=post>\n <input type=hidden name=action value=reset>\n <input class=\"btn btn-warning\" type=submit value=\"" . tra("Reset preferences") . "\">\n </form>\n ";
page_tail();
exit;
}
// If the user has requested a reset of preferences;
// preserve a few fields.
//
示例5: error_page
if (time() - $t > 86400) {
error_page("Link has expired;\n go <a href=get_passwd.php>here</a> to\n get a new login link by email.");
}
send_cookie('auth', $user->authenticator, true);
Header("Location: home.php");
exit;
}
// check for account key case.
// see if key is in URL; if not then check for POST data
//
$authenticator = get_str("key", true);
if (!$authenticator) {
$authenticator = post_str("authenticator", true);
}
if (!$authenticator) {
error_page("You must supply an email address and password");
}
if (substr($user->authenticator, 0, 1) == 'x') {
//User has been bad so we are going to take away ability to post for awhile.
error_page("This account has been administratively disabled.");
}
$user = BoincUser::lookup_auth($authenticator);
if (!$user) {
page_head("Login failed");
echo "There is no account with that authenticator.\n Please <a href=get_passwd.php>try again</a>.\n ";
page_tail();
} else {
Header("Location: {$next_url}");
$perm = $_POST['stay_logged_in'];
send_cookie('auth', $authenticator, $perm);
}