]> code.citadel.org Git - citadel.git/blobdiff - ctdlphp/ctdlsession.php
* removed wrong include.
[citadel.git] / ctdlphp / ctdlsession.php
index db56974ef3c398f9ea94674744104cc2554efe07..640f4ecfe14ab1e4a74b0d03e410208c8e771027 100644 (file)
@@ -42,10 +42,18 @@ function establish_citadel_session() {
                //exec($cmd);
 
                // It ain't there, dude.  Open up the proxy.  (PHP version)
+               if (CITADEL_DEBUG_PROXY){
+                       $stdout = '>>/tmp/sessionproxyout.txt ';
+               }
+               else{
+                       $stdout = '>/dev/null ';
+               }
+
                $cmd = "./sessionproxy.php " . $sockname .
-                       " </dev/null >/dev/null 2>&1 " .
+                       " </dev/null ".$stdout."2>&1 " .
                        " 3>&1 4>&1 5>&1 6>&1 7>&1 8>&1 & " ;
                exec($cmd);
+               sleep(1);
 
                // Keep attempting connections 10 times per second up to 100 times
                $attempts = 0;
@@ -71,14 +79,14 @@ function establish_citadel_session() {
 
                ctdl_iden($identity);   // Identify client
                ctdl_MessageFormatsPrefered(array("text/html","text/plain"));
-               if ($_SESSION["username"]) {
+               if (isset($_SESSION["username"])) {
                        login_existing_user(
                                $_SESSION["username"],
                                $_SESSION["password"]
                        );
                }
 
-               if ($_SESSION["room"]) {
+               if (isset($_SESSION["room"])) {
                        ctdl_goto($_SESSION["room"]);
                }
                else {