Welcome to mirror list, hosted at ThFree Co, Russian Federation.

adminSettings.php « user_vd - github.com/nextcloud/apps.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: dc1576eeb2ff33588e8fe3f51383c435274778ee (plain)
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
<?php
OCP\Util::addscript('user_vd', 'adminSettings');
$paramsCheck = array( 'forceCreateUsers', 'disableBackends');
if ($_POST) {
	if(array_key_exists('domain',$_POST) && array_key_exists('fqdn',$_POST)){
		foreach($_POST['domain'] as $index => $domain){
			$fqdn=$_POST['fqdn'][$index];
			if($domain!='' OR $fqdn!=''){
				$domains[$domain]=$fqdn;
			}
		}
		OC_USER_VD_DOMAIN::saveDomains($domains);
	}
	foreach($paramsCheck as $param){
		if(isset($_POST[$param])){
			OCP\Config::setAppValue('user_vd',$param,true);
		}else{
			OCP\Config::setAppValue('user_vd',$param,false);
		}
	}
}


$tmpl = new OCP\Template('user_vd', 'adminSettings');
$tmpl->assign('domains',OC_USER_VD_DOMAIN::getDomains(true));
foreach($paramsCheck as $param){
	$tmpl->assign($param,OCP\Config::getAppValue('user_vd',$param));
}
return $tmpl->fetchPage();