Skip to content

Commit 1fca2e4

Browse files
committed
First stable release
0 parents  commit 1fca2e4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+3447
-0
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## 1.0.0
2+
3+
- First stable release

LICENCE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (C) 2023 Pixel Développement
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Prestashop Sucuri
2+
3+
[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.2-green)](https://php.net/)
4+
[![Minimum Prestashop Version](https://img.shields.io/badge/prestashop-%3E%3D%201.7.6.0-green)](https://www.prestashop.com)
5+
[![GitHub release](https://img.shields.io/github/v/release/Pixel-Open/prestashop-sucuri)](https://github.com/Pixel-Open/prestashop-sucuri/releases)
6+
7+
## Presentation
8+
9+
Manage your Sucuri WAF in Prestashop.
10+
11+
![Sucuri](screenshot.png)
12+
13+
## Requirements
14+
15+
- Prestashop >= 1.7.6.0
16+
- PHP >= 7.2.0
17+
18+
## Installation
19+
20+
Download the **pixel_sucuri.zip** file from the [last release](https://github.com/Pixel-Open/prestashop-sucuri/releases/latest) assets.
21+
22+
### Admin
23+
24+
Go to the admin module catalog section and click **Upload a module**. Select the downloaded zip file.
25+
26+
### Manually
27+
28+
Move the downloaded file in the Prestashop **modules** directory and unzip the archive. Go to the admin module catalog section and search for "Sucuri".
29+
30+
## Configuration
31+
32+
From the module manager, find the module and click on configure.
33+
34+
| Field | Description | Required |
35+
|:-------------------|:----------------------|----------|
36+
| Sucuri API Key | The Sucuri API key | Y |
37+
| Sucuri API Secret | The Sucuri API Secret | Y |
38+
39+
## Settings
40+
41+
Sucuri settings are available under the menu: *Advanced settings > Sucuri*
42+
43+
**Action:**
44+
45+
- **Flush Sucuri Cache:** Allows to flush the Sucuri cache
46+
47+
**List:**
48+
49+
- **Refresh**: Refresh the Sucuri config values saved in the local cache
50+
- **Update**: Update a Sucuri config value

composer.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"name": "pixel-open/prestashop-sucuri",
3+
"description": "Manage your Sucuri WAF in Prestashop.",
4+
"license": "MIT",
5+
"authors": [
6+
{
7+
"name": "Pixel",
8+
"email": "[email protected]"
9+
}
10+
],
11+
"require": {
12+
"php": ">=7.2.0"
13+
},
14+
"autoload": {
15+
"psr-4": {
16+
"Pixel\\Module\\Sucuri\\": "src/"
17+
},
18+
"exclude-from-classmap": []
19+
},
20+
"config": {
21+
"preferred-install": "dist",
22+
"prepend-autoloader": false
23+
},
24+
"type": "prestashop-module"
25+
}

composer.lock

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/routes.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
admin_sucuri_settings:
2+
path: /sucuri/settings
3+
methods: [GET]
4+
defaults:
5+
_controller: 'pixel.sucuri.controller:settingsAction'
6+
admin_sucuri_edit:
7+
path: /sucuri/edit
8+
methods: [GET, POST]
9+
defaults:
10+
_controller: 'pixel.sucuri.controller:editAction'
11+
admin_sucuri_refresh:
12+
path: /sucuri/refresh
13+
methods: [GET]
14+
defaults:
15+
_controller: 'pixel.sucuri.controller:refreshAction'
16+
admin_sucuri_flush:
17+
path: /sucuri/flush
18+
methods: [GET]
19+
defaults:
20+
_controller: 'pixel.sucuri.controller:flushAction'

config/services.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
services:
2+
pixel.sucuri.controller:
3+
class: 'Pixel\Module\Sucuri\Controller\Admin\SucuriController'
4+
arguments:
5+
- '@pixel.sucuri.api'
6+
- '@pixel.sucuri.cache'
7+
- '@pixel.sucuri.config'
8+
pixel.sucuri.grid.definition.factory.settings_definition_factory:
9+
class: 'Pixel\Module\Sucuri\Grid\Definition\SettingsFactory'
10+
parent: 'prestashop.core.grid.definition.factory.abstract_grid_definition'
11+
public: true
12+
pixel.sucuri.grid.settings_grid_factory:
13+
class: 'PrestaShop\PrestaShop\Core\Grid\GridFactory'
14+
arguments:
15+
- '@pixel.sucuri.grid.definition.factory.settings_definition_factory'
16+
- '@pixel.sucuri.grid.data.factory.settings_data_factory'
17+
- '@prestashop.core.grid.filter.form_factory'
18+
- '@prestashop.core.hook.dispatcher'
19+
symfony.component.http.client.curl:
20+
class: 'Symfony\Component\HttpClient\CurlHttpClient'
21+
pixel.sucuri.cache:
22+
class: 'Pixel\Module\Sucuri\Helper\Cache'
23+
pixel.sucuri.config:
24+
class: 'Pixel\Module\Sucuri\Helper\Config'
25+
pixel.sucuri.api:
26+
class: 'Pixel\Module\Sucuri\Model\Api'
27+
arguments:
28+
- '@symfony.component.http.client.curl'
29+
- '@pixel.sucuri.config'
30+
- '@pixel.sucuri.cache'
31+
pixel.sucuri.grid.data.factory.settings_data_factory:
32+
class: 'Pixel\Module\Sucuri\Grid\Data\SettingsFactory'
33+
arguments:
34+
- '@pixel.sucuri.api'
35+
36+
imports:
37+
- { resource: services/bundle/form/form_builder.yml }
38+
- { resource: services/bundle/form/form_type.yml }
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
services:
2+
_defaults:
3+
public: true
4+
5+
pixel.sucuri.form.option_form_builder:
6+
class: 'PrestaShop\PrestaShop\Core\Form\IdentifiableObject\Builder\FormBuilder'
7+
factory: 'prestashop.core.form.builder.form_builder_factory:create'
8+
arguments:
9+
- 'Pixel\Module\Sucuri\Form\Admin\OptionType'
10+
- '@prestashop.core.form.identifiable_object.data_provider.customer_form_data_provider'
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
services:
2+
_defaults:
3+
public: true
4+
5+
form.type.pixel.sucuri.option_form:
6+
class: 'Pixel\Module\Sucuri\Form\Admin\OptionType'
7+
public: true
8+
arguments:
9+
- '@translator'
10+
- '@pixel.sucuri.config'
11+
tags:
12+
- { name: form.type }

index.php

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
/**
3+
* Copyright since 2007 PrestaShop SA and Contributors
4+
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
5+
*
6+
* NOTICE OF LICENSE
7+
*
8+
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
9+
* that is bundled with this package in the file LICENSE.md.
10+
* It is also available through the world-wide-web at this URL:
11+
* https://opensource.org/licenses/AFL-3.0
12+
* If you did not receive a copy of the license and are unable to
13+
* obtain it through the world-wide-web, please send an email
14+
* to [email protected] so we can send you a copy immediately.
15+
*
16+
* DISCLAIMER
17+
*
18+
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
19+
* versions in the future. If you wish to customize PrestaShop for your
20+
* needs please refer to https://devdocs.prestashop.com/ for more information.
21+
*
22+
* @author PrestaShop SA and Contributors <[email protected]>
23+
* @copyright Since 2007 PrestaShop SA and Contributors
24+
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
25+
*/
26+
27+
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
28+
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
29+
30+
header("Cache-Control: no-store, no-cache, must-revalidate");
31+
header("Cache-Control: post-check=0, pre-check=0", false);
32+
header("Pragma: no-cache");
33+
34+
header("Location: ../");
35+
exit;

0 commit comments

Comments
 (0)