mirror of
https://github.com/unraid/webgui.git
synced 2026-04-30 23:09:42 -05:00
Replace fixed path with absolute path in docroot variable
This commit is contained in:
@@ -11,11 +11,14 @@
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
$docroot = $docroot ?: @$_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
|
||||
|
||||
// Wrapper functions
|
||||
function parse_plugin_cfg($plugin, $sections=false) {
|
||||
$ram = "/usr/local/emhttp/plugins/$plugin/default.cfg";
|
||||
global $docroot;
|
||||
$ram = "$docroot/plugins/$plugin/default.cfg";
|
||||
$rom = "/boot/config/plugins/$plugin/$plugin.cfg";
|
||||
$cfg = file_exists($ram) ? parse_ini_file($ram, $sections) : array();
|
||||
$cfg = file_exists($ram) ? parse_ini_file($ram, $sections) : [];
|
||||
return file_exists($rom) ? array_replace_recursive($cfg, parse_ini_file($rom, $sections)) : $cfg;
|
||||
}
|
||||
|
||||
@@ -34,7 +37,8 @@ function agent_fullname($agent, $state) {
|
||||
}
|
||||
|
||||
function get_plugin_attr($attr, $file) {
|
||||
exec("/usr/local/emhttp/plugins/dynamix.plugin.manager/scripts/plugin $attr $file", $result, $error);
|
||||
global $docroot;
|
||||
exec("$docroot/plugins/dynamix.plugin.manager/scripts/plugin $attr $file", $result, $error);
|
||||
if ($error===0) return $result[0];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user