-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.php
70 lines (66 loc) · 2.75 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
68
69
70
<?php
require_once INCLUDE_DIR . 'class.plugin.php';
class DrupalPluginConfig extends PluginConfig {
// Provide compatibility function for versions of osTicket prior to
// translation support (v1.9.4)
function translate() {
if (!method_exists('Plugin', 'translate')) {
return [
function ($x) {
return $x;
},
function ($x, $y, $n) {
return $n != 1 ? $y : $x;
},
];
}
return Plugin::translate('auth-drupal');
}
function getOptions() {
[$__, $_N] = self::translate();
return [
'drupal' => new SectionBreakField([
'label' => $__('Drupal Authentication'),
]),
'drupal-enabled' => new ChoiceField([
'label' => $__('Authentication'),
'default' => "disabled",
'choices' => [
'disabled' => $__('Disabled'),
'staff' => $__('Agents Only'),
'client' => $__('Clients Only'),
'all' => $__('Agents and Clients'),
],
]),
'drupal-login-url' => new TextboxField([
'label' => $__('Login page URL'),
'configuration' => ['size' => 60, 'length' => 100],
]),
'drupal-agent-url' => new TextboxField([
'label' => $__('URL of a page to which only agents have access'),
'configuration' => ['size' => 60, 'length' => 100],
'hint' => $__('This URL should return the HTTP status 403 if not logged in.'),
]),
'drupal-client-url' => new TextboxField([
'label' => $__('URL of a page to which clients have access'),
'configuration' => ['size' => 60, 'length' => 100],
'hint' => $__('This URL should return the HTTP status 403 if not logged in.'),
]),
'drupal-email-domain' => new TextboxField([
'label' => $__('Domain to remove from email addresses'),
'validator' => 'domain-lead-by-at',
'configuration' => ['size' => 60, 'length' => 100],
'hint' => $__('
Optional. In case the login page URL requires an
email address as the user name, this config options does two
things:<ol style="width: 700px">
<li>@domain part will be removed to convert the email address
to an osTicket user name.
<li>If the user did not type the email address, but only the
local part, the @example.com part will be added before it is
sent to the login page URL form.</ol>
This field should be empty or start with an "@" character.'),
]),
];
}
}