mirror of https://github.com/BOINC/boinc.git
parent
4f2896d760
commit
0f79afb5d4
171
html/user/db.inc
171
html/user/db.inc
|
@ -1,5 +1,8 @@
|
|||
<?php
|
||||
|
||||
// database-related functions.
|
||||
// Presentation code (HTML) shouldn't be here
|
||||
|
||||
function db_init() {
|
||||
$retval = mysql_pconnect();
|
||||
if (!$retval) {
|
||||
|
@ -24,172 +27,4 @@ function lookup_user_auth($auth) {
|
|||
}
|
||||
}
|
||||
|
||||
function show_platform($platform) {
|
||||
start_table();
|
||||
row("ID", $platform->id);
|
||||
row("created", time_str($platform->create_time));
|
||||
row("name", $platform->name);
|
||||
echo "</table>";
|
||||
}
|
||||
|
||||
function show_app($app) {
|
||||
start_table();
|
||||
row("ID", $app->id);
|
||||
row("created", time_str($app->create_time));
|
||||
row("name", $app->name);
|
||||
row("alpha version", $app->alpha_vers);
|
||||
row("beta version", $app->beta_vers);
|
||||
row("production version", $app->prod_vers);
|
||||
row("result template", "<pre>".htmlspecialchars($app->result_xml_template)."</pre>");
|
||||
echo "</table>";
|
||||
}
|
||||
|
||||
function show_app_version($app_version) {
|
||||
start_table();
|
||||
row("ID", $app_version->id);
|
||||
row("created", time_str($app_version->create_time));
|
||||
row("app ID", $app_version->appid);
|
||||
row("version num", $app_version->version_num);
|
||||
row("platform ID", $app_version->platformid);
|
||||
row("XML doc", "<pre>".htmlspecialchars($app_version->xml_doc)."</pre>");
|
||||
row("min_core_version", $app_version->min_core_version);
|
||||
row("max_core_version", $app_version->max_core_version);
|
||||
row("message", $app_version->message);
|
||||
row("deprecated", $app_version->deprecated);
|
||||
echo "</table>";
|
||||
}
|
||||
|
||||
function show_host($host) {
|
||||
|
||||
echo TABLE2."\n";
|
||||
echo "<tr>Below is information on all the hosts you have running the BOINC core client.";
|
||||
echo "<p>";
|
||||
echo "<tr>".TD2.LG_FONT."<b>Host Information:</b></font></td></tr>\n";
|
||||
row("<b>IP address: </b>", "$host->last_ip_addr<br>(same the last $host->nsame_ip_addr times)");
|
||||
row("<b>Domain name: <b>", $host->domain_name);
|
||||
$x = $host->timezone/3600;
|
||||
row("<b>Time zone: </b>", "UTC - $x hours");
|
||||
row("<b>Created: </b>", time_str($host->create_time));
|
||||
row("<b>Total Credit:(specific to project) </b>", $host->total_credit);
|
||||
row("<b>Recent Averaged Credit:(credits per second) </b>", $host->expavg_credit);
|
||||
row("<b>CPU: </b>", "$host->p_vendor $host->p_model");
|
||||
row("<b>Number of CPUs: </b>", $host->p_ncpus);
|
||||
row("<b>Operating System: </b>", "$host->os_name $host->os_version");
|
||||
$x = $host->m_nbytes/(1024*1024);
|
||||
$y = round($x, 2);
|
||||
row("<b>Memory: </b>", "$y MB");
|
||||
$x = $host->m_cache/1024;
|
||||
$y = round($x, 2);
|
||||
row("<b>Cache: </b>", "$y KB");
|
||||
$x = $host->m_swap/(1024*1024);
|
||||
$y = round($x, 2);
|
||||
row("<b>Swap Space: </b>", "$y MB");
|
||||
$x = $host->d_total/(1024*1024*1024);
|
||||
$y = round($x, 2);
|
||||
row("<b>Total Disk Space: </b>", "$y GB");
|
||||
$x = $host->d_free/(1024*1024*1024);
|
||||
$y = round($x, 2);
|
||||
row("<b>Free Disk Space: </b>", "$y GB");
|
||||
row("<b>Avg network bandwidth:<br>(upstream) </b>", "$host->n_bwup bytes/sec");
|
||||
row("<b>Avg network bandwidth:<br>(downstream) </b>", "$host->n_bwdown bytes/sec");
|
||||
row("<b>Number of times client has contacted server: </b>", $host->rpc_seqno);
|
||||
row("<b>Last time contacted server: </b>", time_str($host->rpc_time));
|
||||
row("<b>% of time client on: </b>", 100*$host->on_frac." %");
|
||||
row("<b>% of time host connected: </b>", 100*$host->connected_frac." %");
|
||||
row("<b>% of time user active: </b>", 100*$host->active_frac." %");
|
||||
echo "</table>\n";
|
||||
|
||||
}
|
||||
|
||||
function show_workunit($wu) {
|
||||
start_table();
|
||||
row("created", time_str($wu->create_time));
|
||||
row("name", $wu->name);
|
||||
row("XML doc", "<pre>".htmlspecialchars($wu->xml_doc)."</pre>");
|
||||
row("app ID", $wu->appid);
|
||||
row("batch", $wu->batch);
|
||||
row("FP operations", $wu->rsc_fpops);
|
||||
row("integer operations", $wu->rsc_iops);
|
||||
row("memory requirement", $wu->rsc_memory);
|
||||
row("disk requirement", $wu->rsc_disk);
|
||||
row("dynamic results", $wu->dynamic_results?"yes":"no");
|
||||
row("max_results", $wu->max_results);
|
||||
row("nresults", $wu->nresults);
|
||||
row("nresults_unsent", $wu->nresults_unsent);
|
||||
row("nresults_done", $wu->nresults_done);
|
||||
row("nresults_fail", $wu->nresults_fail);
|
||||
echo "</table>";
|
||||
}
|
||||
|
||||
function res_state_string($s) {
|
||||
switch($s) {
|
||||
case 1: return "inactive";
|
||||
case 2: return "unsent";
|
||||
case 3: return "in progress";
|
||||
case 4: return "done";
|
||||
case 5: return "timeout";
|
||||
case 6: return "error";
|
||||
}
|
||||
}
|
||||
|
||||
function show_result($result) {
|
||||
start_table();
|
||||
row("created", time_str($result->create_time));
|
||||
row("name", $result->name);
|
||||
row("workunit ID", $result->workunitid);
|
||||
row("state", res_state_string($result->state));
|
||||
row("host ID", $result->hostid);
|
||||
row("sent", time_str($result->sent_time));
|
||||
row("received", time_str($result->received_time));
|
||||
row("exit status", $result->exit_status);
|
||||
row("CPU time", $result->cpu_time);
|
||||
row("XML doc in", "<pre>".htmlspecialchars($result->xml_doc_in)."</pre>");
|
||||
row("XML doc out", "<pre>".htmlspecialchars($result->xml_doc_out)."</pre>");
|
||||
row("stderr out", "<pre>".htmlspecialchars($result->stderr_out)."</pre>");
|
||||
row("batch", $result->batch);
|
||||
row("validated", $result->validated);
|
||||
echo "</table>";
|
||||
}
|
||||
|
||||
function show_user_stats($user, $project) {
|
||||
echo TABLE2."\n";
|
||||
echo "<tr>".TD2.LG_FONT."<b>User Stats:</b></font></td></tr>\n";
|
||||
row("<b>User ID: </b>", $user->id);
|
||||
$row = sprintf("<b>%s user since: </b>", $project);
|
||||
row($row, time_str($user->create_time));
|
||||
row("<b>Total credit: </b>", $user->total_credit);
|
||||
row("<b>Recent averaged credit: </b>", $user->expavg_credit);
|
||||
if ($user->teamid) {
|
||||
$result = mysql_query("select * from team where id = $user->teamid");
|
||||
$team = mysql_fetch_object($result);
|
||||
row("<b>Member of team: </b>", "<a href=team_display.php?id=$team->id>$team->name</a>");
|
||||
} else {
|
||||
row("<b>Member of team: </b>", "You are currently not part of a team");
|
||||
}
|
||||
echo "</table>\n";
|
||||
}
|
||||
|
||||
function show_user_profile($user) {
|
||||
echo TABLE2."\n";
|
||||
echo "<tr>".TD2.LG_FONT."<b>User Information:</b></font></td></tr>\n";
|
||||
row("<b>User name: </b>", $user->name);
|
||||
row("<b>Email address: <b>", $user->email_addr);
|
||||
row("<b>Country: </b>", $user->country);
|
||||
row("<b>Postal (ZIP) code: </b>", $user->postal_code);
|
||||
echo "<tr><td align=right><a href=edit_user_info.php>Edit User Information</a></td>\n";
|
||||
echo "<td align=center><a href=change_password.php>Change Password</a></td></tr>\n";
|
||||
echo "</table>\n";
|
||||
}
|
||||
|
||||
function show_team($team) {
|
||||
start_table();
|
||||
row("ID", $team->id);
|
||||
row("founder", $team->userid);
|
||||
row("name", $team->name);
|
||||
row("url", $team->url);
|
||||
row("type", $team->type);
|
||||
row("name_html", $team->name_html);
|
||||
row("description", $team->description);
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -3,28 +3,25 @@
|
|||
function platform_downloads($platform, $core_app) {
|
||||
$result = mysql_query("select * from app_version where platformid=$platform->id and appid=$core_app->id");
|
||||
|
||||
if (!$result) return;
|
||||
echo "<tr><td><b>$platform->name</b></td></tr>\n";
|
||||
while ($app_version = mysql_fetch_object($result)) {
|
||||
$version = sprintf("<a href=dl_%s_%s.php>BOINC core client,<b> version %s.</b></a>",
|
||||
$platform->name, $app_version->version_num, $app_version->version_num);
|
||||
$version = sprintf(
|
||||
"<a href=dl_%s_%s.php>BOINC core client,<b> version %s.</b></a>",
|
||||
$platform->name, $app_version->version_num,
|
||||
$app_version->version_num
|
||||
);
|
||||
echo "<tr><td>      $version</td></tr>\n";
|
||||
//$app_version->md5_cksum";
|
||||
}
|
||||
mysql_free_result($result);
|
||||
}
|
||||
|
||||
require_once("db.inc");
|
||||
require_once("util.inc");
|
||||
|
||||
db_init();
|
||||
page_head("Download the BOINC Core Client");
|
||||
|
||||
printf(
|
||||
TABLE2."\n"
|
||||
."<tr><td><br></td></tr>\n"
|
||||
."<tr><td><b>To select the right core client for your computer, click on the download\n"
|
||||
."link corresponding to the name of your operating system.</b></td></tr>\n"
|
||||
."<tr>".TD2.LG_FONT."<b>To Download:</b></font></td></tr>\n"
|
||||
);
|
||||
page_head("Download the BOINC client");
|
||||
|
||||
$result = mysql_query("select * from app where name='core_client'");
|
||||
$core_app = mysql_fetch_object($result);
|
||||
|
@ -34,7 +31,7 @@ function platform_downloads($platform, $core_app) {
|
|||
while ($platform = mysql_fetch_object($result)) {
|
||||
platform_downloads($platform, $core_app);
|
||||
}
|
||||
mysql_free_result($result);
|
||||
echo "</table>\n";
|
||||
page_tail();
|
||||
mysql_free_result($result);
|
||||
?>
|
||||
|
|
|
@ -50,33 +50,33 @@ function print_change_password($user) {
|
|||
function print_update_ok($e_ok) {
|
||||
if ($e_ok == EMAIL_EXISTS) {
|
||||
printf(
|
||||
TABLE2."\n"
|
||||
."<tr><td>There's already an account with that email address. Click the <b>Back</b> button\n"
|
||||
." on your browser to edit your information, or <a href=login.php>login </a>to your \n"
|
||||
.$project." account.</td></tr>\n"
|
||||
."<tr><td>Any other changes you've made, if any, were successfully updated.</td></tr>\n"
|
||||
."</table>\n"
|
||||
TABLE2."\n"
|
||||
."<tr><td>There's already an account with that email address. Click the <b>Back</b> button\n"
|
||||
." on your browser to edit your information, or <a href=login.php>login </a>to your \n"
|
||||
.$project." account.</td></tr>\n"
|
||||
."<tr><td>Any other changes you've made, if any, were successfully updated.</td></tr>\n"
|
||||
."</table>\n"
|
||||
);
|
||||
} else if ($e_ok == EMAIL_FAIL) {
|
||||
printf(
|
||||
TABLE2."\n"
|
||||
."<tr><td>Your email address failed to be updated. Click the <b>Back</b> button\n"
|
||||
." on your browser to edit your information, or try again later.</td></tr>\n"
|
||||
."<tr><td>Any other changes you've made, if any, were successfully updated.</td></tr>\n"
|
||||
."</table>\n"
|
||||
TABLE2."\n"
|
||||
."<tr><td>Your email address failed to be updated. Click the <b>Back</b> button\n"
|
||||
." on your browser to edit your information, or try again later.</td></tr>\n"
|
||||
."<tr><td>Any other changes you've made, if any, were successfully updated.</td></tr>\n"
|
||||
."</table>\n"
|
||||
);
|
||||
} else if ($e_ok == EMAIL_UPDATED) {
|
||||
printf(
|
||||
TABLE2."\n"
|
||||
."<tr><td>Your information was successfully updated. A new, temporary password will be sent to the\n"
|
||||
." email address you provided. You must use this new password the next time you login.</td></tr>\n"
|
||||
."</table>\n"
|
||||
TABLE2."\n"
|
||||
."<tr><td>Your information was successfully updated. A new, temporary password will be sent to the\n"
|
||||
." email address you provided. You must use this new password the next time you login.</td></tr>\n"
|
||||
."</table>\n"
|
||||
);
|
||||
} else {
|
||||
printf(
|
||||
TABLE2."\n"
|
||||
."<tr><td>Your information was successfully updated.</td></tr>\n"
|
||||
."</table>\n"
|
||||
TABLE2."\n"
|
||||
."<tr><td>Your information was successfully updated.</td></tr>\n"
|
||||
."</table>\n"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -84,33 +84,33 @@ function print_update_ok($e_ok) {
|
|||
function print_update_fail($e_ok) {
|
||||
if ($e_ok == EMAIL_EXISTS) {
|
||||
printf(
|
||||
TABLE2."\n"
|
||||
."<tr><td>There's already an account with that email address. Click the <b>Back</b> button\n"
|
||||
." on your browser to edit your information, or <a href=login.php>login </a>to your \n"
|
||||
.$project." account. </td></tr>\n"
|
||||
."<tr><td>Any other changes you've made, if any, failed to be updated. Please try again later.</td></tr>\n"
|
||||
."</table>\n"
|
||||
TABLE2."\n"
|
||||
."<tr><td>There's already an account with that email address. Click the <b>Back</b> button\n"
|
||||
." on your browser to edit your information, or <a href=login.php>login </a>to your \n"
|
||||
.$project." account. </td></tr>\n"
|
||||
."<tr><td>Any other changes you've made, if any, failed to be updated. Please try again later.</td></tr>\n"
|
||||
."</table>\n"
|
||||
);
|
||||
} else if ($e_ok == EMAIL_FAIL) {
|
||||
printf(
|
||||
TABLE2."\n"
|
||||
."<tr><td>Your information failed to be updated. Click the <b>Back</b> button\n"
|
||||
." on your browser to edit your information, or try again later.</td></tr>\n"
|
||||
."</table>\n"
|
||||
TABLE2."\n"
|
||||
."<tr><td>Your information failed to be updated. Click the <b>Back</b> button\n"
|
||||
." on your browser to edit your information, or try again later.</td></tr>\n"
|
||||
."</table>\n"
|
||||
);
|
||||
} else if ($e_ok == EMAIL_UPDATED) {
|
||||
printf(
|
||||
TABLE2."\n"
|
||||
."<tr><td>Your email address was successfully updated. A new, temporary password will be sent to the\n"
|
||||
." email address you provided. You must use this new password the next time you login.</td></tr>\n"
|
||||
."<tr><td>Any other changes you've made, if any, failed to be updated. Please try again later.</td></tr>\n"
|
||||
."</table>\n"
|
||||
TABLE2."\n"
|
||||
."<tr><td>Your email address was successfully updated. A new, temporary password will be sent to the\n"
|
||||
." email address you provided. You must use this new password the next time you login.</td></tr>\n"
|
||||
."<tr><td>Any other changes you've made, if any, failed to be updated. Please try again later.</td></tr>\n"
|
||||
."</table>\n"
|
||||
);
|
||||
} else {
|
||||
printf(
|
||||
TABLE2."\n"
|
||||
."<tr><td>Your information failed to be updated. Please try again later.</td></tr>\n"
|
||||
."</table>\n"
|
||||
TABLE2."\n"
|
||||
."<tr><td>Your information failed to be updated. Please try again later.</td></tr>\n"
|
||||
."</table>\n"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,15 +4,15 @@
|
|||
require_once("db.inc");
|
||||
require_once("login.inc");
|
||||
|
||||
// show the home page of whoever's logged in
|
||||
|
||||
db_init();
|
||||
$user = get_user_from_cookie();
|
||||
if ($user) {
|
||||
$head = sprintf("%s's User Page", $user->name);
|
||||
page_head($head);
|
||||
show_user_page($user, PROJECT);
|
||||
page_head($user->name);
|
||||
show_user_page_private($user);
|
||||
page_tail();
|
||||
} else {
|
||||
page_head("Log in");
|
||||
print_login_form();
|
||||
}
|
||||
page_tail();
|
||||
?>
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?php
|
||||
|
||||
require_once("util.inc");
|
||||
require_once("db.inc");
|
||||
|
||||
|
@ -23,29 +22,21 @@
|
|||
?>
|
||||
|
||||
<p>
|
||||
This distributed computing project is running on the BOINC software platform. BOINC is a software platform for public-participation distributed computing projects. Users are allowed
|
||||
to simultaneously participate in multiple projects and to choose how to allocate their resources
|
||||
for each project.
|
||||
This distributed computing project is running on the BOINC software platform.
|
||||
BOINC is a software platform for public-participation distributed
|
||||
computing projects.
|
||||
Users are allowed to simultaneously participate in multiple projects
|
||||
and to choose how to allocate their resources for each project.
|
||||
|
||||
<h3>Joining Sample Project</h3>
|
||||
First, <a href=create_account.php>create an account</a>, setting your preferences to specify how much your computer should be
|
||||
working on this project. You may view your user page to see how much credit you have accumulated as your
|
||||
participation proceeds. In addition, you may update your user information or modify your preferences
|
||||
through your user page at anytime to reallocate your resources among the different projects you may
|
||||
be involved in.
|
||||
<p>
|
||||
When creating you account the project will send you an authenticator to the email specified. After successfully
|
||||
creating an account <a href=download.php>download the core client</a>. In order to run the core client you must cut and paste in the
|
||||
authenticator provided in the email sent to you by the project.
|
||||
<h3>Joining Other Projects</h3>
|
||||
|
||||
When you join subsequent projects make sure to edit your project preferences for your home project
|
||||
(the first BOINC supported project you joined) accordingly. You will need to update project preferences with each new project you join. You will be asked to provide the authenticator for each
|
||||
project so make sure to cut and paste those in from the emails sent to you. This will inform other projects
|
||||
of the other projects you are involved in, allowing you to participate in all of them simultaneously.
|
||||
<p>
|
||||
If this is not the first project you are joining, make sure to edit the project preferences of your home
|
||||
project.
|
||||
<h3>Joining this project</h3>
|
||||
First, <a href=create_account.php>create an account</a>.
|
||||
You will be sent an authenticator
|
||||
to the email specified.
|
||||
After successfully creating an account,
|
||||
<a href=download.php>download the BOINC client</a>.
|
||||
Install and run the client.
|
||||
When it asks you for authenticator,
|
||||
cut and paste the authenticator from the email.
|
||||
|
||||
<ul>
|
||||
<li><a href=create_account.php>Create account</a></li>
|
||||
|
@ -54,8 +45,5 @@ project.
|
|||
<li><a href=home.php>User home page</a></li> - view stats, modify preferences
|
||||
<li><a href=team.php>Teams</a></li> - join sample distributed computing project community
|
||||
</ul>
|
||||
<!--
|
||||
<scheduler>http://maggie.ssl.berkeley.edu/barry-cgi/cgi</scheduler>
|
||||
-->
|
||||
</td></tr></table>
|
||||
</body>
|
||||
|
|
|
@ -1,30 +1,31 @@
|
|||
<?php
|
||||
|
||||
function print_login_form() {
|
||||
printf(
|
||||
page_head("Log in");
|
||||
echo(
|
||||
"<form method=post action=login_action.php>\n"
|
||||
.TABLE2."\n"
|
||||
."<tr><td colspan=2><b>Enter the email address and password of your account to login:</b></td></tr>\n"
|
||||
."<tr><td><br></td></tr>\n"
|
||||
."<tr>\n"
|
||||
." <td align=right>Email Address</td>\n"
|
||||
." <td> <input name=existing_email type=text size=40></td>\n"
|
||||
."</tr>\n"
|
||||
."<tr>\n"
|
||||
." <td align=right>Password</td>\n"
|
||||
." <td> <input name=existing_password type=password></td>\n"
|
||||
."</tr>\n"
|
||||
."<tr>\n"
|
||||
." <td><br></td>\n"
|
||||
." <td><input type=submit name=old value=\"Log in\"></td>\n"
|
||||
."</tr>\n"
|
||||
."</table>\n"
|
||||
."</form>\n"
|
||||
."<br>\n"
|
||||
.TABLE2."\n"
|
||||
."<tr><td>If you don't have an account, please <a href=create_account.php>create a new one</a></td</tr>\n"
|
||||
."</table>\n"
|
||||
);
|
||||
.TABLE2."\n
|
||||
<tr><td colspan=2><b>Enter the email address and password of your account to login:</b></td></tr>\n
|
||||
<tr><td><br></td></tr>\n
|
||||
<tr>\n
|
||||
<td align=right>Email Address</td>\n
|
||||
<td> <input name=existing_email type=text size=40></td>\n
|
||||
</tr>\n
|
||||
<tr>\n
|
||||
<td align=right>Password</td>\n
|
||||
<td> <input name=existing_password type=password></td>\n
|
||||
</tr>\n
|
||||
<tr>\n
|
||||
<td><br></td>\n
|
||||
<td><input type=submit name=old value=\"Log in\"></td>\n
|
||||
</tr>\n
|
||||
</table>\n
|
||||
</form>\n
|
||||
<br>\n
|
||||
.TABLE2."\n
|
||||
<tr><td>If you don't have an account, please <a href=create_account.php>create a new one</a></td</tr>\n
|
||||
</table>\n";
|
||||
page_tail();
|
||||
}
|
||||
|
||||
function print_create_account_form() {
|
||||
|
@ -69,7 +70,7 @@ function print_create_account_form() {
|
|||
." <td><select name=country>\n"
|
||||
|
||||
);
|
||||
print_country_select();
|
||||
print_country_select();
|
||||
printf(
|
||||
" </select>\n"
|
||||
." </td>\n"
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
} else {
|
||||
setcookie("auth", $user->authenticator, time()+100000000);
|
||||
page_head("User Page");
|
||||
show_user_page($user, PROJECT);
|
||||
show_user_page_private($user);
|
||||
}
|
||||
} else if (strlen($HTTP_POST_VARS["new"])) {
|
||||
$query = sprintf(
|
||||
|
@ -87,23 +87,25 @@
|
|||
if ($result) {
|
||||
setcookie("auth", $authenticator);
|
||||
page_head("Creating Account");
|
||||
printf(
|
||||
TABLE2."\n"
|
||||
."<tr><td>Account has been created successfully. In order to run the client you will need a BOINC key. A key will be sent to \n"
|
||||
."the email address you provided, and you can simply copy and paste the key, which will be a string of letters and numbers, \n"
|
||||
."in the location indicated when you run the client.</td></tr>\n"
|
||||
."<tr><td><br><br></td></tr>\n"
|
||||
."<tr><td><a href=download.php>Download core client</a></td></tr>\n"
|
||||
."</table>\n"
|
||||
);
|
||||
echo( TABLE2."\n
|
||||
<tr><td>
|
||||
Your account has been created successfully.
|
||||
In order to run the client you will need a BOINC key.
|
||||
A key will be sent to the email address you provided,
|
||||
and you can simply copy and paste the key,
|
||||
which will be a string of letters and numbers,
|
||||
in the location indicated when you run the client.
|
||||
</td></tr>\n
|
||||
<tr><td><br><br></td></tr>\n
|
||||
<tr><td><a href=download.php>Download core client</a></td></tr>\n
|
||||
</table>\n";
|
||||
mail($email_addr, "BOINC key", "Your BOINC key is " . $authenticator);
|
||||
} else {
|
||||
page_head("Creating Account");
|
||||
printf(
|
||||
TABLE2."\n"
|
||||
."<tr><td>Couldn't create account. Please try again later.</td></tr>\n"
|
||||
."</table>\n"
|
||||
);
|
||||
echo(TABLE2."\n
|
||||
<tr><td>Couldn't create account.
|
||||
Please try again later.</td></tr>\n
|
||||
</table>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,13 +5,54 @@
|
|||
require_once("login.inc");
|
||||
require_once("user.inc");
|
||||
|
||||
function show_host($host) {
|
||||
|
||||
echo TABLE2."\n";
|
||||
echo "<tr>Below is information on all the hosts you have running the BOINC core client.";
|
||||
echo "<p>";
|
||||
echo "<tr>".TD2.LG_FONT."<b>Host Information:</b></font></td></tr>\n";
|
||||
row("<b>IP address: </b>", "$host->last_ip_addr<br>(same the last $host->nsame_ip_addr times)");
|
||||
row("<b>Domain name: <b>", $host->domain_name);
|
||||
$x = $host->timezone/3600;
|
||||
row("<b>Time zone: </b>", "UTC - $x hours");
|
||||
row("<b>Created: </b>", time_str($host->create_time));
|
||||
row("<b>Total Credit:(specific to project) </b>", $host->total_credit);
|
||||
row("<b>Recent Averaged Credit:(credits per second) </b>", $host->expavg_credit);
|
||||
row("<b>CPU: </b>", "$host->p_vendor $host->p_model");
|
||||
row("<b>Number of CPUs: </b>", $host->p_ncpus);
|
||||
row("<b>Operating System: </b>", "$host->os_name $host->os_version");
|
||||
$x = $host->m_nbytes/(1024*1024);
|
||||
$y = round($x, 2);
|
||||
row("<b>Memory: </b>", "$y MB");
|
||||
$x = $host->m_cache/1024;
|
||||
$y = round($x, 2);
|
||||
row("<b>Cache: </b>", "$y KB");
|
||||
$x = $host->m_swap/(1024*1024);
|
||||
$y = round($x, 2);
|
||||
row("<b>Swap Space: </b>", "$y MB");
|
||||
$x = $host->d_total/(1024*1024*1024);
|
||||
$y = round($x, 2);
|
||||
row("<b>Total Disk Space: </b>", "$y GB");
|
||||
$x = $host->d_free/(1024*1024*1024);
|
||||
$y = round($x, 2);
|
||||
row("<b>Free Disk Space: </b>", "$y GB");
|
||||
row("<b>Avg network bandwidth:<br>(upstream) </b>", "$host->n_bwup bytes/sec");
|
||||
row("<b>Avg network bandwidth:<br>(downstream) </b>", "$host->n_bwdown bytes/sec");
|
||||
row("<b>Number of times client has contacted server: </b>", $host->rpc_seqno);
|
||||
row("<b>Last time contacted server: </b>", time_str($host->rpc_time));
|
||||
row("<b>% of time client on: </b>", 100*$host->on_frac." %");
|
||||
row("<b>% of time host connected: </b>", 100*$host->connected_frac." %");
|
||||
row("<b>% of time user active: </b>", 100*$host->active_frac." %");
|
||||
echo "</table>\n";
|
||||
|
||||
}
|
||||
db_init();
|
||||
$user = get_user_from_cookie();
|
||||
page_head("Hosts stats");
|
||||
if ($user) {
|
||||
page_head("Hosts stats");
|
||||
show_hosts($user);
|
||||
page_tail();
|
||||
} else {
|
||||
print_login_form();
|
||||
}
|
||||
page_tail();
|
||||
?>
|
||||
|
|
|
@ -3,442 +3,445 @@
|
|||
require_once("util.inc");
|
||||
require_once("db.inc");
|
||||
|
||||
function print_teams_display() {
|
||||
function show_team($team) {
|
||||
start_table();
|
||||
row("ID", $team->id);
|
||||
row("founder", $team->userid);
|
||||
row("name", $team->name);
|
||||
row("url", $team->url);
|
||||
row("type", $team->type);
|
||||
row("name_html", $team->name_html);
|
||||
row("description", $team->description);
|
||||
}
|
||||
|
||||
page_head("Teams");
|
||||
echo "<table width=780>";
|
||||
echo "<tr><td><h2>BOINC Teams</h2></td></tr>";
|
||||
echo "<tr><td>";
|
||||
echo "<p>";
|
||||
echo "BOINC users may form "teams" - ";
|
||||
echo "for example, students in a school, employees of a company, etc. ";
|
||||
echo "<p>";
|
||||
echo "Teams may compete against other teams to analyze the most data, ";
|
||||
echo "or they may meet and discuss BOINC projects via the web. ";
|
||||
echo "Team members may view their individual records and compare ";
|
||||
echo "personals statistics with other team members' statistics, in addition ";
|
||||
echo "to viewing their team's total statistics on the team's statistics page.";
|
||||
echo "<p>";
|
||||
echo "<br>";
|
||||
echo "To create a team click on the below link. ";
|
||||
echo "Team founder's have more privileges than normal team members.";
|
||||
echo "<p>";
|
||||
echo "<a href=team_create_form.php>Create a new team</a>";
|
||||
echo "<p>";
|
||||
echo "<br>";
|
||||
echo "<br>";
|
||||
echo "To search for a team type in the team name below and hit the Search button. ";
|
||||
echo "You may join teams through these team pages.";
|
||||
echo "<p>";
|
||||
echo "It may be more effective to type in only a portion of the team name ";
|
||||
echo "and choose from the search results in order to assure ";
|
||||
echo "that you do not overlook a variation of the team. ";
|
||||
echo "(i.e. If you work for a team affiliated with Apple Computer, Inc. it will be more effective ";
|
||||
echo "to search for \"Apple\" and to choose fromt eh search results than to search for the entire name of the company.)";
|
||||
echo "<p>";
|
||||
echo "<form method=post action=team_lookup.php>";
|
||||
echo "Search for a team: ";
|
||||
echo "<input name=team_name>";
|
||||
echo "<input type=submit name=search value=\"Search\">";
|
||||
echo "</form>";
|
||||
echo "</td></tr></table>";
|
||||
page_tail();
|
||||
function print_teams_display() {
|
||||
page_head("Teams");
|
||||
echo "<table width=780>";
|
||||
echo "<tr><td><h2>BOINC Teams</h2></td></tr>";
|
||||
echo "<tr><td>";
|
||||
echo "<p>";
|
||||
echo "BOINC users may form "teams" - ";
|
||||
echo "for example, students in a school, employees of a company, etc. ";
|
||||
echo "<p>";
|
||||
echo "Teams may compete against other teams to analyze the most data, ";
|
||||
echo "or they may meet and discuss BOINC projects via the web. ";
|
||||
echo "Team members may view their individual records and compare ";
|
||||
echo "personals statistics with other team members' statistics, in addition ";
|
||||
echo "to viewing their team's total statistics on the team's statistics page.";
|
||||
echo "<p>";
|
||||
echo "<br>";
|
||||
echo "To create a team click on the below link. ";
|
||||
echo "Team founder's have more privileges than normal team members.";
|
||||
echo "<p>";
|
||||
echo "<a href=team_create_form.php>Create a new team</a>";
|
||||
echo "<p>";
|
||||
echo "<br>";
|
||||
echo "<br>";
|
||||
echo "To search for a team type in the team name below and hit the Search button. ";
|
||||
echo "You may join teams through these team pages.";
|
||||
echo "<p>";
|
||||
echo "It may be more effective to type in only a portion of the team name ";
|
||||
echo "and choose from the search results in order to assure ";
|
||||
echo "that you do not overlook a variation of the team. ";
|
||||
echo "(i.e. If you work for a team affiliated with Apple Computer, Inc. it will be more effective ";
|
||||
echo "to search for \"Apple\" and to choose fromt eh search results than to search for the entire name of the company.)";
|
||||
echo "<p>";
|
||||
echo "<form method=post action=team_lookup.php>";
|
||||
echo "Search for a team: ";
|
||||
echo "<input name=team_name>";
|
||||
echo "<input type=submit name=search value=\"Search\">";
|
||||
echo "</form>";
|
||||
echo "</td></tr></table>";
|
||||
page_tail();
|
||||
}
|
||||
|
||||
function display_team_page($team) {
|
||||
|
||||
page_head("$team->name");
|
||||
if ($team->name_html != null) {
|
||||
page_head("$team->name");
|
||||
if ($team->name_html != null) {
|
||||
echo "<p>";
|
||||
echo "$team->name_html";
|
||||
}
|
||||
echo "<p>";
|
||||
echo "$team->name_html";
|
||||
}
|
||||
echo "<p>";
|
||||
echo "[<a href=team_join_form.php?id=$team->id><b>Join</b></a>] ";
|
||||
echo "[<a href=team_quit_form.php?id=$team->id><b>Quit</b></a>] ";
|
||||
echo "[<a href=team_edit_form.php?id=$team->id><b>Edit*</b></a>] ";
|
||||
echo "[<a href=team_remove_inactive_form.php?id=$team->id><b>Remove Inactive Members*</b></a>] ";
|
||||
echo "[<a href=team_disband_form.php?id=$team->id><b>Disband Team*</b></a>] ";
|
||||
echo "[<a href=team_email_list.php?id=$team->id><b>View Team Emails*</b></a>]";
|
||||
echo "<br><font size=2>* Team founder only</font>";
|
||||
echo "<table width=780>";
|
||||
echo "<tr><td>";
|
||||
echo "<ul>";
|
||||
echo "<li>Anyone may join a team at any time.</li>";
|
||||
echo "<li>Likewise, anyone may quit a team at any time.</li>";
|
||||
echo "<li>Only the team founder may edit a team's fields (i.e. name, html code, ";
|
||||
echo "description, etc.).</li>";
|
||||
echo "<li>In addition, team founder's have the right of removing inactive members ";
|
||||
echo "from a team.</li>";
|
||||
echo "<li>Only the team founder may disband a team, however, in order to successfully disband a ";
|
||||
echo "team all members of the team must no longer be members of the team, including the team founder. ";
|
||||
echo "Then the team founder may go to the team page and disband the team. ";
|
||||
echo "A team may not be disbanded if it still has members.</li>";
|
||||
echo "<li>Finally, the team founder has access to all team members' email addresses.</li>";
|
||||
echo "</ul>";
|
||||
echo "</td></tr></table>";
|
||||
echo "[<a href=team_join_form.php?id=$team->id><b>Join</b></a>] ";
|
||||
echo "[<a href=team_quit_form.php?id=$team->id><b>Quit</b></a>] ";
|
||||
echo "[<a href=team_edit_form.php?id=$team->id><b>Edit*</b></a>] ";
|
||||
echo "[<a href=team_remove_inactive_form.php?id=$team->id><b>Remove Inactive Members*</b></a>] ";
|
||||
echo "[<a href=team_disband_form.php?id=$team->id><b>Disband Team*</b></a>] ";
|
||||
echo "[<a href=team_email_list.php?id=$team->id><b>View Team Emails*</b></a>]";
|
||||
echo "<br><font size=2>* Team founder only</font>";
|
||||
echo "<table width=780>";
|
||||
echo "<tr><td>";
|
||||
echo "<ul>";
|
||||
echo "<li>Anyone may join a team at any time.</li>";
|
||||
echo "<li>Likewise, anyone may quit a team at any time.</li>";
|
||||
echo "<li>Only the team founder may edit a team's fields (i.e. name, html code, ";
|
||||
echo "description, etc.).</li>";
|
||||
echo "<li>In addition, team founder's have the right of removing inactive members ";
|
||||
echo "from a team.</li>";
|
||||
echo "<li>Only the team founder may disband a team, however, in order to successfully disband a ";
|
||||
echo "team all members of the team must no longer be members of the team, including the team founder. ";
|
||||
echo "Then the team founder may go to the team page and disband the team. ";
|
||||
echo "A team may not be disbanded if it still has members.</li>";
|
||||
echo "<li>Finally, the team founder has access to all team members' email addresses.</li>";
|
||||
echo "</ul>";
|
||||
echo "</td></tr></table>";
|
||||
|
||||
echo "<br>";
|
||||
echo "<p>";
|
||||
echo "<table border=0 width=580>";
|
||||
echo "<tr bgcolor=#708090><td colspan=2><font size=+1>";
|
||||
echo "<b>Team Info:</b></font></td></tr></table>";
|
||||
echo "<table>";
|
||||
if (strlen($team->description)) {
|
||||
row("<b>Description: </b>", $team->description);
|
||||
}
|
||||
if (strlen($team->url)) {;
|
||||
row("<b>Web site: </b>", "<a href=http://$team->url>http://$team->url</a>");
|
||||
}
|
||||
row("<b>Members: </b>", $team->nusers);
|
||||
echo "<br>";
|
||||
echo "<p>";
|
||||
echo "<table border=0 width=580>";
|
||||
echo "<tr bgcolor=#708090><td colspan=2><font size=+1>";
|
||||
echo "<b>Team Info:</b></font></td></tr></table>";
|
||||
echo "<table>";
|
||||
if (strlen($team->description)) {
|
||||
row("<b>Description: </b>", $team->description);
|
||||
}
|
||||
if (strlen($team->url)) {;
|
||||
row("<b>Web site: </b>", "<a href=http://$team->url>http://$team->url</a>");
|
||||
}
|
||||
row("<b>Members: </b>", $team->nusers);
|
||||
|
||||
$query = sprintf(
|
||||
"select * from user where teamid = %d",
|
||||
$team->id
|
||||
$query = sprintf(
|
||||
"select * from user where teamid = %d",
|
||||
$team->id
|
||||
);
|
||||
$result = mysql_query($query);
|
||||
$total_credit = 0;
|
||||
for ($i = 0; $i < $team->nusers; $i++) {
|
||||
$user = mysql_fetch_object($result);
|
||||
$total_credit = $total_credit + $user->total_credit;
|
||||
}
|
||||
|
||||
row("<b>Total Credit: </b>", $total_credit);
|
||||
$query = sprintf(
|
||||
"select * from user where id = %d",
|
||||
$team->userid
|
||||
);
|
||||
$result = mysql_query($query);
|
||||
$total_credit = 0;
|
||||
for ($i = 0; $i < $team->nusers; $i++) {
|
||||
$result = mysql_query($query);
|
||||
$user = mysql_fetch_object($result);
|
||||
$total_credit = $total_credit + $user->total_credit;
|
||||
}
|
||||
|
||||
row("<b>Total Credit: </b>", $total_credit);
|
||||
$query = sprintf(
|
||||
"select * from user where id = %d",
|
||||
$team->userid
|
||||
);
|
||||
$result = mysql_query($query);
|
||||
$user = mysql_fetch_object($result);
|
||||
row("<b>Founder: </b>", $user->name);
|
||||
echo "</table>";
|
||||
echo "<p>";
|
||||
echo "<table border=0 width=580>";
|
||||
echo "<tr bgcolor=#708090><td colspan=2><font size=+1>";
|
||||
echo "<b>Team Members:</b></font></td></tr></table>";
|
||||
echo "<table border=1 cellpadding=2 width=40%><tr>";
|
||||
echo "<th>Name</th>";
|
||||
echo "<th>Total credit</th>";
|
||||
echo "<th>Recent average CPU<br>time per work unit</th>";
|
||||
echo "<th>Country</th>";
|
||||
echo "</tr>";
|
||||
|
||||
$query = sprintf(
|
||||
"select * from user where teamid = %d",
|
||||
$team->id
|
||||
);
|
||||
$result = mysql_query($query);
|
||||
|
||||
for ($i = 0; $i < $team->nusers; $i++) {
|
||||
$user = mysql_fetch_object($result);
|
||||
$j = $i+1;
|
||||
echo "<tr><td align=left>$j) $user->name";
|
||||
echo "<td align=center>$user->total_credit</td>";
|
||||
echo "<td align=center>$user->expavg_time</td>";
|
||||
echo "<td align=center>$user->country</td>";
|
||||
row("<b>Founder: </b>", $user->name);
|
||||
echo "</table>";
|
||||
echo "<p>";
|
||||
echo "<table border=0 width=580>";
|
||||
echo "<tr bgcolor=#708090><td colspan=2><font size=+1>";
|
||||
echo "<b>Team Members:</b></font></td></tr></table>";
|
||||
echo "<table border=1 cellpadding=2 width=40%><tr>";
|
||||
echo "<th>Name</th>";
|
||||
echo "<th>Total credit</th>";
|
||||
echo "<th>Recent average CPU<br>time per work unit</th>";
|
||||
echo "<th>Country</th>";
|
||||
echo "</tr>";
|
||||
}
|
||||
echo "</table>";
|
||||
page_tail();
|
||||
|
||||
$query = sprintf(
|
||||
"select * from user where teamid = %d",
|
||||
$team->id
|
||||
);
|
||||
$result = mysql_query($query);
|
||||
|
||||
for ($i = 0; $i < $team->nusers; $i++) {
|
||||
$user = mysql_fetch_object($result);
|
||||
$j = $i+1;
|
||||
echo "<tr><td align=left>$j) $user->name";
|
||||
echo "<td align=center>$user->total_credit</td>";
|
||||
echo "<td align=center>$user->expavg_time</td>";
|
||||
echo "<td align=center>$user->country</td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
echo "</table>";
|
||||
page_tail();
|
||||
}
|
||||
|
||||
|
||||
function print_team_create_form() {
|
||||
|
||||
page_head("Create Team");
|
||||
echo "<h2>Create a BOINC Team</h2>";
|
||||
echo "<table width=780>";
|
||||
echo "<tr><td>";
|
||||
echo "<p>";
|
||||
echo "Use this form to create a team. ";
|
||||
echo "<p>";
|
||||
echo "You'll become the first member of the team. ";
|
||||
echo "Then tell your friends/co-workers/etc. about the team. ";
|
||||
echo "They may join it using the BOINC "Teams" page. ";
|
||||
echo "</td></tr></table>";
|
||||
echo "<p>";
|
||||
echo "<form method=post action=team_create_action.php>";
|
||||
echo "<table>";
|
||||
echo "<tr>";
|
||||
echo "<td>Team name (plain-text version):<br><br> </td>";
|
||||
echo "<td><input name=name type=text size=50>";
|
||||
echo "<br><font size=2>This name will be printed as-is and is the name ";
|
||||
echo "you should use <br>when searching for your Team.";
|
||||
echo "</td>";
|
||||
echo "</tr><tr>";
|
||||
echo "<td>Team name (HTML version):<br><br> </td>";
|
||||
echo "<td><input name=name_html type=text size=50>";
|
||||
echo "<br><font size=2>This name will be printed as HTML source, so you may include any HTML";
|
||||
echo "<br>code that you want. This will only be displayed in your teams' page.";
|
||||
echo "<br>If you don't know HTML, just leave this box blank.";
|
||||
echo "</td>";
|
||||
echo "</tr><tr>";
|
||||
echo "<td>URL of team web page, if any:<br><font size=2>(without "http://")</td>";
|
||||
echo "<td><input name=url size=60>";
|
||||
echo "<br><font size=2>This URL will be linked to from the team's page.</td>";
|
||||
echo "</tr><tr>";
|
||||
echo "<td valign=top>Description of team:</td>";
|
||||
echo "<td><textarea name=description cols=60 rows=10></textarea></td>";
|
||||
echo "</tr><tr>";
|
||||
echo "<td valign=top>Type of team:</td>";
|
||||
echo "<td>";
|
||||
echo "<input type=radio name=type value=4 checked>Club";
|
||||
echo "<br>";
|
||||
echo "<input type=radio name=type value=1>Small Company (< 50 employees)";
|
||||
echo "<br>";
|
||||
echo "<input type=radio name=type value=2>Medium Company (50-1000 employees)";
|
||||
echo "<br>";
|
||||
echo "<input type=radio name=type value=3>Large Company (> 1000 employees)";
|
||||
echo "<br>";
|
||||
echo "<input type=radio name=type value=5>Primary School";
|
||||
echo "<br>";
|
||||
echo "<input type=radio name=type value=6>Secondary School";
|
||||
echo "<br>";
|
||||
echo "<input type=radio name=type value=8>Junior College";
|
||||
echo "<br>";
|
||||
echo "<input type=radio name=type value=7>University or Department";
|
||||
echo "<br>";
|
||||
echo "<input type=radio name=type value=9>Government Agency";
|
||||
echo "</td>";
|
||||
echo "</td>";
|
||||
echo "</tr></table>";
|
||||
echo "<input type=submit name=new value=\"Create Team\">";
|
||||
echo "</form>";
|
||||
page_tail();
|
||||
page_head("Create Team");
|
||||
echo "<h2>Create a BOINC Team</h2>";
|
||||
echo "<table width=780>";
|
||||
echo "<tr><td>";
|
||||
echo "<p>";
|
||||
echo "Use this form to create a team. ";
|
||||
echo "<p>";
|
||||
echo "You'll become the first member of the team. ";
|
||||
echo "Then tell your friends/co-workers/etc. about the team. ";
|
||||
echo "They may join it using the BOINC "Teams" page. ";
|
||||
echo "</td></tr></table>";
|
||||
echo "<p>";
|
||||
echo "<form method=post action=team_create_action.php>";
|
||||
echo "<table>";
|
||||
echo "<tr>";
|
||||
echo "<td>Team name (plain-text version):<br><br> </td>";
|
||||
echo "<td><input name=name type=text size=50>";
|
||||
echo "<br><font size=2>This name will be printed as-is and is the name ";
|
||||
echo "you should use <br>when searching for your Team.";
|
||||
echo "</td>";
|
||||
echo "</tr><tr>";
|
||||
echo "<td>Team name (HTML version):<br><br> </td>";
|
||||
echo "<td><input name=name_html type=text size=50>";
|
||||
echo "<br><font size=2>This name will be printed as HTML source, so you may include any HTML";
|
||||
echo "<br>code that you want. This will only be displayed in your teams' page.";
|
||||
echo "<br>If you don't know HTML, just leave this box blank.";
|
||||
echo "</td>";
|
||||
echo "</tr><tr>";
|
||||
echo "<td>URL of team web page, if any:<br><font size=2>(without "http://")</td>";
|
||||
echo "<td><input name=url size=60>";
|
||||
echo "<br><font size=2>This URL will be linked to from the team's page.</td>";
|
||||
echo "</tr><tr>";
|
||||
echo "<td valign=top>Description of team:</td>";
|
||||
echo "<td><textarea name=description cols=60 rows=10></textarea></td>";
|
||||
echo "</tr><tr>";
|
||||
echo "<td valign=top>Type of team:</td>";
|
||||
echo "<td>";
|
||||
echo "<input type=radio name=type value=4 checked>Club";
|
||||
echo "<br>";
|
||||
echo "<input type=radio name=type value=1>Small Company (< 50 employees)";
|
||||
echo "<br>";
|
||||
echo "<input type=radio name=type value=2>Medium Company (50-1000 employees)";
|
||||
echo "<br>";
|
||||
echo "<input type=radio name=type value=3>Large Company (> 1000 employees)";
|
||||
echo "<br>";
|
||||
echo "<input type=radio name=type value=5>Primary School";
|
||||
echo "<br>";
|
||||
echo "<input type=radio name=type value=6>Secondary School";
|
||||
echo "<br>";
|
||||
echo "<input type=radio name=type value=8>Junior College";
|
||||
echo "<br>";
|
||||
echo "<input type=radio name=type value=7>University or Department";
|
||||
echo "<br>";
|
||||
echo "<input type=radio name=type value=9>Government Agency";
|
||||
echo "</td>";
|
||||
echo "</td>";
|
||||
echo "</tr></table>";
|
||||
echo "<input type=submit name=new value=\"Create Team\">";
|
||||
echo "</form>";
|
||||
page_tail();
|
||||
}
|
||||
|
||||
function print_team_join_form($id) {
|
||||
|
||||
$query = sprintf(
|
||||
"select * from team where id = %d",
|
||||
$id
|
||||
);
|
||||
$result = mysql_query($query);
|
||||
if ($result) {
|
||||
$team = mysql_fetch_object($result);
|
||||
mysql_free_result($result);
|
||||
}
|
||||
$team_name = $team->name;
|
||||
$team_id = $team->id;
|
||||
page_head("Join $team_name");
|
||||
echo "<h2>Join $team_name</h2>";
|
||||
echo "<table width=780>";
|
||||
echo "<tr><td>";
|
||||
echo "<p><b>Please note before joining or switching to a new team:</b>";
|
||||
echo "<ul>";
|
||||
echo "<li>If this is the first team you have ever joined ";
|
||||
echo "then all of your current credit will be given to this ";
|
||||
echo "team, in addition to all new credit you receive.";
|
||||
echo "<li>If you are currently a member of a team ";
|
||||
echo "and are switching to another team, the new team will receive ";
|
||||
echo "all of your credits, the old teams total will be decreased by ";
|
||||
echo "your credit amount.";
|
||||
echo "<li>Joining a team does not affect your personal credit ";
|
||||
echo "statistics in any way.";
|
||||
echo "<li>Joining a team gives your team's founder access to your email address.";
|
||||
echo "</ul>";
|
||||
echo "</p>";
|
||||
echo "<hr>";
|
||||
echo "<form method=post action=team_join_action.php>";
|
||||
echo "<input type=hidden name=id value=$team_id>";
|
||||
echo "<input type=submit value=\"Join Team\">";
|
||||
echo "</form>";
|
||||
echo "</td></tr></table>";
|
||||
page_tail();
|
||||
$query = sprintf(
|
||||
"select * from team where id = %d",
|
||||
$id
|
||||
);
|
||||
$result = mysql_query($query);
|
||||
if ($result) {
|
||||
$team = mysql_fetch_object($result);
|
||||
mysql_free_result($result);
|
||||
}
|
||||
$team_name = $team->name;
|
||||
$team_id = $team->id;
|
||||
page_head("Join $team_name");
|
||||
echo "<h2>Join $team_name</h2>";
|
||||
echo "<table width=780>";
|
||||
echo "<tr><td>";
|
||||
echo "<p><b>Please note before joining or switching to a new team:</b>";
|
||||
echo "<ul>";
|
||||
echo "<li>If this is the first team you have ever joined ";
|
||||
echo "then all of your current credit will be given to this ";
|
||||
echo "team, in addition to all new credit you receive.";
|
||||
echo "<li>If you are currently a member of a team ";
|
||||
echo "and are switching to another team, the new team will receive ";
|
||||
echo "all of your credits, the old teams total will be decreased by ";
|
||||
echo "your credit amount.";
|
||||
echo "<li>Joining a team does not affect your personal credit ";
|
||||
echo "statistics in any way.";
|
||||
echo "<li>Joining a team gives your team's founder access to your email address.";
|
||||
echo "</ul>";
|
||||
echo "</p>";
|
||||
echo "<hr>";
|
||||
echo "<form method=post action=team_join_action.php>";
|
||||
echo "<input type=hidden name=id value=$team_id>";
|
||||
echo "<input type=submit value=\"Join Team\">";
|
||||
echo "</form>";
|
||||
echo "</td></tr></table>";
|
||||
page_tail();
|
||||
}
|
||||
|
||||
function print_team_quit_form($id) {
|
||||
|
||||
$query = sprintf(
|
||||
"select * from team where id = %d",
|
||||
$id
|
||||
);
|
||||
$result = mysql_query($query);
|
||||
if ($result) {
|
||||
$team = mysql_fetch_object($result);
|
||||
mysql_free_result($result);
|
||||
}
|
||||
$team_name = $team->name;
|
||||
$team_id = $team->id;
|
||||
page_head("Quit $team_name");
|
||||
echo "<h2>Quit $team_name</h2>";
|
||||
echo "<table width=780>";
|
||||
echo "<tr><td>";
|
||||
echo "<p><b>Please note before quitting a team:</b>";
|
||||
echo "<ul>";
|
||||
echo "<li>By quitting a team you remove your name from the team listing. ";
|
||||
echo "Your credit contribution to the team is also removed";
|
||||
echo "<li>Even if you quit a team, you may rejoin later, ";
|
||||
echo "or join any other team you desire ";
|
||||
echo "<li>Quitting a team does not affect your personal credit ";
|
||||
echo "statistics in any way.";
|
||||
echo "</ul>";
|
||||
echo "</p>";
|
||||
echo "<hr>";
|
||||
echo "<form method=post action=team_quit_action.php>";
|
||||
echo "<input type=hidden name=id value=$team_id>";
|
||||
echo "<input type=submit value=\"Quit Team\">";
|
||||
echo "</form>";
|
||||
echo "</td></tr></table>";
|
||||
page_tail();
|
||||
$query = sprintf(
|
||||
"select * from team where id = %d",
|
||||
$id
|
||||
);
|
||||
$result = mysql_query($query);
|
||||
if ($result) {
|
||||
$team = mysql_fetch_object($result);
|
||||
mysql_free_result($result);
|
||||
}
|
||||
$team_name = $team->name;
|
||||
$team_id = $team->id;
|
||||
page_head("Quit $team_name");
|
||||
echo "<h2>Quit $team_name</h2>";
|
||||
echo "<table width=780>";
|
||||
echo "<tr><td>";
|
||||
echo "<p><b>Please note before quitting a team:</b>";
|
||||
echo "<ul>";
|
||||
echo "<li>By quitting a team you remove your name from the team listing. ";
|
||||
echo "Your credit contribution to the team is also removed";
|
||||
echo "<li>Even if you quit a team, you may rejoin later, ";
|
||||
echo "or join any other team you desire ";
|
||||
echo "<li>Quitting a team does not affect your personal credit ";
|
||||
echo "statistics in any way.";
|
||||
echo "</ul>";
|
||||
echo "</p>";
|
||||
echo "<hr>";
|
||||
echo "<form method=post action=team_quit_action.php>";
|
||||
echo "<input type=hidden name=id value=$team_id>";
|
||||
echo "<input type=submit value=\"Quit Team\">";
|
||||
echo "</form>";
|
||||
echo "</td></tr></table>";
|
||||
page_tail();
|
||||
}
|
||||
|
||||
function print_team_edit_form($id) {
|
||||
|
||||
$query = sprintf(
|
||||
"select * from team where id = %d",
|
||||
$id
|
||||
);
|
||||
$result = mysql_query($query);
|
||||
if ($result) {
|
||||
$team = mysql_fetch_object($result);
|
||||
mysql_free_result($result);
|
||||
}
|
||||
$team_name = $team->name;
|
||||
$team_id = $team->id;
|
||||
$team_name_html = $team->name_html;
|
||||
$team_url = $team->url;
|
||||
$team_description = $team->description;
|
||||
$team_type = $team->type;
|
||||
page_head("Edit $team_name");
|
||||
echo "<h2>Edit $team_name</h2>";
|
||||
echo "<table width=780>";
|
||||
echo "<tr><td>";
|
||||
echo "<p><b>Please note before editing a team:</b>";
|
||||
echo "<ul>";
|
||||
echo "<li>Only the founder may edit a team";
|
||||
echo "</ul>";
|
||||
echo "</p>";
|
||||
echo "<hr>";
|
||||
echo "<form method=post action=team_edit_action.php>";
|
||||
echo "<input type=hidden name=id value=$team_id>";
|
||||
echo "</td></tr></table>";
|
||||
echo "<table><tr>";
|
||||
echo "<td>Team name (plain-text version):<br><br> </td>";
|
||||
echo "<td><input name=name size=50 value=$team_name>";
|
||||
echo "<br><font size=2>This name will be print as-is";
|
||||
echo "<br>and is the name you should use when searching for your team.";
|
||||
echo "</td></tr></tr>";
|
||||
echo "<td>Team name (HTML version):<br><br> </td>";
|
||||
echo "<td><input name=name_html size=50 value='$team_name_html'>";
|
||||
echo "<br><font size=2>This name will be printed as HTML source, so you may include any HTML";
|
||||
echo "<br>code that you want. This will only be displayed in your team's page.";
|
||||
echo "<br>If you don't know HTML, just leave this box blank.";
|
||||
echo "</td></tr><tr>";
|
||||
echo "<td>URL of team web page, if any:<br><font size=2>(without "http://")</td>";
|
||||
echo "<td><input name=url size=60 value=$team_url>";
|
||||
echo "<br><font size=2>This page will be linked to from the project's team page.";
|
||||
echo "</td></tr><tr>";
|
||||
echo "<td valign=top>Description of team:</td>";
|
||||
echo "<td><textarea name=description value=$team_description cols=60 rows=10>$team_description</textarea>";
|
||||
echo "</td></tr><tr>";
|
||||
echo "<td valign=top>Type of team:</td><td>";
|
||||
printf("<input type=radio name=type value=4%s>Club<br>", ($team->type==4)?" checked":"");
|
||||
printf("<input type=radio name=type value=1%s>Small Company (< 50 employees)<br>", ($team->type==1)?" checked":"");
|
||||
printf("<input type=radio name=type value=2%s>Medium Company (50-1000 employees)<br>", ($team->type==2)?" checked":"");
|
||||
printf("<input type=radio name=type value=3%s>Large Company (> 1000 employees)<br>", ($team->type==3)?" checked":"");
|
||||
printf("<input type=radio name=type value=5%s>Primary School<br>", ($team->type==5)?" checked":"");
|
||||
printf("<input type=radio name=type value=6%s>Secondary School<br>", ($team->type==6)?" checked":"");
|
||||
printf("<input type=radio name=type value=8%s>Junior College<br>", ($team->type==8)?" checked":"");
|
||||
printf("<input type=radio name=type value=7%s>University or Department<br>", ($team->type==7)?" checked":"");
|
||||
printf("<input type=radio name=type value=9%s>Government Agency</td>", ($team->type==9)?" checked":"");
|
||||
echo "</tr></table>";
|
||||
echo "<input type=submit value=\"Edit Team\">";
|
||||
echo "</form>";
|
||||
page_tail();
|
||||
$query = sprintf(
|
||||
"select * from team where id = %d",
|
||||
$id
|
||||
);
|
||||
$result = mysql_query($query);
|
||||
if ($result) {
|
||||
$team = mysql_fetch_object($result);
|
||||
mysql_free_result($result);
|
||||
}
|
||||
$team_name = $team->name;
|
||||
$team_id = $team->id;
|
||||
$team_name_html = $team->name_html;
|
||||
$team_url = $team->url;
|
||||
$team_description = $team->description;
|
||||
$team_type = $team->type;
|
||||
page_head("Edit $team_name");
|
||||
echo "<h2>Edit $team_name</h2>";
|
||||
echo "<table width=780>";
|
||||
echo "<tr><td>";
|
||||
echo "<p><b>Please note before editing a team:</b>";
|
||||
echo "<ul>";
|
||||
echo "<li>Only the founder may edit a team";
|
||||
echo "</ul>";
|
||||
echo "</p>";
|
||||
echo "<hr>";
|
||||
echo "<form method=post action=team_edit_action.php>";
|
||||
echo "<input type=hidden name=id value=$team_id>";
|
||||
echo "</td></tr></table>";
|
||||
echo "<table><tr>";
|
||||
echo "<td>Team name (plain-text version):<br><br> </td>";
|
||||
echo "<td><input name=name size=50 value=$team_name>";
|
||||
echo "<br><font size=2>This name will be print as-is";
|
||||
echo "<br>and is the name you should use when searching for your team.";
|
||||
echo "</td></tr></tr>";
|
||||
echo "<td>Team name (HTML version):<br><br> </td>";
|
||||
echo "<td><input name=name_html size=50 value='$team_name_html'>";
|
||||
echo "<br><font size=2>This name will be printed as HTML source, so you may include any HTML";
|
||||
echo "<br>code that you want. This will only be displayed in your team's page.";
|
||||
echo "<br>If you don't know HTML, just leave this box blank.";
|
||||
echo "</td></tr><tr>";
|
||||
echo "<td>URL of team web page, if any:<br><font size=2>(without "http://")</td>";
|
||||
echo "<td><input name=url size=60 value=$team_url>";
|
||||
echo "<br><font size=2>This page will be linked to from the project's team page.";
|
||||
echo "</td></tr><tr>";
|
||||
echo "<td valign=top>Description of team:</td>";
|
||||
echo "<td><textarea name=description value=$team_description cols=60 rows=10>$team_description</textarea>";
|
||||
echo "</td></tr><tr>";
|
||||
echo "<td valign=top>Type of team:</td><td>";
|
||||
printf("<input type=radio name=type value=4%s>Club<br>", ($team->type==4)?" checked":"");
|
||||
printf("<input type=radio name=type value=1%s>Small Company (< 50 employees)<br>", ($team->type==1)?" checked":"");
|
||||
printf("<input type=radio name=type value=2%s>Medium Company (50-1000 employees)<br>", ($team->type==2)?" checked":"");
|
||||
printf("<input type=radio name=type value=3%s>Large Company (> 1000 employees)<br>", ($team->type==3)?" checked":"");
|
||||
printf("<input type=radio name=type value=5%s>Primary School<br>", ($team->type==5)?" checked":"");
|
||||
printf("<input type=radio name=type value=6%s>Secondary School<br>", ($team->type==6)?" checked":"");
|
||||
printf("<input type=radio name=type value=8%s>Junior College<br>", ($team->type==8)?" checked":"");
|
||||
printf("<input type=radio name=type value=7%s>University or Department<br>", ($team->type==7)?" checked":"");
|
||||
printf("<input type=radio name=type value=9%s>Government Agency</td>", ($team->type==9)?" checked":"");
|
||||
echo "</tr></table>";
|
||||
echo "<input type=submit value=\"Edit Team\">";
|
||||
echo "</form>";
|
||||
page_tail();
|
||||
}
|
||||
|
||||
function print_team_remove_inactive_form($id) {
|
||||
$query = sprintf(
|
||||
"select * from team where id = %d",
|
||||
$id
|
||||
);
|
||||
$result = mysql_query($query);
|
||||
if ($result) {
|
||||
$team = mysql_fetch_object($result);
|
||||
mysql_free_result($result);
|
||||
}
|
||||
$team_name = $team->name;
|
||||
$team_id = $team->id;
|
||||
$nusers = $team->nusers;
|
||||
page_head("Remove Members from $team_name");
|
||||
echo "<h2>Remove members from $team_name</h2>";
|
||||
echo "<table width=780>";
|
||||
echo "<tr><td>";
|
||||
echo "<p><b>Please note:</b>";
|
||||
echo "<ul>";
|
||||
echo "<li>Only the founder may remove members from a team";
|
||||
echo "<li>By removing a member, you will also remove their credit and CPU time ";
|
||||
echo "contributions to the team.";
|
||||
echo "</ul>";
|
||||
echo "</p>";
|
||||
echo "<hr>";
|
||||
echo "<form method=post action=team_remove_inactive_action.php>";
|
||||
echo "<input type=hidden name=id value=$team_id>";
|
||||
echo "<br></td></tr></table>";
|
||||
echo "<table border=1><tr><th>Remove?</th>";
|
||||
echo "<th>Name</th>";
|
||||
echo "<th>Total<br>Credit</th>";
|
||||
|
||||
$query = sprintf(
|
||||
"select * from team where id = %d",
|
||||
$id
|
||||
);
|
||||
$result = mysql_query($query);
|
||||
if ($result) {
|
||||
$team = mysql_fetch_object($result);
|
||||
mysql_free_result($result);
|
||||
}
|
||||
$team_name = $team->name;
|
||||
$team_id = $team->id;
|
||||
$nusers = $team->nusers;
|
||||
page_head("Remove Members from $team_name");
|
||||
echo "<h2>Remove members from $team_name</h2>";
|
||||
echo "<table width=780>";
|
||||
echo "<tr><td>";
|
||||
echo "<p><b>Please note:</b>";
|
||||
echo "<ul>";
|
||||
echo "<li>Only the founder may remove members from a team";
|
||||
echo "<li>By removing a member, you will also remove their credit and CPU time ";
|
||||
echo "contributions to the team.";
|
||||
echo "</ul>";
|
||||
echo "</p>";
|
||||
echo "<hr>";
|
||||
echo "<form method=post action=team_remove_inactive_action.php>";
|
||||
echo "<input type=hidden name=id value=$team_id>";
|
||||
echo "<br></td></tr></table>";
|
||||
echo "<table border=1><tr><th>Remove?</th>";
|
||||
echo "<th>Name</th>";
|
||||
echo "<th>Total<br>Credit</th>";
|
||||
$query = sprintf(
|
||||
"select * from user where teamid = %d",
|
||||
$team_id
|
||||
);
|
||||
$result = mysql_query($query);
|
||||
|
||||
$query = sprintf(
|
||||
"select * from user where teamid = %d",
|
||||
$team_id
|
||||
);
|
||||
$result = mysql_query($query);
|
||||
|
||||
$ninactive_users = 0;
|
||||
for ($i = 0; $i < $nusers; $i++) {
|
||||
$user = mysql_fetch_object($result);
|
||||
echo "<tr><td align=center><input type=checkbox name=remove_$ninactive_users value=$user->id>";
|
||||
echo "<td>$user->name</td>";
|
||||
echo "<td>$user->total_credit</td>";
|
||||
$ninactive_users++;
|
||||
}
|
||||
echo "<input type=hidden name=ninactive_users value=$ninactive_users>";
|
||||
if ($result) {
|
||||
mysql_free_result($result);
|
||||
}
|
||||
echo "</table>";
|
||||
echo "<input type=submit value=\"Remove Users\">";
|
||||
echo "</form>";
|
||||
page_tail();
|
||||
$ninactive_users = 0;
|
||||
for ($i = 0; $i < $nusers; $i++) {
|
||||
$user = mysql_fetch_object($result);
|
||||
echo "<tr><td align=center><input type=checkbox name=remove_$ninactive_users value=$user->id>";
|
||||
echo "<td>$user->name</td>";
|
||||
echo "<td>$user->total_credit</td>";
|
||||
$ninactive_users++;
|
||||
}
|
||||
echo "<input type=hidden name=ninactive_users value=$ninactive_users>";
|
||||
if ($result) {
|
||||
mysql_free_result($result);
|
||||
}
|
||||
echo "</table>";
|
||||
echo "<input type=submit value=\"Remove Users\">";
|
||||
echo "</form>";
|
||||
page_tail();
|
||||
}
|
||||
|
||||
function print_team_disband_form($id) {
|
||||
|
||||
$query = sprintf(
|
||||
"select * from team where id = %d",
|
||||
$id
|
||||
);
|
||||
$result = mysql_query($query);
|
||||
if ($result) {
|
||||
$team = mysql_fetch_object($result);
|
||||
mysql_free_result($result);
|
||||
}
|
||||
$team_name = $team->name;
|
||||
$team_id = $team->id;
|
||||
page_head("Disband $team_name");
|
||||
echo "<h2>Disband $team_name</h2>";
|
||||
echo "<table width=780>";
|
||||
echo "<tr><td>";
|
||||
echo "<p><b>Please note:</b>";
|
||||
echo "<ul>";
|
||||
echo "<li>Only the found may disband a team.";
|
||||
echo "<li>Only teams with no members may be disbanded. The founder of a team ";
|
||||
echo "may email the members of a team to inform them of the disbanding of the team.";
|
||||
echo "<li>After a team is disbanded, all members will no longer belong to a team, ";
|
||||
echo "though they may join another team if desired.";
|
||||
echo "<li>Disbanding a team is permanent, make sure you know what you're doing!";
|
||||
echo "</ul>";
|
||||
echo "</p>";
|
||||
echo "Press "Disband Team" when you're ready.";
|
||||
echo "<hr>";
|
||||
echo "<form method=post action=team_disband_action.php>";
|
||||
echo "<input type=hidden name=id value=$team_id>";
|
||||
echo "<input type=submit value=\"Disband Team\">";
|
||||
echo "</form>";
|
||||
echo "</tr></td></table>";
|
||||
page_tail();
|
||||
$query = sprintf(
|
||||
"select * from team where id = %d",
|
||||
$id
|
||||
);
|
||||
$result = mysql_query($query);
|
||||
if ($result) {
|
||||
$team = mysql_fetch_object($result);
|
||||
mysql_free_result($result);
|
||||
}
|
||||
$team_name = $team->name;
|
||||
$team_id = $team->id;
|
||||
page_head("Disband $team_name");
|
||||
echo "<h2>Disband $team_name</h2>";
|
||||
echo "<table width=780>";
|
||||
echo "<tr><td>";
|
||||
echo "<p><b>Please note:</b>";
|
||||
echo "<ul>";
|
||||
echo "<li>Only the found may disband a team.";
|
||||
echo "<li>Only teams with no members may be disbanded. The founder of a team ";
|
||||
echo "may email the members of a team to inform them of the disbanding of the team.";
|
||||
echo "<li>After a team is disbanded, all members will no longer belong to a team, ";
|
||||
echo "though they may join another team if desired.";
|
||||
echo "<li>Disbanding a team is permanent, make sure you know what you're doing!";
|
||||
echo "</ul>";
|
||||
echo "</p>";
|
||||
echo "Press "Disband Team" when you're ready.";
|
||||
echo "<hr>";
|
||||
echo "<form method=post action=team_disband_action.php>";
|
||||
echo "<input type=hidden name=id value=$team_id>";
|
||||
echo "<input type=submit value=\"Disband Team\">";
|
||||
echo "</form>";
|
||||
echo "</tr></td></table>";
|
||||
page_tail();
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
<?php
|
||||
require_once("util.inc");
|
||||
require_once("user.inc");
|
||||
|
||||
db_init();
|
||||
$user = get_user_from_cookie();
|
||||
if ($user) {
|
||||
show_user_page($user, $project);
|
||||
} else {
|
||||
echo NOLOGIN;
|
||||
}
|
||||
?>
|
|
@ -0,0 +1,14 @@
|
|||
<?php
|
||||
require_once("util.inc");
|
||||
require_once("user.inc");
|
||||
|
||||
db_init();
|
||||
page_head("Top users");
|
||||
$result = mysql_query("select * from user order by expavg_credit desc");
|
||||
user_table_start();
|
||||
while ($user = mysql_fetch_object($result)) {
|
||||
show_user_row($user);
|
||||
}
|
||||
echo "</table>\n";
|
||||
page_tail();
|
||||
?>
|
|
@ -1,5 +1,35 @@
|
|||
<?php
|
||||
|
||||
function show_user_stats($user) {
|
||||
echo TABLE2."\n";
|
||||
echo "<tr>".TD2.LG_FONT."<b>User Stats:</b></font></td></tr>\n";
|
||||
row("<b>User ID: </b>", $user->id);
|
||||
$row = sprintf("<b>%s user since: </b>", $project);
|
||||
row($row, time_str($user->create_time));
|
||||
row("<b>Total credit: </b>", $user->total_credit);
|
||||
row("<b>Recent averaged credit: </b>", $user->expavg_credit);
|
||||
if ($user->teamid) {
|
||||
$result = mysql_query("select * from team where id = $user->teamid");
|
||||
$team = mysql_fetch_object($result);
|
||||
row("<b>Team: </b>", "<a href=team_display.php?id=$team->id>$team->name</a>");
|
||||
} else {
|
||||
row("<b>Team: </b>", "None");
|
||||
}
|
||||
echo "</table>\n";
|
||||
}
|
||||
|
||||
function show_user_profile($user) {
|
||||
echo TABLE2."\n";
|
||||
echo "<tr>".TD2.LG_FONT."<b>User Information:</b></font></td></tr>\n";
|
||||
row("<b>User name: </b>", $user->name);
|
||||
row("<b>Email address: <b>", $user->email_addr);
|
||||
row("<b>Country: </b>", $user->country);
|
||||
row("<b>Postal (ZIP) code: </b>", $user->postal_code);
|
||||
echo "<tr><td align=right><a href=edit_user_info.php>Edit User Information</a></td>\n";
|
||||
echo "<td align=center><a href=change_password.php>Change Password</a></td></tr>\n";
|
||||
echo "</table>\n";
|
||||
}
|
||||
|
||||
function show_hosts($user) {
|
||||
$result = mysql_query("select * from host where userid=$user->id");
|
||||
while ($host = mysql_fetch_object($result)) {
|
||||
|
@ -9,12 +39,16 @@ function show_hosts($user) {
|
|||
mysql_free_result($result);
|
||||
}
|
||||
|
||||
function show_user_page($user, $project) {
|
||||
echo "<h1>Welcome, $user->name!</h1>\n";
|
||||
// show a summary of the user.
|
||||
// NOTE: This is intended to be shown only to that user.
|
||||
// it has info that other users aren't supposed to see
|
||||
|
||||
function show_user_page_private($user) {
|
||||
echo "<h1>$user->name</h1>\n";
|
||||
start_table();
|
||||
show_user_profile($user);
|
||||
echo "<p><p>\n";
|
||||
show_user_stats($user, $project);
|
||||
show_user_stats($user);
|
||||
echo "<p>\n";
|
||||
echo "<ul>";
|
||||
echo "<li><a href=show_hosts.php>Host info</a></li>";
|
||||
|
@ -23,4 +57,20 @@ function show_user_page($user, $project) {
|
|||
echo "</ul>";
|
||||
|
||||
}
|
||||
|
||||
function user_table_start() {
|
||||
echo TABLE."
|
||||
<tr><th>Name</th><th>Average credit</th><th>Total credit</th>
|
||||
<th>Participant since</th></tr>";
|
||||
}
|
||||
|
||||
function show_user_row($user) {
|
||||
echo "<tr>
|
||||
<td>$user->name</td>
|
||||
<td>$user->expavg_credit</td>
|
||||
<td>$user->total_credit</td>
|
||||
<td>".time_str($user->create_time)."</td>
|
||||
<tr>\n";
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -23,7 +23,7 @@ define("BODY_COLOR", " bgcolor=ffffff ");
|
|||
define("NOLOGIN", "Not logged in. Click <a href=login.php>here</a> to login.\n");
|
||||
define("BADPASS", "The password you entered is incorrect. Click the <b>Back</b> button on your browser to re-enter your password or try again later.");
|
||||
define("DIFFPASS", "You've typed two different passwords. Click the <b>Back</b> button on your browser to edit your information, making sure you type the same password in both password fields.");
|
||||
define("PROJECT", "SAMPLE_PROJECT");
|
||||
define("PROJECT", "Sample project");
|
||||
|
||||
|
||||
function get_user_from_cookie() {
|
||||
|
@ -39,20 +39,25 @@ function show_login($user) {
|
|||
if ($user) {
|
||||
printf("Logged in as %s.\n", $user->name);
|
||||
printf("<br><a href=login.php>Log in as someone else.</a>\n");
|
||||
printf("<br><a href=this_user.php>My %s</a>\n", PROJECT);
|
||||
} else {
|
||||
echo NOLOGIN;
|
||||
}
|
||||
}
|
||||
|
||||
function page_head($title) {
|
||||
echo "<head><title>$title</title><body " . BG_COLOR . ">\n";
|
||||
echo TABLE."<tr ".TITLE_COLOR."><td>".TITLE_FONT."<font size=6><b><a href=index.php>".PROJECT.":</a> $title</b></font></td></tr></table>\n";
|
||||
echo "<head><title>$title</title><body ".BG_COLOR.">\n";
|
||||
|
||||
// Put your project title and logo here
|
||||
|
||||
echo "<h2>Sample Project</h2>\n";
|
||||
echo "<h3>$title</h3>\n";
|
||||
}
|
||||
|
||||
function page_tail() {
|
||||
echo "<hr><table width=100%><tr><td align=center>|<a href=create_account.php> Create New Account </a>|<a href=login.php> Login </a>\n";
|
||||
echo "|<a href=home.php> User Page </a>|<a href=team.php> Teams </a>|<a href=index.php> Main Project Page </a>|</td></tr></table>\n";
|
||||
|
||||
// put your copyright notice etc. here
|
||||
|
||||
echo "<hr>Copyright (c) 2002 Sample Project\n";
|
||||
}
|
||||
|
||||
function date_str($when) {
|
||||
|
@ -92,17 +97,4 @@ function print_country_select() {
|
|||
PassThru("/disks/milkyway/a/users/anderson/boinc_cvs/boinc/tools/country_select");
|
||||
}
|
||||
|
||||
function print_page_header($title) {
|
||||
echo "<html>\n";
|
||||
echo "<head>\n";
|
||||
echo "<title>$title</title>\n";
|
||||
echo "</head>\n";
|
||||
echo "<body BGCOLOR=000000 TEXT=FFFFFF LINK=cc99ff VLINK=cc99ff>\n";
|
||||
echo "<br clear=all><br>\n";
|
||||
}
|
||||
|
||||
function print_page_end() {
|
||||
echo "</body></html>";
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
Loading…
Reference in New Issue