1<?php
2/**
3 * -----------------------------------------------------------------------
4 * vBSSO is a solution which helps you connect to different software platforms
5 * via secure Single Sign-On.
6 *
7 * Copyright (c) 2011-2017 vBSSO. All Rights Reserved.
8 * This software is the proprietary information of vBSSO.
9 *
10 * Author URI: http://www.vbsso.com
11 * License: GPL version 2 or later -
12 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
13 * -----------------------------------------------------------------------
14 */
15
16if (!defined('DIR')) {
17    define('DIR', dirname(__FILE__) . '/');
18}
19
20if (!defined('VBSSO_PLATFORM_CONFIG_FILE')) {
21    define('VBSSO_PLATFORM_CONFIG_FILE', DIR . 'platform.conf');
22}
23
24if (!defined('VBSSO_VBSSO_CONFIG_FILE')) {
25    define('VBSSO_VBSSO_CONFIG_FILE', DIR . 'vbsso.conf');
26}
27define('VBSSO_DOKUWIKI_PLUGIN_VERSION', '1.1.0');
28
29require_once(DIR . '../../../inc/init.php');
30require_once(DIR . 'vendor/com.extremeidea.vbsso/vbsso-connect-shared/vbsso_shared.php');
31require_once(DIR . 'includes/api.php');
32
33if (file_exists(DIR . 'config.custom.php')) {
34    require_once(DIR . 'config.custom.php');
35}
36
37global $vbsso_platform_settings, $vbsso_settings;
38$vbsso_platform_settings = ($vbsso_platform_settings) ? $vbsso_platform_settings : vbsso_get_platform_settings();
39$vbsso_settings = ($vbsso_settings) ? $vbsso_settings : vbsso_get_dokuwiki_settings();
40
41$vbsso = new action_plugin_vbsso();
42sharedapi_data_handler(SHAREDAPI_PLATFORM_DOKUWIKI, getVersion(),
43    VBSSO_DOKUWIKI_PLUGIN_VERSION,
44    $vbsso_settings[VBSSO_NAMED_EVENT_FIELD_API_KEY],
45    (!$plugin_controller->isdisabled('vbsso')) ? array(
46        SHAREDAPI_EVENT_VERIFY => 'vbsso_listener_verify',
47        SHAREDAPI_EVENT_LOGIN => 'vbsso_listener_register',
48        SHAREDAPI_EVENT_AUTHENTICATION => 'vbsso_listener_authentication',
49        SHAREDAPI_EVENT_LOGOUT => 'vbsso_listener_logout',
50        SHAREDAPI_EVENT_REGISTER => 'vbsso_listener_register',
51        SHAREDAPI_EVENT_CREDENTIALS => 'vbsso_listener_credentials',
52    ) : array()
53);
54