summaryrefslogtreecommitdiffstats
path: root/modules-available/vmstore/baseconfig/getconfig.inc.php
blob: e34c502ac626d3c64787f174a711966ace93804f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php

// VMStore path and type
$vmstore = Property::getVmStoreConfig();
if (is_array($vmstore) && isset($vmstore['storetype'])) {
	switch ($vmstore['storetype']) {
	case 'internal';
		$configVars["SLX_VM_NFS"] = $_SERVER['SERVER_ADDR'] . ":/srv/openslx/nfs";
		break;
	case 'nfs';
		$configVars["SLX_VM_NFS"] = $vmstore['nfsaddr'];
		break;
	case 'cifs';
		$configVars["SLX_VM_NFS"] = $vmstore['cifsaddr'];
		$configVars["SLX_VM_NFS_USER"] = $vmstore['cifsuserro'];
		$configVars["SLX_VM_NFS_PASSWD"] = $vmstore['cifspasswdro'];
		break;
	}
}

// vm list url. doesn't really fit anywhere, seems to be a tie between here and dozmod
$configVars["SLX_VMCHOOSER_BASE_URL"] = 'http://' . $_SERVER['SERVER_ADDR'] . '/vmchooser/';