editionguard_drm - Version 1.0.2.1

Version Notes

Compatibility with Magento 1.9 and 1.8.

Download this release

Release Info

Developer EditionGuard
Extension editionguard_drm
Version 1.0.2.1
Comparing to
See all releases


Code changes from version 1.0.2.0 to 1.0.2.1

app/code/community/Editionguard/Editionguard/Block/Downloadable/Customer/Products/List.php CHANGED
@@ -39,7 +39,6 @@ class Editionguard_Editionguard_Block_Downloadable_Customer_Products_List extend
39
  {
40
  if (Mage::helper('editionguard')->getUseEditionguard($item))
41
  {
42
- Mage::log(print_r($item, true));
43
  return Mage::helper('editionguard')->getDownloadUrl($item->getOrderItemId(), $item->getEditionguardResource());
44
  }
45
  else
@@ -47,4 +46,8 @@ class Editionguard_Editionguard_Block_Downloadable_Customer_Products_List extend
47
  return parent::getDownloadUrl($item);
48
  }
49
  }
 
 
 
 
50
  }
39
  {
40
  if (Mage::helper('editionguard')->getUseEditionguard($item))
41
  {
 
42
  return Mage::helper('editionguard')->getDownloadUrl($item->getOrderItemId(), $item->getEditionguardResource());
43
  }
44
  else
46
  return parent::getDownloadUrl($item);
47
  }
48
  }
49
+
50
+ public function getItems() {
51
+ return null;
52
+ }
53
  }
app/code/community/Editionguard/Editionguard/Helper/Data.php CHANGED
@@ -271,18 +271,28 @@ class Editionguard_Editionguard_Helper_Data extends Mage_Core_Helper_Data
271
  $sharedSecret = Mage::getStoreConfig(Editionguard_Editionguard_Helper_Data::XML_PATH_CONFIG_EDITIONGUARD_SECRET);
272
  $order_item = Mage::getModel('sales/order_item')->load($order_item_id);
273
  $order = Mage::getModel("sales/order")->load($order_item->order_id);
274
- $transactionId = $order->getIncrementId()."-".$order_item_id;
 
 
275
  $resourceId = $resource;
276
  $linkURL = Editionguard_Editionguard_Helper_Data::API_LINK_URL;
277
  $orderSource = Mage::getStoreConfig(Editionguard_Editionguard_Helper_Data::XML_PATH_CONFIG_EDITIONGUARD_EMAIL);
278
 
279
- // Create download URL
280
- $URL = "action=enterorder&ordersource=".urlencode($orderSource)."&orderid=".urlencode($transactionId)."&resid=".urlencode("$resourceId")."&dateval=".urlencode($dateval)."&gblver=4";
281
-
282
- // Digitaly sign the request
283
- $URL = $linkURL."?".$URL."&auth=".hash_hmac("sha1", $URL, base64_decode($sharedSecret));
284
 
285
- return $URL;
 
 
 
 
 
 
 
 
 
286
  }
287
 
288
 
271
  $sharedSecret = Mage::getStoreConfig(Editionguard_Editionguard_Helper_Data::XML_PATH_CONFIG_EDITIONGUARD_SECRET);
272
  $order_item = Mage::getModel('sales/order_item')->load($order_item_id);
273
  $order = Mage::getModel("sales/order")->load($order_item->order_id);
274
+ $quantity = $order_item->QtyOrdered;
275
+
276
+ $transactionId = $order->getIncrementId();
277
  $resourceId = $resource;
278
  $linkURL = Editionguard_Editionguard_Helper_Data::API_LINK_URL;
279
  $orderSource = Mage::getStoreConfig(Editionguard_Editionguard_Helper_Data::XML_PATH_CONFIG_EDITIONGUARD_EMAIL);
280
 
281
+ // If only one of the item was sold, simply generate direct download link
282
+ if($quantity == 1) {
283
+ // Create download URL
284
+ $URL = "action=enterorder&ordersource=".urlencode($orderSource)."&orderid=".urlencode($transactionId)."&resid=".urlencode("$resourceId")."&dateval=".urlencode($dateval)."&gblver=4";
 
285
 
286
+ // Digitaly sign the request
287
+ $URL = $linkURL."?".$URL."&auth=".hash_hmac("sha1", $URL, base64_decode($sharedSecret));
288
+
289
+ return $URL;
290
+ }
291
+ // If more than one of the item has been sold, direct to download link listing page
292
+ else {
293
+ $hash = hash_hmac("sha1", $transactionId . $orderSource, base64_decode($sharedSecret));
294
+ return "http://www.editionguard.com/api/mage_links/".urlencode($orderSource)."/".urlencode($transactionId)."/".urlencode($resourceId)."/".urlencode($quantity)."/$hash";
295
+ }
296
  }
297
 
298
 
app/code/community/Editionguard/Editionguard/etc/config.xml CHANGED
@@ -14,7 +14,7 @@
14
  <config>
15
  <modules>
16
  <Editionguard_Editionguard>
17
- <version>1.0.2.0</version>
18
  </Editionguard_Editionguard>
19
  </modules>
20
  <frontend>
14
  <config>
15
  <modules>
16
  <Editionguard_Editionguard>
17
+ <version>1.0.2.1</version>
18
  </Editionguard_Editionguard>
19
  </modules>
20
  <frontend>
package.xml CHANGED
@@ -1,18 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>editionguard_drm</name>
4
- <version>1.0.2.0</version>
5
  <stability>stable</stability>
6
  <license>New BSD</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>This extension is used to integrate Magento with EditionGuard, a cost-effective Adobe DRM service for eBooks.</summary>
10
- <description>This extension will allow you to create eBooks protected with the industry standard Adobe Content Server 4 DRM through the EditionGuard APIs. Through the admin interface, you will be able to manage your DRM enabled eBooks and put them up for sale as Downloadable Products. Your clients will then be able to purchase your eBooks, download them securely on the frontend and open them in Adobe Digital Editions.</description>
11
- <notes>Fixed a UI bug where eBook wasn't being selected in dropdown automatically.</notes>
12
  <authors><author><name>EditionGuard</name><user>EditionGuard</user><email>support@editionguard.com</email></author></authors>
13
- <date>2013-10-16</date>
14
- <time>21:43:33</time>
15
- <contents><target name="magecommunity"><dir><dir name="Editionguard"><dir name="Editionguard"><dir name="Block"><dir name="Downloadable"><dir name="Adminhtml"><dir name="Catalog"><dir name="Product"><dir name="Edit"><dir name="Tab"><dir name="Downloadable"><file name="Links.php" hash="cadc7871db136a3260392daf38a029aa"/></dir></dir></dir></dir></dir></dir><dir name="Customer"><dir name="Products"><file name="List.php" hash="d6ed16a7183e3e97e3725d39d87c4c37"/></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="f7aec5709db45721c6589a3c792cd4f4"/></dir><dir name="Model"><dir name="Downloadable"><file name="Link.php" hash="4e683792593ec39e94cf02ad9c967cdc"/></dir><file name="Exception.php" hash="18afd5abedb9a0413481ea5255a89a53"/><dir name="Mysql4"><dir name="Editionguard"><file name="Collection.php" hash="de7c2d9c3aa413612a6473dafdf2f779"/></dir><file name="Editionguard.php" hash="adaa5e0d1718f506e89c657420c4d31a"/></dir><dir name="Resource"><dir name="Downloadable"><file name="Link.php" hash="cfc4b1417f2fd0adf93daf15b24681e1"/></dir><dir name="Eav"><dir name="Mysql4"><file name="Setup.php" hash="ff76c3213b9b428220578ba48a667365"/></dir></dir></dir></dir><dir name="controllers"><file name="DownloadController.php" hash="f7b27200e5ca4f612ab70e313631c2a9"/></dir><dir name="etc"><file name="config.xml" hash="0a84430a576439e578a8c8f46e025e6c"/><file name="system.xml" hash="e1a700fb181b7b11e318edd4612d93e3"/></dir><dir name="sql"><dir name="editionguard_setup"><file name="install-1.0.0.0.php" hash="9e9ccd8e5fb5f5f63b32fa6ccea92ce6"/></dir></dir></dir></dir></dir></target><target name="magedesign"><dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="editionguard"><dir name="downloadable"><dir name="product"><dir name="edit"><dir name="downloadable"><file name="links.phtml" hash="9bdbc99ef01ddc52424060492c5663c6"/><file name="links.phtml.zip" hash="8c2249a9e77f11735222aca65a4a0577"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><file name=".DS_Store" hash="15fac25ebcf2a7b1d7e9b86c7ff994ae"/></dir><file name=".DS_Store" hash="0a0b84ae758c5fd76efde758b41c2735"/></dir><file name=".DS_Store" hash="7688e3e1f70b35fc9717a876ffedb8e0"/></dir><file name=".DS_Store" hash="15fac25ebcf2a7b1d7e9b86c7ff994ae"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir><dir name="modules"><file name="Editionguard_Editionguard.xml" hash="1d6aac7609bf2b57392b64213f3722ca"/></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.2.17</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>editionguard_drm</name>
4
+ <version>1.0.2.1</version>
5
  <stability>stable</stability>
6
  <license>New BSD</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>This extension is used to integrate Magento with EditionGuard, a cost-effective Adobe DRM service for eBooks.</summary>
10
+ <description>This extension will allow you to create eBooks protected with the industry standard Adobe Content Server DRM through the EditionGuard APIs. Through the admin interface, you will be able to manage your DRM enabled eBooks and put them up for sale as Downloadable Products. Your clients will then be able to purchase your eBooks, download them securely on the frontend and open them in Adobe Digital Editions.</description>
11
+ <notes>Compatibility with Magento 1.9 and 1.8.</notes>
12
  <authors><author><name>EditionGuard</name><user>EditionGuard</user><email>support@editionguard.com</email></author></authors>
13
+ <date>2015-03-03</date>
14
+ <time>10:27:16</time>
15
+ <contents><target name="magecommunity"><dir><dir name="Editionguard"><dir name="Editionguard"><dir name="Block"><dir name="Downloadable"><dir name="Adminhtml"><dir name="Catalog"><dir name="Product"><dir name="Edit"><dir name="Tab"><dir name="Downloadable"><file name="Links.php" hash="cadc7871db136a3260392daf38a029aa"/></dir></dir></dir></dir></dir></dir><dir name="Customer"><dir name="Products"><file name="List.php" hash="427a1e5797d2bee3a2f64d2fb6f13b90"/></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="5796cc4226f3cb1f702b14912507c652"/></dir><dir name="Model"><dir name="Downloadable"><file name="Link.php" hash="4e683792593ec39e94cf02ad9c967cdc"/></dir><file name="Exception.php" hash="18afd5abedb9a0413481ea5255a89a53"/><dir name="Mysql4"><dir name="Editionguard"><file name="Collection.php" hash="de7c2d9c3aa413612a6473dafdf2f779"/></dir><file name="Editionguard.php" hash="adaa5e0d1718f506e89c657420c4d31a"/></dir><dir name="Resource"><dir name="Downloadable"><file name="Link.php" hash="cfc4b1417f2fd0adf93daf15b24681e1"/></dir><dir name="Eav"><dir name="Mysql4"><file name="Setup.php" hash="ff76c3213b9b428220578ba48a667365"/></dir></dir></dir></dir><dir name="controllers"><file name="DownloadController.php" hash="f7b27200e5ca4f612ab70e313631c2a9"/></dir><dir name="etc"><file name="config.xml" hash="b464f387652f740fecb54b724911ff01"/><file name="system.xml" hash="e1a700fb181b7b11e318edd4612d93e3"/></dir><dir name="sql"><dir name="editionguard_setup"><file name="install-1.0.0.0.php" hash="9e9ccd8e5fb5f5f63b32fa6ccea92ce6"/></dir></dir></dir></dir></dir></target><target name="magedesign"><dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="editionguard"><dir name="downloadable"><dir name="product"><dir name="edit"><dir name="downloadable"><file name="links.phtml" hash="9bdbc99ef01ddc52424060492c5663c6"/><file name="links.phtml.zip" hash="8c2249a9e77f11735222aca65a4a0577"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><file name=".DS_Store" hash="15fac25ebcf2a7b1d7e9b86c7ff994ae"/></dir><file name=".DS_Store" hash="0a0b84ae758c5fd76efde758b41c2735"/></dir><file name=".DS_Store" hash="7688e3e1f70b35fc9717a876ffedb8e0"/></dir><file name=".DS_Store" hash="15fac25ebcf2a7b1d7e9b86c7ff994ae"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir><dir name="modules"><file name="Editionguard_Editionguard.xml" hash="1d6aac7609bf2b57392b64213f3722ca"/></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.2.17</min><max>6.0.0</max></php></required></dependencies>
18
  </package>