/** * laceListener() * * Checks POST variables for incoming messages or * update requests. */ function laceListener($fromListener = true) { $cookie_name = cookieVar(LACE_NAME_COOKIE, false); $post_name = postVar('name', false); // name $post_text = postVar('text', false); // text if ($post_name !== false && $post_text !== false) { if (validateSession() === false) { return '"chat":{"nodata":"1"}'; } if (isFlooding() === true) { return '"chat":{"nodata":"1"}'; } $message = prepareMessage($post_name, $post_text); if ($message !== false) { if ($cookie_name && $cookie_name != $post_name) { addNameChange($cookie_name, $post_name); } else { global $A; // Activity object joinMessage($post_name); $A->update($post_name); } // Reset $name just in case it has been changed global $name; $name = $post_name; setcookie(LACE_NAME_COOKIE, $post_name, time() + 259200, LACE_URL_REL); addMessage($message); } } if ($fromListener) { $chatHash = postVar('chatHash', false); if ($chatHash) { $hash = getMessageHash(); if (validateSession() === false || $chatHash == $hash) { return '"chat":{"nodata":""}'; } $json = '"chat":{"hash":"' . $hash . '","data":"'; $json .= addslashes(str_replace("\n", "", printFileContentsHTML())) . '"}'; return $json; } return '"chat":{"nodata":""}'; } return '"chat":{"nodata":""}'; }
?> </ul> </div> </div> <h4 id="windowTitle"><?php echo LACE_SITE_NAME; ?> <?php echo LACE_SITE_DESCRIPTION ? ' - ' . LACE_SITE_DESCRIPTION : ''; ?> </h4> <div id="main"> <div id="laceoutput"> <?php echo printFileContentsHTML(); ?> </div> </div> <form name="laceform" id="laceform" action="<?php echo LACE_URL_REL; ?> " method="post"> <table> <tbody id="lacecontrols"> <tr> <td class="name"> <input type="text" name="name" id="name" maxlength="10" size="10" value="<?php echo $name; ?>
* You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ require_once '../config.php'; $logfile = LACE_LOGDIR . postVar('log') . '.dat'; if (!file_exists($logfile)) { $logfile = LACE_LOGFILE; } ?> <div id="subnav"> <?php printLogList($logfile); ?> </div> <h4 id="windowTitle"><?php echo LACE_SITE_NAME; ?> Logs</h4> <div id="main"> <div id="laceoutput"> <?php echo printFileContentsHTML($logfile); ?> </div> </div> <div id="footer"> </div>