*** empty log message ***
authorArt Cancro <ajc@citadel.org>
Fri, 31 Oct 2003 05:35:03 +0000 (05:35 +0000)
committerArt Cancro <ajc@citadel.org>
Fri, 31 Oct 2003 05:35:03 +0000 (05:35 +0000)
ctdlphp/ctdlheader.php
ctdlphp/ctdlprotocol.php
ctdlphp/ctdlsession.php
ctdlphp/login.php

index d35a62f2f34fb117e99b80f2ea37121fb7f65547..e8073362cd96c45bc878c2f454e941bcac41f672 100644 (file)
@@ -9,7 +9,6 @@ function bbs_page_header() {
 
        establish_citadel_session();
 
-
        echo <<<LITERAL
 
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
index 84ab12541616d1011cdd819908101b64bb52ab7c..2a6545187f5e6ff8bd0895d1460fc2120e161b07 100644 (file)
@@ -1,5 +1,17 @@
 <?PHP
 
+// $Id$
+// 
+// Implements various Citadel server commands.
+//
+// Copyright (c) 2003 by Art Cancro <ajc@uncensored.citadel.org>
+// This program is released under the terms of the GNU General Public License.
+//
+
+
+//
+// serv_gets() -- generic function to read one line of text from the server
+//
 function serv_gets() {
        global $clientsocket;
 
@@ -8,6 +20,10 @@ function serv_gets() {
        return $buf;
 }
 
+
+//
+// serv_puts() -- generic function to write one line of text to the server
+//
 function serv_puts($buf) {
        global $clientsocket;
        
@@ -15,6 +31,29 @@ function serv_puts($buf) {
 }
 
 
+//
+// Learn all sorts of interesting things about the Citadel server to
+// which we are connected.
+//
+function ctdl_get_serv_info() {
+       global $serv_humannode;
+       global $serv_software;
+
+       serv_puts("INFO");
+       serv_gets($buf);
+       if (substr($buf, 0, 1) == "1") {
+               $i = 0;
+               do {
+                       $buf = serv_gets();
+                       if ($i == 2) $serv_humannode = $buf;
+                       if ($i == 4) $serv_software = $buf;
+                       $i = $i + 1;
+               } while ($buf != "000");
+       }
+
+}
+
+
 
 function test_for_echo() {
 
index eefde56cb09304937a9920b6f60b4f43b9ed98ed..fe0e374f3e6a526e180db73bb304a1b89afa7712 100644 (file)
@@ -26,9 +26,6 @@ function establish_citadel_session() {
        // flush();
        $clientsocket = fsockopen($sockname, 0, $errno, $errstr, 5);
        if (!$clientsocket) {
-               //echo "Socket not present.  Firing up a new proxy.<BR>\n";
-               //flush();
-
                // It ain't there, dude.  Open up the proxy. (C version)
                //$cmd = "./sessionproxy " . $sockname ;
                //exec($cmd);
@@ -41,8 +38,6 @@ function establish_citadel_session() {
                sleep(2);
 
                // Ok, now try again.
-               // echo "Connecting to ", $sockname, "...<BR>\n";
-               // flush();
                $clientsocket = fsockopen($sockname, 0, $errno, $errstr, 5);
        }
 
index a4da890a11760057e16e13d6b1ec18fd3ab0d75a..7938064bc4e62ed1bac84c7beb6da5b16c7e9f0f 100644 (file)
@@ -1,6 +1,5 @@
 <?PHP
        include "ctdlheader.php";
-
        bbs_page_header();
 
        ctdl_mesg("hello");