This repository has been archived by the owner on Jul 18, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 49
/
settings.php
56 lines (48 loc) · 2.01 KB
/
settings.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
<?php
/**
* ownCloud - user_cas
*
* @author Sixto Martin <[email protected]>
* @copyright Sixto Martin Garcia. 2012
* @copyright Leonis. 2014 <[email protected]>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
OC_Util::checkAdminUser();
$params = array('cas_server_version', 'cas_server_hostname', 'cas_server_port', 'cas_server_path', 'cas_force_login', 'cas_autocreate',
'cas_update_user_data', 'cas_protected_groups', 'cas_default_group', 'cas_email_mapping', 'cas_displayName_mapping','cas_group_mapping',
'cas_cert_path', 'cas_debug_file', 'cas_php_cas_path', 'cas_link_to_ldap_backend', 'cas_disable_logout', 'cas_service_url');
OCP\Util::addscript('user_cas', 'settings');
OCP\Util::addStyle('user_cas', 'settings');
if ($_POST) {
// CSRF check
OCP\JSON::callCheck();
foreach($params as $param) {
if (isset($_POST[$param])) {
OCP\Config::setAppValue('user_cas', $param, $_POST[$param]);
}
elseif (in_array($param,array('cas_force_login', 'cas_autocreate','cas_update_user_data','cas_link_to_ldap_backend','cas_disable_logout'))) {
// unchecked checkboxes are not included in the post paramters
OCP\Config::setAppValue('user_cas', $param, 0);
}
}
}
// fill template
$tmpl = new OCP\Template( 'user_cas', 'settings');
foreach ($params as $param) {
$value = htmlentities(OCP\Config::getAppValue('user_cas', $param,''));
$tmpl->assign($param, $value);
}
return $tmpl->fetchPage();