1 | <?php
|
---|
2 |
|
---|
3 | /***************************************************************************
|
---|
4 | * Dolphin Smart Community Builder
|
---|
5 | * -----------------
|
---|
6 | * begin : Mon Mar 23 2006
|
---|
7 | * copyright : (C) 2006 BoonEx Group
|
---|
8 | * website : http://www.boonex.com/
|
---|
9 | * This file is part of Dolphin - Smart Community Builder
|
---|
10 | *
|
---|
11 | * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License.
|
---|
12 | * http://creativecommons.org/licenses/by/3.0/
|
---|
13 | *
|
---|
14 | * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
---|
15 | * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
---|
16 | * See the Creative Commons Attribution 3.0 License for more details.
|
---|
17 | * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin,
|
---|
18 | * see license.txt file; if not, write to marketing@boonex.com
|
---|
19 | ***************************************************************************/
|
---|
20 |
|
---|
21 |
|
---|
22 | require_once( '../inc/header.inc.php' );
|
---|
23 | require_once( BX_DIRECTORY_PATH_INC . 'profiles.inc.php' );
|
---|
24 | require_once( BX_DIRECTORY_PATH_INC . 'images.inc.php' );
|
---|
25 |
|
---|
26 | ob_start();
|
---|
27 | $chars = array("a","b","c","d","e","f","h","i","k","m","n","o","r","s","t","u","v","w","x","z","2","3","4","5","6","7","8","9");
|
---|
28 | /*
|
---|
29 | $chars = array("a","A","b","B","c","C","d","D","e","E","f","F","g","G","h","H","i","I","j","J",
|
---|
30 | "k","K","L","m","M","n","N","o","p","P","q","Q","r","R","s","S","t","T",
|
---|
31 | "u","U","v","V","w","W","x","X","y","Y","z","Z","2","3","4","5","6","7","8","9");
|
---|
32 | */
|
---|
33 | $textstr = '';
|
---|
34 | for ($i = 0, $length = 6; $i < $length; $i++)
|
---|
35 | $textstr .= $chars[rand(0, count($chars) - 1)];
|
---|
36 |
|
---|
37 | $hashtext = md5($textstr);
|
---|
38 | setcookie('strSec', $hashtext, 0, '/');
|
---|
39 |
|
---|
40 | if ( produceSecurityImage( $textstr, $hashtext ) != IMAGE_ERROR_SUCCESS )
|
---|
41 | {
|
---|
42 | // output header
|
---|
43 | header( "Content-Type: image/gif" );
|
---|
44 |
|
---|
45 | header( "Expires: Mon, 26 Jul 1997 05:00:00 GMT" );
|
---|
46 | header( "Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT" );
|
---|
47 | header( "Cache-Control: no-store, no-cache, must-revalidate" );
|
---|
48 | header( "Cache-Control: post-check=0, pre-check=0", false );
|
---|
49 | header( "Pragma: no-cache" );
|
---|
50 |
|
---|
51 | // output error image
|
---|
52 | @readfile( $dir['profileImage'] . 'simg_error.gif' );
|
---|
53 | }
|
---|
54 |
|
---|
55 | ob_end_flush();
|
---|
56 | ?>
|
---|