]> code.citadel.org Git - citadel.git/blobdiff - ctdlphp/ctdlsession.php
* Added an initial version of the goto command
[citadel.git] / ctdlphp / ctdlsession.php
index 5683467abae3f93b76b9e42be3ea535b28fb588b..b8f2dbcd14215fce35960876abf60fd69044670c 100644 (file)
@@ -1,7 +1,6 @@
 <?PHP
 
-//
-// ctdlsession.php
+// $Id$
 //
 // This gets called from within the header functions.  It establishes or
 // connects to a PHP session, and then connects to Citadel if necessary.
@@ -43,9 +42,10 @@ function establish_citadel_session() {
                // Ok, now try again.
                $clientsocket = fsockopen($sockname, 0, $errno, $errstr, 5);
 
-               // Try to log the user back in.
+               // Try to log the user back in and go back to the correct room.
                if ($clientsocket) {
 
+                       ctdl_iden();    // Identify client
 
                        if ($_SESSION["username"]) {
                                login_existing_user(
@@ -53,6 +53,13 @@ function establish_citadel_session() {
                                        $_SESSION["password"]
                                );
                        }
+
+                       if ($_SESSION["room"]) {
+                               ctdl_goto($_SESSION["room"]);
+                       }
+                       else {
+                               ctdl_goto("_BASEROOM_");
+                       }
                }
        }