Skip to content

Commit 0cd4d1f

Browse files
authored
Merge pull request #5 from mage-one-com/develop
T28444 : Test für QPS bauen
2 parents 048aaf9 + 4a14ed2 commit 0cd4d1f

File tree

5 files changed

+34
-8
lines changed

5 files changed

+34
-8
lines changed

README.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ QPS is a request inspection module for Magento 1 stores. It receives its rule se
77
The Magento cron job needs to run in order to obtain updated rule sets.
88

99
# Install
10-
## with composer
10+
11+
Make sure your **Magento cronjob** is running.
12+
13+
### with composer
1114

1215
1. Add the repository with the module:
1316

@@ -20,13 +23,22 @@ The Magento cron job needs to run in order to obtain updated rule sets.
2023

2124
2. `composer require mage_one_com/qps`
2225

23-
## with modman
26+
### with modman
2427

2528
modman clone [email protected]:mage-one-com/qps.git
2629

27-
## manually
30+
### manually
2831
[Download zip file](https://github.com/mage-one-com/qps/archive/master.zip) and copy the files from inside the `src` folder into your magento root directory
2932

33+
## Clean cache/run install scripts
34+
35+
After cleaning the cache, the install scripts should run automatically to create the table for the rules.
36+
37+
## Username + key
38+
To use the QPS you need to [add your username and key in the configuration](https://my.mage-one.com/qps):
39+
40+
System > Konfiguration > General > Quick Protection System
41+
3042
# Uninstall
3143
## with composer
3244
- Remove module from `composer.json` and rerun `composer update mageone/qps`
@@ -41,6 +53,7 @@ The Magento cron job needs to run in order to obtain updated rule sets.
4153
The rule processing must be enabled manually in `System > Config > Quick Protection System (General Tab)`.
4254

4355
Rules can be automatically enabled after the hourly API sync, although we recommend enabling rules manually after testing them (this is our default setting).
56+
Enabling or disabling rules is possible in `System > Tools > MageOne QPS Rules`
4457

4558
You have to enter a username and public key, which you can obtain from [https://my.mage-one.com/qps](https://my.mage-one.com/qps)
4659

src/app/code/community/Mageone/Qps/Block/Rule.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ public function __construct()
1010
parent::__construct();
1111

1212
$this->removeButton('add');
13+
14+
$this->_addButton('load_rules', array(
15+
'label' => $this->__('Load rules'),
16+
'onclick' => "setLocation('{$this->getUrl('*/*/load')}')",
17+
));
1318
}
1419
}
1520

src/app/code/community/Mageone/Qps/Model/HTTP/Client/Curl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,6 @@ protected function validateHttpVersion(array $line): void
6464

6565
return;
6666
}
67-
$this->doError('Invalid response line returned from server: ' . $data);
67+
$this->doError('Invalid response line returned from server: ' . implode(' ', $line));
6868
}
6969
}

src/app/code/community/Mageone/Qps/controllers/Adminhtml/QpsController.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public function indexAction(): void
1212

1313
public function editAction()
1414
{
15-
$id = $this->getRequest()->getParam('id');
15+
$id = $this->getRequest()->getParam('id');
1616
$model = Mage::getModel('qps/rule');
1717

1818
if (!$id) {
@@ -47,8 +47,8 @@ public function saveAction()
4747
$redirectBack = $this->getRequest()->getParam('back', false);
4848
if ($data = $this->getRequest()->getPost()) {
4949

50-
$id = $this->getRequest()->getParam('id');
51-
$model = Mage::getModel('qps/rule');
50+
$id = $this->getRequest()->getParam('id');
51+
$model = Mage::getModel('qps/rule');
5252
$session = $this->_getSession();
5353
if (!$id) {
5454
$session->addError('You can\'t create new rules. You can only change the status of existing rules.');
@@ -90,6 +90,14 @@ public function saveAction()
9090
$this->_redirect('*/*/index');
9191
}
9292

93+
public function loadAction()
94+
{
95+
$cron = Mage::getModel('qps/cron');
96+
$cron->getRules();
97+
98+
$this->_redirect('*/*/index');
99+
}
100+
93101
protected function _isAllowed()
94102
{
95103
return Mage::getSingleton('admin/session')->isAllowed('system/config/qps_section');

src/app/locale/de_DE/Mageone_Qps.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"Fixing Patch","Schützender Patch"
1515
"Auto-Enable New Rules","Neue Regeln automatisch aktivieren"
1616
"Enable module","Modul aktivieren"
17-
"Enable new Rules automatically. Rules will be updated every hour via our API. (We recommend to enable rules manually after intensive testing)","Neue Regeln automatisch aktivieren. Neue Regeln werden automatisch jede Stunde über die API abgeglichen. (Wir empfehlen, Regeln manuell nach intensen Tests zu aktivieren)"
17+
"Enable new Rules automatically. Rules will be updated every hour via our API. (We recommend to enable rules manually after intensive testing)","Neue Regeln automatisch aktivieren. Neue Regeln werden automatisch jede Stunde über die API abgeglichen. (Wir empfehlen, Regeln manuell nach intensiven Tests zu aktivieren)"
1818
"Your <a href=""https://my.mage-one.com/qps"">https://my.mage-one.com/qps</a> username","Ihr <a href=""https://my.mage-one.com/qps"">https://my.mage-one.com/qps</a> Benutzername"
1919
"Public key for encryption between API and store. This key can be copied from <a href=""https://my.mage-one.com"">https://my.mage-one.com/qps</a>","Öffentlicher Schlüssel für die Verschlüsselung zwischen API und Ihrem Shop. Diesen Key erhalten Sie von <a href=""https://my.mage-one.com/qps"">https://my.mage-one.com/qps</a>"
2020
"You can only enable and disable a rule.", "Sie können nur Regeln aktivieren und deaktivieren."

0 commit comments

Comments
 (0)