]> code.citadel.org Git - citadel.git/blobdiff - ctdlphp/ctdlsession.php
* experiments on user creation... not yet ready, but maybe helpfull to others.
[citadel.git] / ctdlphp / ctdlsession.php
index 996975d7a6d6b2b62d78cf6dd89f39d50d1bd762..9dbf0ec22aa6736ed4d138aca88f08f190b34850 100644 (file)
@@ -62,17 +62,23 @@ function establish_citadel_session() {
                }
 
                // At this point we have a good connection to Citadel.
-
-               ctdl_iden();    // Identify client
-
-               if ($_SESSION["username"]) {
+               $identity=array(
+                       "DevelNr" => '0',
+                       "ClientID" => '8',
+                       "VersionNumber" => '001',
+                       "ClientInfoString" => 'PHP web client|',
+                       "Remote Address" => $_SERVER['REMOTE_ADDR'] );
+
+               ctdl_iden($identity);   // Identify client
+               ctdl_MessageFormatsPrefered(array("text/html","text/plain"));
+               if (isset($_SESSION["username"])) {
                        login_existing_user(
                                $_SESSION["username"],
                                $_SESSION["password"]
                        );
                }
 
-               if ($_SESSION["room"]) {
+               if (isset($_SESSION["room"])) {
                        ctdl_goto($_SESSION["room"]);
                }
                else {
@@ -81,7 +87,11 @@ function establish_citadel_session() {
        }
 
        if (!isset($_SESSION["serv_humannode"])) {
-               ctdl_get_serv_info();
+               $server_info = ctdl_get_serv_info();
+               print_r($server_info);
+               $keys = array_keys($server_info);
+               foreach ($keys as $key)
+                       $_SESSION[$key] = $server_info[$key];
        }
 
        // If the user is trying to call up any page other than