fixed more page headers on login, create account, team, preferences pages. Problem with getting user from cookies??? sometimes, when u click on a link on the user page, it brings u back to the log in form page. will look into it.

svn path=/trunk/boinc/; revision=275
This commit is contained in:
Cecile Kim 2002-08-08 20:49:09 +00:00
parent e9aa34829e
commit e6b71ccb52
11 changed files with 28 additions and 22 deletions

View File

@ -9,5 +9,6 @@ db_init();
page_head("Create Account");
print_create_account_form();
page_tail();
?>

View File

@ -1 +1 @@
boinc_barry
boinc_cecile

View File

@ -6,8 +6,8 @@
db_init();
$user = get_user_from_cookie();
page_head("User home");
if ($user) {
page_head("User Home");
show_user_page($user);
} else {
print_login_form();

View File

@ -2,6 +2,7 @@
require_once("util.inc");
require_once("user.inc");
require_once("db.inc");
db_init();
if (strlen($HTTP_POST_VARS["old"])) {
$query = sprintf(
@ -14,6 +15,7 @@
mysql_free_result($result);
}
if (!$user or ($user->web_password != $HTTP_POST_VARS["existing_password"])) {
page_head("Logging In");
echo "We have no account with that name and password.";
} else {
setcookie("auth", $user->authenticator, time()+100000000);
@ -31,9 +33,11 @@
mysql_free_result($result);
}
if ($user) {
page_head("Creating Account");
echo "There's already an account with that email address.";
} else {
if ($HTTP_POST_VARS["new_password"] != $HTTP_POST_VARS["new_password2"]) {
page_head("Creating Account");
echo "You've typed two different passwords.";
} else {
$authenticator = random_string();
@ -51,9 +55,11 @@
$result = mysql_query($query);
if ($result) {
setcookie("auth", $authenticator);
page_head("Creating Account");
echo "Account created. You are being mailed a key that you'll need to run the client.\n";
mail($email_addr, "BOINC key", "Your BOINC key is " . $authenticator);
} else {
page_head("Creating Account");
echo "Couldn't create account - please try later.\n";
}
}

View File

@ -224,11 +224,11 @@ function prefs_form_work($user, $prefs) {
printf(" <td><input type=checkbox name=confirm_before_connecting %s></td>\n", $prefs->confirm_before_connecting?"checked":"");
echo " </tr>\n";
echo " <tr>\n";
echo " <td align=right>Minimum work buffer (days)</td>\n";
echo " <td align=right>Minimum work buffer (hours)</td>\n";
printf(" <td><input name=low_water_days value='$prefs->low_water_days'></td>\n");
echo " </tr>\n";
echo " <tr>\n";
echo " <td align=right>Maximum work buffer (days)</td>\n";
echo " <td align=right>Maximum work buffer (hours)</td>\n";
printf(" <td><input name=high_water_days value='$prefs->high_water_days'></td>\n");
echo " </tr>\n";
echo " <tr><td><br></td><td><input type=submit value=OK></td></tr>\n";

View File

@ -1,20 +1,19 @@
<?php
include_once("db.inc");
include_once("util.inc");
include_once("login.inc");
include_once("prefs.inc");
require_once("db.inc");
require_once("util.inc");
require_once("login.inc");
require_once("prefs.inc");
db_init();
$user = get_user_from_cookie();
page_head("Preferences");
if ($user == NULL) {
//show_login($user);
print_login_form();
} else {
if ($user) {
page_head("Preferences");
$prefs = prefs_parse($user->prefs);
print_prefs_display($prefs);
} else {
//show_login($user);
print_login_form();
}
echo "<p>\n";
page_tail();

View File

@ -8,10 +8,10 @@ include_once("prefs.inc");
db_init();
$user = get_user_from_cookie();
page_head("Edit Disk Preferences");
if ($user == NULL) {
print_login_form();
} else {
page_head("Edit Disk Preferences");
$prefs = prefs_parse($user->prefs);
prefs_form_disk($user, $prefs);
echo "<a href=prefs.php>Preferences</a>\n";

View File

@ -8,10 +8,10 @@ include_once("prefs.inc");
db_init();
$user = get_user_from_cookie();
page_head("Preferences");
if ($user == NULL) {
print_login_form();
} else {
page_head("Preferences");
$prefs = prefs_parse($user->prefs);
prefs_work_parse_form($prefs);
prefs_update($user, $prefs);

View File

@ -8,10 +8,10 @@ include_once("prefs.inc");
db_init();
$user = get_user_from_cookie();
page_head("Edit Work Preferences");
if ($user == NULL) {
print_login_form();
} else {
page_head("Edit Work Preferences");
$prefs = prefs_parse($user->prefs);
prefs_form_work($user, $prefs);
echo "<a href=prefs.php>Preferences</a>\n";

View File

@ -5,12 +5,12 @@
require_once("login.inc");
db_init();
$user = get_user_from_cookie();
page_head("User stats");
$user = get_user_From_cookie();
if ($user) {
show_user($user);
page_head("User stats");
show_user($user);
} else {
print_login_form();
echo "Not logged in";
}
page_tail();
?>

View File

@ -59,7 +59,7 @@ function random_string() {
}
function print_country_select() {
PassThru("/home/david/boinc/tools/country_select");
PassThru("/disks/milkyway/a/users/anderson/boinc/tools/country_select");
}
function print_page_header($title) {