1<?php
2/*
3 * e107 website system
4 *
5 * Copyright (C) 2008-2009 e107 Inc (e107.org)
6 * Released under the terms and conditions of the
7 * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
8 *
9 */
10
11/*   Example Custom secure_image_custom.php file:
12	<?php
13
14	$secureimg['image'] = "code_bg_custom";  // filename excluding the .ext
15	$secureimg['size']	= "15";
16	$secureimg['angle']	= "0";
17	$secureimg['x']		= "6";
18	$secureimg['y']		= "22";
19	$secureimg['font'] 	= "imagecode.ttf";
20	$secureimg['color'] = "90,90,90"; // red,green,blue
21
22	 ?>
23*/
24// error_reporting(E_ALL);
25// define('e107_INIT', true);
26$_E107 = array();
27$_E107['no_online'] = true;
28$_E107['no_forceuserupdate'] = true;
29$_E107['no_menus'] = true;
30$_E107['no_maintenance'] = true;
31//$_E107['no_theme'] = true;
32
33require_once("../class2.php");
34header('Expires: Sat, 26 Jul 1997 05:00:00 GMT', true);
35/*
36define('e_BASE',realpath("..".DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR);
37@include(e_BASE.'e107_config.php');
38if(!isset($mySQLserver))
39{
40    if(defined('e_DEBUG'))
41    {
42          echo "FAILED TO LOAD ".e_BASE."e107_config.php in secimg.php";
43    }
44    exit;
45}*/
46
47
48// require_once(realpath(e_BASE.$HANDLERS_DIRECTORY.DIRECTORY_SEPARATOR."secure_img_handler.php"));
49
50require_once(e_HANDLER."secure_img_handler.php");
51
52$sim = new secure_image();
53
54if(!isset($_GET['id']))
55{
56	exit;
57}
58
59$code = $_GET['id'];
60
61if(!empty($_GET['clr']) && preg_match('/^[a-f0-9]{6}$/i', $_GET['clr'])) //hex color is valid
62{
63	$color = $_GET['clr'];
64}
65else
66{
67	$color = "cccccc";
68}
69
70ob_clean(); // Precaution - clearout utf-8 BOM or any other garbage in e107_config.php
71$sim->render($code,$color);
72
73exit;
74
75?>