class Pman_Core_Images extends Pman
{
- var $public_image_table = array();
+ // tables that do not need authentication checks before serving.
+ var $public_image_tables = array();
+
function getAuth()
{
var $thumb = false;
var $as_mimetype = false;
var $method = 'inline';
+ var $page = false;
function get($s, $opts=array()) // determin what to serve!!!!
{
$this->as_mimetype = empty($_REQUEST['as']) ? '' : $_REQUEST['as'];
+ $this->page = empty($_REQUEST['page']) ? false : $_REQUEST['page'];
+
$bits= explode('/', $s);
$id = 0;
// var_dump($bits);die('in');
$this->imgErr("image has been removed or deleted.",$s);
}
- if (!$this->authUser) {
+ if (!$this->authUser && !in_array($img->ontable,$this->public_image_tables)) {
if ($img->ontable != 'core_company') {
- $this->imgErr("not-authenticated",$s);
+ $this->imgErr("not-authenticated {$img->ontable}",$s);
}
if ($img->imgtype != 'LOGO') {
$this->imgErr("not-logo",$s);
$this->validateSize();
}
- $x->convert( $this->as_mimetype, $this->size);
+ if(!empty($this->page)){
+ $x->convert( $this->as_mimetype, $this->size, 0, $this->page);
+ } else {
+ $x->convert( $this->as_mimetype, $this->size);
+ }
+
$x->serve();
exit;