Skip to content

Commit

Permalink
add version number and improve handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Fasse committed Nov 15, 2022
1 parent a93c217 commit a6c4437
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions statistics.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/******************************************************************************
* Statistiken V 3.1.3 (kompatibel mit Admidio 4.0)
* Statistiken V 3.2.1 (kompatibel mit Admidio 4.1)
*
* Beta Version
* Beta-Version
*
* Dieses Plugin ermöglicht das Erstellen von Statistiken aus den Profildaten
* der angemeldeten Benutzer. Konfigurierte Statistiken können gespeichert,
Expand All @@ -19,10 +19,6 @@
require_once(__DIR__. '/utils/db_constants.php');
require_once(__DIR__. '/install/install_functions.php');

define('LINK_TEXT_INSTALLATION','Installation / Deinstallation');
define('LINK_TEXT_OVERWIEW','Statistiken');
define('LINK_TEXT_CONFIG', 'Statistikeditor');

$showOverview = false;

if(!isset($plgAllowShow))
Expand All @@ -38,7 +34,7 @@
foreach ($plgAllowShow AS $i)
{
if($i == 'Benutzer'
&& $gValidLogin == true)
&& $gValidLogin)
{
$showOverview = true;
}
Expand All @@ -48,9 +44,12 @@
$showOverview = true;
}
elseif($i == 'Listenberechtigte'
&& $gCurrentUser->viewAllLists())
&& $gCurrentUser->checkRolesRight('rol_all_lists_view'))
{
$hasAccess = true;
$showOverview = true;
}
elseif($i === 'Administrator' && $gCurrentUser->isAdministrator()) {
$showOverview = true;
}
elseif(hasRole($i))
{
Expand All @@ -63,7 +62,7 @@
foreach ($plgAllowConfig AS $i)
{
if($i == 'Benutzer'
&& $gValidLogin == true)
&& $gValidLogin)
{
$showPlugin = true;
}
Expand All @@ -73,9 +72,12 @@
$showConfig = true;
}
elseif($i == 'Listenberechtigte'
&& $gCurrentUser->viewAllLists())
&& $gCurrentUser->checkRolesRight('rol_all_lists_view'))
{
$hasAccess = true;
$showConfig = true;
}
elseif($i === 'Administrator' && $gCurrentUser->isAdministrator()) {
$showConfig = true;
}
elseif(hasRole($i))
{
Expand Down Expand Up @@ -104,6 +106,7 @@
{
echo 'Please install plugin statistics first!';
}
}
} else {
echo 'Plugin is successfully installed. Please go to the menu of Admidio and select the new added entries of the statistic plugin!';
}
}
?>

0 comments on commit a6c4437

Please sign in to comment.