-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettings.php
More file actions
73 lines (61 loc) · 2.23 KB
/
settings.php
File metadata and controls
73 lines (61 loc) · 2.23 KB
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
71
72
73
<?php
/**
* ownCloud - user_servervars
*
* @author Jean-Jacques Puig
* @copyright 2013 Jean-Jacques Puig // ESPCI ParisTech
*
* 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/>.
*
*/
OCP\App::checkAppEnabled('user_servervars');
OC_Util::checkAdminUser();
// define('SERVERVARS_RO_BINDING', true);
require_once 'user_servervars/config/parameters.php';
$params = servervars_getParameters();
OCP\Util::addscript('user_servervars', 'settings');
if ($_POST) {
foreach ($params as $param => $default_value) {
if (defined('SERVERVARS_RO_BINDING')) {
switch ($param) {
case 'servervars_login_name':
case 'servervars_display_name':
case 'servervars_email':
case 'servervars_group':
continue 2;
}
}
if (isset($_POST[$param])) {
switch ($param) {
case 'servervars_autocreate':
case 'servervars_update_user_data':
// unchecked checkboxes are not included in the post parameters
OCP\Config::setAppValue('user_servervars',
$param, 0);
break;
default:
OCP\Config::setAppValue('user_servervars',
$param, $_POST[$param]);
break;
}
}
}
}
$tmpl = new OCP\Template('user_servervars', 'settings');
foreach ($params as $param => $default_value) {
$value = OCP\Config::getAppValue('user_servervars', $param, $default_value);
$value = htmlentities($value);
$tmpl->assign($param, $value);
}
return $tmpl->fetchPage();