X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=blobdiff_plain;f=index.php;h=cf556803ad17b6f8a84f9ac26b4baf21594064d8;hp=689a8ceeb161c98c235ffea3221f58876c2f1b8f;hb=1bb3313519b27a11d6634b584301f4d65f3ff364;hpb=51312acc9682902810edee454471aae1ce59d80c diff --git a/index.php b/index.php index 689a8ce..cf55680 100644 --- a/index.php +++ b/index.php @@ -1,53 +1,16 @@ - - - - e-Doko - - - - - -
-

Welcome to E-Doko

-
- \n Local times:"; + $users = array(); + $users = DB_get_all_userid_by_gameid($gameid); + foreach($users as $user) + { + $offset = DB_get_user_timezone($user); + $zone = return_timezone($offset); + date_default_timezone_set($zone); + $name = DB_get_name_by_userid($user); + + echo "\n"; + }; + echo "
$name ".date("Y-m-d H:i:s")."
\n\n"; display_status(); + /* display links to other games */ + echo "
\n"; + $result = mysql_query("SELECT email,password from User WHERE id='$myid'" ); + $r = mysql_fetch_array($result,MYSQL_NUM); + echo "
\n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo "
\n"; + echo "
\n"; + + display_news(); + $gamestatus = DB_get_game_status_by_gameid($gameid); if($gamestatus == 'pre') { @@ -465,10 +454,10 @@ else if(isset($_REQUEST["me"])) $next_hash = DB_get_hash_from_game_and_pos($gameid,$next); $email = DB_get_email_by_hash($next_hash); - $message .= "It's your turn now.\n". + $message = "It's your turn now.\n". "Use this link to play a card: ".$host."?me=".$next_hash."\n\n" ; mymail($email,"[DoKo-debug] a card has been played",$message); - + if($debug) echo "DEBUG: next player
\n"; @@ -528,7 +517,7 @@ else if(isset($_REQUEST["me"])) $names = DB_get_all_names_by_gameid($gameid); echo "Do you want to continue playing?(This will start a new game, with the next person as dealer.)\n"; - echo "
\n"; + echo "\n"; echo " \n"; echo " \n"; echo " \n"; @@ -547,12 +536,16 @@ else if(isset($_REQUEST["me"])) else if(isset($_REQUEST["email"]) && isset($_REQUEST["password"])) { /* test id and password, should really be done in one step */ + $email = $_REQUEST["email"]; + $password = $_REQUEST["password"]; + + if(strlen($password)!=32) + $password = md5($password); + $ok=1; - $uid = DB_get_userid_by_email($_REQUEST["email"]); + $uid = DB_get_userid_by_email_and_password($email,$password); if(!$uid) $ok=0; - if(!DB_get_userid_by_passwd(md5($_REQUEST["password"]))) - $ok=0; if($ok) { @@ -563,15 +556,14 @@ else if(isset($_REQUEST["me"])) $zone = return_timezone($offset); date_default_timezone_set($zone); - echo "ok. your logged in, now what? :)
last login: "; - echo date("r",$unixtime)."
"; + echo "last login: ".date("r",$unixtime)."
"; DB_update_user_timestamp($uid); echo "

these are the games you are playing in:
\n"; $result = mysql_query("SELECT hash,game_id from Hand WHERE user_id='$uid' AND status<>'gameover'" ); while( $r = mysql_fetch_array($result,MYSQL_NUM)) - echo "game #".$r[1]."
"; + echo "game #".$r[1]."
"; echo "

\n"; $names = DB_get_all_names(); @@ -580,7 +572,7 @@ else if(isset($_REQUEST["me"])) echo "$name
\n"; echo "

\n"; echo "

Want to start a new game? remember 4 names from the list above and visit ". - "this page.

"; + "this page.

"; } else { @@ -591,6 +583,7 @@ else if(isset($_REQUEST["me"])) /* page for registration */ else if(isset($_REQUEST["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: convert timezone into a menu
\n"; echo "TODO: figure out a way to handle passwrods
\n"; ?> @@ -652,34 +645,10 @@ else if(isset($_REQUEST["Rfullname"]) && /* default login page */ else { /* no new game, not in a game */ -?> -

If you want to play a game of Doppelkopf, you found the right place ;)

-

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

- -
- Login - - - - - - - -
-
-
- - - - - - -