]> code.citadel.org Git - citadel.git/blobdiff - ctdlphp/ctdlsession.php
* Cleaned up the pages in preparation for handing it off to the extremely
[citadel.git] / ctdlphp / ctdlsession.php
index 6669eac75af8d4007841273844f834b4c1216050..81e7c282924b6c155273dda069a9ef8017e48a34 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.
@@ -42,24 +41,24 @@ function establish_citadel_session() {
 
                // Ok, now try again.
                $clientsocket = fsockopen($sockname, 0, $errno, $errstr, 5);
+
+               // Try to log the user back in.
+               if ($clientsocket) {
+
+
+                       if ($_SESSION["username"]) {
+                               login_existing_user(
+                                       $_SESSION["username"],
+                                       $_SESSION["password"]
+                               );
+                       }
+               }
        }
 
        if ($clientsocket) {
-               /*
-               echo "Connected.  Performing echo tests.<BR>\n";
-               flush();
-               $cmd = "ECHO test echo string upon connection\n";
-               fwrite($clientsocket, $cmd);
-               $response = fgets($clientsocket, 4096);
-               echo "Response is: ", $response, "<BR>\n";
-               flush();
-
-               $cmd = "ECHO second test for echo\n";
-               fwrite($clientsocket, $cmd);
-               $response = fgets($clientsocket, 4096);
-               echo "Response is: ", $response, "<BR>\n";
-               flush();
-               */
+               if (!$_SESSION["serv_humannode"]) {
+                       ctdl_get_serv_info();
+               }
        }
        else {
                echo "ERROR: no Citadel socket!<BR>\n";