-
Notifications
You must be signed in to change notification settings - Fork 1
/
DrupalAuthPlugin.php
33 lines (28 loc) · 1.08 KB
/
DrupalAuthPlugin.php
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
<?php
require_once(INCLUDE_DIR.'class.plugin.php');
require_once(__DIR__.'/DrupalBackendTrait.php');
require_once('config.php');
class DrupalAuthPlugin extends Plugin {
public $config_class = "DrupalPluginConfig";
public function bootstrap() {
/** @var \DrupalPluginConfig $config */
$config = $this->getConfig();
$enabled = $config->get('drupal-enabled');
if (in_array($enabled, array('all', 'staff'))) {
require_once('drupal_connector.php');
StaffAuthenticationBackend::register(
new DrupalStaffAuthBackend($config));
}
if (in_array($enabled, array('all', 'client'))) {
require_once('drupal_connector.php');
UserAuthenticationBackend::register(
new DrupalClientAuthBackend($config));
}
}
}
require_once(INCLUDE_DIR.'UniversalClassLoader.php');
use Symfony\Component\ClassLoader\UniversalClassLoader_osTicket;
$loader = new UniversalClassLoader_osTicket();
$loader->registerNamespaceFallbacks(array(
dirname(__file__).'/lib'));
$loader->register();