From: Kazuki Przyborowski Date: Sun, 12 Oct 2008 01:16:05 +0000 (+0000) Subject: Add CAPTCHA System to guest stuff. :P X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=edb1090f4616b7e6fcc6de4efb4def8d1a8aaab6;p=idb%2FiDB.git.git Add CAPTCHA System to guest stuff. :P git-svn-id: svn://svn.code.sf.net/p/intdb/svn/trunk@174 2b68903e-0b30-0410-9a39-a2e4f3c5be39 --- diff --git a/inc/events.php b/inc/events.php index ded0efb..99f09bc 100644 --- a/inc/events.php +++ b/inc/events.php @@ -11,7 +11,7 @@ Copyright 2004-2008 Cool Dude 2k - http://idb.berlios.de/ Copyright 2004-2008 Game Maker 2k - http://intdb.sourceforge.net/ - $FileInfo: events.php - Last Update: 10/10/2008 SVN 173 - Author: cooldude2k $ + $FileInfo: events.php - Last Update: 10/11/2008 SVN 174 - Author: cooldude2k $ */ $File3Name = basename($_SERVER['SCRIPT_NAME']); if ($File3Name=="events.php"||$File3Name=="/events.php") { @@ -190,8 +190,11 @@ echo ""; + - + + + @@ -202,6 +205,10 @@ echo "";
+ +
+
+

@@ -232,6 +239,9 @@ if(!isset($_POST['EventText'])) { $_POST['EventText'] = null; } if(!isset($_POST['GuestName'])) { $_POST['GuestName'] = null; } $TimeIn = explode("/",$_POST['EventStart']); $TimeOut = explode("/",$_POST['EventEnd']); +if($_SESSION['UserGroup']==$Settings['GuestGroup']&& + $Settings['captcha_guest']=="on") { +require($SettDir['inc']."captcha.php"); } ?>
@@ -252,7 +262,17 @@ $TimeOut = explode("/",$_POST['EventEnd']);
Your Event Name is too big.
  - + + + + + + - + + +
+
Invalid code entered
+
 

Event Start Month is too small.
@@ -361,6 +381,10 @@ $_POST['EventText'] = stripcslashes(htmlspecialchars($_POST['EventText'], ENT_QU //$_POST['EventText'] = preg_replace("/&#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['EventText']); $_POST['EventText'] = remove_bad_entities($_POST['EventText']); //$_POST['EventText'] = @remove_spaces($_POST['EventText']); +if($_SESSION['UserGroup']==$Settings['GuestGroup']) { +if(isset($_POST['GuestName'])&&$_POST['GuestName']!=null) { +@setcookie("GuestName", $_POST['GuestName'], time() + (7 * 86400), $cbasedir); +$_SESSION['GuestName']=$_POST['GuestName']; } } /* <_< iWordFilter >_> by Kazuki Przyborowski - Cool Dude 2k */ $katarzynaqy=query("SELECT * FROM `".$Settings['sqltable']."wordfilter`", array(null)); diff --git a/inc/members.php b/inc/members.php index 1a108bf..0421d1b 100644 --- a/inc/members.php +++ b/inc/members.php @@ -11,7 +11,7 @@ Copyright 2004-2008 Cool Dude 2k - http://idb.berlios.de/ Copyright 2004-2008 Game Maker 2k - http://intdb.sourceforge.net/ - $FileInfo: members.php - Last Update: 10/10/2008 SVN 173 - Author: cooldude2k $ + $FileInfo: members.php - Last Update: 10/11/2008 SVN 174 - Author: cooldude2k $ */ $File3Name = basename($_SERVER['SCRIPT_NAME']); if ($File3Name=="members.php"||$File3Name=="/members.php") { @@ -535,7 +535,11 @@ if($_SESSION['UserID']==0||$_SESSION['UserID']==null) { + + + + @@ -624,7 +628,7 @@ echo "\n"; }
-
+

@@ -651,7 +655,7 @@ $URL['HOST'] = $_SERVER["SERVER_NAME"]; $REFERERurl = null; if(!isset($_POST['username'])) { $_POST['username'] = null; } if(!isset($_POST['TOS'])) { $_POST['TOS'] = null; } - if($Settings['use_captcha']=="on") { +if($Settings['use_captcha']=="on") { require($SettDir['inc']."captcha.php"); } ?>
diff --git a/inc/pm.php b/inc/pm.php index a28ab50..26fa7ef 100644 --- a/inc/pm.php +++ b/inc/pm.php @@ -11,7 +11,7 @@ Copyright 2004-2008 Cool Dude 2k - http://idb.berlios.de/ Copyright 2004-2008 Game Maker 2k - http://intdb.sourceforge.net/ - $FileInfo: pm.php - Last Update: 10/10/2008 SVN 173 - Author: cooldude2k $ + $FileInfo: pm.php - Last Update: 10/11/2008 SVN 174 - Author: cooldude2k $ */ $File3Name = basename($_SERVER['SCRIPT_NAME']); if ($File3Name=="pm.php"||$File3Name=="/pm.php") { @@ -518,12 +518,19 @@ echo "
";
+ - + + +
+ +
+
+

@@ -548,6 +555,9 @@ if(!isset($_POST['MessageName'])) { $_POST['MessageName'] = null; } if(!isset($_POST['MessageDesc'])) { $_POST['MessageDesc'] = null; } if(!isset($_POST['Message'])) { $_POST['Message'] = null; } if(!isset($_POST['GuestName'])) { $_POST['GuestName'] = null; } +if($_SESSION['UserGroup']==$Settings['GuestGroup']&& + $Settings['captcha_guest']=="on") { +require($SettDir['inc']."captcha.php"); } ?>
@@ -568,7 +578,17 @@ if(!isset($_POST['GuestName'])) { $_POST['GuestName'] = null; }
Send to user name too big.
  - + + + + +
+
Invalid code entered
+
 

You need to enter a user name to send message to.
@@ -617,6 +637,10 @@ $_POST['Message'] = stripcslashes(htmlspecialchars($_POST['Message'], ENT_QUOTES //$_POST['Message'] = preg_replace("/&#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['Message']); //$_POST['Message'] = @remove_spaces($_POST['Message']); $_POST['Message'] = remove_bad_entities($_POST['Message']); +if($_SESSION['UserGroup']==$Settings['GuestGroup']) { +if(isset($_POST['GuestName'])&&$_POST['GuestName']!=null) { +@setcookie("GuestName", $_POST['GuestName'], time() + (7 * 86400), $cbasedir); +$_SESSION['GuestName']=$_POST['GuestName']; } } /* <_< iWordFilter >_> by Kazuki Przyborowski - Cool Dude 2k */ $katarzynaqy=query("SELECT * FROM `".$Settings['sqltable']."wordfilter`", array(null)); diff --git a/inc/replys.php b/inc/replys.php index bbec63a..c34feec 100644 --- a/inc/replys.php +++ b/inc/replys.php @@ -11,7 +11,7 @@ Copyright 2004-2008 Cool Dude 2k - http://idb.berlios.de/ Copyright 2004-2008 Game Maker 2k - http://intdb.sourceforge.net/ - $FileInfo: replys.php - Last Update: 10/10/2008 SVN 173 - Author: cooldude2k $ + $FileInfo: replys.php - Last Update: 10/11/2008 SVN 174 - Author: cooldude2k $ */ $File3Name = basename($_SERVER['SCRIPT_NAME']); if ($File3Name=="replys.php"||$File3Name=="/replys.php") { @@ -468,12 +468,19 @@ echo "
";
+ - + + + @@ -348,6 +351,10 @@ echo "
+ +
+
+

@@ -504,6 +511,9 @@ $REFERERurl = null; if(!isset($_POST['ReplyDesc'])) { $_POST['ReplyDesc'] = null; } if(!isset($_POST['ReplyPost'])) { $_POST['ReplyPost'] = null; } if(!isset($_POST['GuestName'])) { $_POST['GuestName'] = null; } +if($_SESSION['UserGroup']==$Settings['GuestGroup']&& + $Settings['captcha_guest']=="on") { +require($SettDir['inc']."captcha.php"); } ?>
@@ -525,6 +535,16 @@ if(!isset($_POST['GuestName'])) { $_POST['GuestName'] = null; }   + + + +="25") { $Error="Yes"; ?>
+
Invalid code entered
+
 
@@ -549,6 +569,10 @@ $_POST['ReplyPost'] = stripcslashes(htmlspecialchars($_POST['ReplyPost'], ENT_QU //$_POST['ReplyPost'] = preg_replace("/&#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['ReplyPost']); //$_POST['ReplyPost'] = @remove_spaces($_POST['ReplyPost']); $_POST['ReplyPost'] = remove_bad_entities($_POST['ReplyPost']); +if($_SESSION['UserGroup']==$Settings['GuestGroup']) { +if(isset($_POST['GuestName'])&&$_POST['GuestName']!=null) { +@setcookie("GuestName", $_POST['GuestName'], time() + (7 * 86400), $cbasedir); +$_SESSION['GuestName']=$_POST['GuestName']; } } /* <_< iWordFilter >_> by Kazuki Przyborowski - Cool Dude 2k */ $katarzynaqy=query("SELECT * FROM `".$Settings['sqltable']."wordfilter`", array(null)); diff --git a/inc/topics.php b/inc/topics.php index 500fe73..247978e 100644 --- a/inc/topics.php +++ b/inc/topics.php @@ -11,7 +11,7 @@ Copyright 2004-2008 Cool Dude 2k - http://idb.berlios.de/ Copyright 2004-2008 Game Maker 2k - http://intdb.sourceforge.net/ - $FileInfo: topics.php - Last Update: 10/10/2008 SVN 173 - Author: cooldude2k $ + $FileInfo: topics.php - Last Update: 10/11/2008 SVN 174 - Author: cooldude2k $ */ $File3Name = basename($_SERVER['SCRIPT_NAME']); if ($File3Name=="topics.php"||$File3Name=="/topics.php") { @@ -339,8 +339,11 @@ echo "
";
";
+ +
+
+

@@ -376,6 +383,9 @@ if(!isset($_POST['TopicName'])) { $_POST['TopicName'] = null; } if(!isset($_POST['TopicDesc'])) { $_POST['TopicDesc'] = null; } if(!isset($_POST['TopicPost'])) { $_POST['TopicPost'] = null; } if(!isset($_POST['GuestName'])) { $_POST['GuestName'] = null; } +if($_SESSION['UserGroup']==$Settings['GuestGroup']&& + $Settings['captcha_guest']=="on") { +require($SettDir['inc']."captcha.php"); } ?>
@@ -396,7 +406,17 @@ if(!isset($_POST['GuestName'])) { $_POST['GuestName'] = null; }
Your Topic Name is too big.
  -="45") { $Error="Yes"; ?> + + + + +="45") { $Error="Yes"; ?>
+
Invalid code entered
+
 

Your Topic Description is too big.
@@ -430,6 +450,10 @@ $_POST['TopicPost'] = stripcslashes(htmlspecialchars($_POST['TopicPost'], ENT_QU //$_POST['TopicPost'] = preg_replace("/&#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['TopicPost']); $_POST['TopicPost'] = remove_bad_entities($_POST['TopicPost']); //$_POST['TopicPost'] = @remove_spaces($_POST['TopicPost']); +if($_SESSION['UserGroup']==$Settings['GuestGroup']) { +if(isset($_POST['GuestName'])&&$_POST['GuestName']!=null) { +@setcookie("GuestName", $_POST['GuestName'], time() + (7 * 86400), $cbasedir); +$_SESSION['GuestName']=$_POST['GuestName']; } } /* <_< iWordFilter >_> by Kazuki Przyborowski - Cool Dude 2k */ $katarzynaqy=query("SELECT * FROM `".$Settings['sqltable']."wordfilter`", array(null)); diff --git a/inc/versioninfo.php b/inc/versioninfo.php index 2baff7b..741a34a 100644 --- a/inc/versioninfo.php +++ b/inc/versioninfo.php @@ -11,7 +11,7 @@ Copyright 2004-2008 Cool Dude 2k - http://idb.berlios.de/ Copyright 2004-2008 Game Maker 2k - http://intdb.sourceforge.net/ - $FileInfo: versioninfo.php - Last Update: 10/10/2008 SVN 173 - Author: cooldude2k $ + $FileInfo: versioninfo.php - Last Update: 10/11/2008 SVN 174 - Author: cooldude2k $ */ $File3Name = basename($_SERVER['SCRIPT_NAME']); if ($File3Name=="versioninfo.php"||$File3Name=="/versioninfo.php") { @@ -27,8 +27,8 @@ function version_info($proname,$subver,$ver,$supver,$reltype,$svnver,$showsvn) { return $return_var; } // Version number and date stuff. :P $VER1[0] = 0; $VER1[1] = 2; $VER1[2] = 3; $VERFull[1] = $VER1[0].".".$VER1[1].".".$VER1[2]; -$VER2[0] = "Pre-Alpha"; $VER2[1] = "PA"; $VER2[2] = "SVN"; $SubVerN = 173; $RName = "iDB"; $SFName = "IntDB"; -$SVNDay[0] = 10; $SVNDay[1] = 10; $SVNDay[2] = 2008; $SVNDay[3] = $SVNDay[0]."/".$SVNDay[1]."/".$SVNDay[2]; +$VER2[0] = "Pre-Alpha"; $VER2[1] = "PA"; $VER2[2] = "SVN"; $SubVerN = 174; $RName = "iDB"; $SFName = "IntDB"; +$SVNDay[0] = 10; $SVNDay[1] = 11; $SVNDay[2] = 2008; $SVNDay[3] = $SVNDay[0]."/".$SVNDay[1]."/".$SVNDay[2]; $VerInfo['iDB_Ver'] = version_info($RName,$VER1[0],$VER1[1],$VER1[2],$VER2[1],$SubVerN,false); $VerInfo['iDB_Ver_SVN'] = version_info($RName,$VER1[0],$VER1[1],$VER1[2],$VER2[1],$SubVerN,true); $VerInfo['iDB_Full_Ver'] = version_info($RName,$VER1[0],$VER1[1],$VER1[2],$VER2[0],$SubVerN,false); diff --git a/mysql.php b/mysql.php index b0f1e11..f057800 100644 --- a/mysql.php +++ b/mysql.php @@ -11,7 +11,7 @@ Copyright 2004-2008 Cool Dude 2k - http://idb.berlios.de/ Copyright 2004-2008 Game Maker 2k - http://intdb.sourceforge.net/ - $FileInfo: mysql.php - Last Update: 09/26/2008 SVN 172 - Author: cooldude2k $ + $FileInfo: mysql.php - Last Update: 10/11/2008 SVN 174 - Author: cooldude2k $ */ //@ini_set("display_errors", true); //@ini_set("display_startup_errors", true); @@ -27,6 +27,7 @@ if(!isset($SettDir['misc'])) { $SettDir['misc'] = "inc/misc/"; } require_once($SettDir['misc'].'killglobals.php'); } require('settings.php'); $Settings['use_captcha'] = "on"; +$Settings['captcha_guest'] = "on"; $Settings['captcha_clean'] = "off"; if($Settings['fixbasedir']===true) { if($Settings['idburl']!=null&&$Settings['idburl']!="localhost") { @@ -232,6 +233,14 @@ if($Settings['DefaultDST']=="off") { $_SESSION['UserDST'] = "off"; } if($Settings['DefaultDST']=="on") { $_SESSION['UserDST'] = "on"; } } +// Guest Stuff +if(isset($_SESSION['MemberName'])|| + isset($_COOKIE['MemberName'])) { + $_SESSION['GuestName'] = null; + $_COOKIE['GuestName'] = null; } +if(!isset($_SESSION['MemberName'])&&!isset($_COOKIE['MemberName'])) { +if(!isset($_SESSION['GuestName'])&&isset($_COOKIE['GuestName'])) { + $_SESSION['GuestName'] = $_COOKIE['GuestName']; } } // Skin Stuff if(!isset($_SESSION['Theme'])) { $_SESSION['Theme'] = null; } if(!isset($_GET['theme'])) { $_GET['theme'] = null; } diff --git a/setup/mkconfig.php b/setup/mkconfig.php index fdced34..1718935 100644 --- a/setup/mkconfig.php +++ b/setup/mkconfig.php @@ -12,7 +12,7 @@ Copyright 2004-2008 Game Maker 2k - http://intdb.sourceforge.net/ iDB Installer made by Game Maker 2k - http://idb.berlios.net/ - $FileInfo: mkconfig.php - Last Update: 05/31/2008 SVN 164 - Author: cooldude2k $ + $FileInfo: mkconfig.php - Last Update: 10/11/2008 SVN 174 - Author: cooldude2k $ */ $File3Name = basename($_SERVER['SCRIPT_NAME']); if ($File3Name=="mkconfig.php"||$File3Name=="/mkconfig.php") { @@ -92,7 +92,7 @@ echo "
".mysql_errno().": ".mysql_error()."\n"; } if ($Error!="Yes") { require($SetupDir['setup'].'mktable.php'); /* -$query = query("INSERT INTO `".$_POST['tableprefix']."tagboard` VALUES (1,-1,'Cool Dude 2k',".$YourDate.",'Welcome to Your New Tag Board. ^_^','127.0.0.1'), array(null)); +$query = query("INSERT INTO `".$_POST['tableprefix']."tagboard` VALUES (1,-1,'Kazuki',".$YourDate.",'Welcome to Your New Tag Board. ^_^','127.0.0.1'), array(null)); */ $query = query("INSERT INTO `".$_POST['tableprefix']."categories` VALUES (1,1,'Main','yes','category','yes',0,'The Main Category.')", array(null)); mysql_query($query); @@ -115,13 +115,13 @@ $EventDay = GMTimeChange("d",$YourDate,0,0,"off"); $EventDayEnd = GMTimeChange("d",$YourDateEnd,0,0,"off"); $EventYear = GMTimeChange("Y",$YourDate,0,0,"off"); $EventYearEnd = GMTimeChange("Y",$YourDateEnd,0,0,"off"); -$query = query("INSERT INTO `".$_POST['tableprefix']."events` VALUES (1, -1, 'Cool Dude 2k', 'Opening', 'This is the day the Board was made. ^_^', %i, %i, %i, %i, %i, %i, %i, %i)", array($YourDate,$YourDateEnd,$EventMonth,$EventMonthEnd,$EventDay,$EventDayEnd,$EventYear,$EventYearEnd)); +$query = query("INSERT INTO `".$_POST['tableprefix']."events` VALUES (1, -1, 'Kazuki', 'Opening', 'This is the day the Board was made. ^_^', %i, %i, %i, %i, %i, %i, %i, %i)", array($YourDate,$YourDateEnd,$EventMonth,$EventMonthEnd,$EventDay,$EventDayEnd,$EventYear,$EventYearEnd)); mysql_query($query); $query = query("INSERT INTO `".$_POST['tableprefix']."forums` VALUES (1,1,1,'Test/Spam','yes','forum',0,'http://',0,0,'A Test Board.','off','yes',1,1)", array(null)); mysql_query($query); -$query = query("INSERT INTO `".$_POST['tableprefix']."topics` VALUES (1,1,1,-1,'Cool Dude 2k',%i,%i,'Welcome','Install was successful',0,0,1,1)", array($YourDate,$YourDate)); +$query = query("INSERT INTO `".$_POST['tableprefix']."topics` VALUES (1,1,1,-1,'Kazuki',%i,%i,'Welcome','Install was successful',0,0,1,1)", array($YourDate,$YourDate)); mysql_query($query); -$query = query("INSERT INTO `".$_POST['tableprefix']."posts` VALUES (1,1,1,1,-1,'Cool Dude 2k',%i,%i,1,'Welcome to Your Message Board. :) ','Install was successful','127.0.0.1','127.0.0.1')", array($YourDate,$YourEditDate)); +$query = query("INSERT INTO `".$_POST['tableprefix']."posts` VALUES (1,1,1,1,-1,'Kazuki',%i,%i,1,'Welcome to Your Message Board. :) ','Install was successful','127.0.0.1','127.0.0.1')", array($YourDate,$YourEditDate)); mysql_query($query); $NewPassword = b64e_hmac($_POST['AdminPasswords'],$YourDate,$YourSalt,"sha1"); //$Name = stripcslashes(htmlspecialchars($AdminUser, ENT_QUOTES, $Settings['charset'])); @@ -146,7 +146,7 @@ $query = query("INSERT INTO `".$_POST['tableprefix']."members` VALUES (-1,'Guest mysql_query($query); $query = query("INSERT INTO `".$_POST['tableprefix']."members` VALUES (1,'%s','%s','iDBH','%s',1,'yes',0,'%s','Admin',%i,%i,'0','0','0','0','%s','Your Notes','%s','100x100','%s','UnKnow',0,'%s','%s','iDB','%s','%s')", array($_POST['AdminUser'],$NewPassword,$Email,$Interests,$YourDate,$YourDate,$NewSignature,$Avatar,$YourWebsite,$AdminTime,$AdminDST,$UserIP,$YourSalt)); mysql_query($query); -$query = query("INSERT INTO `".$_POST['tableprefix']."messenger` VALUES (1,-1,1,'Cool Dude 2k','Test','Hello Welcome to your board.\r\nThis is a Test PM. :P ','Hello Welcome',%i,0)", array($YourDate)); +$query = query("INSERT INTO `".$_POST['tableprefix']."messenger` VALUES (1,-1,1,'Kazuki','Test','Hello Welcome to your board.\r\nThis is a Test PM. :P ','Hello Welcome',%i,0)", array($YourDate)); mysql_query($query); $CHMOD = $_SERVER['PHP_SELF']; $pretext = "