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


PHP BoincUser::lookup_email_addr方法代碼示例

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


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

示例1: login_with_ldap

function login_with_ldap($uid, $passwd, $next_url, $perm)
{
    list($ldap_user, $error_msg) = ldap_auth($uid, $passwd);
    if ($error_msg) {
        error_page($error_msg);
    }
    $x = ldap_email_string($uid);
    $user = BoincUser::lookup_email_addr($x);
    if (!$user) {
        // LDAP authentication succeeded but we don't have a user record.
        // Create one.
        //
        $user = make_user_ldap($x, $ldap_user->name);
    }
    if (!$user) {
        error_page("Couldn't create user");
    }
    Header("Location: " . url_base() . "{$next_url}");
    send_cookie('auth', $user->authenticator, $perm);
    return;
}
開發者ID:aggroskater,項目名稱:boinc,代碼行數:21,代碼來源:login_action.php

示例2: email_sent_message

function email_sent_message($email_addr)
{
    if (defined('EMAIL_FROM')) {
        $email_from = EMAIL_FROM;
    } else {
        $email_from = URL_BASE;
    }
    page_head("Email sent");
    echo "\n        Instructions have been emailed to {$email_addr}.\n        <p>\n        If the email doesn't arrive in a few minutes,\n        your ISP may be blocking it as spam.\n        In this case please contact your ISP and\n        ask them to not block email from {$email_from}.\n    ";
}
$email_addr = strtolower(post_str("email_addr"));
$email_addr = sanitize_email($email_addr);
if (!strlen($email_addr)) {
    error_page("no address given");
}
$user = BoincUser::lookup_email_addr($email_addr);
if (!$user) {
    page_head("No such user");
    echo "There is no user with email address {$email_addr}. <br>\n        Try reentering your email address.<p>\n    ";
} else {
    if (substr($user->authenticator, 0, 1) == 'x') {
        page_head("Account Currently Disabled");
        echo "This account has been administratively disabled.";
    } else {
        $user->email_addr = $email_addr;
        $retval = send_auth_email($user);
        if ($retval) {
            email_sent_message($email_addr);
        } else {
            page_head("Email failed");
            echo "Can't send email to {$user->email_addr}";
開發者ID:maexlich,項目名稱:boinc-igemathome,代碼行數:31,代碼來源:mail_passwd.php

示例3: check_get_args

require_once "../inc/user.inc";
check_get_args(array());
$user = get_logged_in_user();
$email_addr = strtolower(post_str("email_addr"));
$passwd = post_str("passwd", true);
page_head(tra("Change email address of account"));
if (!is_valid_email_addr($email_addr)) {
    echo tra("New email address '%1' is invalid.", $email_addr);
} else {
    if (is_banned_email_addr($email_addr)) {
        echo tra("New email address '%1' is invalid.", $email_addr);
    } else {
        if ($email_addr == $user->email_addr) {
            echo tra("New email address is same as existing address. Nothing is changed.");
        } else {
            $existing = BoincUser::lookup_email_addr($email_addr);
            if ($existing) {
                echo tra("There's already an account with that email address");
            } else {
                $passwd_hash = md5($passwd . $user->email_addr);
                // deal with the case where user hasn't set passwd
                // (i.e. passwd is account key)
                //
                if ($passwd_hash != $user->passwd_hash) {
                    $passwd = $user->authenticator;
                    $passwd_hash = md5($passwd . $user->email_addr);
                }
                if ($passwd_hash != $user->passwd_hash) {
                    echo tra("Invalid password.");
                } else {
                    $passwd_hash = md5($passwd . $email_addr);
開發者ID:CalvinZhu,項目名稱:boinc,代碼行數:31,代碼來源:edit_email_action.php

示例4: handle_team

function handle_team($f)
{
    $t = parse_team($f);
    if (!$t) {
        echo "Failed to parse team\n";
        return;
    }
    //print_r($t);
    //return;
    if (!valid_team($t)) {
        echo "Invalid team\n";
        return;
    }
    echo "Processing {$t->name} {$t->user_email}\n";
    $user = BoincUser::lookup_email_addr($t->user_email);
    $team = BoincTeam::lookup_name($t->name);
    if ($team) {
        if (!$user) {
            echo "   team exists but user {$t->user_email} doesn't\n";
            return;
        }
        if ($user->id != $team->userid) {
            echo "   team exists but is owned by a different user\n";
            return;
        }
        if ($team->seti_id) {
            if ($team->seti_id == $t->id) {
                echo "   case 1\n";
                update_team($t, $team, $user);
                // update1 case
            } else {
                echo "   team exists but has wrong seti_id\n";
            }
        } else {
            $team2 = lookup_team_seti_id($t->id);
            if ($team2) {
                // update1 case
                echo "   case 2\n";
                update_team($t, $team2, $user);
            } else {
                // update2 case
                echo "   case 3\n";
                update_team($t, $team, $user);
            }
        }
    } else {
        $team = lookup_team_seti_id($t->id);
        if ($team) {
            echo "   A team with same ID but different name exists;\n";
            echo "   Please report this to {$t->user_email};\n";
        } else {
            echo "   Adding team\n";
            insert_case($t, $user);
        }
    }
}
開發者ID:ChristianBeer,項目名稱:boinc,代碼行數:56,代碼來源:team_import.php


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