diff --git a/.gitignore b/.gitignore index 5f7c146..bae18d9 100755 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,3 @@ -*.log *.txt -*.pingfile -*.push /users diff --git a/README.md b/README.md index 5ee8bcf..b1dfc6d 100755 --- a/README.md +++ b/README.md @@ -60,6 +60,17 @@ Read-Write access for working directory #### Changelog +* v1.3.0: + * CSS changes / fixes + cleanup + * Added server/port set ability on register + settings (Can toggle on or off in config.php as $allowMultiServer == "false") + * More HTML fixes + cleanup + * Bugfixes in IRC protocol parsing + * Added user QUIT parsing to irc.php + * Removed unneeded ping code from server.php from previous project. + * Pushed cycle speed up in irc.php for more snappy responses + * Removed client passed messages from idleirc log + * Moved all client needed files to users/ directory for better file management + * v1.2.3: * CSS fixes and updates * HTML format fixes within server.php and irc.php generation diff --git a/config.php b/config.php index 68f09a4..5f1b828 100755 --- a/config.php +++ b/config.php @@ -9,16 +9,16 @@ $title = "IdleIRC"; // Chat title $desc = "IdleIRC is a simple web based IRC client & bouncer service."; // Chat description $server = "cddo.cf"; // IRC server connected to (for information display panel and client) $port = "1337"; // IRC server port (for information display panel) -$server_msgcount = "80"; // Number of messages to leave at the end of the server database $default_channel = "#theroot"; // Default channel to push users into $logfile = "irclog.txt"; // Log instances for each bouncer +$allowMultiServer = "true"; // [true/false] Allow users to set other IRC servers for bouncer connect //$maxloglength = "10"; // Max line length for flatfile IRC logger ~ bouncer. ///// WEBCLIENT LAYOUT ///// $ipcolor = "#00FF00"; ///// NO TOUCHY SECTION ///// -$version = "1.2.3"; // CWChat version +$version = "1.3.0"; // CWChat version function doLog($string) { file_put_contents($GLOBALS['logfile'], $string . "\r\n", FILE_APPEND); diff --git a/index.php b/index.php index 146fd28..f0816fc 100755 --- a/index.php +++ b/index.php @@ -16,33 +16,51 @@ if(!file_exists("users")) } function registerForm() { - ?> -
-
-
- Username:
- Password:
- Password again:

- Default Nickname:
- Autoconnect/focus channel:
- -
+ ?> +
+
+
+ + + + + + + + + + + +
Username:
Password:
Password again:
Below forms: The nickname form can be left blank and
will be substituted with your username.
Default Nickname:
Autoconnect/focus channel:
Server (IP:Port) :
+
+ + +
+

-
+

Welcome to " . $GLOBALS['desc']; ?>
Don't have an account? Create one here!

- Username:
- Password:
- + + + + + +
Username:
Password:
+
\n", FILE_APPEND); $_SESSION['idleirc-nick'] = stripslashes(htmlentities($_POST['nick'])); } - if(isset($_POST['channel']) && $_POST['channel']!="") { + if (isset($_POST['channel']) && $_POST['channel']!="") { file_put_contents("users/$username.php", "\n", FILE_APPEND); $_SESSION['idleirc-channel'] = stripslashes(htmlentities($_POST['channel'])); } - if(isset($_POST['password']) && $_POST['password']!="") { + if (isset($_POST['password']) && $_POST['password']!="") { file_put_contents("users/$username.php", "\n", FILE_APPEND); $_SESSION['idleirc-pass'] = md5($_POST['password']); } + if ($allowMultiServer == "true") { + if (isset($_POST['servaddr']) && $_POST['servaddr']!="") { + file_put_contents("users/$username.php", "\n", FILE_APPEND); + $_SESSION['idleirc-servaddr'] = stripslashes(htmlentities($_POST['servaddr'])); + } + + if (isset($_POST['servport']) && $_POST['servport']!="") { + file_put_contents("users/$username.php", "\n", FILE_APPEND); + $_SESSION['idleirc-servport'] = stripslashes(htmlentities($_POST['servport'])); + } + } + header("refresh: 0;url=index.php"); } else { header("refresh: 0;url=index.php"); @@ -95,7 +125,7 @@ if (isset($_GET['register']) && $_GET['register'] == "go") { $nickname = isset($_POST['nick']) && ($_POST['nick'] !== "") ? htmlentities(stripslashes($_POST['nick'])) : $username; $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", "\n"); + file_put_contents("users/$username.php", "\n"); file_put_contents("users/.$username.first", "First time, start up\n"); $_SESSION['idleirc-user'] = $username; $_SESSION['idleirc-nick'] = $nickname; @@ -115,8 +145,6 @@ if (isset($_GET['register']) && $_GET['register'] == "go") { // If web frontend is trying to login, process and connect if (isset($_GET['do']) && $_GET['do']=="login" && isset($_POST['submitBtn']) && isset($_POST['password']) && $_POST['password']!=""){ $name = isset($_POST['username']) && ($_POST['username'] !== "") && file_exists("users/" . $_POST['username'] . ".php") ? htmlentities(stripslashes($_POST['username'])) : "Unnamed"; - $servaddr = isset($_POST['servaddr']) && ($_POST['servaddr'] !== "") ? htmlentities(stripslashes($_POST['servaddr'])) : $server; - $servport = isset($_POST['servport']) && ($_POST['servport'] !== "") ? htmlentities(stripslashes($_POST['servport'])) : $port; if(file_exists("users/$name.php")) { include("users/$name.php"); if(md5($_POST['password']) == $userpass) { @@ -124,8 +152,8 @@ if (isset($_GET['do']) && $_GET['do']=="login" && isset($_POST['submitBtn']) && $_SESSION['idleirc-nick'] = $usernickname; $_SESSION['idleirc-pass'] = $userpass; $_SESSION['idleirc-channel'] = $userchannel; - $_SESSION['idleirc-servaddr'] = $servaddr; - $_SESSION['idleirc-servport'] = $servport; + $_SESSION['idleirc-servaddr'] = $userserver; + $_SESSION['idleirc-servport'] = $userserverport; header("refresh: 0;url=index.php"); } else { echo "ERROR: Failed to login: password incorrect."; @@ -288,7 +316,7 @@ if (isset($_GET['do']) && $_GET['do']=="login" && isset($_POST['submitBtn']) && >
-Back to IRC
\n"; + echo "\n"; echo "
\n" . $logcontents . "
\n"; } } else if(isset($_GET['settings'])) { $username = $_SESSION['idleirc-user']; - $logcontents = file_get_contents("$username.log"); + $logcontents = file_get_contents("users/$username.log"); if(file_exists("users/$username.php")) { include("users/$username.php"); } else { @@ -321,7 +349,7 @@ if (!isset($_SESSION['idleirc-user'])) { } if(isset($_SESSION['idleirc-pass']) && $userpass != "" && $userpass == $_SESSION['idleirc-pass']) { - echo "
Back to IRC
\n"; + echo "\n"; ?>
@@ -333,6 +361,11 @@ if (!isset($_SESSION['idleirc-user'])) { Default Nickname: Autoconnect/focus channel: New password: + Server (IP:Port) : @@ -344,18 +377,18 @@ if (!isset($_SESSION['idleirc-user'])) { } } else { ?> -
+