Skip to content

Commit

Permalink
Merge pull request #27 from mailjet/development
Browse files Browse the repository at this point in the history
Fix Marketplace validator errors
  • Loading branch information
Ferhan Ismailov authored Jan 21, 2019
2 parents add8028 + ae2df58 commit 0795ccf
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 20 deletions.
5 changes: 3 additions & 2 deletions app/code/community/Mailjet/Iframes/Helper/ApiWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -984,8 +984,9 @@ private function debug()
$this->_debugErrorHtml .= '<tr><th>Call url</th><td>'.$this->_debugCallUrl.'</td></tr>';
$this->_debugErrorHtml .= '</table>';
$this->_debugErrorHtml .= '</div>';
if ($this->_debugEcho)
echo $this->_debugErrorHtml;
if ($this->_debugEcho) {
var_dump($this->_debugErrorHtml);
}
}


Expand Down
20 changes: 13 additions & 7 deletions app/code/community/Mailjet/Iframes/Helper/IframesWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -427,21 +427,27 @@ private function isAllowedOnOffParameter($parameter)
*/
private function getToken()
{
if (!isset($_SESSION[self::SESSION_NAME])) {
Mage::getSingleton('core/session')->getData(self::SESSION_NAME);
Mage::getSingleton('core/session')->setData(self::SESSION_SET, $messageValue);
Mage::getSingleton('core/session')->getData(self::SESSION_SET);

$_SESSION[self::SESSION_NAME] = $this->generateToken();
$_SESSION[self::SESSION_SET] = time();
$sessionToken = Mage::getSingleton('core/session')->getData(self::SESSION_NAME);
$sessionTime = Mage::getSingleton('core/session')->getData(self::SESSION_SET);

if (!isset($sessionToken) && !empty($sessionToken)) {
Mage::getSingleton('core/session')->setData(self::SESSION_NAME, $this->generateToken());
Mage::getSingleton('core/session')->setData(self::SESSION_SET, time());
} else {

if (time() - $_SESSION[self::SESSION_SET] >= $this->sessionExpiration) {
$_SESSION[self::SESSION_NAME] = $this->generateToken();
$_SESSION[self::SESSION_SET] = time();
if (time() - $sessionTime >= $this->sessionExpiration) {
Mage::getSingleton('core/session')->setData(self::SESSION_NAME, $this->generateToken());
Mage::getSingleton('core/session')->setData(self::SESSION_SET, time());
}

}
$sessionToken = Mage::getSingleton('core/session')->getData(self::SESSION_NAME);

return $_SESSION[self::SESSION_NAME];
return $sessionToken;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -421,4 +421,3 @@ private function _gatherCurrentContacts($mailjetListId, $offset = 0)


}
?>
2 changes: 0 additions & 2 deletions app/code/community/Mailjet/Iframes/Model/Observer.php
Original file line number Diff line number Diff line change
Expand Up @@ -318,5 +318,3 @@ private function _isSubscribed($email)
}

}

?>
18 changes: 14 additions & 4 deletions app/code/community/Mailjet/Iframes/controllers/IndexController.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,18 @@ class Mailjet_Iframes_IndexController extends Mage_Adminhtml_Controller_Action
* @var string
*/
protected $_secretKey;


/**
* Required by latest Magento 1.x.x versions
*
* @return bool
*/
protected function _isAllowed()
{
return true;
}


public function preDispatch()
{
/*
Expand Down Expand Up @@ -91,8 +102,8 @@ public function eventsAction()
if (!array_key_exists($username, $authorizedAccess) || $authorizedAccess[$username] != $password) {
header('WWW-Authenticate: Basic realm="My Realm"');
header('HTTP/1.0 401 Unauthorized');
echo 'Unauthorized access !';
exit;
$this->getResponse()->setBody('Unauthorized access !');
return;
}

$postInput = trim(file_get_contents('php://input'));
Expand Down Expand Up @@ -159,7 +170,6 @@ public function eventsAction()
} catch (Exception $e) {
//throw new Exception(Mage::helper('adminhtml')->__('Wrong event type'));
}

}

/**
Expand Down
Binary file modified mailjet-2.0.5.tgz
Binary file not shown.
4 changes: 2 additions & 2 deletions mailjet.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<_>
<form_key>YPvifqo68ee0fus8</form_key>
<form_key>BjPKGH2ySifeciyp</form_key>
<name>mailjet</name>
<channel>community</channel>
<version_ids>
Expand Down Expand Up @@ -40,7 +40,7 @@
<max/>
</max>
<files>
<files> </files>
<files> </files>
</files>
</package>
<extension>
Expand Down
4 changes: 2 additions & 2 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<notes>Minor fixes related to Email events processing</notes>
<authors><author><name>Ferhan</name><user>Ferhan</user><email>f.ismailov@proxiad.com</email></author></authors>
<date>2019-01-21</date>
<time>13:08:37</time>
<contents><target name="mageetc"><dir name="modules"><file name="Mailjet_Iframes.xml" hash="009ef92cd62bcd8e6181fc22e98edddd"/></dir></target><target name="magecommunity"><dir name="Mailjet"><dir name="Iframes"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><file name="Edit.php" hash="03d3ce93b3d21b919434560d972a96b7"/></dir></dir></dir></dir><dir name="Helper"><file name="ApiWrapper.php" hash="cbed2ee71bd6be94516cd9d453125b63"/><file name="Config.php" hash="6319e94f1cca0b2e6ed3758823d8ac75"/><file name="Data.php" hash="5ae3ab90647b02980e37cd17c3505be1"/><dir name="IframesWrapper"><file name="Exception.php" hash="5a5d26abc214279ff35ab6b95a4b13a5"/></dir><file name="IframesWrapper.php" hash="9e04be2bc49673723edb8293423c9db2"/><file name="SyncManager.php" hash="1bbfa227657aaa7b59f033d29d879c40"/><file name="Synchronization.php" hash="572652fe6b5d668ae4d262714a78ee55"/><file name="SynchronizationAbstract.php" hash="53d40b3f2a10b12c0277940a3cfe4645"/></dir><dir name="Model"><dir name="Email"><file name="Queue.php" hash="41dc63064b10b772f6e17e4bfb0b50ce"/><file name="Template.php" hash="440bb09a023dd36794945c1a8ad0442b"/></dir><file name="Iframes.php" hash="f004ad967d8455740281904f3981178c"/><file name="Mail.php" hash="95659574f4ea4ce67da93804f0e1d44b"/><file name="Observer.php" hash="53d191aba1e5e8a204f3a25be61b74ca"/><dir name="Resource"><dir name="Iframes"><file name="Collection.php" hash="6473d9b3d8a4e6f6d9fd8b07cd228302"/></dir><file name="Iframes.php" hash="5016c2d0c8e43ca0d5c9c09c0b5f5632"/><file name="Setup.php" hash="26c3e5abb6ea4dce80b21d0cf162c847"/></dir><file name="Settings.php" hash="4d1a2e119d3bdfece2b73aa64eddbcde"/></dir><dir name="controllers"><file name="IndexController.php" hash="1ab0e492f8dc47e17158f5be69a32671"/></dir><dir name="etc"><file name="config.xml" hash="2fb129fd9e3615cb9c3ac67b6a14ed4f"/><file name="system.xml" hash="8b5d821c6b8f114a7f76e0edec97a8ee"/></dir><dir name="sql"><dir name="iframes_setup"><file name="install-1.0.0.php" hash="76098a78b1eaafcee36265267db324cf"/></dir></dir></dir></dir></target><target name="magelocale"><dir><dir name="en_US"><file name="Mailjet_Iframes.csv" hash="ca745c1b6813b784000b9553dabe1ce1"/></dir><dir name="fr_Fr"><file name="Mailjet_Iframes.csv" hash="ca745c1b6813b784000b9553dabe1ce1"/></dir></dir></target></contents>
<time>15:57:36</time>
<contents><target name="mageetc"><dir name="modules"><file name="Mailjet_Iframes.xml" hash="009ef92cd62bcd8e6181fc22e98edddd"/></dir></target><target name="magecommunity"><dir name="Mailjet"><dir name="Iframes"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><file name="Edit.php" hash="03d3ce93b3d21b919434560d972a96b7"/></dir></dir></dir></dir><dir name="Helper"><file name="ApiWrapper.php" hash="6d48516f8addda774c51cba86ce3f587"/><file name="Config.php" hash="6319e94f1cca0b2e6ed3758823d8ac75"/><file name="Data.php" hash="5ae3ab90647b02980e37cd17c3505be1"/><dir name="IframesWrapper"><file name="Exception.php" hash="5a5d26abc214279ff35ab6b95a4b13a5"/></dir><file name="IframesWrapper.php" hash="7f41ec7ad9afafc99882e91ae1197694"/><file name="SyncManager.php" hash="1bbfa227657aaa7b59f033d29d879c40"/><file name="Synchronization.php" hash="a41ebe6720523104535946ec29c5a7c3"/><file name="SynchronizationAbstract.php" hash="53d40b3f2a10b12c0277940a3cfe4645"/></dir><dir name="Model"><dir name="Email"><file name="Queue.php" hash="41dc63064b10b772f6e17e4bfb0b50ce"/><file name="Template.php" hash="440bb09a023dd36794945c1a8ad0442b"/></dir><file name="Iframes.php" hash="f004ad967d8455740281904f3981178c"/><file name="Mail.php" hash="95659574f4ea4ce67da93804f0e1d44b"/><file name="Observer.php" hash="0ba2e8d5eed9e8ecd08d67a51fb09756"/><dir name="Resource"><dir name="Iframes"><file name="Collection.php" hash="6473d9b3d8a4e6f6d9fd8b07cd228302"/></dir><file name="Iframes.php" hash="5016c2d0c8e43ca0d5c9c09c0b5f5632"/><file name="Setup.php" hash="26c3e5abb6ea4dce80b21d0cf162c847"/></dir><file name="Settings.php" hash="4d1a2e119d3bdfece2b73aa64eddbcde"/></dir><dir name="controllers"><file name="IndexController.php" hash="461ec877ab31974c9f342c8e8d6e4450"/></dir><dir name="etc"><file name="config.xml" hash="2fb129fd9e3615cb9c3ac67b6a14ed4f"/><file name="system.xml" hash="8b5d821c6b8f114a7f76e0edec97a8ee"/></dir><dir name="sql"><dir name="iframes_setup"><file name="install-1.0.0.php" hash="76098a78b1eaafcee36265267db324cf"/></dir></dir></dir></dir></target><target name="magelocale"><dir><dir name="en_US"><file name="Mailjet_Iframes.csv" hash="ca745c1b6813b784000b9553dabe1ce1"/></dir><dir name="fr_Fr"><file name="Mailjet_Iframes.csv" hash="ca745c1b6813b784000b9553dabe1ce1"/></dir></dir></target></contents>
<compatible/>
<dependencies><required><php><min>5.2.0</min><max>7.3.0</max></php></required></dependencies>
</package>

0 comments on commit 0795ccf

Please sign in to comment.