Example #1
0
    $_GET['cmd'] = "/usr/bin/docker rm -f $Name";
    include($dockerManPaths['plugin'] . "/include/Exec.php");
  }

  // Remove old container if renamed
  $existing = isset($_POST['existingContainer']) ? $_POST['existingContainer'] : FALSE;
  if ($existing && ContainerExist($existing)){
    $_GET['cmd'] = "/usr/bin/docker rm -f $existing";
    include($dockerManPaths['plugin'] . "/include/Exec.php");
  }

  // Injecting the command in $_GET variable and executing.
  $_GET['cmd'] = $cmd;
  include($dockerManPaths['plugin'] . "/include/Exec.php");

  $DockerTemplates->removeInfo($Name);
  $DockerUpdate->syncVersions($Name);

  echo '<center><input type="button" value="Done" onclick="done()"></center><br>';
  die();
}


if ($_GET['updateContainer']){
  foreach ($_GET['ct'] as $value) {
    $Name = urldecode($value);
    $tmpl = $DockerTemplates->getUserTemplate($Name);

    if (! $tmpl){
      echo 'Configuration not found. Was this container created using this plugin?';
      continue;