-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
186 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
<?php | ||
/** | ||
* @copyright Copyright 2003-2024 Zen Cart Development Team | ||
* Zen Cart German Specific (200 code in 157) | ||
* Zen Cart German Version - www.zen-cart-pro.at | ||
* @copyright Portions Copyright 2003 osCommerce | ||
* @license https://www.zen-cart-pro.at/license/3_0.txt GNU General Public License V3.0 | ||
* @version $Id: index_dashboard.php for AbuseIPDB 2024-11-13 17:29:16Z webchills $ | ||
* | ||
* @var notifier $zco_notifier | ||
*/ | ||
|
||
if (empty($currencies)) { | ||
require_once DIR_WS_CLASSES . 'currencies.php'; | ||
$currencies = new currencies(); | ||
} | ||
|
||
$widgets = []; | ||
$widgets[] = ['column' => 1, 'sort' => 10, 'visible' => true, 'path' => DIR_WS_MODULES . 'dashboard_widgets/BaseStatisticsDashboardWidget.php']; | ||
$widgets[] = ['column' => 1, 'sort' => 15, 'visible' => true, 'path' => DIR_WS_MODULES . 'dashboard_widgets/SpecialsDashboardWidget.php']; | ||
$widgets[] = ['column' => 1, 'sort' => 20, 'visible' => true, 'path' => DIR_WS_MODULES . 'dashboard_widgets/OrderStatusDashboardWidget.php']; | ||
$widgets[] = ['column' => 2, 'sort' => 10, 'visible' => true, 'path' => DIR_WS_MODULES . 'dashboard_widgets/RecentCustomersDashboardWidget.php']; | ||
$widgets[] = ['column' => 2, 'sort' => 15, 'visible' => true, 'path' => DIR_WS_MODULES . 'dashboard_widgets/WhosOnlineDashboardWidget.php']; | ||
$widgets[] = ['column' => 2, 'sort' => 20, 'visible' => true, 'path' => DIR_WS_MODULES . 'dashboard_widgets/TrafficDashboardWidget.php']; | ||
$widgets[] = ['column' => 3, 'sort' => 10, 'visible' => true, 'path' => DIR_WS_MODULES . 'dashboard_widgets/RecentOrdersDashboardWidget.php']; | ||
$widgets[] = ['column' => 3, 'sort' => 15, 'visible' => true, 'path' => DIR_WS_MODULES . 'dashboard_widgets/SalesReportDashboardWidget.php']; | ||
$widgets[] = ['column' => 3, 'sort' => 30, 'visible' => true, 'path' => DIR_WS_MODULES . 'dashboard_widgets/AbuseIPDBDashboardWidget.php']; | ||
|
||
$zco_notifier->notify('NOTIFY_ADMIN_DASHBOARD_WIDGETS', null, $widgets); | ||
|
||
// Prepare for sorting: ensure each has its dependent columns, so multisort doesn't complain about inconsistent array sizes | ||
foreach ($widgets as $key => $widget) { | ||
if (!isset($widget['sort'])) { | ||
$widgets[$key]['sort'] = 999; | ||
} | ||
if (!isset($widget['column'])) { | ||
$widgets[$key]['column'] = 0; // 0-unspecified, will be ignored | ||
} | ||
} | ||
|
||
// Sort in advance so the template can simply loop over each column without re-sorting. | ||
array_multisort(array_column($widgets, 'column'), SORT_ASC, array_column($widgets, 'sort'), SORT_ASC, $widgets); | ||
|
||
// Path validation (catch invalid path errors) and security LFI check (prevent loading files from outside) | ||
$acceptedPath = realPath(DIR_FS_CATALOG); | ||
foreach ($widgets as $key => $widget) { | ||
$realPath = realpath($widget['path']); | ||
if ($realPath === false || !str_starts_with($realPath, $acceptedPath) || !file_exists($widget['path'])) { | ||
unset($widgets[$key]); // Skip if it's not under the intended directory or doesn't exist | ||
} | ||
} | ||
|
||
|
||
?> | ||
<!doctype html> | ||
<html <?php echo HTML_PARAMS; ?>> | ||
<head> | ||
<?php require DIR_WS_INCLUDES . 'admin_html_head.php'; ?> | ||
<!--Load the AJAX API FOR GOOGLE GRAPHS --> | ||
<script src="https://www.gstatic.com/charts/loader.js" title="google_graphs_api"></script> | ||
<style> | ||
/* #coltwo div.row span.left { float: left; text-align: left; width: 50%; white-space: nowrap; }*/ | ||
#colthree div.row span.left { float: left; text-align: left; width: 50%; white-space: nowrap; } | ||
#div.row span.center { margin-right: 30px; } | ||
.indented { padding-left: 5%; margin-right: 5%;} | ||
div.first { float: left; width: 90px; } | ||
div.col { float: left; width: 18%; } | ||
</style> | ||
</head> | ||
<body class="indexDashboard"> | ||
<!-- header //--> | ||
<?php require(DIR_WS_INCLUDES . 'header.php'); ?> | ||
<!-- header_eof //--> | ||
|
||
<?php | ||
$notifications = new AdminNotifications(); | ||
$availableNotifications = $notifications->getNotifications('index', $_SESSION['admin_id']); | ||
require_once(DIR_WS_MODULES . 'notificationsDisplay.php'); | ||
?> | ||
|
||
<div id="colone" class="col-xs-12 col-sm-6 col-md-4 col-lg-4"> | ||
<?php | ||
foreach ($widgets as $widget) { | ||
if ($widget['column'] === 1 && !empty($widget['visible'])) { | ||
include $widget['path']; | ||
} | ||
} | ||
?> | ||
</div> | ||
<div id="coltwo" class="col-xs-12 col-sm-6 col-md-4 col-lg-4"> | ||
<?php | ||
foreach ($widgets as $widget) { | ||
if ($widget['column'] === 2 && !empty($widget['visible'])) { | ||
include $widget['path']; | ||
} | ||
} | ||
?> | ||
</div> | ||
<div id="colthree" class="col-xs-12 col-sm-6 col-md-4 col-lg-4"> | ||
<?php | ||
foreach ($widgets as $widget) { | ||
if ($widget['column'] === 3 && !empty($widget['visible'])) { | ||
include $widget['path']; | ||
} | ||
} | ||
?> | ||
</div> | ||
|
22 changes: 22 additions & 0 deletions
22
NEUE DATEIEN/DEINADMIN/includes/installers/abuseipdb/2_1_3.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
/** | ||
* AbuseIPDB for Zen Cart German 1.5.7 | ||
* Zen Cart German Version - www.zen-cart-pro.at | ||
* Copyright 2023-2024 marcopolo | ||
* see https://github.com/CcMarc/AbuseIPDB | ||
* license GNU General Public License (GPL) | ||
* version $Id: 2.1.3.php 2024-11-13 16:13:16Z webchills $ | ||
*/ | ||
|
||
$db->Execute(" SELECT @gid:=configuration_group_id | ||
FROM ".TABLE_CONFIGURATION_GROUP." | ||
WHERE configuration_group_title= 'AbuseIPDB' | ||
LIMIT 1;"); | ||
|
||
$db->Execute("INSERT IGNORE INTO " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, date_added, sort_order, use_function, set_function) VALUES | ||
('AbuseIPDB - User ID', 'ABUSEIPDB_USERID', '', 'This is the UserID of the AbuseIPDB account. You can find this by visiting your account summary on AbuseIPDB.com and copying the numbers that appear at the end of the profile URL.<br><br>For example, if your profile was <code>https://www.abuseipdb.com/user/XXXXXX</code>, you would enter <code>XXXXXX</code> here.', @gid, now(), 13, NULL, NULL)"); | ||
|
||
$db->Execute("REPLACE INTO ".TABLE_CONFIGURATION_LANGUAGE." (configuration_title, configuration_key, configuration_description, configuration_language_id) VALUES | ||
('AbuseIPDB - User ID', 'ABUSEIPDB_USERID', 'Dies ist die Benutzer-ID des AbuseIPDB-Kontos. Sie finden diese, indem Sie Ihre Kontoübersicht auf AbuseIPDB.com aufrufen und die Zahlen am Ende der Profil-URL kopieren.<br><br>Wenn Ihr Profil beispielsweise <code>https://www.abuseipdb.com/user/XXXXXX</code> lautet, geben Sie hier <code>XXXXXX</code> ein.<br><br>', 43)"); | ||
|
||
$db->Execute("UPDATE " . TABLE_CONFIGURATION . " SET configuration_value = '2.1.3' WHERE configuration_key = 'ABUSEIPDB_MODUL_VERSION';"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
NEUE DATEIEN/DEINADMIN/includes/modules/dashboard_widgets/AbuseIPDBDashboardWidget.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
/** | ||
* AbuseIPDB for Zen Cart German 1.5.7 | ||
* Zen Cart German Version - www.zen-cart-pro.at | ||
* Copyright 2023-2024 marcopolo | ||
* see https://github.com/CcMarc/AbuseIPDB | ||
* license GNU General Public License (GPL) | ||
* version $Id: AbuseIPDBDashboardWidget.php 2024-11-13 16:13:16Z webchills $ | ||
*/ | ||
|
||
if (!zen_is_superuser() && !check_page(FILENAME_ORDERS, '')) return; | ||
|
||
// to disable this module for everyone, uncomment the following "return" statement so the rest of this file is ignored | ||
// return; | ||
|
||
?> | ||
<?php if(zen_not_null(ABUSEIPDB_USERID) && ABUSEIPDB_ENABLED == 'true') { ?> | ||
<div class="panel panel-default reportBox"> | ||
<div class="panel-heading header"> | ||
<?php echo BOX_ABUSEIPDB_HEADER; ?> | ||
</div> | ||
|
||
<div class="panel-body" style="text-align: center;"> | ||
<a href="https://www.abuseipdb.com/user/<?php echo ABUSEIPDB_USERID; ?>" target="_blank" title="AbuseIPDB is an IP address blacklist for webmasters and sysadmins to report IP addresses engaging in abusive behavior on their networks"> | ||
<img src="https://www.abuseipdb.com/contributor/<?php echo ABUSEIPDB_USERID; ?>.svg" alt="AbuseIPDB Contributor Badge" style="width: 401px;box-shadow: 2px 2px 1px 1px rgba(0, 0, 0, .2);"> | ||
</a> | ||
</div> | ||
</div> | ||
<?php } ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters