1 |
4f315dab
|
Assos Assos
|
<?php
|
2 |
|
|
|
3 |
|
|
/**
|
4 |
|
|
* @file
|
5 |
|
|
* CAS Server module settings UI.
|
6 |
|
|
*/
|
7 |
|
|
|
8 |
|
|
/**
|
9 |
|
|
* Provides settings pages.
|
10 |
|
|
*/
|
11 |
|
|
function cas_server_admin_settings() {
|
12 |
|
|
$form = array();
|
13 |
|
|
|
14 |
|
|
$form['whitelist'] = array(
|
15 |
|
|
'#type' => 'fieldset',
|
16 |
|
|
'#title' => t('Service Whitelist Settings'),
|
17 |
|
|
);
|
18 |
|
|
|
19 |
|
|
$example_list_1 = array('http://example.com', 'http://example.com/*', 'https://example.com', 'https://example.com/*');
|
20 |
|
|
$example_list_2 = array('https://example.com/some_directory/*');
|
21 |
|
|
|
22 |
|
|
$form['whitelist']['cas_server_service_whitelist'] = array(
|
23 |
|
|
'#type' => 'textarea',
|
24 |
|
|
'#title' => t('Whitelist'),
|
25 |
|
|
'#description' => t("Define which services CAS Server will accept. Leave blank to accept all services.<br/>
|
26 |
|
|
<strong>It is strongly recommended that you use this feature to prevent inadvertent information disclosure
|
27 |
|
|
about your users.</strong>
|
28 |
|
|
<br/><br/>
|
29 |
|
|
Enter the URL of each service you wish to accept, one per line. The '*' character is a wildcard.<br/>
|
30 |
|
|
As an example, if you wished to accept any and all validation requests from example.com, you would need the following lines:
|
31 |
|
|
!example_list_1
|
32 |
|
|
If you only wanted to accept secure connections from some_directory at example.com, you would just need this line:
|
33 |
|
|
!example_list_2", array('!example_list_1' => theme('item_list', array('items' => $example_list_1)),
|
34 |
|
|
'!example_list_2' => theme('item_list', array('items' => $example_list_2)),
|
35 |
|
|
)),
|
36 |
|
|
'#default_value' => variable_get('cas_server_service_whitelist', ''),
|
37 |
|
|
);
|
38 |
|
|
|
39 |
|
|
$form['whitelist']['cas_server_whitelist_failure'] = array(
|
40 |
|
|
'#type' => 'textfield',
|
41 |
|
|
'#title' => t('Whitelist failure message'),
|
42 |
|
|
'#description' => t('Message to display when an unauthorized service attempts to authenticate via this CAS server.'),
|
43 |
|
|
'#default_value' => variable_get('cas_server_whitelist_failure', t('You do not have permission to login to CAS from this service.')),
|
44 |
|
|
);
|
45 |
|
|
|
46 |
|
|
return system_settings_form($form);
|
47 |
|
|
} |