1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-16 20:28:28 +01:00
php-e107/e107_images/secimg.php

74 lines
1.6 KiB
PHP
Raw Normal View History

2006-12-02 04:36:16 +00:00
<?php
/*
2009-11-17 10:46:35 +00:00
* e107 website system
*
2009-11-18 01:06:08 +00:00
* Copyright (C) 2008-2009 e107 Inc (e107.org)
2009-11-17 10:46:35 +00:00
* Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
*
*/
2006-12-02 04:36:16 +00:00
2011-06-26 20:09:45 +00:00
/* Example Custom secure_image_custom.php file:
<?php
2011-06-30 11:10:34 +00:00
2006-12-02 04:36:16 +00:00
$secureimg['image'] = "code_bg_custom"; // filename excluding the .ext
$secureimg['size'] = "15";
$secureimg['angle'] = "0";
$secureimg['x'] = "6";
$secureimg['y'] = "22";
$secureimg['font'] = "imagecode.ttf";
$secureimg['color'] = "90,90,90"; // red,green,blue
2011-06-30 11:10:34 +00:00
2011-06-26 20:09:45 +00:00
?>
*/
// error_reporting(E_ALL);
// define('e107_INIT', true);
$_E107 = array();
$_E107['no_online'] = true;
$_E107['no_forceuserupdate'] = true;
$_E107['no_menus'] = true;
2016-02-26 12:36:35 -08:00
$_E107['no_maintenance'] = true;
2016-02-26 12:50:48 -08:00
//$_E107['no_theme'] = true;
2018-01-18 16:22:49 -08:00
require_once("../class2.php");
header('Expires: Sat, 26 Jul 1997 05:00:00 GMT', true);
/*
define('e_BASE',realpath("..".DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR);
@include(e_BASE.'e107_config.php');
if(!isset($mySQLserver))
{
if(defined('e_DEBUG'))
{
echo "FAILED TO LOAD ".e_BASE."e107_config.php in secimg.php";
}
exit;
}*/
2016-02-26 12:36:35 -08:00
// require_once(realpath(e_BASE.$HANDLERS_DIRECTORY.DIRECTORY_SEPARATOR."secure_img_handler.php"));
2006-12-02 04:36:16 +00:00
$sim = e107::getSecureImg();
if(!isset($_GET['id']))
{
exit;
}
$code = (int) $_GET['id'];
if(!empty($_GET['clr']) && preg_match('/^[a-f0-9]{6}$/i', $_GET['clr'])) //hex color is valid
{
$color = $_GET['clr'];
}
else
{
$color = "cccccc";
}
ob_clean(); // Precaution - clearout utf-8 BOM or any other garbage in e107_config.php
$sim->render($code,$color);
2006-12-02 04:36:16 +00:00
2011-06-26 20:09:45 +00:00
exit;
2011-06-30 11:10:34 +00:00