-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathindex.php
More file actions
63 lines (55 loc) · 2.45 KB
/
index.php
File metadata and controls
63 lines (55 loc) · 2.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php
/**
***********************************************************************************************
* Mitgliedsbeitrag / Membership fee
*
* Version 6.0.2
*
* This plugin calculates membership fees based on role assignments.
*
* Author: rmb
*
* Compatible with Admidio version 5
*
* @copyright The Admidio Team
* @see https://www.admidio.org/
* @license https://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2.0 only
***********************************************************************************************
*/
use Admidio\Infrastructure\Utils\SecurityUtils;
use Admidio\Infrastructure\Exception;
use Plugins\MembershipFee\classes\Config\ConfigTable;
try {
require_once (__DIR__ . '/../../system/common.php');
require_once (__DIR__ . '/../../system/login_valid.php');
require_once (__DIR__ . '/system/common_function.php');
// only authorized user are allowed to start this module
if (!isUserAuthorized())
{
throw new Exception('SYS_NO_RIGHTS');
}
$gNavigation->addStartUrl(CURRENT_URL);
$pPreferences = new ConfigTable();
$checked = $pPreferences->checkforupdate();
if ($checked === 1) {
// Nur Update der Konfigurationstabelle (Konfigurationdaten sind vorhanden, der Stand ist aber unterschiedlich zur Version.php)
$pPreferences->init();
} elseif ($checked === 2) {
// Detaillierte Installationsroutine durchlaufen (mind. ein Profilfeld fehlt)
$urlInst = ADMIDIO_URL . FOLDER_PLUGINS . PLUGIN_FOLDER . '/system/install_db.php';
$gMessage->show($gL10n->get('PLG_MEMBERSHIPFEE_INSTALL_DETAILED_DESC', array(
'<a href="' . $urlInst . '">' . $urlInst . '</a>'
)), $gL10n->get('PLG_MEMBERSHIPFEE_ATTENTION'));
}
$pPreferences->read();
// prüfen, ob role_id und/ item_id gespeichert sind (Wichtig für eine Deinstallation; evtl. ist eine vorher durchgeführte Deinstallation fehlgeschlagen)
if ($pPreferences->config['install']['access_role_id'] == 0 || $pPreferences->config['install']['menu_item_id'] == 0) {
$urlInst = ADMIDIO_URL . FOLDER_PLUGINS . PLUGIN_FOLDER . '/system/install.php';
$gMessage->show($gL10n->get('PLG_MEMBERSHIPFEE_INSTALL_UPDATE_REQUIRED', array(
'<a href="' . $urlInst . '">' . $urlInst . '</a>'
)));
}
admRedirect(ADMIDIO_URL . FOLDER_PLUGINS . PLUGIN_FOLDER . '/system/membership_fee.php');
} catch (Exception $e) {
$gMessage->show($e->getMessage());
}