Version Notes
-Few bug fixes
Download this release
Release Info
| Developer | Glew |
| Extension | Glew |
| Version | 1.0.2 |
| Comparing to | |
| See all releases | |
Code changes from version 1.0.1 to 1.0.2
- app/code/community/Glew/Service/Helper/Data.php +46 -81
- app/code/community/Glew/Service/Model/Types/OrderItems.php +3 -1
- app/code/community/Glew/Service/Model/Types/RefundItems.php +3 -1
- app/code/community/Glew/Service/controllers/ModuleController.php +38 -2
- app/code/community/Glew/Service/etc/config.xml +1 -1
- package.xml +7 -9
app/code/community/Glew/Service/Helper/Data.php
CHANGED
|
@@ -1,101 +1,66 @@
|
|
| 1 |
-
<?php
|
| 2 |
|
| 3 |
class Glew_Service_Helper_Data extends Mage_Core_Helper_Abstract
|
| 4 |
{
|
| 5 |
private static $connRead;
|
| 6 |
private static $connWrite;
|
| 7 |
-
private static $console;
|
| 8 |
private static $filename = "glew.log";
|
| 9 |
private static $debug = true;
|
| 10 |
-
|
| 11 |
-
|
| 12 |
public function getBaseDir()
|
| 13 |
{
|
| 14 |
-
|
| 15 |
}
|
| 16 |
-
|
| 17 |
-
public function getLogDir()
|
| 18 |
-
{
|
| 19 |
-
return Mage::getBaseDir('log');
|
| 20 |
-
}
|
| 21 |
-
|
| 22 |
public function getDatabaseConnection()
|
| 23 |
{
|
| 24 |
return Mage::getSingleton('core/resource')->getConnection('glew_write');
|
| 25 |
}
|
| 26 |
-
|
| 27 |
-
|
| 28 |
{
|
| 29 |
-
|
| 30 |
}
|
| 31 |
-
|
| 32 |
-
public function getConfig()
|
| 33 |
-
{
|
| 34 |
-
$config = array();
|
| 35 |
-
$config['enabled'] = Mage::getStoreConfig('glew_settings/general/enabled');
|
| 36 |
-
$config['security_token'] = Mage::getStoreConfig('glew_settings/general/security_token');
|
| 37 |
-
|
| 38 |
-
$this->_config = $config;
|
| 39 |
-
return $config;
|
| 40 |
-
}
|
| 41 |
-
|
| 42 |
-
public function formatDate($str)
|
| 43 |
-
{
|
| 44 |
-
if ($str) {
|
| 45 |
-
if (stripos($str, ' ')) {
|
| 46 |
-
$str = substr($str, 0, stripos($str, ' '));
|
| 47 |
-
}
|
| 48 |
-
}
|
| 49 |
-
return $str;
|
| 50 |
-
}
|
| 51 |
-
|
| 52 |
-
public function toArray($value, $create = false)
|
| 53 |
-
{
|
| 54 |
-
if ($value !== false) {
|
| 55 |
-
return is_array($value) ? $value : array($value);
|
| 56 |
-
} else {
|
| 57 |
-
return $create ? array() : $value;
|
| 58 |
-
}
|
| 59 |
-
}
|
| 60 |
-
|
| 61 |
-
public function logException($ex, $msg)
|
| 62 |
-
{
|
| 63 |
-
if ($this->_logging()) {
|
| 64 |
-
$msg = "an exception has occurred during $msg: " . $ex->getMessage();
|
| 65 |
-
$this->_write($msg);
|
| 66 |
-
}
|
| 67 |
-
return false;
|
| 68 |
-
}
|
| 69 |
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 73 |
}
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
if (self::$console) {
|
| 84 |
-
$stats = fstat(self::$console);
|
| 85 |
-
if ($stats) {
|
| 86 |
-
$size = $stats['size'] / (1024*1000);
|
| 87 |
-
if ($size > 10) {
|
| 88 |
-
@fclose(self::$console);
|
| 89 |
-
self::$console = @fopen($uri, "w");
|
| 90 |
-
}
|
| 91 |
-
}
|
| 92 |
-
}
|
| 93 |
-
|
| 94 |
-
if (self::$console) {
|
| 95 |
-
$msg = strftime("%Y-%m-%d %H:%M:%S ") . " " . $msg;
|
| 96 |
-
|
| 97 |
-
fwrite(self::$console, print_r($msg, true)."\n");
|
| 98 |
-
fflush(self::$console);
|
| 99 |
-
}
|
| 100 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 101 |
}
|
| 1 |
+
<?php
|
| 2 |
|
| 3 |
class Glew_Service_Helper_Data extends Mage_Core_Helper_Abstract
|
| 4 |
{
|
| 5 |
private static $connRead;
|
| 6 |
private static $connWrite;
|
|
|
|
| 7 |
private static $filename = "glew.log";
|
| 8 |
private static $debug = true;
|
| 9 |
+
private $_config;
|
| 10 |
+
|
| 11 |
public function getBaseDir()
|
| 12 |
{
|
| 13 |
+
return Mage::getBaseDir() . '/app/code/community/Glew/';
|
| 14 |
}
|
| 15 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
public function getDatabaseConnection()
|
| 17 |
{
|
| 18 |
return Mage::getSingleton('core/resource')->getConnection('glew_write');
|
| 19 |
}
|
| 20 |
+
|
| 21 |
+
public function getDatabaseReadConnection()
|
| 22 |
{
|
| 23 |
+
return Mage::getSingleton('core/resource')->getConnection('glew_read');
|
| 24 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
+
public function getConfig()
|
| 27 |
+
{
|
| 28 |
+
$config = array();
|
| 29 |
+
$config['enabled'] = Mage::getStoreConfig('glew_settings/general/enabled');
|
| 30 |
+
$config['security_token'] = Mage::getStoreConfig('glew_settings/general/security_token');
|
| 31 |
+
|
| 32 |
+
$this->_config = $config;
|
| 33 |
+
return $config;
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
public function formatDate($str)
|
| 37 |
+
{
|
| 38 |
+
if ($str) {
|
| 39 |
+
if (stripos($str, ' ')) {
|
| 40 |
+
$str = substr($str, 0, stripos($str, ' '));
|
| 41 |
+
}
|
| 42 |
}
|
| 43 |
+
return $str;
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
public function toArray($value, $create = false)
|
| 47 |
+
{
|
| 48 |
+
if ($value !== false) {
|
| 49 |
+
return is_array($value) ? $value : array($value);
|
| 50 |
+
} else {
|
| 51 |
+
return $create ? array() : $value;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
}
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
public function logException($ex, $msg)
|
| 56 |
+
{
|
| 57 |
+
Mage::logException($ex);
|
| 58 |
+
Mage::log($msg . ': ' . $ex->getMessage(), null, self::$filename);
|
| 59 |
+
return false;
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
public function log($msg)
|
| 63 |
+
{
|
| 64 |
+
return Mage::log($msg, null, self::$filename);
|
| 65 |
+
}
|
| 66 |
}
|
app/code/community/Glew/Service/Model/Types/OrderItems.php
CHANGED
|
@@ -19,8 +19,10 @@ class Glew_Service_Model_Types_OrderItems
|
|
| 19 |
} else {
|
| 20 |
$collection = Mage::getModel('sales/order_item')->getCollection();
|
| 21 |
}
|
|
|
|
|
|
|
| 22 |
$collection->getSelect()->joinLeft(
|
| 23 |
-
array('cost' =>
|
| 24 |
"main_table.product_id = cost.entity_id AND cost.attribute_id = {$attribute->getId()}",
|
| 25 |
array('cost' => 'value')
|
| 26 |
);
|
| 19 |
} else {
|
| 20 |
$collection = Mage::getModel('sales/order_item')->getCollection();
|
| 21 |
}
|
| 22 |
+
$resource = Mage::getSingleton('core/resource');
|
| 23 |
+
$catProdEntDecTable = $resource->getTableName('catalog_product_entity_decimal');
|
| 24 |
$collection->getSelect()->joinLeft(
|
| 25 |
+
array('cost' => $catProdEntDecTable),
|
| 26 |
"main_table.product_id = cost.entity_id AND cost.attribute_id = {$attribute->getId()}",
|
| 27 |
array('cost' => 'value')
|
| 28 |
);
|
app/code/community/Glew/Service/Model/Types/RefundItems.php
CHANGED
|
@@ -17,7 +17,9 @@ class Glew_Service_Model_Types_RefundItems
|
|
| 17 |
} else {
|
| 18 |
$refunds = Mage::getResourceModel('sales/order_creditmemo_collection');
|
| 19 |
}
|
| 20 |
-
$
|
|
|
|
|
|
|
| 21 |
$refunds->setOrder('created_at', $sortDir);
|
| 22 |
$this->pageNum = $pageNum;
|
| 23 |
$refunds->setCurPage($pageNum);
|
| 17 |
} else {
|
| 18 |
$refunds = Mage::getResourceModel('sales/order_creditmemo_collection');
|
| 19 |
}
|
| 20 |
+
$resource = Mage::getSingleton('core/resource');
|
| 21 |
+
$salesFlatCredMemItem = $resource->getTableName('sales_flat_creditmemo_item');
|
| 22 |
+
$refunds->getSelect()->join(array('credit_item' => $salesFlatCredMemItem), 'credit_item.parent_id = main_table.entity_id', array('*'));
|
| 23 |
$refunds->setOrder('created_at', $sortDir);
|
| 24 |
$this->pageNum = $pageNum;
|
| 25 |
$refunds->setCurPage($pageNum);
|
app/code/community/Glew/Service/controllers/ModuleController.php
CHANGED
|
@@ -53,6 +53,9 @@ class Glew_Service_ModuleController extends Mage_Core_Controller_Front_Action
|
|
| 53 |
$collection = Mage::getModel('glew/types_abandonedCarts')->load($this->_pageSize, $this->_pageNum, $this->_startDate, $this->_endDate, $this->_sortDir, $this->_filterField);
|
| 54 |
$this->_sendResponse($collection);
|
| 55 |
} catch(Exception $e) {
|
|
|
|
|
|
|
|
|
|
| 56 |
$this->_helper->logException($e, 'abandonedCarts');
|
| 57 |
}
|
| 58 |
}
|
|
@@ -64,6 +67,9 @@ class Glew_Service_ModuleController extends Mage_Core_Controller_Front_Action
|
|
| 64 |
$collection = Mage::getModel('glew/types_customers')->load($this->_pageSize, $this->_pageNum, $this->_startDate, $this->_endDate, $this->_sortDir, $this->_filterField);
|
| 65 |
$this->_sendResponse($collection);
|
| 66 |
} catch(Exception $e) {
|
|
|
|
|
|
|
|
|
|
| 67 |
$this->_helper->logException($e, 'customers');
|
| 68 |
}
|
| 69 |
}
|
|
@@ -76,6 +82,9 @@ class Glew_Service_ModuleController extends Mage_Core_Controller_Front_Action
|
|
| 76 |
$collection = Mage::getModel('glew/types_orders')->load($this->_pageSize, $this->_pageNum, $this->_startDate, $this->_endDate, $this->_sortDir, $this->_filterField);
|
| 77 |
$this->_sendResponse($collection);
|
| 78 |
} catch(Exception $e) {
|
|
|
|
|
|
|
|
|
|
| 79 |
$this->_helper->logException($e, 'orders');
|
| 80 |
}
|
| 81 |
}
|
|
@@ -87,6 +96,9 @@ class Glew_Service_ModuleController extends Mage_Core_Controller_Front_Action
|
|
| 87 |
$collection = Mage::getModel('glew/types_orderItems')->load($this->_pageSize, $this->_pageNum, $this->_startDate, $this->_endDate, $this->_sortDir, $this->_filterField);
|
| 88 |
$this->_sendResponse($collection);
|
| 89 |
} catch(Exception $e) {
|
|
|
|
|
|
|
|
|
|
| 90 |
$this->_helper->logException($e, 'orderItems');
|
| 91 |
}
|
| 92 |
}
|
|
@@ -98,6 +110,9 @@ class Glew_Service_ModuleController extends Mage_Core_Controller_Front_Action
|
|
| 98 |
$collection = Mage::getModel('glew/types_stores')->load();
|
| 99 |
$this->_sendResponse($collection);
|
| 100 |
} catch(Exception $e) {
|
|
|
|
|
|
|
|
|
|
| 101 |
$this->_helper->logException($e, 'stores');
|
| 102 |
}
|
| 103 |
}
|
|
@@ -109,6 +124,9 @@ class Glew_Service_ModuleController extends Mage_Core_Controller_Front_Action
|
|
| 109 |
$collection = Mage::getModel('glew/types_subscribers')->load($this->_pageSize, $this->_pageNum, $this->_sortDir, $this->_filterField);
|
| 110 |
$this->_sendResponse($collection);
|
| 111 |
} catch(Exception $e) {
|
|
|
|
|
|
|
|
|
|
| 112 |
$this->_helper->logException($e, 'subscribers');
|
| 113 |
}
|
| 114 |
}
|
|
@@ -120,6 +138,9 @@ class Glew_Service_ModuleController extends Mage_Core_Controller_Front_Action
|
|
| 120 |
$collection = Mage::getModel('glew/types_products')->load($this->_pageSize, $this->_pageNum, $this->_startDate, $this->_endDate, $this->_sortDir, $this->_filterField);
|
| 121 |
$this->_sendResponse($collection);
|
| 122 |
} catch(Exception $e) {
|
|
|
|
|
|
|
|
|
|
| 123 |
$this->_helper->logException($e, 'products');
|
| 124 |
}
|
| 125 |
}
|
|
@@ -131,6 +152,9 @@ class Glew_Service_ModuleController extends Mage_Core_Controller_Front_Action
|
|
| 131 |
$collection = Mage::getModel('glew/types_productAlerts')->load($this->_pageSize, $this->_pageNum, $this->_startDate, $this->_endDate, $this->_sortDir, $this->_filterField);
|
| 132 |
$this->_sendResponse($collection);
|
| 133 |
} catch(Exception $e) {
|
|
|
|
|
|
|
|
|
|
| 134 |
$this->_helper->logException($e, 'productAlerts');
|
| 135 |
}
|
| 136 |
}
|
|
@@ -142,6 +166,9 @@ class Glew_Service_ModuleController extends Mage_Core_Controller_Front_Action
|
|
| 142 |
$collection = Mage::getModel('glew/types_categories')->load($this->_pageSize, $this->_pageNum, $this->_startDate, $this->_endDate, $this->_sortDir, $this->_filterField);
|
| 143 |
$this->_sendResponse($collection);
|
| 144 |
} catch(Exception $e) {
|
|
|
|
|
|
|
|
|
|
| 145 |
$this->_helper->logException($e, 'categories');
|
| 146 |
}
|
| 147 |
}
|
|
@@ -178,6 +205,9 @@ class Glew_Service_ModuleController extends Mage_Core_Controller_Front_Action
|
|
| 178 |
$collection = Mage::getModel('glew/types_extensions')->load($this->_pageSize, $this->_pageNum, $this->_sortDir, $this->_filterField);
|
| 179 |
$this->_sendResponse($collection);
|
| 180 |
} catch(Exception $e) {
|
|
|
|
|
|
|
|
|
|
| 181 |
$this->_helper->logException($e, 'extensions');
|
| 182 |
}
|
| 183 |
}
|
|
@@ -189,6 +219,9 @@ class Glew_Service_ModuleController extends Mage_Core_Controller_Front_Action
|
|
| 189 |
$collection = Mage::getModel('glew/types_refundItems')->load($this->_pageSize, $this->_pageNum, $this->_startDate, $this->_endDate, $this->_sortDir, $this->_filterField);
|
| 190 |
$this->_sendResponse($collection);
|
| 191 |
} catch(Exception $e) {
|
|
|
|
|
|
|
|
|
|
| 192 |
$this->_helper->logException($e, 'refund items');
|
| 193 |
}
|
| 194 |
}
|
|
@@ -200,6 +233,9 @@ class Glew_Service_ModuleController extends Mage_Core_Controller_Front_Action
|
|
| 200 |
$collection = Mage::getModel('glew/types_refunds')->load($this->_pageSize, $this->_pageNum, $this->_startDate, $this->_endDate, $this->_sortDir, $this->_filterField);
|
| 201 |
$this->_sendResponse($collection);
|
| 202 |
} catch(Exception $e) {
|
|
|
|
|
|
|
|
|
|
| 203 |
$this->_helper->logException($e, 'refunds');
|
| 204 |
}
|
| 205 |
}
|
|
@@ -232,7 +268,7 @@ class Glew_Service_ModuleController extends Mage_Core_Controller_Front_Action
|
|
| 232 |
}
|
| 233 |
|
| 234 |
if(trim( $token ) != trim($authToken)) {
|
| 235 |
-
|
| 236 |
$this->_reject();
|
| 237 |
}
|
| 238 |
}
|
|
@@ -240,7 +276,7 @@ class Glew_Service_ModuleController extends Mage_Core_Controller_Front_Action
|
|
| 240 |
private function _reject()
|
| 241 |
{
|
| 242 |
$this->getResponse()->setHttpResponseCode(401)->setBody('Invalid security token or module disabled');
|
| 243 |
-
throw new Exception('Invalid security token or module disabled');
|
| 244 |
}
|
| 245 |
|
| 246 |
}
|
| 53 |
$collection = Mage::getModel('glew/types_abandonedCarts')->load($this->_pageSize, $this->_pageNum, $this->_startDate, $this->_endDate, $this->_sortDir, $this->_filterField);
|
| 54 |
$this->_sendResponse($collection);
|
| 55 |
} catch(Exception $e) {
|
| 56 |
+
if($e->getCode() != 600) {
|
| 57 |
+
print_r($e);
|
| 58 |
+
}
|
| 59 |
$this->_helper->logException($e, 'abandonedCarts');
|
| 60 |
}
|
| 61 |
}
|
| 67 |
$collection = Mage::getModel('glew/types_customers')->load($this->_pageSize, $this->_pageNum, $this->_startDate, $this->_endDate, $this->_sortDir, $this->_filterField);
|
| 68 |
$this->_sendResponse($collection);
|
| 69 |
} catch(Exception $e) {
|
| 70 |
+
if($e->getCode() != 600) {
|
| 71 |
+
print_r($e);
|
| 72 |
+
}
|
| 73 |
$this->_helper->logException($e, 'customers');
|
| 74 |
}
|
| 75 |
}
|
| 82 |
$collection = Mage::getModel('glew/types_orders')->load($this->_pageSize, $this->_pageNum, $this->_startDate, $this->_endDate, $this->_sortDir, $this->_filterField);
|
| 83 |
$this->_sendResponse($collection);
|
| 84 |
} catch(Exception $e) {
|
| 85 |
+
if($e->getCode() != 600) {
|
| 86 |
+
print_r($e);
|
| 87 |
+
}
|
| 88 |
$this->_helper->logException($e, 'orders');
|
| 89 |
}
|
| 90 |
}
|
| 96 |
$collection = Mage::getModel('glew/types_orderItems')->load($this->_pageSize, $this->_pageNum, $this->_startDate, $this->_endDate, $this->_sortDir, $this->_filterField);
|
| 97 |
$this->_sendResponse($collection);
|
| 98 |
} catch(Exception $e) {
|
| 99 |
+
if($e->getCode() != 600) {
|
| 100 |
+
print_r($e);
|
| 101 |
+
}
|
| 102 |
$this->_helper->logException($e, 'orderItems');
|
| 103 |
}
|
| 104 |
}
|
| 110 |
$collection = Mage::getModel('glew/types_stores')->load();
|
| 111 |
$this->_sendResponse($collection);
|
| 112 |
} catch(Exception $e) {
|
| 113 |
+
if($e->getCode() != 600) {
|
| 114 |
+
print_r($e);
|
| 115 |
+
}
|
| 116 |
$this->_helper->logException($e, 'stores');
|
| 117 |
}
|
| 118 |
}
|
| 124 |
$collection = Mage::getModel('glew/types_subscribers')->load($this->_pageSize, $this->_pageNum, $this->_sortDir, $this->_filterField);
|
| 125 |
$this->_sendResponse($collection);
|
| 126 |
} catch(Exception $e) {
|
| 127 |
+
if($e->getCode() != 600) {
|
| 128 |
+
print_r($e);
|
| 129 |
+
}
|
| 130 |
$this->_helper->logException($e, 'subscribers');
|
| 131 |
}
|
| 132 |
}
|
| 138 |
$collection = Mage::getModel('glew/types_products')->load($this->_pageSize, $this->_pageNum, $this->_startDate, $this->_endDate, $this->_sortDir, $this->_filterField);
|
| 139 |
$this->_sendResponse($collection);
|
| 140 |
} catch(Exception $e) {
|
| 141 |
+
if($e->getCode() != 600) {
|
| 142 |
+
print_r($e);
|
| 143 |
+
}
|
| 144 |
$this->_helper->logException($e, 'products');
|
| 145 |
}
|
| 146 |
}
|
| 152 |
$collection = Mage::getModel('glew/types_productAlerts')->load($this->_pageSize, $this->_pageNum, $this->_startDate, $this->_endDate, $this->_sortDir, $this->_filterField);
|
| 153 |
$this->_sendResponse($collection);
|
| 154 |
} catch(Exception $e) {
|
| 155 |
+
if($e->getCode() != 600) {
|
| 156 |
+
print_r($e);
|
| 157 |
+
}
|
| 158 |
$this->_helper->logException($e, 'productAlerts');
|
| 159 |
}
|
| 160 |
}
|
| 166 |
$collection = Mage::getModel('glew/types_categories')->load($this->_pageSize, $this->_pageNum, $this->_startDate, $this->_endDate, $this->_sortDir, $this->_filterField);
|
| 167 |
$this->_sendResponse($collection);
|
| 168 |
} catch(Exception $e) {
|
| 169 |
+
if($e->getCode() != 600) {
|
| 170 |
+
print_r($e);
|
| 171 |
+
}
|
| 172 |
$this->_helper->logException($e, 'categories');
|
| 173 |
}
|
| 174 |
}
|
| 205 |
$collection = Mage::getModel('glew/types_extensions')->load($this->_pageSize, $this->_pageNum, $this->_sortDir, $this->_filterField);
|
| 206 |
$this->_sendResponse($collection);
|
| 207 |
} catch(Exception $e) {
|
| 208 |
+
if($e->getCode() != 600) {
|
| 209 |
+
print_r($e);
|
| 210 |
+
}
|
| 211 |
$this->_helper->logException($e, 'extensions');
|
| 212 |
}
|
| 213 |
}
|
| 219 |
$collection = Mage::getModel('glew/types_refundItems')->load($this->_pageSize, $this->_pageNum, $this->_startDate, $this->_endDate, $this->_sortDir, $this->_filterField);
|
| 220 |
$this->_sendResponse($collection);
|
| 221 |
} catch(Exception $e) {
|
| 222 |
+
if($e->getCode() != 600) {
|
| 223 |
+
print_r($e);
|
| 224 |
+
}
|
| 225 |
$this->_helper->logException($e, 'refund items');
|
| 226 |
}
|
| 227 |
}
|
| 233 |
$collection = Mage::getModel('glew/types_refunds')->load($this->_pageSize, $this->_pageNum, $this->_startDate, $this->_endDate, $this->_sortDir, $this->_filterField);
|
| 234 |
$this->_sendResponse($collection);
|
| 235 |
} catch(Exception $e) {
|
| 236 |
+
if($e->getCode() != 600) {
|
| 237 |
+
print_r($e);
|
| 238 |
+
}
|
| 239 |
$this->_helper->logException($e, 'refunds');
|
| 240 |
}
|
| 241 |
}
|
| 268 |
}
|
| 269 |
|
| 270 |
if(trim( $token ) != trim($authToken)) {
|
| 271 |
+
$this->_helper->log('Glew feed request with invalid security token: ' . $authToken . ' compared to stored token: ' . $token);
|
| 272 |
$this->_reject();
|
| 273 |
}
|
| 274 |
}
|
| 276 |
private function _reject()
|
| 277 |
{
|
| 278 |
$this->getResponse()->setHttpResponseCode(401)->setBody('Invalid security token or module disabled');
|
| 279 |
+
throw new Exception('Invalid security token or module disabled', 600);
|
| 280 |
}
|
| 281 |
|
| 282 |
}
|
app/code/community/Glew/Service/etc/config.xml
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
<config>
|
| 3 |
<modules>
|
| 4 |
<Glew_Service>
|
| 5 |
-
<version>1.0.
|
| 6 |
<depends>
|
| 7 |
<Mage_Shipping />
|
| 8 |
</depends>
|
| 2 |
<config>
|
| 3 |
<modules>
|
| 4 |
<Glew_Service>
|
| 5 |
+
<version>1.0.7</version>
|
| 6 |
<depends>
|
| 7 |
<Mage_Shipping />
|
| 8 |
</depends>
|
package.xml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>Glew</name>
|
| 4 |
-
<version>1.0.
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license>OSL</license>
|
| 7 |
<channel>community</channel>
|
|
@@ -18,14 +18,12 @@ Glew empowers you with the ability to measure:
|
|
| 18 |
-Lifetime-Value-based ROAS instead of transaction-based ROAS
|
| 19 |
-Value of your At Risk and Lost Customers
|
| 20 |
-Trending store performance on a daily, weekly, monthly, and yearly basis
|
| 21 |
-
-And more
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
<notes>-Couple enhancements to 1.0.0</notes>
|
| 25 |
-
<authors><author><name>Glew</name><user>jedyoung</user><email>jed.young@glew.io</email></author></authors>
|
| 26 |
<date>2015-10-16</date>
|
| 27 |
-
<time>15:
|
| 28 |
-
<contents><target name="magecommunity"><dir name="Glew"><dir name="Service"><dir name="Block"><dir name="Adminhtml"><dir name="Widget"><dir name="Info"><file name="Info.php" hash="cb7f32c9a9d9032d9af801834e4ed5af"/></dir></dir></dir><file name="SecretKey.php" hash="22ecb01340e09eec8708abccea746637"/></dir><dir name="Helper"><file name="Data.php" hash="
|
| 29 |
<compatible/>
|
| 30 |
-
<dependencies><required><php><min>5.0.0</min><max>7.0.0</max></php><package><name>Glew</name><channel>community</channel><min>1.5</min><max>1.9</max></package><extension><name>Core</name><min>5.0</min><max>
|
| 31 |
</package>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>Glew</name>
|
| 4 |
+
<version>1.0.2</version>
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license>OSL</license>
|
| 7 |
<channel>community</channel>
|
| 18 |
-Lifetime-Value-based ROAS instead of transaction-based ROAS
|
| 19 |
-Value of your At Risk and Lost Customers
|
| 20 |
-Trending store performance on a daily, weekly, monthly, and yearly basis
|
| 21 |
+
-And more...</description>
|
| 22 |
+
<notes>-Few bug fixes</notes>
|
| 23 |
+
<authors><author><name>Glew</name><user>glewio</user><email>jed.young@glew.io</email></author></authors>
|
|
|
|
|
|
|
| 24 |
<date>2015-10-16</date>
|
| 25 |
+
<time>15:36:54</time>
|
| 26 |
+
<contents><target name="magecommunity"><dir name="Glew"><dir name="Service"><dir name="Block"><dir name="Adminhtml"><dir name="Widget"><dir name="Info"><file name="Info.php" hash="cb7f32c9a9d9032d9af801834e4ed5af"/></dir></dir></dir><file name="SecretKey.php" hash="22ecb01340e09eec8708abccea746637"/></dir><dir name="Helper"><file name="Data.php" hash="8533491c5565ee9eaff37e3d6ec23df8"/></dir><dir name="Model"><file name="Glew.php" hash="66742d93d1fe3d0f56dc1d4e32eae93f"/><dir name="Resource"><dir name="Mysql4"><file name="Setup.php" hash="1d14cfc8543e118ba7420af63ee31762"/></dir></dir><dir name="Types"><file name="AbandonedCart.php" hash="ca99b85c3b2b93795013e1929a0d3613"/><file name="AbandonedCarts.php" hash="ef3a30f2a3d38bfd62fc77a2b23476ea"/><file name="Address.php" hash="dac4e96501d687ce8c84ddfcc18a8327"/><file name="Categories.php" hash="b01bd1e07f22e1774e7051897e931dac"/><file name="Category.php" hash="a75878be202411265d91a20dd4afa457"/><file name="Customer.php" hash="e1f2058d9358d89a48715f151ab45755"/><file name="Customers.php" hash="c932bc753514548798c3f3b5b3a652cb"/><file name="Extension.php" hash="3a0bc967154cfd1ac5e9534ae96921fc"/><file name="Extensions.php" hash="c3cb76d52ac1b1dbf92723bd10ebf752"/><file name="Inventory.php" hash="b982cc0e6d066a4ebc0059a887596626"/><file name="InventoryItem.php" hash="01403ce6dd1f0042654d0c8f0bb18e7a"/><file name="Order.php" hash="f17622408310699e6cbccbb4b02e1ac3"/><file name="OrderItem.php" hash="26158c6d23d695ed6cd377bdd12f544f"/><file name="OrderItems.php" hash="8b7b034254cdeae7439a9570291803db"/><file name="Orders.php" hash="289850161d53317c87d20b73bba21a2e"/><file name="Product.php" hash="188167c24400632bbd848f406d671125"/><file name="ProductAlert.php" hash="e7ca7668907dad5547d80ad581519e78"/><file name="ProductAlerts.php" hash="1cf09e9adef0f08a0bfcddc8372f6e80"/><file name="Products.php" hash="3279d1410b9918a51e4b2d1f20084ead"/><file name="Refund.php" hash="1b79b89a2ac66cc0dfb05e1f3100f98c"/><file name="RefundItem.php" hash="1d43007ec2bb990eb08b8d0a2812f4ca"/><file name="RefundItems.php" hash="f565395740e704d689ad7b8a86a01d11"/><file name="Refunds.php" hash="e35ea9d6570f2bb7bffe8977abe1ed19"/><file name="Store.php" hash="455923168b5d2550af6b862d776db3f2"/><file name="Stores.php" hash="f69cb94c13a8f85665a034b5dd581b90"/><file name="Subscriber.php" hash="727153725fc7be3fd093422d6a67dfa1"/><file name="Subscribers.php" hash="834e26d8aa73020819e46c930429c54c"/></dir></dir><dir name="controllers"><file name="ModuleController.php" hash="4fff121a3773a64db65582735389014b"/></dir><dir name="etc"><file name="adminhtml.xml" hash="d2d95c59dc81f92df0ed6adaba801a52"/><file name="config.xml" hash="859d61254dc8743a249c3f5d7c6d1579"/><file name="system.xml" hash="07aa4da88108940bf267cb2abb854eab"/></dir><dir name="sql"><dir name="glew_setup"><file name="mysql4-install-0.0.2.php" hash="b403d80422a7f4d80957d0405d55e2d7"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Glew_Service.xml" hash="db2470cc1c1c36b01cea61416a3f6f37"/></dir></target></contents>
|
| 27 |
<compatible/>
|
| 28 |
+
<dependencies><required><php><min>5.0.0</min><max>7.0.0</max></php><package><name>Glew</name><channel>community</channel><min>1.5</min><max>1.9</max></package><extension><name>Core</name><min>5.0</min><max>7.0</max></extension></required></dependencies>
|
| 29 |
</package>
|
