diff --git a/2.8.3_captcha_patch/captcha-readme.txt b/2.8.3_captcha_patch/captcha-readme.txt deleted file mode 100644 index c49cc2c..0000000 --- a/2.8.3_captcha_patch/captcha-readme.txt +++ /dev/null @@ -1 +0,0 @@ -http://www.websitebaker2.org/forum/index.php/topic,23986.msg164705.html#msg164705 diff --git a/2.8.3_captcha_patch/captchas/calc_image.php b/2.8.3_captcha_patch/captchas/calc_image.php deleted file mode 100644 index 7c59706..0000000 --- a/2.8.3_captcha_patch/captchas/calc_image.php +++ /dev/null @@ -1,96 +0,0 @@ - - Copyright (C) 2004-2009, Ryan Djurovich - - Website Baker is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Website Baker is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Website Baker; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -*/ - -require_once("../../../config.php"); -require_once(WB_PATH.'/include/captcha/captcha.php'); - -if(!isset($_SESSION['captcha_time'])) - exit; -//unset($_SESSION['captcha_time']); - -// Captcha -$sec_id = ''; -if(isset($_GET['s'])) $sec_id = $_GET['s']; -$_SESSION['captcha'.$sec_id] = ''; -mt_srand((double)microtime()*1000000); -$n = mt_rand(1,3); -switch ($n) { - case 1: - $x = mt_rand(1,9); - $y = mt_rand(1,9); - $_SESSION['captcha'.$sec_id] = $x + $y; - $cap = "$x+$y"; - break; - case 2: - $x = mt_rand(10,20); - $y = mt_rand(1,9); - $_SESSION['captcha'.$sec_id] = $x - $y; - $cap = "$x-$y"; - break; - case 3: - $x = mt_rand(2,10); - $y = mt_rand(2,5); - $_SESSION['captcha'.$sec_id] = $x * $y; - $cap = "$x*$y"; - break; -} - -// create reload-image -$reload = ImageCreateFromPNG(WB_PATH.'/include/captcha/reload_120_30.png'); // reload-overlay - -$image = imagecreate(120, 30); - -$white = imagecolorallocate($image, 0xFF, 0xFF, 0xFF); -$gray = imagecolorallocate($image, 0xC0, 0xC0, 0xC0); -$darkgray = imagecolorallocate($image, 0x30, 0x30, 0x30); - -for($i = 0; $i < 30; $i++) { - $x1 = mt_rand(0,120); - $y1 = mt_rand(0,30); - $x2 = mt_rand(0,120); - $y2 = mt_rand(0,30); - imageline($image, $x1, $y1, $x2, $y2 , $gray); -} - -$x = 10; -$l = strlen($cap); -for($i = 0; $i < $l; $i++) { - $fnt = mt_rand(3,5); - $x = $x + mt_rand(12 , 20); - $y = mt_rand(7 , 12); - imagestring($image, $fnt, $x, $y, substr($cap, $i, 1), $darkgray); -} - -imagealphablending($reload, TRUE); -imagesavealpha($reload, TRUE); - -// overlay -imagecopy($reload, $image, 0,0,0,0, 120,30); -imagedestroy($image); -$image = $reload; - -captcha_header(); -imagepng($image); -imagedestroy($image); diff --git a/2.8.3_captcha_patch/captchas/calc_text.php b/2.8.3_captcha_patch/captchas/calc_text.php deleted file mode 100644 index f968c16..0000000 --- a/2.8.3_captcha_patch/captchas/calc_text.php +++ /dev/null @@ -1,60 +0,0 @@ - - Copyright (C) 2004-2009, Ryan Djurovich - - Website Baker is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Website Baker is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Website Baker; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -*/ - -// Must include code to stop this file being accessed directly -if(defined('WB_PATH') == false) { exit("Cannot access this file directly"); } - -if(!file_exists(WB_PATH.'/modules/captcha_control/languages/'.LANGUAGE .'.php')) { - // no module language file exists for the language set by the user, include default module language file EN.php - require_once(WB_PATH.'/modules/captcha_control/languages/EN.php'); -} else { - // a module language file exists for the language defined by the user, load it - require_once(WB_PATH.'/modules/captcha_control/languages/'.LANGUAGE .'.php'); -} - -$_SESSION['captcha'.$sec_id] = ''; -mt_srand((double)microtime()*1000000); -$n = mt_rand(1,3); -switch ($n) { - case 1: - $x = mt_rand(1,9); - $y = mt_rand(1,9); - $_SESSION['captcha'.$sec_id] = $x + $y; - $cap = "$x {$MOD_CAPTCHA['ADDITION']} $y"; - break; - case 2: - $x = mt_rand(10,20); - $y = mt_rand(1,9); - $_SESSION['captcha'.$sec_id] = $x - $y; - $cap = "$x {$MOD_CAPTCHA['SUBTRAKTION']} $y"; - break; - case 3: - $x = mt_rand(2,10); - $y = mt_rand(2,5); - $_SESSION['captcha'.$sec_id] = $x * $y; - $cap = "$x {$MOD_CAPTCHA['MULTIPLIKATION']} $y"; - break; -} -echo $cap; diff --git a/2.8.3_captcha_patch/captchas/calc_ttf_image.php b/2.8.3_captcha_patch/captchas/calc_ttf_image.php deleted file mode 100644 index ebe9184..0000000 --- a/2.8.3_captcha_patch/captchas/calc_ttf_image.php +++ /dev/null @@ -1,150 +0,0 @@ - - Copyright (C) 2004-2009, Ryan Djurovich - - Website Baker is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Website Baker is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Website Baker; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -*/ - -require_once("../../../config.php"); -require_once(WB_PATH.'/include/captcha/captcha.php'); - -if(!isset($_SESSION['captcha_time'])) - exit('missing captcha_time'); -//unset($_SESSION['captcha_time']); // otherwise there can't be 2 captchas on one page! - -// get lists of fonts and backgrounds -require_once(WB_PATH.'/framework/functions.php'); -$t_fonts = file_list(WB_PATH.'/include/captcha/fonts'); -$t_bgs = file_list(WB_PATH.'/include/captcha/backgrounds'); -$fonts = array(); -$bgs = array(); -foreach($t_fonts as $file) { if(preg_match('/\.ttf/',$file)) { $fonts[]=$file; } } -foreach($t_bgs as $file) { if(preg_match('/\.png/',$file)) { $bgs[]=$file; } } - -// Captcha -$sec_id = ''; -if(isset($_GET['s'])) $sec_id = $_GET['s']; -$_SESSION['captcha'.$sec_id] = ''; -mt_srand((double)microtime()*1000000); -$n = mt_rand(1,3); -switch ($n) { - case 1: - $x = mt_rand(1,9); - $y = mt_rand(1,9); - $_SESSION['captcha'.$sec_id] = $x + $y; - $cap = "$x+$y"; - break; - case 2: - $x = mt_rand(10,20); - $y = mt_rand(1,9); - $_SESSION['captcha'.$sec_id] = $x - $y; - $cap = "$x-$y"; - break; - case 3: - $x = mt_rand(2,10); - $y = mt_rand(2,5); - $_SESSION['captcha'.$sec_id] = $x * $y; - $cap = "$x*$y"; - break; -} -$text = $cap; - -// choose a font and background -$font = $fonts[array_rand($fonts)]; -$bg = $bgs[array_rand($bgs)]; -// get image-dimensions -list($width, $height, $type, $attr) = getimagesize($bg); - -// create reload-image -$reload = ImageCreateFromPNG(WB_PATH.'/include/captcha/reload_140_40.png'); // reload-overlay - -if(mt_rand(0,2)==0) { // 1 out of 3 - - // draw each character individualy - $image = ImageCreateFromPNG($bg); // background image - $grey = mt_rand(0,50); - $color = ImageColorAllocate($image, $grey, $grey, $grey); // font-color - $ttf = $font; - $ttfsize = 25; // fontsize - $count = 0; - $image_failed = true; - $angle = mt_rand(-10,10); - $x = mt_rand(20,35); - $y = mt_rand($height-10,$height-2); - do { - for($i=0;$i $width) { - $image_failed = true; - } else { - $image_failed = false; - } - if(++$count > 4) // too many tries! Use the image - break; - } while($image_failed); - -} else { - - // draw whole string at once - $image_failed = true; - $count=0; - do { - $image = ImageCreateFromPNG($bg); // background image - $grey = mt_rand(0,50); - $color = ImageColorAllocate($image, $grey, $grey, $grey); // font-color - $ttf = $font; - $ttfsize = 25; // fontsize - $angle = mt_rand(0,5); - $x = mt_rand(20,35); - $y = mt_rand($height-10,$height-2); - $res = imagettftext($image, $ttfsize, $angle, $x, $y, $color, $ttf, $text); - // check if text fits into the image - if(($res[0]>0 && $res[0]<$width) && ($res[1]>0 && $res[1]<$height) && - ($res[2]>0 && $res[2]<$width) && ($res[3]>0 && $res[3]<$height) && - ($res[4]>0 && $res[4]<$width) && ($res[5]>0 && $res[5]<$height) && - ($res[6]>0 && $res[6]<$width) && ($res[7]>0 && $res[7]<$height) - ) { - $image_failed = false; - } - if(++$count > 4) // too many tries! Use the image - break; - } while($image_failed); - -} - -imagealphablending($reload, TRUE); -imagesavealpha($reload, TRUE); - -// overlay -imagecopy($reload, $image, 0,0,0,0, 140,40); -imagedestroy($image); -$image = $reload; - -captcha_header(); -ob_start(); -imagepng($image); -header("Content-Length: ".ob_get_length()); -ob_end_flush(); -imagedestroy($image); diff --git a/2.8.3_captcha_patch/captchas/text.php b/2.8.3_captcha_patch/captchas/text.php deleted file mode 100644 index 15ac2f8..0000000 --- a/2.8.3_captcha_patch/captchas/text.php +++ /dev/null @@ -1,95 +0,0 @@ - - Copyright (C) 2004-2009, Ryan Djurovich - - Website Baker is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Website Baker is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Website Baker; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -*/ - -// Must include code to stop this file being accessed directly -if(defined('WB_PATH') == false) { exit("Cannot access this file directly"); } - -global $database; -$name = 'text'; -$file = WB_PATH."/temp/.captcha_$name.php"; - -srand((double)microtime()*100000); -$_SESSION['captcha'.$sec_id] = rand(0,99999); - -// get questions and answers -$text_qa=''; -$table = TABLE_PREFIX.'mod_captcha_control'; -if($query = $database->query("SELECT ct_text FROM $table")) { - $data = $query->fetchRow(); - $text_qa = $data['ct_text']; -} -$content = explode("\n", $text_qa); - -reset($content); -while($s = current($content)) { - // get question - $s=trim(rtrim(rtrim($s,"\n"),"\r")); // remove newline - if($s=='' OR $s{0}!='?') { - next($content); - continue; - } - if(isset($s{3}) && $s{3}==':') { - $lang=substr($s,1,2); - $q=substr($s,4); - } else { - $lang='XX'; - $q=substr($s,1); - if($q=='') { - next($content); - continue; - } - } - // get answer - $s=next($content); - $s=trim(rtrim(rtrim($s,"\n"),"\r")); // remove newline - if(isset($s{0}) && $s{0}=='!') { - $a=substr($s,1); - $qa[$lang][$q]=$a; - next($content); - } -} -if(!isset($qa) || $qa == array()) { - echo 'Error: no text defined! Enter 0 to solve this captcha'; - $_SESSION['captcha'] = '0'; - return; -} - -// choose language to use -if(defined('LANGUAGE') && isset($qa[LANGUAGE])) - $lang = LANGUAGE; -else - $lang = 'XX'; -if(!isset($qa[$lang])) { - echo 'Error: no text defined! Enter 0 to solve this captcha'; - $_SESSION['captcha'] = '0'; - return; -} - -// choose random question -$k = array_rand($qa[$lang]); - -$_SESSION['captcha'.$sec_id] = $qa[$lang][$k]; - -echo $k; diff --git a/2.8.3_captcha_patch/captchas/ttf_image.php b/2.8.3_captcha_patch/captchas/ttf_image.php deleted file mode 100644 index 61dbb01..0000000 --- a/2.8.3_captcha_patch/captchas/ttf_image.php +++ /dev/null @@ -1,143 +0,0 @@ - - Copyright (C) 2004-2009, Ryan Djurovich - - Website Baker is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Website Baker is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Website Baker; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -*/ - - -require_once("../../../config.php"); -require_once(WB_PATH.'/include/captcha/captcha.php'); - -if(!isset($_SESSION['captcha_time'])) - exit; -//unset($_SESSION['captcha_time']); - -// get lists of fonts and backgrounds -require_once(WB_PATH.'/framework/functions.php'); -$t_fonts = file_list(WB_PATH.'/include/captcha/fonts'); -$t_bgs = file_list(WB_PATH.'/include/captcha/backgrounds'); -$fonts = array(); -$bgs = array(); -foreach($t_fonts as $file) { if(preg_match('/\.ttf/',$file)) { $fonts[]=$file; } } -foreach($t_bgs as $file) { if(preg_match('/\.png/',$file)) { $bgs[]=$file; } } - -// make random string -if(!function_exists('randomString')) { - function randomString($len) { - list($usec, $sec) = explode(' ', microtime()); - mt_srand((float)$sec + ((float)$usec * 100000)); - //$possible="ABCDEFGHJKLMNPRSTUVWXYZabcdefghkmnpqrstuvwxyz23456789"; - $possible="abdfhkrsvwxz23456789"; - $str=""; - while(strlen($str)<$len) { - $str.=substr($possible,(mt_rand()%(strlen($possible))),1); - } - return($str); - } -} -$text = randomString(5); // number of characters - -$sec_id = ''; -if(isset($_GET['s'])) $sec_id = $_GET['s']; -$_SESSION['captcha'.$sec_id] = $text; - -// choose a font and background -$font = $fonts[array_rand($fonts)]; -$bg = $bgs[array_rand($bgs)]; -// get image-dimensions -list($width, $height, $type, $attr) = getimagesize($bg); - -// create reload-image -$reload = ImageCreateFromPNG(WB_PATH.'/include/captcha/reload_140_40.png'); // reload-overlay - -if(mt_rand(0,2)==0) { // 1 out of 3 - - // draw each character individualy - $image = ImageCreateFromPNG($bg); // background image - $grey = mt_rand(0,50); - $color = ImageColorAllocate($image, $grey, $grey, $grey); // font-color - $ttf = $font; - $ttfsize = 25; // fontsize - $count = 0; - $image_failed = true; - $angle = mt_rand(-15,15); - $x = mt_rand(10,25); - $y = mt_rand($height-10,$height-2); - do { - for($i=0;$i $width) { - $image_failed = true; - } else { - $image_failed = false; - } - if(++$count > 4) // too many tries! Use the image - break; - } while($image_failed); - -} else { - - // draw whole string at once - $image_failed = true; - $count=0; - do { - $image = ImageCreateFromPNG($bg); // background image - $grey = mt_rand(0,50); - $color = ImageColorAllocate($image, $grey, $grey, $grey); // font-color - $ttf = $font; - $ttfsize = 25; // fontsize - $angle = mt_rand(0,5); - $x = mt_rand(5,30); - $y = mt_rand($height-10,$height-2); - $res = imagettftext($image, $ttfsize, $angle, $x, $y, $color, $ttf, $text); - // check if text fits into the image - if(($res[0]>0 && $res[0]<$width) && ($res[1]>0 && $res[1]<$height) && - ($res[2]>0 && $res[2]<$width) && ($res[3]>0 && $res[3]<$height) && - ($res[4]>0 && $res[4]<$width) && ($res[5]>0 && $res[5]<$height) && - ($res[6]>0 && $res[6]<$width) && ($res[7]>0 && $res[7]<$height) - ) { - $image_failed = false; - } - if(++$count > 4) // too many tries! Use the image - break; - } while($image_failed); - -} - -imagealphablending($reload, TRUE); -imagesavealpha($reload, TRUE); - -// overlay -imagecopy($reload, $image, 0,0,0,0, 140,40); -imagedestroy($image); -$image = $reload; - -captcha_header(); -ob_start(); -imagepng($image); -header("Content-Length: ".ob_get_length()); -ob_end_flush(); -imagedestroy($image); diff --git a/nbproject/project.properties b/nbproject/project.properties deleted file mode 100644 index d37ef95..0000000 --- a/nbproject/project.properties +++ /dev/null @@ -1,7 +0,0 @@ -include.path=${php.global.include.path} -php.version=PHP_54 -source.encoding=UTF-8 -src.dir=. -tags.asp=false -tags.short=false -web.root=. diff --git a/nbproject/project.xml b/nbproject/project.xml deleted file mode 100644 index a724294..0000000 --- a/nbproject/project.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - org.netbeans.modules.php.project - - - mpForm - - -