diff --git a/CHANGELOG b/CHANGELOG
index 8aaa7da..3832e3a 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,12 @@
+Version 1.11 - Jul. 11, 2015
+Clean all messages of someone
+Kick via active session display
+Change languages supported without cookies
+Global password only in setup and not in admin section
+CSS Styling supported
+Moved many configurations from file to database
+More simplifications and bugfixes
+
Version 1.10 - Jun. 7, 2015
Added message encryption option
diff --git a/chat.php b/chat.php
index 99d4bf7..239be7d 100755
--- a/chat.php
+++ b/chat.php
@@ -73,7 +73,7 @@ if(!isSet($_REQUEST['action'])){
send_controls();
}elseif($_REQUEST['action']=='delete'){
check_session();
- if($_REQUEST['what']=='all') del_all_messages($U['nickname']);
+ if($_REQUEST['what']=='all') del_all_messages($U['nickname'], 10);
if($_REQUEST['what']=='last') del_last_message();
send_post();
}elseif($_REQUEST['action']=='profile'){
@@ -104,8 +104,9 @@ if(!isSet($_REQUEST['action'])){
send_admin();
}elseif($_REQUEST['do']=='clean'){
if($_REQUEST['what']=='choose') send_choose_messages();
- if($_REQUEST['what']=='selected') clean_selected();
- if($_REQUEST['what']=='room') clean_room();
+ elseif($_REQUEST['what']=='selected') clean_selected();
+ elseif($_REQUEST['what']=='room') clean_room();
+ elseif($_REQUEST['what']=='nick') del_all_messages($_REQUEST['nickname'], $U['status']);
send_admin();
}elseif($_REQUEST['do']=='kick'){
if(!isSet($_REQUEST['name'])) send_admin();
@@ -117,6 +118,7 @@ if(!isSet($_REQUEST['action'])){
logout_chatter($_REQUEST['name']);
send_admin();
}elseif($_REQUEST['do']=='sessions'){
+ if(isSet($_REQUEST['nick'])) kick_chatter(array($_REQUEST['nick']), '', false);
send_sessions();
}elseif($_REQUEST['do']=='register'){
register_guest(3);
@@ -140,13 +142,6 @@ if(!isSet($_REQUEST['action'])){
}elseif($_REQUEST['do']=='filter'){
manage_filter();
send_filter();
- }elseif($_REQUEST['do']=='globalpass'){
- if(isSet($_REQUEST['globalpass'])){
- update_setting('globalpass', $_REQUEST['globalpass']);
- }
- if(isSet($_REQUEST['englobalpass']) && preg_match('/^[012]$/', $_REQUEST['englobalpass'])){
- update_setting('englobalpass', $_REQUEST['englobalpass']);
- }
}
send_admin();
}elseif($_REQUEST['action']=='setup'){
@@ -162,18 +157,21 @@ if(!isSet($_REQUEST['action'])){
if($num_tables<7) send_init();
update_db();
if(!valid_admin()) send_alogin();
+ $setting_update=array('guestaccess', 'dateformat', 'captcha', 'css', 'memberexpire', 'guestexpire', 'kickpenalty', 'entrywait', 'captchatime', 'messageexpire', 'messagelimit', 'maxmessage');
if(!isSet($_REQUEST['do'])){
- }elseif($_REQUEST['do']=='guestaccess'){
- if(isSet($_REQUEST['set']) && preg_match('/^[0123]$/', $_REQUEST['set'])){
- update_setting('guestaccess', $_REQUEST['set']);
+ }elseif(in_array($_REQUEST['do'], $setting_update)){
+ if(isSet($_REQUEST[$_REQUEST['do']])){
+ update_setting($_REQUEST['do'], $_REQUEST[$_REQUEST['do']]);
}
}elseif($_REQUEST['do']=='messages'){
update_messages();
}elseif($_REQUEST['do']=='rules'){
- $_REQUEST['rulestxt']=preg_replace("/\r\n/", '
', $_REQUEST['rulestxt']);
- $_REQUEST['rulestxt']=preg_replace("/\n/", '
', $_REQUEST['rulestxt']);
- $_REQUEST['rulestxt']=preg_replace("/\r/", '
', $_REQUEST['rulestxt']);
- update_setting('rulestxt', $_REQUEST['rulestxt']);
+ if(isSet($_REQUEST['rulestxt'])){
+ $_REQUEST['rulestxt']=preg_replace("/\r\n/", '
', $_REQUEST['rulestxt']);
+ $_REQUEST['rulestxt']=preg_replace("/\n/", '
', $_REQUEST['rulestxt']);
+ $_REQUEST['rulestxt']=preg_replace("/\r/", '
', $_REQUEST['rulestxt']);
+ update_setting('rulestxt', $_REQUEST['rulestxt']);
+ }
}elseif($_REQUEST['do']=='globalpass'){
if(isSet($_REQUEST['globalpass'])){
update_setting('globalpass', $_REQUEST['globalpass']);
@@ -181,14 +179,6 @@ if(!isSet($_REQUEST['action'])){
if(isSet($_REQUEST['englobalpass']) && preg_match('/^[012]$/', $_REQUEST['englobalpass'])){
update_setting('englobalpass', $_REQUEST['englobalpass']);
}
- }elseif($_REQUEST['do']=='dateformat'){
- if(isSet($_REQUEST['dateformat'])){
- update_setting('dateformat', $_REQUEST['dateformat']);
- }
- }elseif($_REQUEST['do']=='captcha'){
- if(isSet($_REQUEST['captcha'])){
- update_setting('captcha', $_REQUEST['captcha']);
- }
}
send_setup();
}elseif($_REQUEST['action']=='init'){
@@ -196,34 +186,26 @@ if(!isSet($_REQUEST['action'])){
}else{
send_login();
}
+mysqli_close($mysqli);
exit;
// html output subs
-
-function print_credits(){
- global $C, $I;
- echo '';
- if($C['showcredits']){
- echo "$I[contributors]
";
- echo 'Programming - Daniel Winzen
';
- echo 'German - Daniel Winzen
';
- echo 'English - Daniel Winzen
';
- }
- echo "
LE CHAT-PHP - $C[version]";
-}
-
-function print_stylesheet($arg1=''){
- echo "";
+function print_stylesheet(){
+ global $C;
+ $css=get_setting('css');
+ echo "";
}
function print_end(){
+ global $mysqli;
echo '