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


PHP BoincUser::lookup_id方法代码示例

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


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

示例1: show_row

function show_row($x, $y, $mode, $i)
{
    $class = $i % 2 ? "row0" : "row1";
    echo "<tr class={$class}><td>";
    switch ($mode) {
        case 'host':
            echo "<a href=show_host_detail.php?hostid={$x}>{$x}</a>";
            break;
        case 'user':
            $user = BoincUser::lookup_id($x);
            echo "<a href=show_user.php?userid={$x}>{$user->name}</a>";
            break;
        case 'team':
            $team = BoincTeam::lookup_id($x);
            if ($team) {
                echo "<a href=team_display.php?teamid={$x}>{$team->name}</a>";
            } else {
                echo "(no team)";
            }
            break;
        case 'model':
            echo $x;
            break;
        case 'day':
            echo $x;
            break;
    }
    echo "</td><td align=right>" . format_credit_large($y->credit), "</td><td align=right>{$y->nresults}</td></tr>\n";
}
开发者ID:CalvinZhu,项目名称:boinc,代码行数:29,代码来源:show_coproc.php

示例2: show_user_wap

function show_user_wap($userid)
{
    wap_begin();
    $user = BoincUser::lookup_id($userid);
    if (!$user) {
        echo "<br/>" . tra("User not found!") . "<br/>";
        wap_end();
        return;
    }
    if ($user->teamid) {
        $team = BoincTeam::lookup_id($user->teamid);
    }
    $wapstr = PROJECT . "<br/>" . tra("Account Data<br/>for %1<br/>Time:", $user->name) . " " . wap_timestamp();
    $wapstr .= show_credit_wap($user);
    if ($user->teamid && $team) {
        $wapstr .= "<br/>" . tra("Team:") . " " . $team->name . "<br/>";
        $wapstr .= tra("Team TotCred:") . " " . format_credit($team->total_credit) . "<br/>";
        $wapstr .= tra("Team AvgCred:") . " " . format_credit($team->expavg_credit) . "<br/>";
    } else {
        $wapstr .= "<br/>" . tra("Team: None") . "<br/>";
    }
    // don't want to send more than 1KB (WAP limit)
    //
    if (strlen($wapstr) > 1024) {
        $wapstr = substr($wapstr, 0, 1024);
    }
    echo $wapstr;
    wap_end();
}
开发者ID:CalvinZhu,项目名称:boinc,代码行数:29,代码来源:userw.php

示例3: send_notify_email

function send_notify_email($userid, $message)
{
    $user = BoincUser::lookup_id($userid);
    $subject = "Daily notification summary from " . PROJECT;
    $body = "The following events occurred in the past day at " . PROJECT . ".\nFor details, visit your Account page at\n" . secure_url_base() . "home.php\n\n{$message}\n---------------\nTo change your email preferences for " . PROJECT . ", visit:\n" . secure_url_base() . "edit_forum_preferences_form.php\n\nDo not reply to this email.\n";
    send_email($user, $subject, $body);
    echo "sending to {$user->email_addr}\n";
}
开发者ID:CalvinZhu,项目名称:boinc,代码行数:8,代码来源:notify.php

示例4: show_admin

function show_admin($user, $admin)
{
    $admin_user = BoincUser::lookup_id($admin->userid);
    $tokens = url_tokens($user->authenticator);
    $date = date_str($admin->create_time);
    echo "<tr>\n        <td>" . user_links($admin_user) . "</td>\n        <td>{$date}</td>\n        <td>\n    ";
    show_button("team_admins.php?teamid={$admin->teamid}&action=remove&userid={$admin_user->id}" . $tokens, tra("Remove"), tra("Remove Team Admin status from this member"));
    echo "</td></tr>\n    ";
}
开发者ID:nicolas17,项目名称:boincgit-test,代码行数:9,代码来源:team_admins.php

示例5: send_founder_transfer_email

function send_founder_transfer_email($team, $user)
{
    $founder = BoincUser::lookup_id($team->userid);
    // send founder a private message for good measure
    $subject = "Team founder transfer request";
    $body = "Team member " . $user->name . " has asked that you\ntransfer foundership of {$team->name}.\nPlease go [url=" . URL_BASE . "team_change_founder_form.php?teamid={$team->id}]here[/url] to grant or decline the request.\n    \nIf you do not respond within 60 days, " . $user->name . " will\nbe allowed to become the team founder.\n";
    pm_send($user, $founder, $subject, $body, false);
    $subject = PROJECT . " team founder transfer";
    $body = "Team member " . $user->name . " has asked that you\ntransfer foundership of {$team->name} in " . PROJECT . ".\nPlease visit\n" . URL_BASE . "team_change_founder_form.php?teamid=" . $team->id . "\nto grant or decline the request.\n    \nIf you do not respond within 60 days, " . $user->name . " will\nbe allowed to become the team founder.\n    \nPlease do not respond to this email.\nThe mailbox is not monitored and the email\nwas sent using an automated system.";
    return send_email($founder, $subject, $body);
}
开发者ID:maexlich,项目名称:boinc-igemathome,代码行数:11,代码来源:team_founder_transfer_action.php

示例6: show_delta

function show_delta($delta)
{
    global $xml;
    $user = BoincUser::lookup_id($delta->userid);
    $when = time_str($delta->timestamp);
    $what = $delta->joining ? "joined" : "quit";
    if ($xml) {
        echo "    <action>\n        <id>{$user->id}</id>\n        <name>{$user->name}</name>\n        <action>{$what}</action>\n        <total_credit>{$delta->total_credit}</total_credit>\n        <when>{$when}</when>\n    </action>\n";
    } else {
        echo "<tr>\n           <td>{$when}</td>\n           <td>", user_links($user), " (ID {$user->id})</td>\n           <td>{$what}</td>\n           <td>{$delta->total_credit}</td>\n           </tr>\n        ";
    }
}
开发者ID:maexlich,项目名称:boinc-igemathome,代码行数:12,代码来源:team_delta.php

示例7: show_admin_page

function show_admin_page($user, $team)
{
    page_head(tra("Team administration for %1", $team->name));
    echo "\n        <ul>\n        <li><a href=team_edit_form.php?teamid={$team->id}>" . tra("Edit team info") . "</a>\n            <br><p class=\"text-muted\">" . tra("Change team name, URL, description, type, or country") . "</p>\n        <li>\n            " . tra("Member list:") . "\n        <a href=team_email_list.php?teamid={$team->id}>" . tra("HTML") . "</a>\n        &middot; <a href=team_email_list.php?teamid={$team->id}&plain=1>" . tra("text") . "</a>\n            <br><p class=\"text-muted\">" . tra("View member names and email addresses") . "</p>\n        <li>" . tra("View change history:") . "\n            <a href=team_delta.php?teamid={$team->id}>" . tra("HTML") . "</a>\n            &middot; <a href=team_delta.php?teamid={$team->id}&xml=1>" . tra("XML") . "</a>\n            <br><p class=\"text-muted\">" . tra("See when members joined or quit this team") . "</p>\n    ";
    // founder-only stuff follows
    //
    if ($team->userid == $user->id) {
        $tokens = url_tokens($user->authenticator);
        if ($team->ping_user > 0) {
            $user2 = BoincUser::lookup_id($team->ping_user);
            $deadline = date_str(transfer_ok_time($team));
            echo "<li>\n                <a href=team_change_founder_form.php?teamid={$team->id}><font color=red><strong>" . tra("Respond to foundership request.") . "</strong></font></a>  " . tra("If you don't respond by %1, %2 may assume foundership of this team.", $deadline, $user2->name);
        }
        echo "\n            <li><a href=team_remove_inactive_form.php?teamid={$team->id}>" . tra("Remove members") . "</a>\n                <br><p class=\"text-muted\">" . tra("Remove inactive or unwanted members from this team") . "</p>\n            <li><a href=team_change_founder_form.php?teamid={$team->id}>" . tra("Change founder") . "</a>\n                <br><p class=\"text-muted\">" . tra("Transfer foundership to another member") . "</p>\n            <li><a href=team_admins.php?teamid={$team->id}>" . tra("Add/remove Team Admins") . "</a>\n                <br><p class=\"text-muted\">" . tra("Give selected team members Team Admin privileges") . "</p>\n\n            <li><a href=team_manage.php?teamid={$team->id}&action=delete&{$tokens}>" . tra("Remove team") . "</a>\n                <br><p class=\"text-muted\">" . tra("Allowed only if team has no members") . "</p>\n            <li><a href=team_forum.php?teamid={$team->id}&cmd=manage>" . tra("Message board") . "</a>\n                <br><p class=\"text-muted\">" . tra("Create or manage a team message board") . "</p>\n        ";
    }
    echo "\n\n        <p>\n        <li>\n            " . tra("To have this team created on all BOINC projects (current and future) you can make it into a %1BOINC-wide team%2.", "<a href=http://boinc.berkeley.edu/teams/>", "</a>") . "\n        <li>\n            " . tra("Team admins are encouraged to join and participate in the Google %1boinc-team-founders%2 group.", "<a href=http://groups.google.com/group/boinc-team-founders>", "</a>") . "\n    </ul>\n    ";
    page_tail();
}
开发者ID:CalvinZhu,项目名称:boinc,代码行数:18,代码来源:team_manage.php

示例8: login_via_link

function login_via_link($id, $t, $h)
{
    $user = BoincUser::lookup_id($id);
    if (!$user) {
        error_page("Invalid user ID.\n            Please make sure you visited the complete URL;\n            it may have been split across lines by your email reader.");
    }
    $x = $id . $user->authenticator . $t;
    $x = md5($x);
    $x = substr($x, 0, 16);
    if ($x != $h) {
        error_page("Invalid authenticator.\n            Please make sure you visited the complete URL;\n            it may have been split across lines by your email reader.");
    }
    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");
}
开发者ID:aggroskater,项目名称:boinc,代码行数:18,代码来源:login_action.php

示例9: handle_team

function handle_team($team, $f)
{
    $user = BoincUser::lookup_id($team->userid);
    if (!$user) {
        echo "no user for team {$team->id}\n";
        exit(1);
    }
    if ($user->teamid != $team->id) {
        echo "Founder is not member of {$team->name}\n";
        return;
    }
    if (!$user->email_validated) {
        echo "the founder of {$team->name}, {$user->email_addr}, is not validated\n";
        return;
    }
    $user_email_munged = str_rot13($user->email_addr);
    fwrite($f, "<team>\n   <name>" . htmlspecialchars($team->name) . "</name>\n   <url>" . htmlspecialchars($team->url) . "</url>\n   <type>{$team->type}</type>\n   <name_html>" . htmlspecialchars($team->name_html) . "</name_html>\n   <description>\n" . htmlspecialchars($team->description) . "\n\t</description>\n   <country>{$team->country}</country>\n   <id>{$team->id}</id>\n   <user_email_munged>{$user_email_munged}</user_email_munged>\n   <user_name>" . htmlspecialchars($user->name) . "</user_name>\n   <user_country>" . htmlspecialchars($user->country) . "</user_country>\n   <user_postal_code>" . htmlspecialchars($user->postal_code) . "</user_postal_code>\n   <user_url>" . htmlspecialchars($user->url) . "</user_url>\n</team>\n");
}
开发者ID:Turante,项目名称:boincweb,代码行数:18,代码来源:team_export.php

示例10: show_admin_page

function show_admin_page($user, $team)
{
    page_head("Team administration for {$team->name}");
    echo "\r\n\t\t<ul>\r\n\t\t<li><a href=team_edit_form.php?teamid={$team->id}>Edit team info</a>\r\n\t\t\t<br><span class=note>Change team name, URL, description, type, or country</span>\r\n\t\t<li>\r\n\t\t\tMember list:\r\n\t\t<a href=team_email_list.php?teamid={$team->id}>HTML</a>\r\n\t\t| <a href=team_email_list.php?teamid={$team->id}&plain=1>text</a>\r\n\t\t\t<br><span class=note> View member names and email addresses </span>\r\n\t\t<li>View change history:\r\n\t\t\t<a href=team_delta.php?teamid={$team->id}>HTML</a>\r\n\t\t\t| <a href=team_delta.php?teamid={$team->id}&xml=1>XML</a>\r\n\t\t\t<br><span class=note>See when members joined or quit this team</span>\r\n\t";
    // founder-only stuff follows
    //
    if ($team->userid == $user->id) {
        $tokens = url_tokens($user->authenticator);
        if ($team->ping_user > 0) {
            $user2 = BoincUser::lookup_id($team->ping_user);
            $deadline = date_str(transfer_ok_time($team));
            echo "<li>\r\n\t\t\t\t<a href=team_change_founder_form.php?teamid={$team->id}><font color=red><b>Respond to foundership request</b></font></a>.  If you don't respond by {$deadline}, {$user2->name} may assume foundership of this team.\r\n\t\t\t";
        }
        echo "\r\n\t\t\t<li><a href=team_remove_inactive_form.php?teamid={$team->id}>Remove members</a>\r\n\t\t\t\t<br><span class=note>Remove inactive or unwanted members from this team</span>\r\n\t\t\t<li><a href=team_change_founder_form.php?teamid={$team->id}>Change founder</a>\r\n\t\t\t\t<br><span class=note>Transfer foundership to another member</span>\r\n\t\t\t<li><a href=team_admins.php?teamid={$team->id}>Add/remove Team Admins</a>\r\n\t\t\t\t<br><span class=note>Give selected team members Team Admin privileges</span>\r\n\r\n\t\t\t<li><a href=team_manage.php?teamid={$team->id}&action=delete&{$tokens}>Remove team</a>\r\n\t\t\t\t<br><span class=note>Allowed only if team has no members</a>\r\n\t\t\t<li><a href=team_forum.php?teamid={$team->id}&cmd=manage>Message board</a>\r\n\t\t\t\t<br><span class=note>Create or manage team message board</span>\r\n\t\t";
    }
    echo "\r\n\r\n\t\t<p>\r\n\t\t<li>\r\n\t\t\tTo have this team created on all BOINC projects\r\n\t\t\t(current and future) you can make it into a\r\n\t\t\t<a href=http://boinc.berkeley.edu/teams/>BOINC-wide team</a>.\r\n\t\t<li>\r\n\t\t\tTeam admins are encouraged to join and participate in the Google\r\n\t\t\t<a href=http://groups.google.com/group/boinc-team-founders>boinc-team-founders</a> group.\r\n\t\t<li>\r\n\t\t\tOther resources for BOINC team admins\r\n\t\t\tare available from a third-party site,\r\n\t\t\t<a href=http://www.boincteams.com>www.boincteams.com</a>.\r\n\t</ul>\r\n\t";
    page_tail();
}
开发者ID:Turante,项目名称:boincweb,代码行数:18,代码来源:team_manage.php

示例11: validate

function validate()
{
    $x = get_str("x");
    $u = get_int("u");
    $user = BoincUser::lookup_id($u);
    if (!$user) {
        error_page(tra("No such user."));
    }
    $x2 = $user->signature;
    if ($x2 != $x) {
        error_page(tra("Error in URL data - can't validate email address"));
    }
    $result = $user->update("email_validated=1");
    if (!$result) {
        error_page(tra("Database update failed - please try again later."));
    }
    page_head(tra("Validate email address"));
    echo tra("The email address of your account has been validated.");
    page_tail();
}
开发者ID:CalvinZhu,项目名称:boinc,代码行数:20,代码来源:validate_email_addr.php

示例12: notify_users

function notify_users()
{
    $now = time();
    $rs = BoltRefresh::enum("due_time < {$now}");
    $users = array();
    foreach ($rs as $r) {
        $view = BoltView::lookup_id($r->view_id);
        $user_id = $view->user_id;
        if (!key_exists($user_id)) {
            $user = BoincUser::lookup_id($user_id);
            BoltUser::lookup($user);
            $user->refresh = array();
            $users[$user_id] = $user;
        }
        $users[$user_id]->refresh[] = $r;
    }
    foreach ($users as $user) {
        notify_user($user);
    }
}
开发者ID:CalvinZhu,项目名称:boinc,代码行数:20,代码来源:bolt_refresh.php

示例13: process_batch

function process_batch($b)
{
    $app = BoincApp::lookup_id($b->app_id);
    if (!$app) {
        echo "no app for batch {$b->id}\n";
        return;
    }
    if ($b->fraction_done > 0 && $b->credit_canonical > 0) {
        $credit_total = $b->credit_canonical / $b->fraction_done;
        $fpops_total = $credit_total * (86400000000000.0 / 200);
    } else {
        $db = BoincDb::get();
        $fpops_total = $db->sum("workunit", "rsc_fpops_est*target_nresults", "where batch={$b->id}");
    }
    echo "batch {$b->id} fpops_total {$fpops_total}\n";
    if ($fpops_total == 0) {
        return;
    }
    // adjust the user's logical start time
    //
    $user = BoincUser::lookup_id($b->user_id);
    if (!$user) {
        die("no user {$b->user_id}\n");
    }
    $us = BoincUserSubmit::lookup_userid("{$user->id}");
    if (!$us) {
        die("no user submit record\n");
    }
    $lst = $us->logical_start_time;
    $cmd = "cd ../../bin; ./adjust_user_priority --user {$user->id} --flops {$fpops_total} --app {$app->name}";
    system($cmd);
    $us = BoincUserSubmit::lookup_userid("{$user->id}");
    $let = $us->logical_start_time;
    $let = (int) $let;
    // set the priority of workunits and results in this batch
    // to the user's new logical start time
    //
    $clause = "priority={$let} where batch={$b->id}";
    BoincResult::update_aux($clause);
    BoincWorkunit::update_aux($clause);
}
开发者ID:CalvinZhu,项目名称:boinc,代码行数:41,代码来源:submit_init_priority.php

示例14: show_row

function show_row($item, $apps, $is_team, $i)
{
    $j = $i % 2;
    if ($is_team) {
        $team = BoincTeam::lookup_id($item->teamid);
        if (!$team) {
            return;
        }
        $x = "<td>" . team_links($team) . "</td>\n";
    } else {
        $user = BoincUser::lookup_id($item->userid);
        if (!$user) {
            return;
        }
        $x = "<td>" . user_links($user, BADGE_HEIGHT_MEDIUM) . "</td>\n";
    }
    echo "<tr class=row{$j}>";
    echo "<td>{$i}</td>\n";
    echo $x;
    foreach ($apps as $app) {
        if ($app->id == $item->appid) {
            $c = $item;
        } else {
            if ($is_team) {
                $c = BoincCreditTeam::lookup("teamid={$item->teamid} and appid={$app->id}");
            } else {
                $c = BoincCreditUser::lookup("userid={$item->userid} and appid={$app->id}");
            }
            if (!$c) {
                $c = new StdClass();
                $c->expavg = 0;
                $c->total = 0;
            }
        }
        echo "<td align=right>" . format_credit($c->expavg) . "</td><td align=right>" . format_credit_large($c->total) . "</td>\n";
    }
    echo "</tr>\n";
}
开发者ID:CalvinZhu,项目名称:boinc,代码行数:38,代码来源:per_app_list.php

示例15: do_pass

function do_pass()
{
    $int_max = 2147483647;
    $now = time();
    $insts = BossaJobInst::enum("timeout < {$now}");
    if (!count($insts)) {
        return false;
    }
    foreach ($insts as $inst) {
        BossaDb::start_transaction();
        $inst = BossaJobInst::lookup_id($inst->id);
        // reread instance within transation
        if ($inst->transition_time < $now) {
            $job = BossaJob::lookup_id($inst->job_id);
            $user = BoincUser::lookup_id($inst->user_id);
            BossaUser::lookup($user);
            job_timed_out($job, $inst, $user);
        }
        $inst->update("timeout={$int_max}");
        BossaDb::commit();
    }
    return true;
}
开发者ID:CalvinZhu,项目名称:boinc,代码行数:23,代码来源:bossa_transitioner.php


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