Compare commits

...

8 Commits
v1.0 ... v1.6

Author SHA1 Message Date
6dd7d425c7 Added option to only allow guests with a global password
Also fixed an error in valid_admin() introduced in the previous version
2015-04-26 14:21:11 +02:00
bb4ca51db8 Added incognito mode 2015-04-20 18:09:03 +02:00
92643bad03 Various changes and additions 2015-04-10 08:53:07 +02:00
be34272e1b Bugfixes on logout and kicking 2015-04-04 20:36:50 +02:00
e6265ba296 Moved rules to database to make changes more easily in the setup 2015-04-02 18:19:36 +02:00
8bf25230f2 Include letters when generating captchas not only numbers 2015-04-02 16:37:11 +02:00
0fa1279764 Added ignore feature 2015-04-02 10:49:43 +02:00
cd0e2ec19c Some simplifications 2015-04-02 09:43:38 +02:00
6 changed files with 408 additions and 210 deletions

23
CHANGELOG Normal file
View File

@ -0,0 +1,23 @@
Version 1.6 - Apr. 26, 2015
Added option to only allow guests with a global password
Version 1.5 - Apr. 20, 2015
Added incognito mode
Version 1.4 - Apr. 10, 2015
Various changes and additions
Version 1.3 - Apr. 4, 2015
Bugfixes on logout and kicking
Version 1.2 - Apr. 2, 2015
Include letters when generating captchas not only numbers
Moved rules to database to make changes more easily in the setup
Version 1.1 - Apr. 2, 2015
Some simplifications
Added ignore feature
Version 1.0 - Mar. 31, 2015
Initial release

16
README
View File

@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
GENERAL INFORMATION: GENERAL INFORMATION:
This is a PHP Chat based on LE CHAT v.1.14 . An up-to-date copy of this script can be downloaded at http://github.com/DanWin/le-chat-php This is a PHP Chat based on LE CHAT v.1.14 . An up-to-date copy of this script can be downloaded at https://github.com/DanWin/le-chat-php
The original perl LE CHAT script by Lucky Eddie can be downloaded at http://4fvfamdpoulu2nms.onion/lechat/ or via a tor2web proxy like https://4fvfamdpoulu2nms.tor2web.blutmagie.de/lechat/ if you don't have TOR installed. The original perl LE CHAT script by Lucky Eddie can be downloaded at http://4fvfamdpoulu2nms.onion/lechat/ or via a tor2web proxy like https://4fvfamdpoulu2nms.tor2web.blutmagie.de/lechat/ if you don't have TOR installed.
If you add your own cool features or have a feature request, please tell me and I will add them, if I like them. If you add your own cool features or have a feature request, please tell me and I will add them, if I like them.
Please also let me know about any bugs you find in the code, so I can fix them. Please also let me know about any bugs you find in the code, so I can fix them.
@ -60,6 +60,7 @@ Then copy the script to your web-server directory and call the script in your br
http://(server)/(script-name).php?action=setup http://(server)/(script-name).php?action=setup
Now you can create the Superadmin account. With this account you can administer the chat and add new members and set the guest access. Now you can create the Superadmin account. With this account you can administer the chat and add new members and set the guest access.
As soon as you are done with the setup, all necessary database tables will be created and the chat can be used. As soon as you are done with the setup, all necessary database tables will be created and the chat can be used.
Note: If you updated the script, please visit http://(server)/(script-name).php?action=setup again, to make sure, that any database changes are applied and no errors occure.
TRANSLATING: TRANSLATING:
@ -71,6 +72,19 @@ When you are done, you have to edit the chat script, to include your translation
to the $L array in the load_lang() function at the bottom, similar to what I did for the German translation. to the $L array in the load_lang() function at the bottom, similar to what I did for the German translation.
Please share your translation with me, so I can add it to the official version. Please share your translation with me, so I can add it to the official version.
REGEX:
Yes, the chat supports regular expression filtering of messages. As regex tends to be difficult for most people, I decided to give it an extra section here.
Regex is very powerful and can be used to filter messages that contain certain expressions and replace them with something else.
It can be used e.g. to turn BB Code into html, so it is possible to use BB Code in the chat to format messages.
To do this, use this Regex-Match '\[(u|b)\](.*?)\[\/\1\]' and this Regex-Replace '<$1>$2</$1>' and your text will be '[b]bold[/b]' or '[u]underlined[/u]'.
You can also use smilies by using this Regex-Match '(?-i::(cry|eek|lol|sad|smile|surprised|wink):)' and this Regex-Replace '<img src="/pictures/$1.gif" alt=":$1:">'
And now if you enter ':smile:' an image with the smiley will be loaded from your server at '/pictures/smile.gif'.
The following should be escaped by putting '\' in front of it, if you are trying to match one of these characters '/ \ ^ . $ | ( ) [ ] * + ? { } ,'.
I used '/' as delimiter, so you will have to escape that, too. The only options I used is 'i' to make the regex case insensitive.
If you want to test your regex, before applying you can use this site and enter your Regex and Replacement there and click on preg_replace: http://www.phpliveregex.com/
If you never used regex before, check out this starting guide to begin with regular expressions: http://docs.activestate.com/komodo/4.4/regex-intro.html
LIVE DEMO: LIVE DEMO:
If you want to see the script in action, you can visit my TOR hidden site http://tt3j2x4k5ycaa5zt.onion/chat.php or via a tor2web proxy like http://tt3j2x4k5ycaa5zt.tor2web.blutmagie.de/chat.php if you don't have TOR installed. If you want to see the script in action, you can visit my TOR hidden site http://tt3j2x4k5ycaa5zt.onion/chat.php or via a tor2web proxy like http://tt3j2x4k5ycaa5zt.tor2web.blutmagie.de/chat.php if you don't have TOR installed.

View File

@ -1,7 +1,7 @@
General Information: General Information:
-------------------- --------------------
This is a PHP Chat based on LE CHAT v.1.14 . An up-to-date copy of this script can be downloaded at http://github.com/DanWin/le-chat-php This is a PHP Chat based on LE CHAT v.1.14 . An up-to-date copy of this script can be downloaded at https://github.com/DanWin/le-chat-php
The original perl LE CHAT script by Lucky Eddie can be downloaded at [his site](http://4fvfamdpoulu2nms.onion/lechat/) or via a tor2web proxy like [this one](https://4fvfamdpoulu2nms.tor2web.blutmagie.de/lechat/) if you don't have TOR installed. The original perl LE CHAT script by Lucky Eddie can be downloaded at [his site](http://4fvfamdpoulu2nms.onion/lechat/) or via a tor2web proxy like [this one](https://4fvfamdpoulu2nms.tor2web.blutmagie.de/lechat/) if you don't have TOR installed.
If you add your own cool features or have a feature request, please tell me and I will add them, if I like them. If you add your own cool features or have a feature request, please tell me and I will add them, if I like them.
Please also let me know about any bugs you find in the code, so I can fix them. Please also let me know about any bugs you find in the code, so I can fix them.
@ -45,6 +45,7 @@ Then copy the script to your web-server directory and call the script in your br
http://(server)/(script-name).php?action=setup http://(server)/(script-name).php?action=setup
Now you can create the Superadmin account. With this account you can administer the chat and add new members and set the guest access. Now you can create the Superadmin account. With this account you can administer the chat and add new members and set the guest access.
As soon as you are done with the setup, all necessary database tables will be created and the chat can be used. As soon as you are done with the setup, all necessary database tables will be created and the chat can be used.
Note: If you updated the script, please visit http://(server)/(script-name).php?action=setup again, to make sure, that any database changes are applied and no errors occure.
Translating: Translating:
------------ ------------
@ -57,6 +58,20 @@ When you are done, you have to edit the chat script, to include your translation
to the $L array in the load_lang() function at the bottom, similar to what I did for the German translation. to the $L array in the load_lang() function at the bottom, similar to what I did for the German translation.
Please share your translation with me, so I can add it to the official version. Please share your translation with me, so I can add it to the official version.
Regex:
------
Yes, the chat supports regular expression filtering of messages. As regex tends to be difficult for most people, I decided to give it an extra section here.
Regex is very powerful and can be used to filter messages that contain certain expressions and replace them with something else.
It can be used e.g. to turn BB Code into html, so it is possible to use BB Code in the chat to format messages.
To do this, use this Regex-Match '\[(u|b)\](.*?)\[\/\1\]' and this Regex-Replace '<$1>$2</$1>' and your text will be '[b]bold[/b]' or '[u]underlined[/u]'.
You can also use smilies by using this Regex-Match '(?-i::(cry|eek|lol|sad|smile|surprised|wink):)' and this Regex-Replace '<img src="/pictures/$1.gif" alt=":$1:">'
And now if you enter ':smile:' an image with the smiley will be loaded from your server at '/pictures/smile.gif'.
The following should be escaped by putting '\' in front of it, if you are trying to match one of these characters '/ \ ^ . $ | ( ) [ ] * + ? { } ,'.
I used '/' as delimiter, so you will have to escape that, too. The only options I used is 'i' to make the regex case insensitive.
If you want to test your regex, before applying you can use [this site](http://www.phpliveregex.com/) and enter your Regex and Replacement there and click on preg_replace.
If you never used regex before, check out [this starting guide](http://docs.activestate.com/komodo/4.4/regex-intro.html) to begin with regular expressions.
Live demo: Live demo:
---------- ----------

534
chat.php

File diff suppressed because it is too large Load Diff

View File

@ -20,12 +20,12 @@
$I=array( $I=array(
'nodb' => 'Keine Verbindung zur Datenbank!', 'nodb' => 'Keine Verbindung zur Datenbank!',
'nodsetupb' => 'Keine Verbindung zur Datenbank, bitte erstelle eine Datenbank und bearbeite das Skript, um die korrekte Datenbank mit angegebenem Benutzernamen und Passwort zu benutzen.', 'nodbsetup' => 'Keine Verbindung zur Datenbank, bitte erstelle eine Datenbank und bearbeite das Skript, um die korrekte Datenbank mit angegebenem Benutzernamen und Passwort zu benutzen.',
'changelang' => 'Sprache ändern:', 'changelang' => 'Sprache ändern:',
'expire' => 'Ungültige/abgelaufene Sitzung', 'expire' => 'Ungültige/abgelaufene Sitzung',
'kicked' => 'Rausgeschmissen!', 'kicked' => 'Rausgeschmissen!',
'invalnick' => 'Ungültiger Nickname (Maximal %d Zeichen, keine Sonderzeichen erlaubt)', 'invalnick' => 'Ungültiger Nickname (Maximal %d Zeichen, keine Sonderzeichen erlaubt)',
'invalpass' => 'Falsches Passwort!', 'invalpass' => 'Ungültiges Passwort (Mindestens %d Zeichen)',
'noconfirm' => 'Passwordbestätigung stimmt nicht überein!', 'noconfirm' => 'Passwordbestätigung stimmt nicht überein!',
'incorregex' => 'Ungültiger regulärer Ausdruck!', 'incorregex' => 'Ungültiger regulärer Ausdruck!',
'bottom' => 'Unten', 'bottom' => 'Unten',
@ -42,8 +42,7 @@ $I=array(
'initdbexist' => 'Datenbanktabellen existieren bereits! Um vortzufahren, musst du diese Tabellen zuerst manuell löschen.', 'initdbexist' => 'Datenbanktabellen existieren bereits! Um vortzufahren, musst du diese Tabellen zuerst manuell löschen.',
'initsuexist' => 'Ein Superadmin existiert bereits!', 'initsuexist' => 'Ein Superadmin existiert bereits!',
'initgosetup' => 'Zur Einrichtungsseite gehen', 'initgosetup' => 'Zur Einrichtungsseite gehen',
'dbupdate' => 'Datenbank aktualisieren', 'dbupdate' => 'Datenbank erfolgreich aktualisiert!',
'update' => 'Aktualisieren',
'sysmessages' => 'Systemnachrichten', 'sysmessages' => 'Systemnachrichten',
'msgenter' => 'Eintritt', 'msgenter' => 'Eintritt',
'msgexit' => 'Verlassen', 'msgexit' => 'Verlassen',
@ -55,6 +54,7 @@ $I=array(
'msgclean' => 'Raum geleert', 'msgclean' => 'Raum geleert',
'nick' => 'Nickname:', 'nick' => 'Nickname:',
'pass' => 'Passwort:', 'pass' => 'Passwort:',
'globalloginpass' => 'Globales Passwort:',
'login' => 'Anmelden', 'login' => 'Anmelden',
'admfunc' => 'Administrative Funktionen', 'admfunc' => 'Administrative Funktionen',
'allguests' => 'Alle Gäste', 'allguests' => 'Alle Gäste',
@ -75,6 +75,7 @@ $I=array(
'guestallow' => 'Erlauben', 'guestallow' => 'Erlauben',
'guestwait' => 'Mit Warteraum erlauben', 'guestwait' => 'Mit Warteraum erlauben',
'adminallow' => 'Moderator-Erlaubnis benötigen', 'adminallow' => 'Moderator-Erlaubnis benötigen',
'globalpass' => 'Globales Passwort',
'guestdisallow' => 'Verweigern', 'guestdisallow' => 'Verweigern',
'addsuguest' => 'Anwerber hinzufügen', 'addsuguest' => 'Anwerber hinzufügen',
'register' => 'Registrieren', 'register' => 'Registrieren',
@ -131,6 +132,8 @@ $I=array(
'helpmod' => 'Moderatoren: Achte auf den Admin-Knof unten. Er bringt eine Seite auf, auf der du Nachrichten löschen kannst, Teilnehmer rausschmeißen kannst, alle aktive Sitzungen anzeigen lassen kannst und den Gastzugriff deaktivieren kannst, falls dies nötig sein sollte.', 'helpmod' => 'Moderatoren: Achte auf den Admin-Knof unten. Er bringt eine Seite auf, auf der du Nachrichten löschen kannst, Teilnehmer rausschmeißen kannst, alle aktive Sitzungen anzeigen lassen kannst und den Gastzugriff deaktivieren kannst, falls dies nötig sein sollte.',
'helpadm' => 'Admins: Du wirst zusätzlich in der Lage sein Gäste zu registrieren, Mitglieder zu verwalten und neue Nicknanem zu registrieren, ohne dass sie im Raum sind.', 'helpadm' => 'Admins: Du wirst zusätzlich in der Lage sein Gäste zu registrieren, Mitglieder zu verwalten und neue Nicknanem zu registrieren, ohne dass sie im Raum sind.',
'profile' => 'Dein Profil', 'profile' => 'Dein Profil',
'ignore' => 'Ignorieren',
'unignore' => 'Nicht mehr ignorieren',
'refreshrate' => 'Aktualisierungsrate (20-150 Sekunden)', 'refreshrate' => 'Aktualisierungsrate (20-150 Sekunden)',
'fontcolour' => 'Schriftfarbe', 'fontcolour' => 'Schriftfarbe',
'viewexample' => 'Beispiele anzeigen', 'viewexample' => 'Beispiele anzeigen',
@ -142,6 +145,7 @@ $I=array(
'fontexample' => 'Beispiel für deine gewählte Schrift', 'fontexample' => 'Beispiel für deine gewählte Schrift',
'timestamps' => 'Zeitstempel anzeigen', 'timestamps' => 'Zeitstempel anzeigen',
'embed' => 'Bilder/Videos einbetten', 'embed' => 'Bilder/Videos einbetten',
'incognito' => 'Inkognito Modus',
'pbsize' => 'Postboxgröße', 'pbsize' => 'Postboxgröße',
'nbsize' => 'Notizboxgröße', 'nbsize' => 'Notizboxgröße',
'width' => 'Breite:', 'width' => 'Breite:',
@ -188,7 +192,7 @@ $I=array(
'cantchgstat' => 'Der Status von %s kann nicht geändert werden.', 'cantchgstat' => 'Der Status von %s kann nicht geändert werden.',
'succdel' => '%s wurde erfolgriech aus der Datenbank gelöscht.', 'succdel' => '%s wurde erfolgriech aus der Datenbank gelöscht.',
'succchg' => 'Status of %s successfully changed.', 'succchg' => 'Status of %s successfully changed.',
'wrongpass' => 'Passwort ist falsch.', 'wrongpass' => 'Falsches Passwort!',
'succprofile' => 'Dein Profil wurde erfolgreich gespeichert.', 'succprofile' => 'Dein Profil wurde erfolgreich gespeichert.',
'backtologin' => 'Zurück zur Anmeldeseite.', 'backtologin' => 'Zurück zur Anmeldeseite.',
'backtochat' => 'Zurück zum Chat.', 'backtochat' => 'Zurück zum Chat.',

View File

@ -21,12 +21,12 @@
//Language: English //Language: English
$I=array( $I=array(
'nodb' => 'No Connection to Database!', 'nodb' => 'No Connection to Database!',
'nodsetupb' => 'No Connection to Database, please create a database and edit the script to use the correct database with given username and password!', 'nodbsetup' => 'No Connection to Database, please create a database and edit the script to use the correct database with given username and password!',
'changelang' => 'Change language:', 'changelang' => 'Change language:',
'expire' => 'Invalid/expired session', 'expire' => 'Invalid/expired session',
'kicked' => 'Kicked!', 'kicked' => 'Kicked!',
'invalnick' => 'Invalid nickname (%d characters maximum, no special characters allowed)', 'invalnick' => 'Invalid nickname (%d characters maximum, no special characters allowed)',
'invalpass' => 'Invalid password!', 'invalpass' => 'Invalid password (At least %d characters)',
'noconfirm' => 'Password confirmation does not match!', 'noconfirm' => 'Password confirmation does not match!',
'incorregex' => 'Incorrect regular expression!', 'incorregex' => 'Incorrect regular expression!',
'bottom' => 'Bottom', 'bottom' => 'Bottom',
@ -45,9 +45,9 @@ $I=array(
'initgosetup' => 'Go to the Setup-Page', 'initgosetup' => 'Go to the Setup-Page',
'nick' => 'Nickname:', 'nick' => 'Nickname:',
'pass' => 'Password:', 'pass' => 'Password:',
'globalloginpass' => 'Global Password:',
'login' => 'Login', 'login' => 'Login',
'dbupdate' => 'Update database', 'dbupdate' => 'Database successfully updated!',
'update' => 'Update',
'sysmessages' => 'System messages', 'sysmessages' => 'System messages',
'msgenter' => 'Entrance', 'msgenter' => 'Entrance',
'msgexit' => 'Leaving', 'msgexit' => 'Leaving',
@ -76,6 +76,7 @@ $I=array(
'guestallow' => 'Allow', 'guestallow' => 'Allow',
'guestwait' => 'Allow with waitingroom', 'guestwait' => 'Allow with waitingroom',
'adminallow' => 'Require moderator approval', 'adminallow' => 'Require moderator approval',
'globalpass' => 'Global Password',
'guestdisallow' => 'Disallow', 'guestdisallow' => 'Disallow',
'addsuguest' => 'Add applicant', 'addsuguest' => 'Add applicant',
'register' => 'Register', 'register' => 'Register',
@ -132,6 +133,8 @@ $I=array(
'helpmod' => 'Moderators: Notice the Admin-button at the bottom. It\'ll bring up a page where you can clean the room, kick chatters, view all active sessions and disable guest access completely if needed.', 'helpmod' => 'Moderators: Notice the Admin-button at the bottom. It\'ll bring up a page where you can clean the room, kick chatters, view all active sessions and disable guest access completely if needed.',
'helpadm' => 'Admins: You\'ll be furthermore able to register guests, edit members and register new nicks without them beeing in the room.', 'helpadm' => 'Admins: You\'ll be furthermore able to register guests, edit members and register new nicks without them beeing in the room.',
'profile' => 'Your Profile', 'profile' => 'Your Profile',
'ignore' => 'Ignore',
'unignore' => 'Don\'t ignore anymore',
'refreshrate' => 'Refresh rate (20-150 seconds)', 'refreshrate' => 'Refresh rate (20-150 seconds)',
'fontcolour' => 'Font colour', 'fontcolour' => 'Font colour',
'viewexample' => 'View examples', 'viewexample' => 'View examples',
@ -143,6 +146,7 @@ $I=array(
'fontexample' => 'Example for your chosen font', 'fontexample' => 'Example for your chosen font',
'timestamps' => 'Show Timestamps', 'timestamps' => 'Show Timestamps',
'embed' => 'Embed images/videos', 'embed' => 'Embed images/videos',
'incognito' => 'Incognito mode',
'pbsize' => 'Post box size', 'pbsize' => 'Post box size',
'nbsize' => 'Notes box size', 'nbsize' => 'Notes box size',
'width' => 'Width:', 'width' => 'Width:',
@ -189,7 +193,7 @@ $I=array(
'cantchgstat' => 'Can\'t change status of %s', 'cantchgstat' => 'Can\'t change status of %s',
'succdel' => '%s successfully deleted from database.', 'succdel' => '%s successfully deleted from database.',
'succchg' => 'Status of %s successfully changed.', 'succchg' => 'Status of %s successfully changed.',
'wrongpass' => 'Password is wrong.', 'wrongpass' => 'Wrong Password!',
'succprofile' => 'Your profile has successfully been saved.', 'succprofile' => 'Your profile has successfully been saved.',
'backtologin' => 'Back to the login page.', 'backtologin' => 'Back to the login page.',
'backtochat' => 'Back to the chat.', 'backtochat' => 'Back to the chat.',