* have a config.php containing our server connection.
--- /dev/null
+<?PHP
+#could be: "uncensored.citadel.org"
+# or the path of the unix domain socket: /var/run/citadel/citadel.sock
+define('CITADEL_HOSTNAME',"127.0.0.1");
+
+#make it 0 to use unix domain sockets
+define('CITADEL_TCP_PORTNO','504');
+
+
+?>
\ No newline at end of file
echo strftime("%b %d %Y %I:%M%p ", $fields["time"]) ;
echo " from " . htmlspecialchars($fields["from"]) ;
echo strftime("%b %d %Y %I:%M%p ", $fields["time"]) ;
echo " from " . htmlspecialchars($fields["from"]) ;
- if (strlen($fields["rfca"]) > 0) {
+ if (isset($fields["rfca"]) && strlen($fields["rfca"]) > 0) {
echo " <" . htmlspecialchars($fields["rfca"]) . ">" ;
}
else if ( (strlen($fields["node"]) > 0)
echo " <" . htmlspecialchars($fields["rfca"]) . ">" ;
}
else if ( (strlen($fields["node"]) > 0)
- if (strlen($fields["rcpt"]) > 0) {
+ if (isset($fields["rcpt"]) && strlen($fields["rcpt"]) > 0) {
echo " to " . htmlspecialchars($fields["rcpt"]) ;
}
echo "</I></B><BR>\n" ;
echo " to " . htmlspecialchars($fields["rcpt"]) ;
}
echo "</I></B><BR>\n" ;
echo '<TABLE BORDER=0 WIDTH=100%>';
echo '<TR>';
echo '<TD>' . $_SESSION["serv_humannode"] . '</TD>' ;
echo '<TABLE BORDER=0 WIDTH=100%>';
echo '<TR>';
echo '<TD>' . $_SESSION["serv_humannode"] . '</TD>' ;
- echo '<TD>' . $_SESSION["username"] . '</TD>' ;
- echo '<TD>' . $_SESSION["room"] . '</TD>' ;
+ echo '<TD>' . (isset($_SESSION["username"]))?'':$_SESSION["username"] . '</TD>' ;
+ echo '<TD>' . (isset($_SESSION["room"]))?'':$_SESSION["room"] . '</TD>' ;
echo '<TD ALIGN=RIGHT><A HREF="logout.php">Log out</A></TD>' ;
echo '</TR></TABLE>';
echo '</div>';
// Temporary menu
echo '<TD ALIGN=RIGHT><A HREF="logout.php">Log out</A></TD>' ;
echo '</TR></TABLE>';
echo '</div>';
// Temporary menu
- if ($_SESSION["logged_in"]) {
+ if (isset($_SESSION["logged_in"])) {
echo '<div id="Menu">' .
'<a href="listrooms.php">' .
'room list</A><BR>' .
echo '<div id="Menu">' .
'<a href="listrooms.php">' .
'room list</A><BR>' .
// $Id$
//
// This gets called from within the header functions. It establishes or
// $Id$
//
// This gets called from within the header functions. It establishes or
- if ($_SESSION["ctdlsession"]) {
+ if (isset($_SESSION["ctdlsession"])) {
$session = $_SESSION["ctdlsession"];
}
else {
$session = $_SESSION["ctdlsession"];
}
else {
- if (!$_SESSION["serv_humannode"]) {
+ if (!isset($_SESSION["serv_humannode"])) {
// login.php logout.php do_login.php,
// and the session is not logged in, redirect to login.php
//
// login.php logout.php do_login.php,
// and the session is not logged in, redirect to login.php
//
- if ($_SESSION["logged_in"] != 1) {
+ if (isset($_SESSION["logged_in"]) && ($_SESSION["logged_in"] != 1)) {
$filename = basename(getenv('SCRIPT_NAME'));
if ( (strcmp($filename, "login.php"))
&& (strcmp($filename, "logout.php"))
$filename = basename(getenv('SCRIPT_NAME'));
if ( (strcmp($filename, "login.php"))
&& (strcmp($filename, "logout.php"))
// $Id$
//
// This is the session proxy that binds a unix domain socket to a Citadel
// $Id$
//
// This is the session proxy that binds a unix domain socket to a Citadel
// We need to get a connection to the Citadel server going now.
// We need to get a connection to the Citadel server going now.
-$ctdlsock = fsockopen("uncensored.citadel.org", 504, $errno, $errstr, 30);
-//$ctdlsock = fsockopen("/appl/citadel/citadel.socket", 0, $errno, $errstr, 30);
+$ctdlsock = fsockopen(CITADEL_HOSTNAME, CITADEL_TCP_PORTNO, $errno, $errstr, 30);
if (!$ctdlsock) {
socket_close ($sock);
system("/bin/rm -f " . $sockname);
if (!$ctdlsock) {
socket_close ($sock);
system("/bin/rm -f " . $sockname);