projects
/
Pman.Core
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e14d01c
)
Fix #5784 - COVERAGE BY REGION: Others
author
Edward
<edward@roojs.com>
Fri, 1 Mar 2019 07:25:37 +0000
(15:25 +0800)
committer
Edward
<edward@roojs.com>
Fri, 1 Mar 2019 07:25:37 +0000
(15:25 +0800)
Images.php
patch
|
blob
|
history
Mailer.php
patch
|
blob
|
history
diff --git
a/Images.php
b/Images.php
index
3a4b741
..
4d2fd14
100644
(file)
--- a/
Images.php
+++ b/
Images.php
@@
-44,8
+44,6
@@
class Pman_Core_Images extends Pman
// tables that do not need authentication checks before serving.
var $public_image_tables = array();
// tables that do not need authentication checks before serving.
var $public_image_tables = array();
- var $is_email = false;
-
var $sizes = array(
'100',
'100x100',
var $sizes = array(
'100',
'100x100',
@@
-77,6
+75,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!!!!
{
@@
-85,9
+84,7
@@
class Pman_Core_Images extends Pman
// return $this->post();
//}
// return $this->post();
//}
- if(!empty($_REQUEST['is_email'])) {
- $this->is_email = true;
- }
+ $this->is_local = (!empty($_SERVER['HTTP_HOST']) && $_SERVER['HTTP_HOST'] == 'localhost') ? true : false;
$this->as_mimetype = empty($_REQUEST['as']) ? '' : $_REQUEST['as'];
$this->as_mimetype = empty($_REQUEST['as']) ? '' : $_REQUEST['as'];
@@
-188,11
+185,11
@@
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($this->is_email) {
- return $this->serve($img);
- }
if ($img->ontable != 'core_company') {
$this->imgErr("not-authenticated {$img->ontable}",$s);
if ($img->ontable != 'core_company') {
$this->imgErr("not-authenticated {$img->ontable}",$s);
@@
-337,6
+334,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;
diff --git
a/Mailer.php
b/Mailer.php
index
1211e4e
..
7da09a8
100644
(file)
--- a/
Mailer.php
+++ b/
Mailer.php
@@
-588,7
+588,6
@@
class Pman_Core_Mailer {
$real_url = str_replace(' ', '%20', $this->mapurl($url));
$a = new HTTP_Request($real_url);
$real_url = str_replace(' ', '%20', $this->mapurl($url));
$a = new HTTP_Request($real_url);
- $a->addQueryString('is_email', 1);
$a->sendRequest();
$data = $a->getResponseBody();
$a->sendRequest();
$data = $a->getResponseBody();