From d0c038e87a2a26ed14048a0f99b3edea1ba03a6a Mon Sep 17 00:00:00 2001
From: Art Cancro
Date: Wed, 5 Nov 2003 03:29:12 +0000
Subject: [PATCH] * Added a room list function to the library * Threw together
temporary room list and goto pages to demonstrate
---
ctdlphp/ChangeLog | 5 +++++
ctdlphp/ctdlprotocol.php | 47 ++++++++++++++++++++++++++++++++++++++++
ctdlphp/do_login.php | 8 +++----
ctdlphp/goto.php | 15 +++++++++++++
ctdlphp/listrooms.php | 27 +++++++++++++++++++++++
ctdlphp/welcome.php | 3 ++-
6 files changed, 100 insertions(+), 5 deletions(-)
create mode 100644 ctdlphp/goto.php
create mode 100644 ctdlphp/listrooms.php
diff --git a/ctdlphp/ChangeLog b/ctdlphp/ChangeLog
index 4b918281e..d90b7c926 100644
--- a/ctdlphp/ChangeLog
+++ b/ctdlphp/ChangeLog
@@ -1,4 +1,8 @@
$Log$
+ Revision 1.13 2003/11/05 03:29:12 ajc
+ * Added a room list function to the library
+ * Threw together temporary room list and goto pages to demonstrate
+
Revision 1.12 2003/11/04 19:17:16 ajc
* Added an initial version of the goto command
@@ -53,3 +57,4 @@
Revision 1.1 2003/10/31 03:47:13 ajc
* Initial CVS import
+
diff --git a/ctdlphp/ctdlprotocol.php b/ctdlphp/ctdlprotocol.php
index cebf9f452..0463ad512 100644
--- a/ctdlphp/ctdlprotocol.php
+++ b/ctdlphp/ctdlprotocol.php
@@ -231,4 +231,51 @@ function ctdl_goto($to_where) {
+//
+// Fetch the list of known rooms.
+//
+function ctdl_knrooms() {
+ global $clientsocket;
+
+ serv_puts("LKRA");
+ $response = serv_gets();
+
+ if (substr($response, 0, 1) != "1") {
+ return array(0, NULL);
+ }
+
+ $all_lines = array();
+ $num_lines = 0;
+
+ while (strcmp($buf = serv_gets(), "000")) {
+
+ $thisline = array();
+
+ $tok = strtok($buf, "|");
+ if ($tok) $thisline["name"] = $tok;
+
+ $tok = strtok("|");
+ if ($tok) $thisline["flags"] = $tok;
+
+ $tok = strtok("|");
+ if ($tok) $thisline["floor"] = $tok;
+
+ $tok = strtok("|");
+ if ($tok) $thisline["order"] = $tok;
+
+ $tok = strtok("|");
+ if ($tok) $thisline["flags2"] = $tok;
+
+ $tok = strtok("|");
+ if ($tok) $thisline["access"] = $tok;
+
+ $num_lines = array_push($all_lines, $thisline);
+ }
+
+ return array($num_lines, $all_lines);
+
+}
+
+
+
?>
diff --git a/ctdlphp/do_login.php b/ctdlphp/do_login.php
index cc1429ded..8a9c2e77b 100644
--- a/ctdlphp/do_login.php
+++ b/ctdlphp/do_login.php
@@ -12,13 +12,13 @@ include "ctdlheader.php";
bbs_page_header();
-if ($_POST["action"] == "Login") {
+if ($_REQUEST["action"] == "Login") {
list($retval, $msg) =
- login_existing_user($_POST["user"], $_POST["pass"]);
+ login_existing_user($_REQUEST["user"], $_REQUEST["pass"]);
}
-else if ($_POST["action"] == "New User") {
+else if ($_REQUEST["action"] == "New User") {
list($retval, $msg) =
- create_new_user($_POST["user"], $_POST["pass"]);
+ create_new_user($_REQUEST["user"], $_REQUEST["pass"]);
}
else {
echo "uuuuhhhhhhhhh....
\n" ;
diff --git a/ctdlphp/goto.php b/ctdlphp/goto.php
new file mode 100644
index 000000000..64d5f96d8
--- /dev/null
+++ b/ctdlphp/goto.php
@@ -0,0 +1,15 @@
+\n";
+?>
+
+Page One
+Page Three
+
+
diff --git a/ctdlphp/listrooms.php b/ctdlphp/listrooms.php
new file mode 100644
index 000000000..9920c4636
--- /dev/null
+++ b/ctdlphp/listrooms.php
@@ -0,0 +1,27 @@
+
+
+Known rooms
+
+
+
+Page One
+Page Three
+
+
diff --git a/ctdlphp/welcome.php b/ctdlphp/welcome.php
index 19dc73428..db770c4a8 100644
--- a/ctdlphp/welcome.php
+++ b/ctdlphp/welcome.php
@@ -20,8 +20,9 @@ lorem, mattis et, interdum eu, bibendum sed, tortor. Mauris eu metus. Fusce
tellus tortor, vehicula at, iaculis vitae, adipiscing quis, sapien. Lorem
ipsum dolor sit amet, consectetuer adipiscing elit.
-Page Two
Who is online?
+room list
+Page Two
Page Three