mirror of https://github.com/BOINC/boinc.git
added instructions to login page, added page headers and tails.
svn path=/trunk/boinc/; revision=269
This commit is contained in:
parent
5218aad497
commit
5fe84197c5
|
@ -1,16 +1,25 @@
|
|||
<?php
|
||||
|
||||
function print_login_form() {
|
||||
page_head("Log in");
|
||||
echo "<br>\n";
|
||||
start_table_instr();
|
||||
echo "<tr><td>If you already have an account, you can login using the email address";
|
||||
echo " and password you used in creating your account. Otherwise you need to create";
|
||||
echo " a new account using a valid email address and password, both of which you will";
|
||||
echo " need in order to access your account in the future.</td></tr>\n";
|
||||
echo "</table>\n";
|
||||
|
||||
printf(
|
||||
"<form method=post action=login_action.php>\n"
|
||||
."<table>\n"
|
||||
."<tr><td colspan=2>If you already have an account:</td></tr>\n"
|
||||
."<tr>\n"
|
||||
." <td align=right>Email</td>\n"
|
||||
." <td align=right>Your account 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 align=right>Your account password</td>\n"
|
||||
." <td> <input name=existing_password type=password></td>\n"
|
||||
."</tr>\n"
|
||||
."<tr>\n"
|
||||
|
@ -41,7 +50,7 @@ function print_create_account_form() {
|
|||
." <td><input name=new_password type=password></td>\n"
|
||||
."</tr>\n"
|
||||
."<tr>\n"
|
||||
." <td align=right>Password confirm</td>\n"
|
||||
." <td align=right>Retype password</td>\n"
|
||||
." <td><input name=new_password2 type=password></td>\n"
|
||||
."</tr>\n"
|
||||
."<tr>\n"
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
require_once("util.inc");
|
||||
require_once("login.inc");
|
||||
db_init();
|
||||
page_head("Log in");
|
||||
print_login_form();
|
||||
if ($user = get_user_from_cookie()) {
|
||||
show_login($user);
|
||||
} else {
|
||||
print_login_form();
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
require_once("user.inc");
|
||||
require_once("db.inc");
|
||||
if (strlen($HTTP_POST_VARS["old"])) {
|
||||
page_head("Logging In");
|
||||
db_init();
|
||||
$query = sprintf(
|
||||
"select * from user where email_addr='%s'",
|
||||
|
@ -21,6 +22,7 @@
|
|||
show_user_page($user);
|
||||
}
|
||||
} else if (strlen($HTTP_POST_VARS["new"])) {
|
||||
page_head("Creating Account");
|
||||
db_init();
|
||||
$query = sprintf(
|
||||
"select * from user where email_addr='%s'",
|
||||
|
|
|
@ -30,6 +30,5 @@ function show_user_page($user) {
|
|||
echo "<li><a href=prefs.php>Preferences</a></li>";
|
||||
echo "<li><a href=team.php>Teams</a></li>";
|
||||
echo "</ul>";
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -19,13 +19,13 @@ function get_user_from_cookie() {
|
|||
}
|
||||
|
||||
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_NAME);
|
||||
} else {
|
||||
printf("Not logged in. <a href=login.php>Log in.</a>\n");
|
||||
}
|
||||
page_head("Log in");
|
||||
printf("Logged in as %s.\n", $user->name);
|
||||
printf("<br><a href=force_login.php>Log in as someone else.</a>\n");
|
||||
printf("<br><a href=this_user.php>My %s</a>\n", PROJECT_NAME);
|
||||
//printf("Not logged in. <a href=login.php>Log in.</a>\n");
|
||||
|
||||
page_tail();
|
||||
}
|
||||
|
||||
function page_head($title) {
|
||||
|
@ -50,6 +50,14 @@ function start_table() {
|
|||
echo "<table width=600 border=2 cellpadding=4>";
|
||||
}
|
||||
|
||||
function start_table_instr() {
|
||||
echo "<table width=800 border=0>";
|
||||
}
|
||||
|
||||
function row_head($x) {
|
||||
echo "<tr><th colspan=2>$x</th></tr>\n";
|
||||
}
|
||||
|
||||
function row($x, $y) {
|
||||
echo "<tr><td width=30% valign=top align=right>$x</td><td>$y</td></tr>\n";
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue