projects
/
Pman.Core
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Pman.js
[Pman.Core]
/
Images.php
diff --git
a/Images.php
b/Images.php
index
68cc362
..
bfda282
100644
(file)
--- a/
Images.php
+++ b/
Images.php
@@
-42,7
+42,9
@@
class Pman_Core_Images extends Pman
{
// tables that do not need authentication checks before serving.
{
// tables that do not need authentication checks before serving.
- var $public_image_tables = array();
+ var $public_image_tables = array(
+ 'crm_mailing_list_message' // we know these are ok...
+ );
var $sizes = array(
'100',
var $sizes = array(
'100',
@@
-75,6
+77,7
@@
class Pman_Core_Images extends Pman
var $as_mimetype = false;
var $method = 'inline';
var $page = false;
var $as_mimetype = false;
var $method = 'inline';
var $page = false;
+ var $is_local = false;
function get($s, $opts=array()) // determin what to serve!!!!
{
function get($s, $opts=array()) // determin what to serve!!!!
{
@@
-83,6
+86,8
@@
class Pman_Core_Images extends Pman
// return $this->post();
//}
// return $this->post();
//}
+ $this->is_local = (!empty($_SERVER['HTTP_HOST']) && $_SERVER['HTTP_HOST'] == 'localhost') ? true : false;
+
$this->as_mimetype = empty($_REQUEST['as']) ? '' : $_REQUEST['as'];
$this->page = empty($_REQUEST['page']) ? false : (int) $_REQUEST['page'];
$this->as_mimetype = empty($_REQUEST['as']) ? '' : $_REQUEST['as'];
$this->page = empty($_REQUEST['page']) ? false : (int) $_REQUEST['page'];
@@
-182,8
+187,12
@@
class Pman_Core_Images extends Pman
$this->imgErr("image has been removed or deleted.",$s);
}
$this->imgErr("image has been removed or deleted.",$s);
}
+ if($this->is_local) {
+ return $this->serve($img);
+ }
+
if (!$this->authUser && !in_array($img->ontable,$this->public_image_tables)) {
if (!$this->authUser && !in_array($img->ontable,$this->public_image_tables)) {
-
+
if ($img->ontable != 'core_company') {
$this->imgErr("not-authenticated {$img->ontable}",$s);
}
if ($img->ontable != 'core_company') {
$this->imgErr("not-authenticated {$img->ontable}",$s);
}
@@
-220,6
+229,9
@@
class Pman_Core_Images extends Pman
function post($v)
{
function post($v)
{
+ if (!empty($_REQUEST['_get'])) {
+ return $this->get($v);
+ }
if (!$this->authUser) {
$this->jerr("image conversion only allowed by registered users");
if (!$this->authUser) {
$this->jerr("image conversion only allowed by registered users");
@@
-327,6
+339,10
@@
class Pman_Core_Images extends Pman
}
function validateSize()
{
}
function validateSize()
{
+ if($this->is_local) {
+ return true;
+ }
+
if (($this->authUser && !empty($this->authUser->company_id) && $this->authUser->company()->comptype=='OWNER')
|| $_SERVER['SERVER_ADDR'] == $_SERVER['REMOTE_ADDR']) {
return true;
if (($this->authUser && !empty($this->authUser->company_id) && $this->authUser->company()->comptype=='OWNER')
|| $_SERVER['SERVER_ADDR'] == $_SERVER['REMOTE_ADDR']) {
return true;