diff --git a/CHANGELOG b/CHANGELOG
index c3ca4be..997d8b9 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,8 @@
+Version 1.7 - May. 3, 2015
+Added member only option with global password protection
+Made date format configurable
+Various improvements
+
Version 1.6 - Apr. 26, 2015
Added option to only allow guests with a global password
diff --git a/chat.php b/chat.php
index 656031b..0420b3c 100755
--- a/chat.php
+++ b/chat.php
@@ -18,6 +18,7 @@
* along with this program. If not, see .
*/
+if($_SERVER['REQUEST_METHOD']=='HEAD') exit; // ignore HEAD requests
date_default_timezone_set('UTC');
$U=array();// This user data
$P=array();// All present users
@@ -61,7 +62,6 @@ if(!isSet($_REQUEST['action'])){
}
}elseif(isSet($_REQUEST['message']) && isSet($_REQUEST['sendto']) && !preg_match('/^\s*$/',$_REQUEST['message'])){
validate_input();
- add_message();
}
send_post();
}elseif($_REQUEST['action']=='login'){
@@ -133,7 +133,7 @@ if(!isSet($_REQUEST['action'])){
approve_session();
send_approve_waiting();
}elseif($_REQUEST['do']=='guestaccess'){
- if(isSet($_REQUEST['set']) && preg_match('/^[01234]$/', $_REQUEST['set'])){
+ if(isSet($_REQUEST['set']) && preg_match('/^(-1|[01234])$/', $_REQUEST['set'])){
update_setting('guestaccess', $_REQUEST['set']);
}
}elseif($_REQUEST['do']=='filter'){
@@ -157,7 +157,7 @@ if(!isSet($_REQUEST['action'])){
if(!valid_admin()) send_alogin();
if(!isSet($_REQUEST['do'])){
}elseif($_REQUEST['do']=='guestaccess'){
- if(isSet($_REQUEST['set']) && preg_match('/^[01234]$/', $_REQUEST['set'])){
+ if(isSet($_REQUEST['set']) && preg_match('/^(-1|[01234])$/', $_REQUEST['set'])){
update_setting('guestaccess', $_REQUEST['set']);
}
}elseif($_REQUEST['do']=='messages'){
@@ -171,6 +171,10 @@ if(!isSet($_REQUEST['action'])){
if(isSet($_REQUEST['globalpass'])){
update_setting('globalpass', $_REQUEST['globalpass']);
}
+ }elseif($_REQUEST['do']=='dateformat'){
+ if(isSet($_REQUEST['dateformat'])){
+ update_setting('dateformat', $_REQUEST['dateformat']);
+ }
}
send_setup();
}elseif($_REQUEST['action']=='init'){
@@ -302,12 +306,15 @@ function send_setup(){
echo '
| |
";
+ echo ' | |
";
echo ' | '.submit($I['change']).' |
';
thr();
- if($ga==4){
+ if($ga==4 || $ga==-1){
echo "$I[globalloginpass] | ";
echo "<$H[form]>".hidden('action', 'setup').hidden('do', 'globalpass').hidden('session', $U['session']).' |
|
';
thr();
}
@@ -328,6 +335,11 @@ function send_setup(){
echo ' |
';
echo ' | '.submit($I['apply']).' |
';
thr();
+ echo "$I[dateformat] | ";
+ echo "<$H[form]>".hidden('action', 'setup').hidden('do', 'dateformat').hidden('session', $U['session']).' |
|
';
+ thr();
echo "<$H[form]>".hidden('action', 'logout').hidden('session', $U['session']).submit($I['logout']).'';
print_credits();
print_end();
@@ -387,7 +399,7 @@ function send_admin($arg=''){
echo submit($I['clean']).'';
thr();
echo ' |
';
thr();
- if($ga==4){
+ if($ga==4 || $ga==-1){
echo "$I[globalloginpass] | ";
- echo frmadm('globalpass').' | ';
thr();
}
@@ -575,7 +590,7 @@ function send_frameset(){
if(isSet($_COOKIE['test'])){
echo "\n
|