Exemple #1
0
function bbs_page_header()
{
    // Make sure we're connected to Citadel.  Do not remove this!!
    establish_citadel_session();
    echo <<<LITERAL
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
\t<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
\t<link rel="stylesheet" href="sitestyle.css" type="text/css" />
\t<meta name="Description" content="Citadel BBS">
\t<meta name="Keywords" content="citadel,bbs">
\t<meta name="MSSmartTagsPreventParsing" content="TRUE">
\t<title>
LITERAL;
    if ($_SESSION["serv_humannode"]) {
        echo $_SESSION["serv_humannode"];
    } else {
        echo "BBS powered by Citadel";
    }
    echo <<<LITERAL
</title>
</head>

<body
\ttext="#000000"
\tbgcolor="#FFFFFF"
\tlink="#0000FF"
\tvlink="#990066"
\talink="#DD0000"
>


LITERAL;
    echo '<div id="Header">';
    echo '<TABLE BORDER=0 WIDTH=100%>';
    echo '<TR>';
    echo '<TD>' . $_SESSION["serv_humannode"] . '</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
    if (isset($_SESSION["logged_in"])) {
        echo '<div id="Menu">' . '<a href="listrooms.php">' . 'room list</A><BR>' . '<a href="readmsgs.php?mode=all&count=0">' . 'Read all</a><BR>' . '<a href="readmsgs.php?mode=new&count=0">' . 'Read new</a><BR>' . '<a href="display_enter.php">' . 'Enter msg</a><BR>' . '<a href="who.php">' . 'Who is online?</a><BR>' . '<a href="myinfo.php">' . 'My information</a><BR>' . '<A HREF="logout.php">' . 'Log out</A>' . '</div>';
        echo '<div id="demolinks">' . '<a href="testcommand.php">' . 'demolist</A><BR>' . '<a href="readmsgs.php?mode=all&count=0">' . 'Read all</a><BR>' . '<a href="readmsgs.php?mode=new&count=0">' . 'Read new</a><BR>' . '<a href="display_enter.php">' . 'Enter msg</a><BR>' . '<a href="who.php">' . 'Who is online?</a><BR>' . '<A HREF="logout.php">' . 'Log out</A>' . '</div>';
    }
    echo '<div id="Content">';
}
Exemple #2
0
 function Logon($username, $domain, $password)
 {
     debugLog("Logging in.\n");
     establish_citadel_session();
     $usr = explode('\\', $username);
     ///	    debugLog(print_r($usr, true));
     debugLog($password);
     if (count($usr) == 2) {
         $username = $usr[1];
     }
     $ret = login_existing_user($username, $password);
     if ($ret[0] != TRUE) {
         echo $ret[1];
     }
     return $ret[0];
 }
}
$configname = $user . "/config.txt";
if (!is_array(stat($configname))) {
    die("\nCouldn't find users config in {$configname}\n");
}
$vcardfh = fopen($vcardname, "r");
$vcard = fread($vcardfh, filesize($vcardname));
fclose($vcardfh);
$configfh = fopen($configname, "r");
$config = fread($configfh, filesize($configname));
fclose($configfh);
include "ctdlsession.php";
include "ctdlprotocol.php";
include "ctdlelements.php";
//define(CITADEL_DEBUG_HTML, FALSE);
establish_citadel_session();
create_new_user($user, $password);
ctdl_goto("My Citadel Config");
list($num_msgs, $response, $msgs) = ctdl_msgs("", "");
$Webcit_Preferences = array();
$Webcit_PrefMsgid = 0;
if ($num_msgs > 0) {
    foreach ($msgs as $msgnum) {
        print_r($msgnum);
        // Fetch the message from the server
        list($ok, $response, $fields) = ctdl_fetch_message($msgnum);
        // Bail out gracefully if the message isn't there.
        if (!$ok) {
            echo "Error: " . $response . "\n";
            return false;
        }