This repository was archived by the owner on Jan 27, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathsetup.php
More file actions
executable file
·93 lines (84 loc) · 3.12 KB
/
setup.php
File metadata and controls
executable file
·93 lines (84 loc) · 3.12 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<?php
/**
* ---------------------------------------------------------------------
* ticketmail is a plugin to allows users to send ticket information by email
* ---------------------------------------------------------------------
* LICENSE
*
* This file is part of ticketmail.
*
* ticketmail is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* ticketmail is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ticketmail. If not, see <http://www.gnu.org/licenses/>.
* ---------------------------------------------------------------------
* @copyright Copyright © 2022-2023 probeSys'
* @license http://www.gnu.org/licenses/agpl.txt AGPLv3+
* @link https://github.com/Probesys/glpi-plugins-ticketmail
* @link https://plugins.glpi-project.org/#/plugin/ticketmail
* ---------------------------------------------------------------------
*/
define('TICKETMAIL_VERSION', '3.6.6');
define('TICKETMAIL_MIN_GLPI_VERSION', '9.4');
define('TICKETMAIL_MAX_GLPI_VERSION', '11.0');
if (!defined("PLUGIN_TICKETMAIL_DIR")) {
define("PLUGIN_TICKETMAIL_DIR", Plugin::getPhpDir("ticketmail"));
}
if (!defined("PLUGIN_TICKETMAIL_WEB_DIR")) {
define("PLUGIN_TICKETMAIL_WEB_DIR", Plugin::getWebDir("ticketmail"));
}
function plugin_version_ticketmail()
{
return [
'name' => "Ticket Mail",
'version' => TICKETMAIL_VERSION,
'author' => '<a href="http://www.probesys.com">Probesys</a>',
'license' => 'GPLv3+',
'homepage' => 'https://github.com/Probesys/glpi-plugins-vip',
'requirements' => [
'glpi' => [
'min' => TICKETMAIL_MIN_GLPI_VERSION,
'max' => TICKETMAIL_MAX_GLPI_VERSION,
],
'php' => [
'min' => '7.0'
]
]
];
}
function plugin_ticketmail_check_prerequisites()
{
$prerequisites_check_ok = false;
try {
if (version_compare(GLPI_VERSION, TICKETMAIL_MIN_GLPI_VERSION, '<')) {
throw new Exception('This plugin requires GLPI >= ' . TICKETMAIL_MIN_GLPI_VERSION);
}
$prerequisites_check_ok = true;
} catch (Exception $e) {
echo $e->getMessage();
}
return $prerequisites_check_ok;
}
function plugin_ticketmail_check_config($verbose=false)
{
if ($verbose) {
echo 'Installed / not configured';
}
return true;
}
function plugin_init_ticketmail()
{
global $PLUGIN_HOOKS;
$PLUGIN_HOOKS['csrf_compliant']['ticketmail'] = true;
Plugin::registerClass('PluginTicketmailProfile');
Plugin::registerClass('PluginTicketmailProfile', array('addtabon' => array('Profile','Ticket')));
$PLUGIN_HOOKS['change_profile']['ticketmail'] = array('PluginTicketmailProfile','changeProfile');
}