Skip to content

Commit fce3e72

Browse files
committed
Add verification step for module page
1 parent 1c81735 commit fce3e72

File tree

9 files changed

+66
-54
lines changed

9 files changed

+66
-54
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ Released under the GPL V3 license: https://opensource.org/licenses/GPL-3.0
5151
5252
7.3.Replace tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . $value . "' where configuration_key = '" . $key . "'"); line with:
5353
```
54-
if((sizeof($errors) === 0 || array_search($key, $validation_keys) === FALSE) || !strpos($_SERVER['REQUEST_URI'], 'module=paylike')){
54+
if(sizeof($errors) === 0 || array_search($key, $validation_keys) === FALSE){
5555
tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . $value . "' where configuration_key = '" . $key . "'");
5656
}
5757
```
5858
5959
7.4.Add:
6060
```
61-
if(sizeof($errors) && strpos($_SERVER['REQUEST_URI'], 'module=paylike')){
61+
if(sizeof($errors)){
6262
tep_redirect(tep_href_link(FILENAME_MODULES, 'set=' . $set . '&module=' . $HTTP_GET_VARS['module'] . '&action=edit'));
6363
}
6464
```

README_CE-Phoenix-2341-Frozen.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ Released under the GPL V3 license: https://opensource.org/licenses/GPL-3.0
5252
5353
7.3.Replace 'tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . $value . "' where configuration_key = '" . $key . "'");' line with:
5454
```
55-
if((sizeof($errors) === 0 || array_search($key, $validation_keys) === FALSE) || !strpos($_SERVER['REQUEST_URI'], 'module=paylike')){
55+
if(sizeof($errors) === 0 || array_search($key, $validation_keys) === FALSE){
5656
tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . $value . "' where configuration_key = '" . $key . "'");
5757
}
5858
```
5959
6060
7.4.Add:
6161
```
62-
if(sizeof($errors) && strpos($_SERVER['REQUEST_URI'], 'module=paylike')){
62+
if(sizeof($errors)){
6363
tep_redirect(tep_href_link('modules.php', 'set=' . $set . '&module=' . $HTTP_GET_VARS['module'] . '&action=edit'));
6464
}
6565
```

README_Phoenix.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ Released under the GPL V3 license: https://opensource.org/licenses/GPL-3.0
5151
5252
7.3.Replace tep_db_query("UPDATE configuration SET configuration_value = '" . tep_db_input($value) . "' WHERE configuration_key = '" . tep_db_input($key) . "'"); line with:
5353
```
54-
if((sizeof($errors) === 0 || array_search($key, $validation_keys) === FALSE) || !strpos($_SERVER['REQUEST_URI'], 'module=paylike')){
54+
if(sizeof($errors) === 0 || array_search($key, $validation_keys) === FALSE){
5555
tep_db_query("UPDATE configuration SET configuration_value = '" . tep_db_input($value) . "' WHERE configuration_key = '" . tep_db_input($key) . "'");
5656
}
5757
```
5858
5959
7.4.Add:
6060
```
61-
if(sizeof($errors) && strpos($_SERVER['REQUEST_URI'], 'module=paylike')){
61+
if(sizeof($errors)){
6262
tep_redirect(tep_href_link('modules.php', 'set=' . $set . '&module=' . $_GET['module'] . '&action=edit'));
6363
}
6464
```
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<?php
2-
/* Initialize errors object */
3-
require_once('helpers/Paylike_Errors.php');
4-
$errorHandler = new PaylikeErrors();
2+
if(strpos($_SERVER['REQUEST_URI'], 'module=paylike')){
3+
/* Initialize errors object */
4+
require_once('helpers/Paylike_Errors.php');
5+
$errorHandler = new PaylikeErrors();
6+
}

upload/admin/includes/modules/payment/paylike/validate.php

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
<?php
2-
require_once('vendor/autoload.php');
3-
require_once('helpers/Paylike_Keys_Validator.php');
4-
require_once($module_language_directory . $language . '/modules/payment/paylike.php');
2+
if(strpos($_SERVER['REQUEST_URI'], 'module=paylike')){
3+
require_once('vendor/autoload.php');
4+
require_once('helpers/Paylike_Keys_Validator.php');
5+
require_once($module_language_directory . $language . '/modules/payment/paylike.php');
56

6-
/* Module keys that needs to be validated */
7-
$validation_keys = array('LIVE_APP_KEY' =>'MODULE_PAYMENT_PAYLIKE_APP_KEY',
8-
'LIVE_PUBLIC_KEY'=>'MODULE_PAYMENT_PAYLIKE_KEY',
9-
'TEST_APP_KEY' =>'MODULE_PAYMENT_PAYLIKE_TEST_APP_KEY',
10-
'TEST_PUBLIC_KEY'=>'MODULE_PAYMENT_PAYLIKE_TEST_KEY',
11-
);
7+
/* Module keys that needs to be validated */
8+
$validation_keys = array('LIVE_APP_KEY' =>'MODULE_PAYMENT_PAYLIKE_APP_KEY',
9+
'LIVE_PUBLIC_KEY'=>'MODULE_PAYMENT_PAYLIKE_KEY',
10+
'TEST_APP_KEY' =>'MODULE_PAYMENT_PAYLIKE_TEST_APP_KEY',
11+
'TEST_PUBLIC_KEY'=>'MODULE_PAYMENT_PAYLIKE_TEST_KEY',
12+
);
1213

13-
$errors = validate($HTTP_POST_VARS['configuration']);
14-
/* In case of errors, write them into cookies */
15-
if (isset($errorHandler)) {
16-
$errorHandler->setCookieErrors($errors);
14+
$errors = validate($HTTP_POST_VARS['configuration']);
15+
/* In case of errors, write them into cookies */
16+
if (isset($errorHandler)) {
17+
$errorHandler->setCookieErrors($errors);
18+
}
1719
}
1820

1921
/* Validate module keys */
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<?php
2-
/* Initialize errors object */
3-
require_once('helpers/Paylike_Errors.php');
4-
$errorHandler = new PaylikeErrors();
2+
if(strpos($_SERVER['REQUEST_URI'], 'module=paylike')){
3+
/* Initialize errors object */
4+
require_once('helpers/Paylike_Errors.php');
5+
$errorHandler = new PaylikeErrors();
6+
}

upload_CE-Phoenix-2341-Frozen/admin/includes/modules/payment/paylike/validate.php

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
<?php
2-
require_once('vendor/autoload.php');
3-
require_once('helpers/Paylike_Keys_Validator.php');
4-
require_once($module_language_directory . $language . '/modules/payment/paylike.php');
2+
if(strpos($_SERVER['REQUEST_URI'], 'module=paylike')){
3+
require_once('vendor/autoload.php');
4+
require_once('helpers/Paylike_Keys_Validator.php');
5+
require_once($module_language_directory . $language . '/modules/payment/paylike.php');
56

6-
/* Module keys that needs to be validated */
7-
$validation_keys = array('LIVE_APP_KEY' =>'MODULE_PAYMENT_PAYLIKE_APP_KEY',
8-
'LIVE_PUBLIC_KEY'=>'MODULE_PAYMENT_PAYLIKE_KEY',
9-
'TEST_APP_KEY' =>'MODULE_PAYMENT_PAYLIKE_TEST_APP_KEY',
10-
'TEST_PUBLIC_KEY'=>'MODULE_PAYMENT_PAYLIKE_TEST_KEY',
11-
);
7+
/* Module keys that needs to be validated */
8+
$validation_keys = array('LIVE_APP_KEY' =>'MODULE_PAYMENT_PAYLIKE_APP_KEY',
9+
'LIVE_PUBLIC_KEY'=>'MODULE_PAYMENT_PAYLIKE_KEY',
10+
'TEST_APP_KEY' =>'MODULE_PAYMENT_PAYLIKE_TEST_APP_KEY',
11+
'TEST_PUBLIC_KEY'=>'MODULE_PAYMENT_PAYLIKE_TEST_KEY',
12+
);
1213

13-
$errors = validate($HTTP_POST_VARS['configuration']);
14-
/* In case of errors, write them into cookies */
15-
if (isset($errorHandler)) {
16-
$errorHandler->setCookieErrors($errors);
14+
$errors = validate($HTTP_POST_VARS['configuration']);
15+
/* In case of errors, write them into cookies */
16+
if (isset($errorHandler)) {
17+
$errorHandler->setCookieErrors($errors);
18+
}
1719
}
1820

1921
/* Validate module keys */
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<?php
2-
/* Initialize errors object */
3-
require_once('helpers/Paylike_Errors.php');
4-
$errorHandler = new PaylikeErrors();
2+
if(strpos($_SERVER['REQUEST_URI'], 'module=paylike')){
3+
/* Initialize errors object */
4+
require_once('helpers/Paylike_Errors.php');
5+
$errorHandler = new PaylikeErrors();
6+
}

upload_ce_phoenix/admin/includes/modules/payment/paylike/validate.php

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
<?php
2-
require_once('vendor/autoload.php');
3-
require_once('helpers/Paylike_Keys_Validator.php');
4-
require_once('../includes/languages/' . $language . '/modules/payment/paylike.php');
2+
if(strpos($_SERVER['REQUEST_URI'], 'module=paylike')){
3+
require_once('vendor/autoload.php');
4+
require_once('helpers/Paylike_Keys_Validator.php');
5+
require_once('../includes/languages/' . $language . '/modules/payment/paylike.php');
56

6-
/* Module keys that needs to be validated */
7-
$validation_keys = array('LIVE_APP_KEY' =>'MODULE_PAYMENT_PAYLIKE_APP_KEY',
8-
'LIVE_PUBLIC_KEY'=>'MODULE_PAYMENT_PAYLIKE_KEY',
9-
'TEST_APP_KEY' =>'MODULE_PAYMENT_PAYLIKE_TEST_APP_KEY',
10-
'TEST_PUBLIC_KEY'=>'MODULE_PAYMENT_PAYLIKE_TEST_KEY',
11-
);
7+
/* Module keys that needs to be validated */
8+
$validation_keys = array('LIVE_APP_KEY' =>'MODULE_PAYMENT_PAYLIKE_APP_KEY',
9+
'LIVE_PUBLIC_KEY'=>'MODULE_PAYMENT_PAYLIKE_KEY',
10+
'TEST_APP_KEY' =>'MODULE_PAYMENT_PAYLIKE_TEST_APP_KEY',
11+
'TEST_PUBLIC_KEY'=>'MODULE_PAYMENT_PAYLIKE_TEST_KEY',
12+
);
1213

13-
$errors = validate($_POST['configuration']);
14-
/* In case of errors, write them into cookies */
15-
if (isset($errorHandler)) {
16-
$errorHandler->setCookieErrors($errors);
14+
$errors = validate($_POST['configuration']);
15+
/* In case of errors, write them into cookies */
16+
if (isset($errorHandler)) {
17+
$errorHandler->setCookieErrors($errors);
18+
}
1719
}
1820

1921
/* Validate module keys */

0 commit comments

Comments
 (0)