function send_founder_transfer_email($team, $user) { $founder = lookup_user_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\r\ntransfer foundership of {$team->name}.\r\nPlease go [url=" . URL_BASE . "team_change_founder_form.php?teamid={$team->id}]here[/url] to grant or decline the request.\r\n\t\r\nIf you do not respond within 60 days, " . $user->name . " will\r\nbe allowed to become the team founder.\r\n"; pm_send($founder, $subject, $body, false); $subject = PROJECT . " team founder transfer"; $body = "Team member " . $user->name . " has asked that you\r\ntransfer foundership of {$team->name} in " . PROJECT . ".\r\nPlease visit\r\n" . URL_BASE . "team_change_founder_form.php?teamid=" . $team->id . "\r\nto grant or decline the request.\r\n\t\r\nIf you do not respond within 60 days, " . $user->name . " will\r\nbe allowed to become the team founder.\r\n\t\r\nPlease do not respond to this email.\r\nThe mailbox is not monitored and the email\r\nwas sent using an automated system."; return send_email($founder, $subject, $body); }
function validate() { $x = get_str("x"); $u = get_int("u"); $user = lookup_user_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(); }
db_init(); // need to do this in any case, // since show_user_summary_public() etc. accesses DB // The page may be presented in many different languages, // so here we cache the data instead // $cache_args = "userid=" . $id; $cached_data = get_cached_data(USER_PAGE_TTL, $cache_args); if ($cached_data) { // We found some old but non-stale data, let's use it $data = unserialize($cached_data); $user = $data->user; $community_links = $data->clo; } else { // No data was found, generate new data for the cache and store it $user = lookup_user_id($id); BoincForumPrefs::lookup($user); $user = @get_other_projects($user); $community_links = get_community_links_object($user); $data->user = $user; $data->clo = $community_links; set_cached_data(USER_PAGE_TTL, serialize($data), $cache_args); } if (!$user->id) { error_page("No such user"); } $logged_in_user = get_logged_in_user(false); page_head($user->name); start_table(); echo "<tr><td valign=top>"; start_table();
function build_alpha_pages() { global $alphabet; $query = "select userid from profile"; $result = mysql_query($query); $numIds = 0; while ($profile = mysql_fetch_object($result)) { $user = lookup_user_id($profile->userid); if (!$user) { continue; } if ($user->name) { $name = ltrim($user->name); $members[strtoupper($name[0])][] = $user->id; $numIds++; } } mysql_free_result($result); //echo "$numIds users have profiles AND non-null country entries.<br>"; $letters = array_keys($members); foreach ($letters as $letter) { // NOTE: Array indexing is case sensitive. $filePath = PROFILE_PATH; if (in_array($letter, $alphabet)) { build_profile_pages($members[$letter], "User Profiles - Names beginning with {$letter}", "Names beginning with {$letter}", 5, 2, $filePath, "profile_{$letter}"); } else { build_profile_pages($members[$letter], "User Profiles - Names beginning with other characters", "Names beginning with other characters", 5, 2, $filePath, "profile_other"); } $letters_used[$letter] = 1; } build_alpha_summary_page($letters_used); }
mysql_free_result($uresult); if (!$user) { echo "Can't find user {$host->userid}\n"; continue; } handle_user($user, 'lapsed'); } mysql_free_result($result); } if (!$USE_PHPMAILER) { echo "You must use PHPMailer (http://phpmailer.sourceforge.net)\n"; exit; } $email_files = read_email_files(); if ($globals->userid) { $user = lookup_user_id($globals->userid); if (!$user) { echo "No such user: {$globals->userid}\n"; exit; } $user->last_rpc_time = last_rpc_time($user); mail_type($user, 'failed'); mail_type($user, 'lapsed'); } else { if ($globals->do_failed) { do_failed(); } if ($globals->do_lapsed) { do_lapsed(); } }
if (parse_bool($config, "disable_account_creation")) { echo "\n <h1>" . tra("Account creation is disabled") . "</h1>\n <p>" . tra("Account creation is currently disabled. Please try again later.") . "</p>\n "; page_tail(); exit; } // CMC check for RAMP $isramp = strstr($next_url, "ramp"); $nwac = parse_bool($config, "no_web_account_creation"); if (!$wac && !$isramp && !no_computing()) { echo "<p>\n <b>" . tra("NOTE: If you use the BOINC Manager, don't use this form. Just run BOINC, select Add Project, and enter an email address and password.") . "</b></p>\n "; } echo "\n <p>\n <form action=\"create_account_action.php\" method=\"post\">\n <input type=hidden name=next_url value=\"{$next_url}\">\n"; $teamid = get_int("teamid", true); if ($teamid) { $team = lookup_team($teamid); $user = lookup_user_id($team->userid); if (!$user) { echo "No such user"; } else { echo "<b>" . tra("This account will belong to the team %1 and will have the project preferences of its founder.", "<a href=\"team_display.php?teamid={$team->id}\">{$team->name}</a>") . "</b><p>"; echo "\n <input type=\"hidden\" name=\"teamid\" value=\"{$teamid}\">\n "; } } start_table(); // Using invitation codes to restrict access? // if (defined('INVITE_CODES')) { row2(tra("Invitation Code") . "<br><span class=\"description\">" . tra("A valid invitation code is required to create an account.") . "</span>", "<input type=\"text\" name=\"invite_code\" size=\"30\" >"); } row2(tra("Name") . "<br><span class=\"description\">" . tra("Identifies you on our web site. Use your real name or a nickname.") . "</span>", "<input type=\"text\" name=\"new_name\" size=\"30\">"); row2(tra("Email Address") . "<br><span class=\"description\">" . tra("Must be a valid address of the form 'name@domain'.") . "</span>", "<input type=\"text\" name=\"new_email_addr\" size=\"50\">");
function show_profile_link2($profile, $n) { $user = lookup_user_id($profile->userid); echo "<tr><td>" . user_links($user) . "</td><td>" . date_str($user->create_time) . "</td><td>{$user->country}</td><td>" . (int) $user->total_credit . "</td><td>" . (int) $user->expavg_credit . "</td></tr>\n"; }
// Copyright (C) 2008 University of California // // BOINC is free software; you can redistribute it and/or modify it // under the terms of the GNU Lesser General Public License // 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/uotd.inc"; require_once "../inc/profile.inc"; check_get_args(array()); db_init(); $profile = get_current_uotd(); if (!$profile) { echo tra("No user of the day has been chosen."); } else { $d = gmdate("d F Y", time()); $user = lookup_user_id($profile->userid); page_head(tra("User of the Day for %1: %2", $d, $user->name)); start_table(); show_profile($user, get_logged_in_user(false)); end_table(); } page_tail();
function do_send($logged_in_user) { global $replyto, $userid; check_banished($logged_in_user); check_tokens($logged_in_user->authenticator); $to = sanitize_tags(post_str("to", true)); $subject = post_str("subject", true); $content = post_str("content", true); if (post_str("preview", true) == tra("Preview")) { pm_form($replyto, $userid); } if ($to == null || $subject == null || $content == null) { pm_form($replyto, $userid, tra("You need to fill all fields to send a private message")); } else { if (!akismet_check($logged_in_user, $content)) { pm_form($replyto, $userid, tra("Your message was flagged as spam\n by the Akismet anti-spam system.\n Please modify your text and try again.")); } $to = str_replace(", ", ",", $to); // Filter out spaces after separator $users = explode(",", $to); $userlist = array(); $userids = array(); // To prevent from spamming a single user by adding it multiple times foreach ($users as $username) { $user = explode(" ", $username); if (is_numeric($user[0])) { // user ID is gived $userid = $user[0]; $user = lookup_user_id($userid); if ($user == null) { pm_form($replyto, $userid, tra("Could not find user with id %1", $userid)); } } else { $user = lookup_user_name($username); if ($user == null) { pm_form($replyto, $userid, tra("Could not find user with username %1", $username)); } elseif ($user == -1) { // Non-unique username pm_form($replyto, $userid, tra("%1 is not a unique username; you will have to use user ID", $username)); } } BoincForumPrefs::lookup($user); if (is_ignoring($user, $logged_in_user)) { pm_form($replyto, $userid, tra("User %1 (ID: %2) is not accepting private messages from you.", $user->name, $user->id)); } if ($userids[$user->id] == null) { $userlist[] = $user; $userids[$user->id] = true; } } foreach ($userlist as $user) { if (!is_moderator($logged_in_user, null)) { check_pm_count($logged_in_user->id); } pm_send($logged_in_user, $user, $subject, $content, true); } Header("Location: pm.php?action=inbox&sent=1"); } }