This commit is contained in:
Pentium44 2020-12-09 21:36:55 -08:00
parent 18513d111c
commit f7b2295a40
3 changed files with 15 additions and 4 deletions

View File

@ -18,7 +18,7 @@ $logfile = "irclog.txt"; // Log instances for each bouncer
$ipcolor = "#00FF00";
///// NO TOUCHY SECTION /////
$version = "1.0.0"; // CWChat version
$version = "1.1.0"; // CWChat version
function doLog($string) {
file_put_contents($GLOBALS['logfile'], $string . "\r\n", FILE_APPEND);

View File

@ -57,7 +57,7 @@ if (isset($_GET['register']) && $_GET['register'] == "go") {
if(isset($_POST['username']) && $_POST['username'] != "") {
$username = stripslashes(htmlentities($_POST['username']));
$password = md5($_POST['password']);
$channame = isset($_POST['channel']) && ($_POST['channel'] !== "") ? htmlentities(stripslashes($_POST['channel'])) : "#theroot";
$channame = isset($_POST['channel']) && ($_POST['channel'] !== "") ? htmlentities(stripslashes($_POST['channel'])) : $default_channel;
$servaddr = isset($_POST['servaddr']) && ($_POST['servaddr'] !== "") ? htmlentities(stripslashes($_POST['servaddr'])) : $server;
$servport = isset($_POST['servport']) && ($_POST['servport'] !== "") ? htmlentities(stripslashes($_POST['servport'])) : $port;
file_put_contents("users/$username.php", "<?php \$userpass = '" . $password . "'; ?>\n");

View File

@ -70,11 +70,22 @@ if (isset($_GET['msg']) && $_GET['msg']!="" && isset($_GET['nick']) && $_GET['ni
$line .= "\x01\n";
} else if ($cmd[0]=="/join") {
doLog("$username: joining " . $cmd[1]);
$line .= "JOIN" . " " . $cmd[1] . "\n"; // set for push
$line .= "JOIN" . " " . trim($cmd[1]) . "\n"; // set for push
//$logline .= "<tr><td class='userinfo'><b>$nick</b>:</td><td>Joining " . $cmd[1] . "</td></tr>\n"; // push to client
$_SESSION['idleirc-channel'] = trim($cmd[1]);
} else if ($cmd[0] == "/rejoin") {
doLog("$username: rejoining channel");
if ($cmd[1] != "") {
$line .= "PART " . trim($cmd[1]) . " :$username leaving...\n"; // push close command to IRC
$line .= "JOIN " . trim($cmd[1]) . "\n"; // set for push
//$logline .= "<tr><td class='userinfo'><b>$nick</b>: </td><td>Leaving " . trim($cmd[1]) . "</td></tr>\n"; // push to client
} else {
$line .= "PART $channel :$username leaving...\n"; // push close command to IRC
$line .= "JOIN $channel\n"; // set for push
//$logline .= "<tr><td class='userinfo'><b>$nick</b>: </td><td>Leaving $channel</td></tr>\n"; // push to client
}
} else if ($cmd[0] == "/part") {
doLog("$username: leaving " . $cmd[1]);
doLog("$username: leaving " . trim($cmd[1]));
if ($cmd[1] != "") {
$line .= "PART " . trim($cmd[1]) . " :$username leaving...\n"; // push close command to IRC
//$logline .= "<tr><td class='userinfo'><b>$nick</b>: </td><td>Leaving " . trim($cmd[1]) . "</td></tr>\n"; // push to client