From efa7b7a3ad7c74b6719a9cd488d4aa45e3a3e1ca Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 19 Sep 2006 12:57:57 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=11175 --- checkin_notes | 22 ++ doc/logo.php | 3 +- html/inc/email.inc | 12 +- html/ops/make_fake_tables.php | 41 --- html/ops/migrate_tables.php | 327 -------------------- html/ops/mungetest.php | 15 - html/user/edit_forum_preferences_action.php | 30 +- 7 files changed, 46 insertions(+), 404 deletions(-) delete mode 100755 html/ops/make_fake_tables.php delete mode 100755 html/ops/migrate_tables.php delete mode 100755 html/ops/mungetest.php diff --git a/checkin_notes b/checkin_notes index a9f3a8fc99..6058783780 100755 --- a/checkin_notes +++ b/checkin_notes @@ -10304,6 +10304,12 @@ Walt 18 Sept 2006 clientgui/ BOINCDialupManager.cpp +David 18 Sept 2006 + - core client: bug in config file error message printfs + + client/ + log_flags.C + Eric K 18 Sept 2006 - Fixed stack corruption that occurs if stderr contains a c format code. Bug reported by Nicolas Alvarez. @@ -10325,3 +10331,19 @@ Charlie 19 Sept 2006 mac_build/ boinc.xcodeproj/ project.pbxproj + +David 19 Sept 2006 + - update account-created email + - user web: use $_POST instead of $_HTTP_POST_VARS. + The latter doesn't work in PHP 5 + (from Christian Beer) + + html/ + inc/ + email.inc + ops/ + make_fake_tables.php (removed) + migrate_tables.php (removed) + mungetest.php (removed) + user/ + edit_forum_preferences_action.php diff --git a/doc/logo.php b/doc/logo.php index e925139a7c..9c03baf53f 100644 --- a/doc/logo.php +++ b/doc/logo.php @@ -19,7 +19,8 @@ An icon for BOINC-related Podcasts, from Christian Beer:

-The 'B in a circle' icon was designed by Tim Lan. +The 'B in a circle' icon +was designed by Tim Lan. The Mac variant was contributed by Juho Viitasalo.

New BOINC logo?

diff --git a/html/inc/email.inc b/html/inc/email.inc index f854ed7962..3a0abcb78d 100644 --- a/html/inc/email.inc +++ b/html/inc/email.inc @@ -79,25 +79,27 @@ function send_auth_email($user, $is_new) { This email confirms your account with ".PROJECT.": Project URL: $master_url - Account Key: $user->authenticator - User name: $user->name E-mail: $user->email_addr + Account Key: $user->authenticator + (use this to log in if you forget your password) "; } else { $subject = PROJECT." information for $user->name"; $body = "Your ".PROJECT." account information is: - Project URL: $master_url - Account Key: $user->authenticator + Project URL: $master_url User name: $user->name E-mail: $user->email_addr + Account Key: $user->authenticator + (use this to log in if you forget your password) "; } $body .= " -For further information and assistance with ".PROJECT." go to $master_url +For further information and assistance with ".PROJECT." go to +$master_url "; return send_email($user, $subject, $body); } diff --git a/html/ops/make_fake_tables.php b/html/ops/make_fake_tables.php deleted file mode 100755 index 74a2dafe3f..0000000000 --- a/html/ops/make_fake_tables.php +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/local/bin/php - Team $i! |\n"; - fwrite($fd, $line); -} - -fclose($fd); -?> diff --git a/html/ops/migrate_tables.php b/html/ops/migrate_tables.php deleted file mode 100755 index 695afa438b..0000000000 --- a/html/ops/migrate_tables.php +++ /dev/null @@ -1,327 +0,0 @@ -#!/usr/local/bin/php -id; - $new_userid = $row->id; - } else if ($feedback_field_map[$i] == 'has_picture') { - - // Because the userid field comes before the picture - // field in the feedback file, we know that $new_userid - // will have been set by the time we get here. - move_user_pic($feedback_data[$i], $new_userid); - $feedback_data[$i] = '1'; - } - - print $feedback_field_map[$i] . ": " . addslashes(clean_newlines(trim($feedback_data[$i]))) . "\n"; - - if (!$first_field) { - $query = $query . ", "; - } else { - $first_field = false; - } - $query = $query . $feedback_field_map[$i] . " = '" . addslashes(clean_newlines(trim($feedback_data[$i]))) . "'"; - } - } - - echo "QUERY: $query\n"; - mysql_query($query); - $num++; - } - fclose($fd); - $num = 1; - - print "Migrating team table...\n"; - - // Team table - $fd = fopen(TEAM_FILE, 'r'); - if (!$fd) { - echo "Error opening '", TEAM_FILE, "' - exiting.\n"; - exit(); - } - - while ($team_data = get_row($fd, $team_field_map, '|')) { - print "\nTeam Record #$num\n----------\n"; - $query = "INSERT INTO team SET "; - $first_field = true; - - for ($i = 0; $i < count($team_field_map); $i++) { - if (!is_null($team_field_map[$i]) && !is_null($team_data) && !empty($team_data[$i])) { - - // Translate old userID -> new userID - if ($team_field_map[$i] == 'userid') { - - $result = mysql_query("SELECT * FROM user WHERE seti_id = " . $team_data[$i]); - if ($result) { - $row = mysql_fetch_object($result); - } else { - print "DB error.\n"; - exit(); - } - - $team_data[$i] = $row->id; - } - - print $team_field_map[$i] . ": " . addslashes(clean_newlines(trim($team_data[$i]))) . "\n"; - - if (!$first_field) { - $query = $query . ", "; - } else { - $first_field = false; - } - $query = $query . $team_field_map[$i] . " = '" . addslashes(clean_newlines(trim($team_data[$i]))) . "'"; - } - } - echo "QUERY: $query\n"; - mysql_query($query); - $num++; - } - fclose($fd); - - // Wrapping up. - print "Re-linking team IDs and sending notification emails...\n"; - - $result = mysql_query("SELECT * FROM user WHERE seti_id IS NOT NULL"); - - while ($user = mysql_fetch_object($result)) { - // Relink team ID. - if (!is_null($user->teamid)) { - $result2 = mysql_query("SELECT * FROM team WHERE seti_id = " . $user->teamid); - $team = mysql_fetch_object($result2); - $result2 = mysql_query("UPDATE user SET teamid = " . $team->id . " WHERE id = " . $user->id); - } - - // Send out email. - split_munged_email_addr($user->email_addr, $user->authenticator, $address); - - $body = "Your SETI@Home account has been transferred to BOINC. Your authenticator is\n\n" . $user->authenticator; - //mail($address, "Your SETI@Home BOINC account is ready!", $body); - - } - - print "Migration Complete.\n"; - -} - -function clean_newlines($string) { - return ereg_replace('\\\0d\\\0a', "\n", $string); -} - -/** Flat file traversal functions - */ - - -function get_row($descriptor, $keys, $delim) { - $data = NULL; - $empty = true; - - for ($i=0; $i < count($keys); $i++) { - $field = get_next_field($descriptor, $delim); - if (!is_null($keys[$i])) { - $data[$i] = $field; - if (!empty($field)) $empty = false; - } - } - - if ($empty) { - return NULL; - } - - return $data; -} - -function get_next_field($descriptor, $delim) { - $data = NULL; - $pos = 0; - while (($char = fgetc($descriptor)) !== FALSE) { - if ($char == $delim) { - if (!($pos > 0 && $data[($pos-1)] == '\\')) { - return $data; - } - } - $data = $data . $char; - $pos++; - } - return NULL; -} -/** Functions copied over from util.inc - */ - -function random_string() { - return md5(uniqid(rand())); -} - -function munge_email_addr($email, $string) { - return "@".$email."_".$string; -} - -// if email_addr is of the form @X_Y, split out the X and return true. -// otherwise return false -// -function split_munged_email_addr($addr, $string, &$email) { - if (substr($addr, 0, 1) != "@") return false; - $x = strrchr($addr, "_"); - if (!$x) return false; - $y = substr($x, 1); - if ($y != $string) return false; - $email = substr($addr, 1, strlen($addr)-strlen($x)-1); - return true; -} - -function jd_to_unix($raw_jd) { - $jd = floor($raw_jd); - $jtime = $raw_jd - $jd; - - $total_secs = 86400 * ($raw_jd - $jd); - - $hours = floor($total_secs / 3600); - $minutes = floor(($total_secs - (3600 * $hours)) / 60); - $seconds = floor(($total_secs - (3600 * $hours) - (60 * $minutes))); - -// Calculate Gregorian date - $l = $jd + 68569; - $n = floor(( 4 * $l ) / 146097); - $l = $l - floor((146097 * $n + 3 ) / 4); - $i = floor(( 4000 * ( $l + 1 ) ) / 1461001); - $l = floor($l - ( 1461 * $i ) / 4 + 31); - $j = floor(( 80 * $l ) / 2447); - $d = floor($l - ( 2447 * $j ) / 80); - $l = floor($j / 11); - $m = $j + 2 - ( 12 * $l ); - $y = 100 * ( $n - 49 ) + $i + $l; - - return mktime($hours, $minutes, $seconds, $m, $d, $y); -} - -function move_user_pic($img_name, $userid) { - $img_name = trim($img_name); - - $filename = SETI_IMAGE_PATH . $img_name; - $filename_sm = SETI_IMAGE_PATH . 'sm_' . $img_name; - - if (file_exists($filename)) { - $dotpos = strrpos($img_name, "."); - $name = substr($img_name, 0, $dotpos); - $ext = strrchr($img_name, "."); - - if ($ext == '.jpg' || $ext == '.jpeg') { - shell_exec("cp $filename " . BOINC_IMAGE_PATH . $userid . ".jpg"); - shell_exec("cp $filename_sm " . BOINC_IMAGE_PATH . $userid . "_sm.jpg"); - return true; - } else if ($ext == '.png' || $ext == '.gif') { - shell_exec("convert $filename jpg:" . BOINC_IMAGE_PATH . $userid . ".jpg"); - shell_exec("convert $filename_sm jpg:" . BOINC_IMAGE_PATH . $userid . "_sm.jpg"); - return true; - } else { - print "Failed to move image $filename"; - return false; - } - } - print "Image $filename does not exist!\n"; - return false; -} diff --git a/html/ops/mungetest.php b/html/ops/mungetest.php deleted file mode 100755 index 25ce91c1c0..0000000000 --- a/html/ops/mungetest.php +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/local/bin/php - diff --git a/html/user/edit_forum_preferences_action.php b/html/user/edit_forum_preferences_action.php index df731c2d2e..1c79958d7c 100644 --- a/html/user/edit_forum_preferences_action.php +++ b/html/user/edit_forum_preferences_action.php @@ -19,7 +19,7 @@ if (post_str("action", true)=="reset"){ $special_user = $user->getSpecialUser(); $dbhandler->deleteUserPrefs($user); $user->resetPrefs(); - $user->setPostcount($post_count); // Recreate postcount + $user->setPostcount($post_count); // Recreate postcount $user->setSpecialUser($special_user); // And recreate special user bitfield Header("Location: edit_forum_preferences_form.php"); exit; @@ -60,13 +60,13 @@ if ($avatar_type==0){ $user->setAvatar($avatar_url); // Update some simple prefs that are either on or off -$images_as_links = ($HTTP_POST_VARS["forum_images_as_links"]!=""); -$link_externally = ($HTTP_POST_VARS["forum_link_externally"]!=""); -$hide_avatars = ($HTTP_POST_VARS["forum_hide_avatars"]!=""); -$hide_signatures = ($HTTP_POST_VARS["forum_hide_signatures"]!=""); -$jump_to_unread = ($HTTP_POST_VARS["forum_jump_to_unread"]!=""); -$ignore_sticky_posts = ($HTTP_POST_VARS["forum_ignore_sticky_posts"]!=""); -$signature_by_default = ($HTTP_POST_VARS["signature_enable"]!=""); +$images_as_links = ($_POST["forum_images_as_links"]!=""); +$link_externally = ($_POST["forum_link_externally"]!=""); +$hide_avatars = ($_POST["forum_hide_avatars"]!=""); +$hide_signatures = ($_POST["forum_hide_signatures"]!=""); +$jump_to_unread = ($_POST["forum_jump_to_unread"]!=""); +$ignore_sticky_posts = ($_POST["forum_ignore_sticky_posts"]!=""); +$signature_by_default = ($_POST["signature_enable"]!=""); $user->setImagesAsLinks($images_as_links); $user->setLinkPopup($link_externally); $user->setHideAvatars($hide_avatars); @@ -82,7 +82,7 @@ $user->setLowRatingThreshold($low_rating_threshold); $user->setHighRatingThreshold($high_rating_threshold); // Update the signature for this user -$signature = sanitize_html(stripslashes($HTTP_POST_VARS["signature"])); +$signature = sanitize_html(stripslashes($_POST["signature"])); if (strlen($signature)>250) { error_page("Your signature was too long, please keep it less than 250 chars"); } @@ -95,20 +95,20 @@ $user->setForumSortStyle($forum_sort); $user->setThreadSortStyle($thread_sort); // Add users to the ignore list if any users are defined -$add_user_to_filter = ($HTTP_POST_VARS["add_user_to_filter"]!=""); +$add_user_to_filter = ($_POST["add_user_to_filter"]!=""); if ($add_user_to_filter){ - $user_to_add = trim($HTTP_POST_VARS["forum_filter_user"]); + $user_to_add = trim($_POST["forum_filter_user"]); if ($user_to_add!="" and $user_to_add==strval(intval($user_to_add))){ - $user->addIgnoredUser(newUser($user_to_add)); + $user->addIgnoredUser(newUser($user_to_add)); } } // Or remove some from the ignore list $ignored_users = $user->getIgnorelist(); for ($i=0;$iremoveIgnoredUser(newUser($ignored_users[$i])); + if ($_POST["remove".trim($ignored_users[$i])]!=""){ + //this user will be removed and no longer ignored + $user->removeIgnoredUser(newUser($ignored_users[$i])); } } // Update preferences for the "Display only the Y last posts if there are more than X posts in the thread" feature