MantisBT-Discord – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | <?php |
2 | /** |
||
3 | * Discord Integration |
||
4 | * Copyright (C) Robin van Nunen (robin@vnunen.nl) for Discord modification |
||
5 | * Copyright (C) Karim Ratib (karim@meedan.com) for original source |
||
6 | * |
||
7 | * Discord Integration is free software; you can redistribute it and/or |
||
8 | * modify it under the terms of the GNU General Public License 2 |
||
9 | * as published by the Free Software Foundation. |
||
10 | * |
||
11 | * Discord Integration is distributed in the hope that it will be useful, |
||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
14 | * GNU General Public License for more details. |
||
15 | * |
||
16 | * You should have received a copy of the GNU General Public License |
||
17 | * along with Discord Integration; if not, write to the Free Software |
||
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
||
19 | * or see http://www.gnu.org/licenses/. |
||
20 | */ |
||
21 | |||
22 | form_security_validate('plugin_Discord_config'); |
||
23 | access_ensure_global_level(config_get('manage_plugin_threshold')); |
||
24 | /** |
||
25 | * Sets plugin config option if value is different from current/default |
||
26 | * |
||
27 | * @param string $p_name option name |
||
28 | * @param string $p_value value to set |
||
29 | * |
||
30 | * @return void |
||
31 | */ |
||
32 | function config_set_if_needed($p_name, $p_value) |
||
33 | { |
||
34 | if($p_value != plugin_config_get($p_name)) |
||
35 | { |
||
36 | plugin_config_set($p_name, $p_value); |
||
37 | } |
||
38 | } |
||
39 | |||
40 | $t_redirect_url = plugin_page('config_page', true); |
||
41 | layout_page_header(null, $t_redirect_url); |
||
42 | layout_page_begin(); |
||
43 | |||
44 | config_set_if_needed('url_webhook', gpc_get_string('url_webhook')); |
||
45 | config_set_if_needed('skip_bulk', gpc_get_bool('skip_bulk')); |
||
46 | config_set_if_needed('link_names', gpc_get_bool('link_names')); |
||
47 | config_set_if_needed('language', gpc_get_string('language')); |
||
48 | |||
49 | config_set_if_needed('hook_bug_report', gpc_get_bool('hook_bug_report')); |
||
50 | config_set_if_needed('hook_bug_update', gpc_get_bool('hook_bug_update')); |
||
51 | config_set_if_needed('hook_bug_deleted', gpc_get_bool('hook_bug_deleted')); |
||
52 | config_set_if_needed('hook_bugnote_add', gpc_get_bool('hook_bugnote_add')); |
||
53 | config_set_if_needed('hook_bugnote_edit', gpc_get_bool('hook_bugnote_edit')); |
||
54 | config_set_if_needed('hook_bugnote_deleted', gpc_get_bool('hook_bugnote_deleted')); |
||
55 | |||
56 | form_security_purge('plugin_Discord_config'); |
||
57 | |||
58 | html_operation_successful($t_redirect_url); |
||
59 | layout_page_end(); |