diff --git a/plugins/dynamix.docker.manager/include/CreateDocker.php b/plugins/dynamix.docker.manager/include/CreateDocker.php index 0a69d9f43..e88c05c91 100644 --- a/plugins/dynamix.docker.manager/include/CreateDocker.php +++ b/plugins/dynamix.docker.manager/include/CreateDocker.php @@ -13,8 +13,12 @@ */ ?> ".htmlentities($postXML).""; echo "

COMMAND:

"; echo "
".htmlentities($cmd)."
"; - echo "
"; - echo "

"; + echo "
"; + echo "

"; goto END; } @@ -501,7 +505,7 @@ if (isset($_POST['contName'])) { if (!$DockerClient->doesImageExist($Repository)) { // Pull image if (!pullImage($Name, $Repository)) { - echo '

'; + echo '

'; goto END; } } @@ -546,7 +550,7 @@ if (isset($_POST['contName'])) { $_GET['cmd'] = $cmd; include($dockerManPaths['plugin'] . "/include/Exec.php"); - echo '

'; + echo '

'; goto END; } @@ -554,7 +558,7 @@ if (isset($_POST['contName'])) { ## UPDATE CONTAINER ## if ($_GET['updateContainer']){ - readfile("/usr/local/emhttp/plugins/dynamix.docker.manager/log.htm"); + readfile("$docroot/plugins/dynamix.docker.manager/log.htm"); @flush(); foreach ($_GET['ct'] as $value) { @@ -602,7 +606,7 @@ if ($_GET['updateContainer']){ } } - echo '

'; + echo '

'; goto END; } diff --git a/plugins/dynamix.docker.manager/include/UpdateConfig.php b/plugins/dynamix.docker.manager/include/UpdateConfig.php index 95ebb2092..5a6b63fa3 100644 --- a/plugins/dynamix.docker.manager/include/UpdateConfig.php +++ b/plugins/dynamix.docker.manager/include/UpdateConfig.php @@ -11,7 +11,8 @@ */ ?> true )); + if ($json) echo json_encode(['autostart' => true]); } else { unset($allAutoStart[$key]); - if ($json) echo json_encode(array( 'autostart' => false )); + if ($json) echo json_encode(['autostart' => false]); } file_put_contents($autostart_file, implode(PHP_EOL, $allAutoStart).(count($allAutoStart)? PHP_EOL : "")); } if ($_POST['#action'] == "templates" ){ - readfile("/usr/local/emhttp/update.htm"); + readfile("$docroot/update.htm"); $repos = $_POST['template_repos']; file_put_contents($template_repos, $repos); $DockerTemplates = new DockerTemplates(); @@ -50,6 +51,6 @@ if ($_POST['#action'] == "templates" ){ } if ( isset($_GET['is_dir'] )) { - echo json_encode( array( 'is_dir' => is_dir( $_GET['is_dir'] ))); + echo json_encode(['is_dir' => is_dir($_GET['is_dir'])]); } ?> diff --git a/plugins/dynamix.docker.manager/scripts/dockerupdate.php b/plugins/dynamix.docker.manager/scripts/dockerupdate.php index c259b4970..37688a913 100755 --- a/plugins/dynamix.docker.manager/scripts/dockerupdate.php +++ b/plugins/dynamix.docker.manager/scripts/dockerupdate.php @@ -12,10 +12,13 @@ */ ?> getAllInfo(true); echo " Done."; } else { - require_once '/usr/local/emhttp/webGui/include/Wrappers.php'; - $notify = "/usr/local/emhttp/webGui/scripts/notify"; + require_once "$docroot/webGui/include/Wrappers.php"; + $notify = "$docroot/webGui/scripts/notify"; $unraid = parse_plugin_cfg("dynamix",true); $server = strtoupper($var['NAME']); $output = $unraid['notify']['docker_notify']; @@ -43,7 +46,7 @@ if (!isset($check)) { $name = $ct['Name']; $image = $ct['Image']; if ($info[$name]['updated'] == "false") { - $updateStatus = (is_file($dockerManPaths['update-status'])) ? json_decode(file_get_contents($dockerManPaths['update-status']), TRUE) : array(); + $updateStatus = (is_file($dockerManPaths['update-status'])) ? json_decode(file_get_contents($dockerManPaths['update-status']), TRUE) : []; $new = str_replace('sha256:', '', $updateStatus[$image]['remote']); $new = substr($new, 0, 4).'..'.substr($new, -4, 4);