From 4fc2c543112c4734b71272b1e4a1392406d63455 Mon Sep 17 00:00:00 2001 From: Arun Persaud Date: Sat, 26 Apr 2008 13:16:24 -0700 Subject: [PATCH] CLEANUP: moved register.php to the include directory new users are now also automatically logged in. Signed-off-by: Arun Persaud --- include/output.php | 2 +- register.php => include/register.php | 51 ++++++++++------------------ index.php | 3 ++ 3 files changed, 21 insertions(+), 35 deletions(-) rename register.php => include/register.php (73%) diff --git a/include/output.php b/include/output.php index b22b6ef..4f4a5b6 100644 --- a/include/output.php +++ b/include/output.php @@ -275,7 +275,7 @@ function output_home_page($pre,$game,$done,$avgtime) echo "$done games have been completed on this server. Average time of a game: $avgtime days

"; ?> -

Please register, in case you have not done that yet
+

Please register, in case you have not done that yet
or login with you email-address or name and password here:

diff --git a/register.php b/include/register.php similarity index 73% rename from register.php rename to include/register.php index 9f4cf0e..88b13a2 100644 --- a/register.php +++ b/include/register.php @@ -1,25 +1,9 @@ homepage to continue."; + { + /* Set session, so that new user doesn't need to log in */ + $myname = DB_get_name('email',$_REQUEST['Remail']); + $_SESSION["name"] = $myname; + + echo "myname $myname --"; + + echo " Welcome to e-DoKo, you are now registered, please visit the". + " homepage to continue."; + } else echo " something went wrong, couldn't add you to the database, please contact $ADMIN_NAME at $ADMIN_EMAIL."; } @@ -55,7 +47,7 @@ if(myisset("Rfullname","Remail","Rpassword","Rtimezone") ) { echo "IMPORTANT: passwords are going over the net as clear text, so pick an easy password. No need to pick anything complicated here ;)

"; ?> - +
Register @@ -87,14 +79,5 @@ if(myisset("Rfullname","Remail","Rpassword","Rtimezone") ) +?> \ No newline at end of file diff --git a/index.php b/index.php index 31c497a..d1d2926 100644 --- a/index.php +++ b/index.php @@ -57,6 +57,9 @@ switch($action) require './include/login.php'; require './include/user.php'; break; + case 'register': + require './include/register.php'; + break; case 'game': require './include/game.php'; break; -- 2.25.1