From: Arun Persaud Date: Sat, 28 Jul 2007 16:44:33 +0000 (-0700) Subject: CLEANUP: moved registration to seperate php file X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=commitdiff_plain;h=046b683603f1c49460079595f819591b1918c9a2 CLEANUP: moved registration to seperate php file started cleanup on index.php. trying to move as much out of index.php as possible to make it easier to read. --- diff --git a/index.php b/index.php index 8c34a2b..40708f8 100644 --- a/index.php +++ b/index.php @@ -1902,38 +1902,6 @@ else if( myisset("email","password") || isset($_SESSION["name"]) ) DB_close(); exit(); } -/* page for registration */ - else if(myisset("register") ) - { - output_register(); - } -/* new user wants to register */ - else if(myisset("Rfullname","Remail","Rpassword","Rtimezone") ) - { - $ok=1; - if(DB_get_userid_by_name($_REQUEST["Rfullname"])) - { - echo "please chose another name
"; - $ok=0; - } - if(DB_get_userid_by_email($_REQUEST["Remail"])) - { - echo "this email address is already used ?!
"; - $ok=0; - } - if($ok) - { - $r=mysql_query("INSERT INTO User VALUES(NULL,".DB_quote_smart($_REQUEST["Rfullname"]). - ",".DB_quote_smart($_REQUEST["Remail"]). - ",".DB_quote_smart(md5($_REQUEST["Rpassword"])). - ",".DB_quote_smart($_REQUEST["Rtimezone"]).",NULL)"); - - if($r) - echo " added you to the database"; - else - echo " something went wrong, couldn't add you to the database, please contact $ADMIN_NAME at $ADMIN_EMAIL."; - } - } /* default login page */ else { diff --git a/output.php b/output.php index 32c8108..8452815 100644 --- a/output.php +++ b/output.php @@ -37,43 +37,6 @@ function output_user_settings($email,$password) return; } -function output_register() -{ - echo "IMPORTANT: passwords are going over the net as clear text, so pick an easy password. No need to pick anything complicated here ;)

"; - echo "TODO: figure out a better way to handle passwords
\n"; - ?> -
-
- Register - - - - - - - - - - - - - - - -
- - (If your timezone is not listed, just select whatever you want and email the admin your correct time zone.) -
-
-
-"; ?> -

Please register, in case you haven't done that yet
+

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

diff --git a/register.php b/register.php new file mode 100644 index 0000000..827e77e --- /dev/null +++ b/register.php @@ -0,0 +1,98 @@ +"; + $ok=0; + } + if(DB_get_userid_by_email($_REQUEST["Remail"])) + { + echo "this email address is already used ?!
"; + $ok=0; + } + if($ok) + { + $r=mysql_query("INSERT INTO User VALUES(NULL,".DB_quote_smart($_REQUEST["Rfullname"]). + ",".DB_quote_smart($_REQUEST["Remail"]). + ",".DB_quote_smart(md5($_REQUEST["Rpassword"])). + ",".DB_quote_smart($_REQUEST["Rtimezone"]).",NULL)"); + + if($r) + 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."; + } + } +/* page for registration */ + else + { + echo "IMPORTANT: passwords are going over the net as clear text, so pick an easy password. No need to pick anything complicated here ;)

"; + ?> + +
+ Register + + + + + + + + + + + + + + + +
+ + (If your timezone is not listed, just select whatever you want and email the admin your correct time zone.) +
+
+
+