Replace fixed path for docroot variable

This commit is contained in:
bergware
2016-10-24 09:49:07 +02:00
parent 0257950b16
commit 3847e44624
10 changed files with 36 additions and 33 deletions
+1 -1
View File
@@ -17,5 +17,5 @@ Markdown="false"
?>
<?
require_once('/usr/local/emhttp/plugins/dynamix.vm.manager/VMedit.php');
require_once "$docroot/plugins/dynamix.vm.manager/VMedit.php";
?>
+1 -1
View File
@@ -16,5 +16,5 @@ Markdown="false"
?>
<?
require_once('/usr/local/emhttp/plugins/dynamix.vm.manager/VMedit.php');
require_once "$docroot/plugins/dynamix.vm.manager/VMedit.php";
?>
+3 -3
View File
@@ -16,8 +16,8 @@ Markdown="false"
*/
?>
<?
require_once('/usr/local/emhttp/plugins/dynamix.vm.manager/classes/libvirt.php');
require_once('/usr/local/emhttp/plugins/dynamix.vm.manager/classes/libvirt_helpers.php');
require_once "$docroot/plugins/dynamix.vm.manager/classes/libvirt.php";
require_once "$docroot/plugins/dynamix.vm.manager/classes/libvirt_helpers.php";
// Check for Intel VT-x (vmx) or AMD-V (svm) cpu virtualzation support
@@ -265,7 +265,7 @@ foreach ($arrSyslinuxCfg as &$strSyslinuxCfg) {
</dl>
<form method="POST" action="/update.php" target="progressFrame">
<?exec("/usr/local/emhttp/webGui/scripts/btrfs_scrub status /etc/libvirt", $scrub_status, $retval);?>
<?exec("$docroot/webGui/scripts/btrfs_scrub status /etc/libvirt", $scrub_status, $retval);?>
<dl>
<dt>btrfs scrub status:</dt>
+5 -5
View File
@@ -11,10 +11,10 @@
*/
?>
<?
require_once('/usr/local/emhttp/webGui/include/Helpers.php');
require_once('/usr/local/emhttp/plugins/dynamix.vm.manager/classes/libvirt.php');
require_once('/usr/local/emhttp/plugins/dynamix.vm.manager/classes/libvirt_helpers.php');
$docroot = $docroot ?: @$_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
require_once "$docroot/webGui/include/Helpers.php";
require_once "$docroot/plugins/dynamix.vm.manager/classes/libvirt.php";
require_once "$docroot/plugins/dynamix.vm.manager/classes/libvirt_helpers.php";
function requireLibvirt() {
global $lv;
@@ -323,7 +323,7 @@ switch ($action) {
case 'get-vm-icons':
$arrImages = [];
foreach (glob("/usr/local/emhttp/plugins/dynamix.vm.manager/templates/images/*.png") as $png_file) {
foreach (glob("$docroot/plugins/dynamix.vm.manager/templates/images/*.png") as $png_file) {
$arrImages[] = [
'custom' => false,
'basename' => basename($png_file),
+8 -7
View File
@@ -11,9 +11,10 @@
*/
?>
<?
require_once('/usr/local/emhttp/webGui/include/Helpers.php');
require_once('/usr/local/emhttp/plugins/dynamix.vm.manager/classes/libvirt.php');
require_once('/usr/local/emhttp/plugins/dynamix.vm.manager/classes/libvirt_helpers.php');
$docroot = $docroot ?: @$_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
require_once "$docroot/webGui/include/Helpers.php";
require_once "$docroot/plugins/dynamix.vm.manager/classes/libvirt.php";
require_once "$docroot/plugins/dynamix.vm.manager/classes/libvirt_helpers.php";
$strSelectedTemplate = array_keys($arrAllTemplates)[1];
if (!empty($_GET['template']) && !(empty($arrAllTemplates[$_GET['template']]))) {
@@ -42,7 +43,7 @@ if (!empty($_GET['uuid'])) {
if (!empty($strIcon)) {
if (is_file($strIcon)) {
$strIconURL = $strIcon;
} else if (is_file('/usr/local/emhttp/plugins/dynamix.vm.manager/templates/images/' . $strIcon)) {
} else if (is_file("$docroot/plugins/dynamix.vm.manager/templates/images/" . $strIcon)) {
$strIconURL = '/plugins/dynamix.vm.manager/templates/images/' . $strIcon;
}
} else {
@@ -291,8 +292,8 @@ if (!empty($_GET['uuid'])) {
<div id="template_img_chooser">
<?
$arrImagePaths = [
'/usr/local/emhttp/plugins/dynamix.vm.manager/templates/images/*.png' => '/plugins/dynamix.vm.manager/templates/images/',
'/usr/local/emhttp/boot/config/plugins/dynamix.vm.manager/templates/images/*.png' => '/boot/config/plugins/dynamix.vm.manager/templates/images/'
"$docroot/plugins/dynamix.vm.manager/templates/images/*.png" => '/plugins/dynamix.vm.manager/templates/images/',
"$docroot/boot/config/plugins/dynamix.vm.manager/templates/images/*.png" => '/boot/config/plugins/dynamix.vm.manager/templates/images/'
];
foreach ($arrImagePaths as $strGlob => $strIconURLBase) {
foreach (glob($strGlob) as $png_file) {
@@ -316,7 +317,7 @@ if (!empty($_GET['uuid'])) {
<p>If you want this VM to start with the array, set this to yes.</p>
</blockquote>
<div id="form_content"><? include('/usr/local/emhttp/plugins/dynamix.vm.manager/templates/'.$arrLoad['form']); ?></div>
<div id="form_content"><? include "$docroot/plugins/dynamix.vm.manager/templates/{$arrLoad['form']}"; ?></div>
</form>
</div>
+2 -4
View File
@@ -17,14 +17,12 @@ Cond="(pgrep('libvirtd')!==false)"
<link type="text/css" rel="stylesheet" href="/plugins/dynamix.vm.manager/styles/dynamix.vm.manager.css">
<link type="text/css" rel="stylesheet" href="/webGui/styles/jquery.filetree.css">
<link type="text/css" rel="stylesheet" href="/webGui/styles/jquery.switchbutton.css">
<link type="text/css" rel="stylesheet" href="/webGui/styles/context.standalone.css">
<style type="text/css">
body{-webkit-overflow-scrolling:touch;}
.fileTree{width:305px;max-height:150px;overflow:scroll;position:absolute;z-index:100;display:none;}
</style>
<script src="/webGui/javascript/jquery.filetree.js"></script>
<script src="/webGui/javascript/jquery.switchbutton.js"></script>
<script src="/webGui/javascript/context.js"></script>
<script src="/plugins/dynamix.vm.manager/scripts/dynamix.vm.manager.js"></script>
<?
@@ -33,8 +31,8 @@ if ($var['fsState'] != "Started") {
return;
}
require_once('/usr/local/emhttp/plugins/dynamix.vm.manager/classes/libvirt.php');
require_once('/usr/local/emhttp/plugins/dynamix.vm.manager/classes/libvirt_helpers.php');
require_once "$docroot/plugins/dynamix.vm.manager/classes/libvirt.php";
require_once "$docroot/plugins/dynamix.vm.manager/classes/libvirt_helpers.php";
if (count($pages)==2) $tabbed = false;
?>
@@ -11,9 +11,10 @@
*/
?>
<?
require_once('/usr/local/emhttp/webGui/include/Helpers.php');
require_once('/usr/local/emhttp/plugins/dynamix.vm.manager/classes/libvirt.php');
require_once('/usr/local/emhttp/plugins/dynamix.vm.manager/classes/libvirt_helpers.php');
$docroot = $docroot ?: @$_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
require_once "$docroot/webGui/include/Helpers.php";
require_once "$docroot/plugins/dynamix.vm.manager/classes/libvirt.php";
require_once "$docroot/plugins/dynamix.vm.manager/classes/libvirt_helpers.php";
$arrValidMachineTypes = getValidMachineTypes();
$arrValidGPUDevices = getValidGPUDevices();
@@ -11,9 +11,10 @@
*/
?>
<?
require_once('/usr/local/emhttp/webGui/include/Helpers.php');
require_once('/usr/local/emhttp/plugins/dynamix.vm.manager/classes/libvirt.php');
require_once('/usr/local/emhttp/plugins/dynamix.vm.manager/classes/libvirt_helpers.php');
$docroot = $docroot ?: @$_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
require_once "$docroot/webGui/include/Helpers.php";
require_once "$docroot/plugins/dynamix.vm.manager/classes/libvirt.php";
require_once "$docroot/plugins/dynamix.vm.manager/classes/libvirt_helpers.php";
$arrValidMachineTypes = getValidMachineTypes();
$arrValidGPUDevices = getValidGPUDevices();
@@ -11,9 +11,10 @@
*/
?>
<?
require_once('/usr/local/emhttp/webGui/include/Helpers.php');
require_once('/usr/local/emhttp/plugins/dynamix.vm.manager/classes/libvirt.php');
require_once('/usr/local/emhttp/plugins/dynamix.vm.manager/classes/libvirt_helpers.php');
$docroot = $docroot ?: @$_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
require_once "$docroot/webGui/include/Helpers.php";
require_once "$docroot/plugins/dynamix.vm.manager/classes/libvirt.php";
require_once "$docroot/plugins/dynamix.vm.manager/classes/libvirt_helpers.php";
$arrValidMachineTypes = getValidMachineTypes();
$arrValidGPUDevices = getValidGPUDevices();
@@ -11,9 +11,10 @@
*/
?>
<?
require_once('/usr/local/emhttp/webGui/include/Helpers.php');
require_once('/usr/local/emhttp/plugins/dynamix.vm.manager/classes/libvirt.php');
require_once('/usr/local/emhttp/plugins/dynamix.vm.manager/classes/libvirt_helpers.php');
$docroot = $docroot ?: @$_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
require_once "$docroot/webGui/include/Helpers.php";
require_once "$docroot/plugins/dynamix.vm.manager/classes/libvirt.php";
require_once "$docroot/plugins/dynamix.vm.manager/classes/libvirt_helpers.php";
$strXML = '';
$strUUID = '';