From eb62d1b31c026a35a9298275001c9282b0e1736d Mon Sep 17 00:00:00 2001 From: flashwave Date: Tue, 26 Nov 2024 21:23:25 +0000 Subject: [PATCH] Cleaned up a bit. --- public/css/chatlogin.css | 72 ----------------------------------- src/AJAXChat.php | 64 ++++++++++--------------------- template/banned.html | 65 ------------------------------- template/loggedOut.html | 72 ----------------------------------- template/loggedOut~.html | 61 ------------------------------ template/~loggedOut.html | 82 ---------------------------------------- 6 files changed, 20 insertions(+), 396 deletions(-) delete mode 100644 public/css/chatlogin.css delete mode 100644 template/banned.html delete mode 100644 template/loggedOut.html delete mode 100644 template/loggedOut~.html delete mode 100644 template/~loggedOut.html diff --git a/public/css/chatlogin.css b/public/css/chatlogin.css deleted file mode 100644 index cf395b9..0000000 --- a/public/css/chatlogin.css +++ /dev/null @@ -1,72 +0,0 @@ -h1, h3 { - font-weight: 100; - margin: 0px; -} - -h1 { - font-size: 3em; - text-shadow: 0px 0px .5em #F1F1F1; -} - -h3 { - display: inline-block; - box-shadow: 0px 0px .5em #700; - min-width: 300px; - font-size: 15px; - padding: 2px; - margin: 10px; - background-color: #700; - background-image: linear-gradient(to bottom, #900, #600); - background-image: -moz-linear-gradient(to bottom, #900, #600); - background-image: -webkit-linear-gradient(top, #900, #600); -} - -div.copyright { - font-size: 12px; - color: #CCC; -} - -form { - margin: 10px; -} - -form input[type="text"], form input[type="password"] { - height: 18px; - width: 288px; -} - -form input[type="text"] { - border-top-left-radius: 5px; - border-top-right-radius: 5px; -} - -form input[type="submit"] { - border-bottom-left-radius: 5px; - border-bottom-right-radius: 5px; - background: #404; - box-shadow: 0px 0px 1em #707 inset; - color: #FFF; - font-weight: 700; - border-color: #808; -} - -form *:not(option) { - height: 30px; - display: block; - margin: 1px auto; - width: 300px; - padding: 5px; - border: 1px #888 solid; - background: transparent; - box-shadow: 0px 0px 1em #888 inset -} - -a { - color: inherit; - text-decoration: none; - transition: text-shadow .2s; -} - -a:hover { - text-shadow: 0px 0px 1em #F1F1F1; -} diff --git a/src/AJAXChat.php b/src/AJAXChat.php index 2306cb8..beb9773 100644 --- a/src/AJAXChat.php +++ b/src/AJAXChat.php @@ -328,14 +328,6 @@ class AJAXChat { return AJAX_CHAT_PATH . '/template/mobile.html'; case 'legacy': return AJAX_CHAT_PATH . '/template/legacyLogin.html'; - case 'banned': - return AJAX_CHAT_PATH . '/template/banned.html'; - case 'legacy1': - return AJAX_CHAT_PATH . '/template/~loggedOut.html'; - case 'legacy2': - return AJAX_CHAT_PATH . '/template/loggedOut~.html'; - case 'legacy3': - return AJAX_CHAT_PATH . '/template/loggedOut.html'; default: return AJAX_CHAT_PATH . '/template/loggedOutFA.html'; } @@ -355,32 +347,25 @@ class AJAXChat { } function hasAccessTo($view) { - if(substr($view, 0, 6) === 'legacy') - return !$this->isLoggedIn(); - switch($view) { case 'legacy': - if($this->isLoggedIn()) { - return false; - } - return true; - case 'banned': - return true; + return !$this->isLoggedIn(); case 'chat': case 'mobile': case 'teaser': - if($this->isLoggedIn()) { - return true; - } - return false; + return $this->isLoggedIn(); case 'logs': - if($this->isLoggedIn() && ($this->getUserRole() == AJAX_CHAT_ADMIN || $this->getUserRole() == CMOD || $this->getUserRole() == AJAX_CHAT_MODERATOR || $this->getUserRole() == PURPLE || $this->getUserRole() == DONATOR || - ($this->getConfig('logsUserAccess') && - ($this->getUserRole() == AJAX_CHAT_USER)) - )) { - return true; - } - return false; + return $this->isLoggedIn() && ( + $this->getUserRole() == AJAX_CHAT_ADMIN + || $this->getUserRole() == CMOD + || $this->getUserRole() == AJAX_CHAT_MODERATOR + || $this->getUserRole() == PURPLE + || $this->getUserRole() == DONATOR + || ( + $this->getConfig('logsUserAccess') + && $this->getUserRole() == AJAX_CHAT_USER + ) + ); default: return false; } @@ -455,16 +440,6 @@ class AJAXChat { $this->purgeLogs(); } - // Report login to Satori: - /*$boatcom = @fsockopen('marie.railgun.sh', 9064, $errno, $errstr, 5); - if($boatcom) { - $message = sprintf('{sock}[i][url=https://flashii.net/profile.php?u=%d][b]%s[/b][/url] logged into [url=https://flash.moe/chat/]Flashii Chat Legacy[/url].[/i]', $userData['userID'], $userData['userName']); - $message = chr(0xF) . hash_hmac('sha256', $message, 'lol glad i caught this, that could\'ve been pretty funny if i forgot to remove this') . $message . chr(0xF); - fwrite($boatcom, $message); - fflush($boatcom); - fclose($boatcom); - }*/ - return true; } @@ -494,20 +469,21 @@ class AJAXChat { if($channelName !== null) { $channelID = $this->getChannelIDFromChannelName($channelName); // channelName might need encoding conversion: - if($channelID === null) { + if($channelID === null) $channelID = $this->getChannelIDFromChannelName( - $this->trimChannelName($channelName, $this->getConfig('contentEncoding')) - ); - } + $this->trimChannelName($channelName, $this->getConfig('contentEncoding')) + ); } } + // Validate the resulting channelID: if(!$this->validateChannel($channelID)) { - if($this->getChannel() !== null) { + if($this->getChannel() !== null) return $this->getChannel(); - } + return $this->getConfig('defaultChannelID'); } + return $channelID; } diff --git a/template/banned.html b/template/banned.html deleted file mode 100644 index 0dd4a79..0000000 --- a/template/banned.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - [LANG]title[/LANG] // Banned - - - [STYLE_SHEETS/] - - - - - - - - - -
-
-

[LANG]title[/LANG] // Banned

-
-
-
Your IP is banned from accessing this Chat.
-
- - -
- - \ No newline at end of file diff --git a/template/loggedOut.html b/template/loggedOut.html deleted file mode 100644 index b561794..0000000 --- a/template/loggedOut.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - -[CONF]flashiiString[/CONF] - Chat - - - - - - - - - -
-
[ERROR_MESSAGES/]
-
-
-

[LANG]title[/LANG] Login

-
- - - - - - - -
[SANDSTORM/]
-
-
-
- -[COPYRIGHT/] - - \ No newline at end of file diff --git a/template/loggedOut~.html b/template/loggedOut~.html deleted file mode 100644 index f0e6968..0000000 --- a/template/loggedOut~.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - [LANG]title[/LANG] - - - - - - - - - -
-
-

[LANG]title[/LANG]

-
- [ERROR_MESSAGES/] - -
-
- - - - - - -
- -
-
- - \ No newline at end of file diff --git a/template/~loggedOut.html b/template/~loggedOut.html deleted file mode 100644 index fa14edc..0000000 --- a/template/~loggedOut.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - [LANG]title[/LANG] - - - [STYLE_SHEETS/] - - - - - - - - - - -
-
-

[LANG]title[/LANG]

-
-
-
-
Welcome to Flashii Chat! Please register if you haven't yet.
- - -

-
-

-
-

-
-

-
-
-
* [LANG]registeredUsers[/LANG]
-
-
-
[ERROR_MESSAGES/]
- - -
- - - \ No newline at end of file