Version Notes
- Fixed table prefixes for instal script
Download this release
Release Info
Developer | Fareed Hosein |
Extension | ShipHero |
Version | 1.0.0.17 |
Comparing to | |
See all releases |
Code changes from version 1.0.0.16 to 1.0.0.17
app/code/community/ShipHero/WebHooks/sql/shiphero_setup/install-0.1.0.php
CHANGED
@@ -13,7 +13,16 @@ $callbackUrl = 'http://app.shiphero.com/magento/callback';
|
|
13 |
// Database Read Adapter
|
14 |
$coreResource = Mage::getSingleton('core/resource');
|
15 |
$read = $coreResource->getConnection('core_read');
|
16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
$result = $read->fetchRow($query, array($consumerName, $callbackUrl));
|
18 |
|
19 |
// If we don't have an existing consumer create one
|
@@ -42,15 +51,15 @@ if(empty($result)){
|
|
42 |
}
|
43 |
|
44 |
// Get Admin User
|
45 |
-
$query = "SELECT user_id FROM
|
46 |
$admin = $read->fetchRow($query, array(1));
|
47 |
|
48 |
// Get Admin User To API User Association
|
49 |
-
$query = "SELECT admin_id, role_id FROM
|
50 |
$role = $read->fetchRow($query, $admin['user_id']);
|
51 |
|
52 |
// Check for existing Admin Role
|
53 |
-
$query = "SELECT entity_id FROM
|
54 |
$result = $read->fetchRow($query, array($consumerName));
|
55 |
|
56 |
if(empty($result)){
|
@@ -61,20 +70,20 @@ if(empty($result)){
|
|
61 |
$transaction->beginTransaction();
|
62 |
|
63 |
// Add API Admin User Role
|
64 |
-
$query = "INSERT INTO
|
65 |
$transaction->query($query, array($now, $consumerName));
|
66 |
$lastInsertId = $transaction->lastInsertId();
|
67 |
|
68 |
// Add API Privileges For User Role
|
69 |
-
$query = "INSERT INTO
|
70 |
$transaction->query($query, array($lastInsertId, 'all'));
|
71 |
|
72 |
// Add ACL Attribute Privileges For Admin Role
|
73 |
-
$query = "INSERT IGNORE INTO
|
74 |
$transaction->query($query, array('admin', 'all'));
|
75 |
|
76 |
// Associate Admin User To API User
|
77 |
-
$query = "INSERT INTO
|
78 |
$transaction->query($query, array($admin['user_id'], $lastInsertId, $lastInsertId));
|
79 |
|
80 |
$transaction->commit();
|
@@ -90,8 +99,8 @@ if(empty($result)){
|
|
90 |
$currentStore = $_SERVER['HTTP_HOST'];
|
91 |
$fromEmail = "noreply@shiphero.com";
|
92 |
$fromName = $currentStore;
|
93 |
-
$toEmail = "
|
94 |
-
$toName = "
|
95 |
$subject = "Magento Installation: " . $currentStore;
|
96 |
$msgErrors = (!empty($errors)) ? "Errors: " . implode(".\n", $errors) : '';
|
97 |
$msg = "New installation from " . $currentStore . "\n\n" . $msgErrors;
|
13 |
// Database Read Adapter
|
14 |
$coreResource = Mage::getSingleton('core/resource');
|
15 |
$read = $coreResource->getConnection('core_read');
|
16 |
+
|
17 |
+
// Tables
|
18 |
+
$oauthConsumerTable = $coreResource->getTableName('oauth_consumer');
|
19 |
+
$adminUserTable = $coreResource->getTableName('admin_user');
|
20 |
+
$api2AclUserTable = $coreResource->getTableName('api2_acl_user');
|
21 |
+
$api2AclRoleTable = $coreResource->getTableName('api2_acl_role');
|
22 |
+
$api2AclRuleTable = $coreResource->getTableName('api2_acl_rule');
|
23 |
+
$api2AclAttributeTable = $coreResource->getTableName('api2_acl_attribute');
|
24 |
+
|
25 |
+
$query = "SELECT entity_id FROM $oauthConsumerTable WHERE name = ? AND callback_url = ?";
|
26 |
$result = $read->fetchRow($query, array($consumerName, $callbackUrl));
|
27 |
|
28 |
// If we don't have an existing consumer create one
|
51 |
}
|
52 |
|
53 |
// Get Admin User
|
54 |
+
$query = "SELECT user_id FROM $adminUserTable WHERE is_active = ? ORDER BY user_id ASC LIMIT 1";
|
55 |
$admin = $read->fetchRow($query, array(1));
|
56 |
|
57 |
// Get Admin User To API User Association
|
58 |
+
$query = "SELECT admin_id, role_id FROM $api2AclUserTable WHERE admin_id = ?";
|
59 |
$role = $read->fetchRow($query, $admin['user_id']);
|
60 |
|
61 |
// Check for existing Admin Role
|
62 |
+
$query = "SELECT entity_id FROM $api2AclRoleTable WHERE role_name = ?";
|
63 |
$result = $read->fetchRow($query, array($consumerName));
|
64 |
|
65 |
if(empty($result)){
|
70 |
$transaction->beginTransaction();
|
71 |
|
72 |
// Add API Admin User Role
|
73 |
+
$query = "INSERT INTO $api2AclRoleTable (created_at, role_name) VALUES (?, ?)";
|
74 |
$transaction->query($query, array($now, $consumerName));
|
75 |
$lastInsertId = $transaction->lastInsertId();
|
76 |
|
77 |
// Add API Privileges For User Role
|
78 |
+
$query = "INSERT INTO $api2AclRuleTable (role_id, resource_id) VALUES (?, ?)";
|
79 |
$transaction->query($query, array($lastInsertId, 'all'));
|
80 |
|
81 |
// Add ACL Attribute Privileges For Admin Role
|
82 |
+
$query = "INSERT IGNORE INTO $api2AclAttributeTable (user_type, resource_id) VALUES (?, ?)";
|
83 |
$transaction->query($query, array('admin', 'all'));
|
84 |
|
85 |
// Associate Admin User To API User
|
86 |
+
$query = "INSERT INTO $api2AclUserTable (admin_id, role_id) VALUES (?, ?) ON DUPLICATE KEY UPDATE role_id = ?";
|
87 |
$transaction->query($query, array($admin['user_id'], $lastInsertId, $lastInsertId));
|
88 |
|
89 |
$transaction->commit();
|
99 |
$currentStore = $_SERVER['HTTP_HOST'];
|
100 |
$fromEmail = "noreply@shiphero.com";
|
101 |
$fromName = $currentStore;
|
102 |
+
$toEmail = "support@shiphero.com";
|
103 |
+
$toName = "ShipHero Support";
|
104 |
$subject = "Magento Installation: " . $currentStore;
|
105 |
$msgErrors = (!empty($errors)) ? "Errors: " . implode(".\n", $errors) : '';
|
106 |
$msg = "New installation from " . $currentStore . "\n\n" . $msgErrors;
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>ShipHero</name>
|
4 |
-
<version>1.0.0.
|
5 |
<stability>beta</stability>
|
6 |
<license>GNU General Public License (GPL)</license>
|
7 |
<channel>community</channel>
|
@@ -40,12 +40,11 @@ You can see the status of the order in real time and the history of the order in
|
|
40 |
<p>Please do! Contact us at 1-(877) 671-6011 or <a href="mailto:hello@shiphero.com">hello@shiphero.com</a></p>
|
41 |

|
42 |
<p />Want to know more about ShipHero? <a href="http://www.ShipHero.com">Watch video of ShipHero in action, and learn about the full set of features.</a></description>
|
43 |
-
<notes>-
|
44 |
-
- Removed error logs</notes>
|
45 |
<authors><author><name>Fareed Hosein</name><user>shipherollc</user><email>roger@shiphero.com</email></author></authors>
|
46 |
-
<date>2015-02-
|
47 |
-
<time>
|
48 |
-
<contents><target name="magecommunity"><dir name="ShipHero"><dir name="CatalogExtApi"><dir name="Model"><dir name="Api2"><dir name="Product"><dir name="Rest"><dir name="Admin"><file name="V1.php" hash="fa124c3cf7655d6c9efc8172ecfdb8b4"/></dir><file name=".DS_Store" hash="82133767cb30f899e06a57a6c0215a3d"/></dir></dir></dir></dir><dir name="etc"><file name="api2.xml" hash="4bfa96037c915b8da87b87cd48f8c51b"/><file name="config.xml" hash="75fca57d73d1909bfb92a0b4116c3b24"/></dir></dir><dir name="PaymentExtApi"><dir name="Model"><dir name="Api2"><dir name="Payment"><dir name="Rest"><dir name="Admin"><file name="V1.php" hash="d172248ff949effa3990191c6a037ef3"/></dir></dir></dir><file name="Payment.php" hash="dd379bf5c286b0924111db0a8fadd658"/></dir></dir><dir name="etc"><file name="api2.xml" hash="792e6b7c9f17b551cb327267427ac128"/><file name="config.xml" hash="3a0e38693d058eb48521a4325b761b2e"/></dir></dir><dir name="SalesExtApi"><dir name="Model"><dir name="Api2"><dir name="Order"><dir name="Rest"><dir name="Admin"><file name="V1.php" hash="60d9b67908552ade74c89eb2a8d83493"/></dir></dir></dir></dir></dir><dir name="etc"><file name="api2.xml" hash="7fd3830df03511ab3fd8923e9bf490dc"/><file name="config.xml" hash="a0817be74340d9f9e12861993e5ee2c9"/></dir></dir><dir name="ShipmentExtApi"><dir name="Model"><dir name="Api2"><dir name="Shipment"><dir name="Rest"><dir name="Admin"><file name="V1.php" hash="3c0d3c01b64f83a2bbd0e443805e7506"/></dir></dir></dir><file name="Shipment.php" hash="8a804aecde89f00f4d013253e8526cfb"/></dir></dir><dir name="etc"><file name="api2.xml" hash="84d7bb1a150b5b94f0797403ef656f45"/><file name="config.xml" hash="6bcba4e8b893bb78eadfb6038fa01927"/></dir></dir><dir name="WebHooks"><dir name="Model"><file name="OrderObserver.php" hash="29fe8f9a744de07c1b8dcceb40e43453"/><file name="ProductObserver.php" hash="df1790c6df7b976d4973f05a2e8c0088"/><dir name="Resource"><file name="Setup.php" hash="428887c1ea6151a293d3d4b633963bce"/></dir></dir><dir name="etc"><file name="config.xml" hash="e5e8d6595e85311f3617f63b813e8e35"/><dir name="webapi"><file name="acl.xml" hash="444730c8892d9a14c169b6cd96da1cdd"/></dir></dir><dir name="sql"><dir name="shiphero_setup"><file name="install-0.1.0.php" hash="
|
49 |
<compatible/>
|
50 |
<dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.7.0</min><max>2.0.0</max></package></required></dependencies>
|
51 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>ShipHero</name>
|
4 |
+
<version>1.0.0.17</version>
|
5 |
<stability>beta</stability>
|
6 |
<license>GNU General Public License (GPL)</license>
|
7 |
<channel>community</channel>
|
40 |
<p>Please do! Contact us at 1-(877) 671-6011 or <a href="mailto:hello@shiphero.com">hello@shiphero.com</a></p>
|
41 |

|
42 |
<p />Want to know more about ShipHero? <a href="http://www.ShipHero.com">Watch video of ShipHero in action, and learn about the full set of features.</a></description>
|
43 |
+
<notes>- Fixed table prefixes for instal script</notes>
|
|
|
44 |
<authors><author><name>Fareed Hosein</name><user>shipherollc</user><email>roger@shiphero.com</email></author></authors>
|
45 |
+
<date>2015-02-17</date>
|
46 |
+
<time>22:25:11</time>
|
47 |
+
<contents><target name="magecommunity"><dir name="ShipHero"><dir name="CatalogExtApi"><dir name="Model"><dir name="Api2"><dir name="Product"><dir name="Rest"><dir name="Admin"><file name="V1.php" hash="fa124c3cf7655d6c9efc8172ecfdb8b4"/></dir><file name=".DS_Store" hash="82133767cb30f899e06a57a6c0215a3d"/></dir></dir></dir></dir><dir name="etc"><file name="api2.xml" hash="4bfa96037c915b8da87b87cd48f8c51b"/><file name="config.xml" hash="75fca57d73d1909bfb92a0b4116c3b24"/></dir></dir><dir name="PaymentExtApi"><dir name="Model"><dir name="Api2"><dir name="Payment"><dir name="Rest"><dir name="Admin"><file name="V1.php" hash="d172248ff949effa3990191c6a037ef3"/></dir></dir></dir><file name="Payment.php" hash="dd379bf5c286b0924111db0a8fadd658"/></dir></dir><dir name="etc"><file name="api2.xml" hash="792e6b7c9f17b551cb327267427ac128"/><file name="config.xml" hash="3a0e38693d058eb48521a4325b761b2e"/></dir></dir><dir name="SalesExtApi"><dir name="Model"><dir name="Api2"><dir name="Order"><dir name="Rest"><dir name="Admin"><file name="V1.php" hash="60d9b67908552ade74c89eb2a8d83493"/></dir></dir></dir></dir></dir><dir name="etc"><file name="api2.xml" hash="7fd3830df03511ab3fd8923e9bf490dc"/><file name="config.xml" hash="a0817be74340d9f9e12861993e5ee2c9"/></dir></dir><dir name="ShipmentExtApi"><dir name="Model"><dir name="Api2"><dir name="Shipment"><dir name="Rest"><dir name="Admin"><file name="V1.php" hash="3c0d3c01b64f83a2bbd0e443805e7506"/></dir></dir></dir><file name="Shipment.php" hash="8a804aecde89f00f4d013253e8526cfb"/></dir></dir><dir name="etc"><file name="api2.xml" hash="84d7bb1a150b5b94f0797403ef656f45"/><file name="config.xml" hash="6bcba4e8b893bb78eadfb6038fa01927"/></dir></dir><dir name="WebHooks"><dir name="Model"><file name="OrderObserver.php" hash="29fe8f9a744de07c1b8dcceb40e43453"/><file name="ProductObserver.php" hash="df1790c6df7b976d4973f05a2e8c0088"/><dir name="Resource"><file name="Setup.php" hash="428887c1ea6151a293d3d4b633963bce"/></dir></dir><dir name="etc"><file name="config.xml" hash="e5e8d6595e85311f3617f63b813e8e35"/><dir name="webapi"><file name="acl.xml" hash="444730c8892d9a14c169b6cd96da1cdd"/></dir></dir><dir name="sql"><dir name="shiphero_setup"><file name="install-0.1.0.php" hash="b793368264d3637cb831dd1ec2dbbeae"/></dir></dir></dir><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir></target><target name="mageetc"><dir name="modules"><file name="ShipHero.xml" hash="9ab0798e75362629478abe9a1db7bb6f"/></dir></target></contents>
|
48 |
<compatible/>
|
49 |
<dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.7.0</min><max>2.0.0</max></package></required></dependencies>
|
50 |
</package>
|