Skip to content

Commit

Permalink
contributor badge integrated
Browse files Browse the repository at this point in the history
  • Loading branch information
webchills committed Nov 13, 2024
1 parent 47df569 commit 029139e
Show file tree
Hide file tree
Showing 7 changed files with 186 additions and 19 deletions.
26 changes: 16 additions & 10 deletions ANLEITUNG/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@
<div class="mobile-menu-closer"></div>
<div class="content-menu">
<div class="content-infos">
<div class="info"><b>Version:</b> 2.1.2</div>
<div class="info"><b>Version:</b> 2.1.3</div>
<div class="info"><b>Autor:</b> <a href="https://www.webchills.at" target="_blank">webchills</a></div>
<div class="info"><b>last Update:</b> 01. April 2024</div>
<div class="info"><b>last Update:</b> 13. November 2024</div>
</div>
<ul>
<li class="scroll-to-link active" data-target="content-zweck">
Expand Down Expand Up @@ -99,7 +99,7 @@
<div class="content-page">

<div class="content">
<p class="headline"><br>Dokumentation zum AbuseIPDB Modul für die deutsche Zen Cart Version 1.5.7h</p>
<p class="headline"><br>Dokumentation zum AbuseIPDB Modul für die deutsche Zen Cart Version 1.5.7</p>
<br>
<p><img src="images/abuseipdb.png" width="200px"/></p>
<span class="smallinfo">Alle Infos zu AbuseIPDB auf: <a href="https://www.abuseipdb.com/" target="_blank">www.abuseipdb.com</a><br>
Expand All @@ -121,9 +121,9 @@ <h1>Sinn und Zweck</h1>
<li>
Freigeschalteter AbuseIPDB Account</li>
<li> Konfiguration des erforderlichen API Keys im AbuseIPDB Account (siehe <a href="#content-vorbereitungen">Vorbereitungen</a>)</li>
<li> Zen Cart 1.5.7h deutsche Version</li>

<li> PHP mindestens 8.0.x, empfohlen 8.2.x
<li> Zen Cart 1.5.7 deutsche Version</li>
<li> empfohlen: 1.5.7i</li>
<li> PHP mindestens 8.2.x, empfohlen 8.3.x
</li>
</ul>
<p><strong>Features:</strong></p>
Expand All @@ -142,7 +142,7 @@ <h1>Sinn und Zweck</h1>
<h1>Copyright, Lizenz</h1>
<p>
<strong>Copyright</strong> <br>
(c) 2023 marcopolo (CcMarc)<br>
(c) 2023-2024 marcopolo (CcMarc)<br>
(<a href="https://github.com/CcMarc/AbuseIPDB" target="_blank">https://github.com/CcMarc/AbuseIPDB</a>)<br><br>
Übersetzung und Anpassung für die deutsche Zen Cart Version:<br>
(c) 2023-2024 webchills (<a href="https://www.webchills.at" target="_blank">www.webchills.at</a>)<br><br>
Expand Down Expand Up @@ -179,7 +179,7 @@ <h2>Vorbereitungen bei AbuseIPDB</h2>
<h2>Installation</h2>
<p><b>Voraussetzungen</b></p>

<p>Dieses Modul ist<strong> nur für Zen Cart 1.5.7h deutsch geeignet</strong>.<br>Stellen Sie sicher, dass Sie Ihren Shop auf 1.5.7h aktualisiert haben, bevor Sie dieses Modul installieren.</p>
<p>Dieses Modul ist<strong> nur für Zen Cart 1.5.7i deutsch geeignet</strong>.<br>Stellen Sie sicher, dass Sie Ihren Shop auf 1.5.7i aktualisiert haben, bevor Sie dieses Modul installieren.</p>



Expand Down Expand Up @@ -249,8 +249,8 @@ <h1>Modul deinstallieren</h1>
<div class="overflow-hidden content-section" id="content-download">
<h1>Download</h1>
<p>Dieses Modul steht kostenlos auf Github zum Download bereit.</p>
<p>Aktuelle Version: 2.1.2 vom 01.04.2024:</p>
<p><a class="downloadbutton" title="Download AbuseIPDB 2.1.2 für Zen Cart 1.5.7 deutsch" href="https://github.com/zencartpro/157-modul-abuseipdb/archive/refs/tags/v2.1.2.zip">Download (.zip)</a></p>
<p>Aktuelle Version: 2.1.3 vom 13.11.2024:</p>
<p><a class="downloadbutton" title="Download AbuseIPDB 2.1.3 für Zen Cart 1.5.7 deutsch" href="https://github.com/zencartpro/157-modul-abuseipdb/archive/refs/tags/v2.1.3.zip">Download (.zip)</a></p>
<p>Der Downloadbutton liefert immer direkt von Github das .zip Archiv der neuesten Version.<br>
Ältere Versionen sind auf Github unter Releases archiviert:<br>
<a href="https://github.com/zencartpro/157-modul-abuseipdb/releases" target="_blank">https://github.com/zencartpro/157-modul-abuseipdb/releases</a><br><br>
Expand All @@ -260,6 +260,12 @@ <h1>Download</h1>
<h1>Changelog</h1>

<br>
<p>Version 2.1.3 - 2024-11-13</p>
<ul>
<li>Contributor Dashboard integriert</li>
<li>Fix für Fatal Error bei IP Adressen regelmäßig löschen = true</li>
<li>Anleitung aktualisiert</li>
</ul>
<p>Version 2.1.2 - 2024-01-04</p>
<ul>
<li>Anpassungen für PHP 8.2 und 1.5.7h</li>
Expand Down
108 changes: 108 additions & 0 deletions GEAENDERTE DATEIEN/DEINADMIN/index_dashboard.php
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 NEUE DATEIEN/DEINADMIN/includes/installers/abuseipdb/2_1_3.php
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';");
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
/**
* AbuseIPDB for Zen Cart German 1.5.7
* Zen Cart German Version - www.zen-cart-pro.at
* @Copyright 2023 marcopolo
* @Copyright 2023-2024 marcopolo
* see https://github.com/CcMarc/AbuseIPDB
* @license GNU General Public License (GPL)
* @version $Id: abuseipdb.php 2023-05-30 10:34:16Z webchills $
* @version $Id: abuseipdb.php 2024-11-13 10:34:16Z webchills $
*/
define('BOX_CONFIGURATION_ABUSEIPDB', 'AbuseIPDB Settings');
define('BOX_CONFIGURATION_ABUSEIPDB', 'AbuseIPDB Settings');
define('BOX_ABUSEIPDB_HEADER', 'AbuseIPDB Contributor');
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
/**
* AbuseIPDB for Zen Cart German 1.5.7
* Zen Cart German Version - www.zen-cart-pro.at
* @Copyright 2023 marcopolo
* @Copyright 2023-2024 marcopolo
* see https://github.com/CcMarc/AbuseIPDB
* @license GNU General Public License (GPL)
* @version $Id: abuseipdb.php 2023-05-30 10:34:16Z webchills $
* @version $Id: abuseipdb.php 2024-11-13 16:34:16Z webchills $
*/
define('BOX_CONFIGURATION_ABUSEIPDB', 'AbuseIPDB Einstellungen');
define('BOX_CONFIGURATION_ABUSEIPDB', 'AbuseIPDB Einstellungen');
define('BOX_ABUSEIPDB_HEADER', 'AbuseIPDB Contributor');
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 } ?>
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
/**
* AbuseIPDB for Zen Cart German 1.5.7
* Zen Cart German Version - www.zen-cart-pro.at
* Copyright 2023 marcopolo
* Copyright 2023-2024 marcopolo
* see https://github.com/CcMarc/AbuseIPDB
* License: GNU General Public License (GPL)
* version $Id: class.abuseipdb_observer.php 2024-04-01 21:21:16Z webchills $
* version $Id: class.abuseipdb_observer.php 2024-11-13 16:21:16Z webchills $
*/

class abuseipdb_observer extends base {
Expand Down Expand Up @@ -52,7 +52,7 @@ protected function runCleanup() {
}

protected function checkAbusiveIP() {
global $current_page_base, $_SESSION, $db, $spider_flag, $zcDate;
global $current_page_base, $_SESSION, $db, $spider_flag;

if (ABUSEIPDB_ENABLED == 'true') {
require_once 'includes/functions/abuseipdb_custom.php';
Expand Down

0 comments on commit 029139e

Please sign in to comment.