diff --git a/checkin_notes b/checkin_notes index f377d1778c..2c40c126a4 100755 --- a/checkin_notes +++ b/checkin_notes @@ -13063,3 +13063,9 @@ David 1 Dec 2006 clientgui/ ViewStatistics.cpp,h + +David 1 Dec 2006 + - a bunch of changes to BOINC Help + + doc/ + help_* diff --git a/doc/download_other.php b/doc/download_other.php index 4a457e9c35..bd1492baa5 100644 --- a/doc/download_other.php +++ b/doc/download_other.php @@ -15,6 +15,11 @@ Read Installing the command-line client.

"; $site_list = array( +array( + "SETI@SummoneR.mikrocomp.hu", + "OpenBSD: amd64 (x86_64)", + "BOINC core client and SETI@home Enhanced non-graphical" +), array( "lunatics.at", "Linux and Windows/x86", diff --git a/doc/help.php b/doc/help.php index 7b9858ceac..c9bf10a959 100644 --- a/doc/help.php +++ b/doc/help.php @@ -3,7 +3,7 @@ require_once("docutil.php"); require_once("spoken_languages.php"); require_once("help_db.php"); -page_head("BOINC Online Help"); +page_head("BOINC Online Help (Beta)"); echo "

Need help?

@@ -21,7 +21,8 @@ BOINC Online Help is based on an Internet-based telephone system. Skype is free (both the software and the calls). If you don't already have Skype, please -download and install it. +download and install it now. +When you're finished, return to this page.

The best way to get help is by voice, for which you need either built-in microphone and speakers diff --git a/doc/help_db.php b/doc/help_db.php index 6ca1e9e79f..d117007d59 100644 --- a/doc/help_db.php +++ b/doc/help_db.php @@ -4,17 +4,67 @@ mysql_pconnect("localhost", "boincadm", null); mysql_select_db("support"); function rating_insert($r) { - $query = "insert into rating (volunteerid, rating, timestamp, comment) values ($r->volunteerid, $r->rating, $r->timestamp, '$r->comment')"; + $auth = mysql_real_escape_string($r->auth); + $comment = mysql_real_escape_string($r->comment); + $query = "insert into rating (volunteerid, rating, timestamp, auth, comment) values ($r->volunteerid, $r->rating, $r->timestamp, '$auth', '$comment')"; return mysql_query($query); } +function rating_update($r) { + $auth = mysql_real_escape_string($r->auth); + $comment = mysql_real_escape_string($r->comment); + $query = "update rating set rating=$r->rating, timestamp=$r->timestamp, comment='$comment' where volunteerid=$r->volunteerid and auth='$auth'"; + return mysql_query($query); +} + +function ratings_get($volid) { + $ratings = array(); + $query = "select * from rating where volunteerid=$volid order by timestamp desc"; + $result = mysql_query($query); + while ($r = mysql_fetch_object($result)) { + $ratings[] = $r; + } + mysql_free_result($result); + return $ratings; +} + +function rating_vol_auth($volid, $auth) { + $auth = mysql_real_escape_string($auth); + mysql_query("select * from rating where volunteerid=$vold and auth='$auth'"); +} + function vol_insert($vol) { + $password = mysql_real_escape_string($vol->password); + $email_addr = mysql_real_escape_string($vol->email_addr); + $country = mysql_real_escape_string($vol->country); + $skypeid = mysql_real_escape_string($vol->skypeid); + $lang1 = mysql_real_escape_string($vol->lang1); + $lang2 = mysql_real_escape_string($vol->lang2); + $specialties = mysql_real_escape_string($vol->specialties); + $projects = mysql_real_escape_string($vol->projects); + $availability = mysql_real_escape_string($vol->availability); + $query = "insert into volunteer (id, create_time, name, password, email_addr, country, skypeid, lang1, lang2, specialties, projects, availability, voice_ok, text_ok, timezone) values (0, $vol->create_time, '$vol->name', '$vol->password', '$vol->email_addr', '$vol->country', '$vol->skypeid', '$vol->lang1', '$vol->lang2', '$vol->specialties', '$vol->projects', '$vol->availability', $vol->voice_ok, $vol->text_ok, $vol->timezone)"; return mysql_query($query); } function vol_update($vol) { - $query = "update volunteer set name='$vol->name', password='$vol->password', email_addr='$vol->email_addr', country='$vol->country', skypeid='$vol->skypeid', lang1='$vol->lang1', lang2='$vol->lang2', specialties='$vol->specialties', projects='$vol->projects', availability='$vol->availability', voice_ok=$vol->voice_ok, text_ok=$vol->text_ok, timezone=$vol->timezone where id=$vol->id"; + $password = mysql_real_escape_string($vol->password); + $email_addr = mysql_real_escape_string($vol->email_addr); + $country = mysql_real_escape_string($vol->country); + $skypeid = mysql_real_escape_string($vol->skypeid); + $lang1 = mysql_real_escape_string($vol->lang1); + $lang2 = mysql_real_escape_string($vol->lang2); + $specialties = mysql_real_escape_string($vol->specialties); + $projects = mysql_real_escape_string($vol->projects); + $availability = mysql_real_escape_string($vol->availability); + + $query = "update volunteer set name='$vol->name', password='$vol->password', email_addr='$vol->email_addr', country='$vol->country', skypeid='$vol->skypeid', lang1='$vol->lang1', lang2='$vol->lang2', specialties='$vol->specialties', projects='$vol->projects', availability='$availability', voice_ok=$vol->voice_ok, text_ok=$vol->text_ok, timezone=$vol->timezone where id=$vol->id"; + return mysql_query($query); +} + +function vol_update_rating($vol, $rating) { + $query = "update volunteer set nratings=nratings+1, rating_sum=rating_sum+$rating where id=$vol->id"; return mysql_query($query); } @@ -59,7 +109,7 @@ function get_languages() { $langs[] = $lang->lang1; } mysql_free_result($result); - $result = mysql_query("select lang2 from volunteer"); + $result = mysql_query("select lang2 from volunteer where lang2<>''"); while ($lang = mysql_fetch_object($result)) { $langs[] = $lang->lang2; } diff --git a/doc/help_funcs.php b/doc/help_funcs.php index fd9bc15137..daad306df2 100644 --- a/doc/help_funcs.php +++ b/doc/help_funcs.php @@ -70,26 +70,27 @@ function checkbox($name, $val) { function yesno($name, $val) { if ($val) { return " - yes - no + yes + no "; } else { return " - yes - no + yes + no "; } } -function star_select($name) { +function star_select($name, $val) { $x = ""; for ($i=0; $i<6; $i++) { $text = ""; if ($i==0) $text="No"; if ($i==5) $text="Yes"; + $selected = ($val==$i)?"selected":""; $x .= " -
+
$text "; } diff --git a/doc/help_lang.php b/doc/help_lang.php index 538fe49f49..17ebe2d655 100644 --- a/doc/help_lang.php +++ b/doc/help_lang.php @@ -25,16 +25,54 @@ function vol_modes($vol) { } } +function rating_info($vol) { + if ($vol->nratings == 0) { + return "(no ratings)"; + } + $x = $vol->rating_sum/$vol->nratings; + if ($x > 4.5) $img = "stars-5-0.gif"; + else if ($x > 4.0) $img = "stars-4-5.gif"; + else if ($x > 3.5) $img = "stars-4-0.gif"; + else if ($x > 3.0) $img = "stars-3-5.gif"; + else if ($x > 2.5) $img = "stars-3-0.gif"; + else if ($x > 2.0) $img = "stars-2-5.gif"; + else if ($x > 1.5) $img = "stars-2-0.gif"; + else if ($x > 1.0) $img = "stars-1-5.gif"; + else if ($x > 0.5) $img = "stars-1-0.gif"; + else if ($x > 0.0) $img = "stars-0-5.gif"; + else $img = "stars-0-0.gif"; + return " + id> + + + $vol->nratings ratings + "; +} + +function info($vol) { + $x = " Country: $vol->country\n"; + if ($vol->availability) { + $x .= "
Usual hours: $vol->availability"; + } + if ($vol->specialities) { + $x .= "
Specialties: $vol->specialties"; + } + if ($vol->projects) { + $x .= "
Projects: $vol->projects"; + } + $x .= "
"; + return $x; +} + function show_vol($vol) { $status = skype_status($vol->skypeid); $image = button_image($status); list_item_array(array( vol_info($vol), - vol_modes($vol), status_string($status), - $vol->specialties, - $vol->availability, - "", + vol_modes($vol), + info($vol), + rating_info($vol) )); } @@ -42,11 +80,10 @@ function show_vols($vols) { list_start("border=0"); list_heading_array(array( "Volunteer name
click to contact", - "Voice/Text", "Status", - "Specialties", - "Usual hours", - "Average rating", + "Voice/Text", + "Info", + "Feedback
Click to see comments", )); foreach ($vols as $vol) { show_vol($vol); diff --git a/doc/help_schema.sql b/doc/help_schema.sql index c753336bfe..db8c9c5e21 100644 --- a/doc/help_schema.sql +++ b/doc/help_schema.sql @@ -1,19 +1,21 @@ create table volunteer ( id integer not null auto_increment, create_time integer not null, - name varchar(254) not null, - password varchar(254) not null, - email_addr varchar(254) not null, - country varchar(254) not null, - skypeid varchar(254) not null, - lang1 varchar(254) not null, - lang2 varchar(254) not null, - specialties varchar(254) not null, - projects varchar(254) not null, - availability varchar(254) not null, + name char(64) not null, + password char(32) not null, + email_addr char(100) not null, + country char(64) not null, + skypeid char(64) not null, + lang1 char(32) not null, + lang2 char(32) not null, + specialties char(128) not null, + projects char(128) not null, + availability char(128) not null, voice_ok tinyint not null, text_ok tinyint not null, timezone integer not null, + nratings integer not null, + rating_sum integer not null, primary key(id) ); @@ -21,9 +23,14 @@ create table rating ( volunteerid integer not null, rating integer not null, timestamp integer not null, + auth char(32) not null, comment text not null ); alter table volunteer add unique(email_addr), add unique(name); + +alter table rating + add index rvt(volunteerid, timestamp), + add index vauth(volunteerid, auth); diff --git a/doc/help_vol.php b/doc/help_vol.php index 7bb285b817..92d17555b2 100644 --- a/doc/help_vol.php +++ b/doc/help_vol.php @@ -8,18 +8,18 @@ $volid = $_GET['volid']; $vol = vol_lookup($volid); -function live_contact($vol) { +function live_contact($vol, $rating) { $skypeid = $vol->skypeid; echo "

Contact $vol->name live using Skype

"; if ($vol->voice_ok) { - echo " Call $vol->name on Skype + echo " Call $vol->name on Skype "; } if ($vol->text_ok) { - echo "

Chat with $vol->name on Skype + echo "

Chat with $vol->name on Skype "; } @@ -33,8 +33,11 @@ function live_contact($vol) { "; list_start(); - list_item("Rating
Would you recommend $vol->name to people seeking help with BOINC?", star_select("rating")); - list_item("Comments", textarea("comment", "")); + list_item( + "Rating
Would you recommend $vol->name to people seeking help with BOINC?", + star_select("rating", $rating->rating) + ); + list_item("Comments", textarea("comment", $rating->comment)); list_item("", ""); list_end(); echo " @@ -62,6 +65,10 @@ function email_contact($vol) { $send_email = $_GET['send_email']; $rate = $_GET['rate']; +session_set_cookie_params(86400*365); +session_start(); +$uid = session_id(); + if ($send_email) { $volid = $_GET['volid']; $vol = vol_lookup($volid); @@ -86,32 +93,52 @@ if ($send_email) { if (!$vol) { error_page("No such volunteer $volid"); } - $rating = (int)$_GET['rating']; + $x = $_GET['rating']; + if (!$x) { + error_page("no rating given"); + } + $rating = (int) $x; if ($rating < 0 || $rating > 5) { error_page("bad rating"); } - $comment = mysql_real_escape_string($_GET['comment']); + $comment = stripslashes($_GET['comment']); $r = null; $r->volunteerid = $volid; $r->rating = $rating; $r->timestamp = time(); $r->comment = $comment; - $retval = rating_insert($r); + $r->auth = $uid; + if ($uid) { + $retval = rating_update($r); + if (!$retval) { + $retval = rating_insert($r); + } + } else { + $retval = rating_insert($r); + } if (!$retval) { + echo mysql_error(); error_page("database error"); } + vol_update_rating($vol, $rating); page_head("Feedback recorded"); - echo "Your feedback has been recorded. Thanks."; + echo "Your feedback has been recorded. Thanks. +

+ Return to BOINC Help. + "; page_tail(); } else { page_head("Contact $vol->name"); $status = skype_status($vol->skypeid); $image = button_image($status); echo " +

"; if (online($status)) { - live_contact($vol); + $rating = rating_vol_auth($vol, $uid); + if (!$rating) $rating->rating = -1; + live_contact($vol, $rating); } email_contact($vol); page_tail(); diff --git a/doc/help_vol_edit.php b/doc/help_vol_edit.php index 5810c8b8bc..17c379c68d 100644 --- a/doc/help_vol_edit.php +++ b/doc/help_vol_edit.php @@ -74,24 +74,24 @@ function print_form($vol, $action_name) { } function get_form_data() { - $vol->name = mysql_real_escape_string($_GET['volname']); + $vol->name = stripslashes($_GET['volname']); if (!$vol->name) error_page("Name must not be blank"); - $vol->password = mysql_real_escape_string($_GET['password']); + $vol->password = stripslashes($_GET['password']); if (!$vol->password) error_page("Password must not be blank"); - $vol->email_addr = mysql_real_escape_string($_GET['email_addr']); + $vol->email_addr = stripslashes($_GET['email_addr']); if (!$vol->email_addr) error_page("Email address must not be blank"); - $vol->skypeid = mysql_real_escape_string($_GET['skypeid']); + $vol->skypeid = stripslashes($_GET['skypeid']); if (!$vol->skypeid) error_page("Skype ID must not be blank"); - $vol->lang1 = mysql_real_escape_string($_GET['lang1']); + $vol->lang1 = stripslashes($_GET['lang1']); if (!$vol->lang1) error_page("Primary language must not be blank"); if (!is_spoken_language($vol->lang1)) error_page("Not a language"); - $vol->lang2 = mysql_real_escape_string($_GET['lang2']); + $vol->lang2 = stripslashes($_GET['lang2']); if (!is_spoken_language($vol->lang2)) error_page("Not a language"); - $vol->country = mysql_real_escape_string($_GET['country']); + $vol->country = stripslashes($_GET['country']); if (!is_valid_country($vol->country)) error_page("Bad country"); - $vol->specialties = mysql_real_escape_string($_GET['specialties']); - $vol->projects = mysql_real_escape_string($_GET['projects']); - $vol->availability = mysql_real_escape_string($_GET['availability']); + $vol->specialties = stripslashes($_GET['specialties']); + $vol->projects = stripslashes($_GET['projects']); + $vol->availability = stripslashes($_GET['availability']); $vol->voice_ok = $_GET['voice_ok']?1:0; $vol->text_ok = $_GET['text_ok']?1:0; return $vol; @@ -130,6 +130,10 @@ if ($create == 'OK') { page_head("Registration finished"); echo " Thanks - you're now registered as a BOINC Help Volunteer. +

+ If later you want to change your account information, + go to the Help page + and click on the link at the bottom of the page. "; } page_tail(); @@ -151,8 +155,8 @@ if ($create == 'OK') { echo "\n"; page_tail(); } else if ($edit_form == "OK") { - $email_addr = mysql_real_escape_string($_GET['email_addr']); - $password = mysql_real_escape_string($_GET['password']); + $email_addr = stripslashes($_GET['email_addr']); + $password = stripslashes($_GET['password']); $vol = vol_lookup_email($email_addr); if (!$vol) { error_page("Bad email address $email_addr"); @@ -174,8 +178,8 @@ if ($create == 'OK') { echo "\n"; page_tail(); } else if ($edit_action) { - $old_email_addr = mysql_real_escape_string($_GET['old_email_addr']); - $old_password = mysql_real_escape_string($_GET['old_password']); + $old_email_addr = stripslashes($_GET['old_email_addr']); + $old_password = stripslashes($_GET['old_password']); $vol = vol_lookup_email($old_email_addr); if (!$vol) { error_page("Bad email address $old_email_addr"); diff --git a/doc/help_volunteer.php b/doc/help_volunteer.php index c29cb9a1b4..caadfbd263 100644 --- a/doc/help_volunteer.php +++ b/doc/help_volunteer.php @@ -23,11 +23,11 @@ There are many reasons why such people would resist, or have difficulty, participating in volunteer computing:

Web-based support for BOINC - FAQs, message boards, web pages - @@ -48,10 +48,9 @@ is ineffective for many people. Inevitably, we write in a technical language that not everyone understands. By providing one-on-one, real-time interactive support, preferably by voice, -we can assess the knowledge and experience of the user, -we can give advice at the right level -and in the right language, -and we can make their experience with BOINC successful and happy. +we can assess the knowledge and experience of an individual user, +we can give advice at the right level and in the right language, +and we can make their experience with BOINC successful and enjoyable.

In this way we can start to reach the remaining 99.9% of the world's computer users, @@ -68,9 +67,10 @@ on the Q&A message boards of a BOINC-based project.

  • Have a computer with Skype (preferably with a headset for voice communication, though text-only is OK too). -
  • Be willing to answer questions patiently and courteously. -
  • Be available for help calls on a regular basis +Install the current version (2.0 or later) of Skype. +
  • Be available to handle calls on a regular basis (a few hours a week, or whatever you can spare). +
  • Be willing to answer questions patiently and courteously.
  • Be willing to spend some additional time researching problems that you can't solve immediately.
  • Handle help emails in a timely manner. @@ -86,13 +86,19 @@ When you're 'on call', run Skype under your Help account (you can switch accounts using the File/Sign Out menu).

    -IMPORTANT: your Skype 'Help account' must allow its status -to be visible on the web. -To do this: log on in Skype. -Select to Tools/Options menu. +IMPORTANT: your Skype 'Help account' must make its status +visible on the web. +To do this: run Skype and log in to your Help account. +

    +

    What if you want to accept calls from either your regular Skype ID or your Help ID? @@ -128,12 +134,12 @@ but users will be able to post to it through a web interface). For each call: