mirror of
https://github.com/e107inc/e107.git
synced 2025-08-02 20:57:26 +02:00
Issue #73 secure_image_render.php moved to e107_images/secimg.php
This commit is contained in:
@@ -2675,9 +2675,10 @@ class e107
|
||||
|
||||
|
||||
$e_ROOT = realpath(dirname(__FILE__)."/../");
|
||||
|
||||
if ((substr($e_ROOT,-1) != '/') && (substr($e_ROOT,-1) != '\\') )
|
||||
{
|
||||
$e_ROOT .= (strpos($e_ROOT,':\\')!==false) ? '\\' : '/'; // Should be functioning correctly on both windows and Linux now.
|
||||
$e_ROOT .= DIRECTORY_SEPARATOR; // Should function correctly on both windows and Linux now.
|
||||
}
|
||||
|
||||
define('e_ROOT',$e_ROOT);
|
||||
|
@@ -54,7 +54,8 @@ class secure_image
|
||||
$this->THIS_DIR = $imgp;
|
||||
$this->BASE_DIR = realpath($imgp.'..'.DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR;
|
||||
$this->HANDLERS_DIRECTORY = $HANDLERS_DIRECTORY;
|
||||
$this->IMAGES_DIRECTORY = str_replace('/', DIRECTORY_SEPARATOR, $IMAGES_DIRECTORY);
|
||||
// $this->IMAGES_DIRECTORY = str_replace('/', DIRECTORY_SEPARATOR, $IMAGES_DIRECTORY);
|
||||
$this->IMAGES_DIRECTORY = $IMAGES_DIRECTORY;
|
||||
$this->MYSQL_INFO = array('db' => $mySQLdefaultdb, 'server' => $mySQLserver, 'user' => $mySQLuser, 'password' => $mySQLpassword, 'prefix' => $mySQLprefix);
|
||||
}
|
||||
|
||||
@@ -136,7 +137,7 @@ class secure_image
|
||||
}
|
||||
|
||||
$code = $this->create_code();
|
||||
return "<img src='".e_HTTP.$this->HANDLERS_DIRECTORY."secure_img_render.php?{$code}' class='icon secure-image' alt='' />";
|
||||
return "<img src='".e_HTTP.$this->IMAGES_DIRECTORY."secimg.php?{$code}' class='icon secure-image' alt='Missing Code' />";
|
||||
}
|
||||
|
||||
|
||||
|
@@ -6,9 +6,6 @@
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
*
|
||||
* $URL$
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/* Example Custom secure_image_custom.php file:
|
||||
@@ -27,7 +24,19 @@
|
||||
// error_reporting(E_ALL);
|
||||
define('e107_INIT', true);
|
||||
|
||||
require_once(realpath(dirname(__FILE__)."/secure_img_handler.php"));
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
require_once(realpath(e_BASE.$HANDLERS_DIRECTORY.DIRECTORY_SEPARATOR."secure_img_handler.php"));
|
||||
|
||||
$sim = new secure_image();
|
||||
|
Reference in New Issue
Block a user