-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.php
67 lines (61 loc) · 2.37 KB
/
config.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
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
<?php
require_once INCLUDE_DIR . 'class.plugin.php';
class OauthPluginConfig extends PluginConfig {
// Provide compatibility function for versions of osTicket prior to
// translation support (v1.9.4)
function translate() {
if (!method_exists('Plugin', 'translate')) {
return array(
function($x) { return $x; },
function($x, $y, $n) { return $n != 1 ? $y : $x; },
);
}
return Plugin::translate('auth-oauth');
}
function getOptions() {
list($__, $_N) = self::translate();
$modes = new ChoiceField(array(
'label' => $__('Authentication'),
'choices' => array(
'0' => $__('Disabled'),
'staff' => $__('Agents Only'),
'client' => $__('Clients Only'),
'all' => $__('Agents and Clients'),
),
));
return array(
'sso' => new SectionBreakField(array(
'label' => $__('SSO Sign-In'),
)),
'g-client-id' => new TextboxField(array(
'label' => $__('Client ID'),
'configuration' => array('size'=>60, 'length'=>100),
)),
'info-url' => new TextboxField(array(
'label' => $__('UserInfo URL'),
'configuration' => array('size'=>60, 'length'=>100),
)),
'token-url' => new TextboxField(array(
'label' => $__('Token URL'),
'configuration' => array('size'=>60, 'length'=>100),
)),
'auth-url' => new TextboxField(array(
'label' => $__('Auth URL'),
'configuration' => array('size'=>60, 'length'=>100),
)),
'g-client-secret' => new TextboxField(array(
'label' => $__('Client Secret'),
'configuration' => array('size'=>60, 'length'=>100),
)),
'g-allowed-domains-agents' => new TextboxField(array(
'label' => $__('Allowed Domains for Agents'),
'configuration' => array('size'=>60, 'length'=>100),
)),
'g-allowed-domains-clients' => new TextboxField(array(
'label' => $__('Allowed Domains for Clients'),
'configuration' => array('size'=>60, 'length'=>100),
)),
'g-enabled' => clone $modes,
);
}
}