tiny-slitaz view step4.php @ rev 29

No hard coded boot menu
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Sep 20 21:20:45 2019 +0200 (2019-09-20)
parents 038499e4d7db
children 974cf6a79cc4
line source
1 <?php
3 if (isset($_POST['packages']) && !isset($_POST['toconfigure'])) {
4 $_POST['toconfigure'] = shell_exec("./helper --depends ".
5 $_POST['tmp_dir']." ".$_POST['packages']);
6 }
8 if (isset($_POST['configuring'])) {
9 $pkg = $_POST['configuring'];
10 $fp = fopen($_POST['tmp_dir']."vars","w");
11 foreach ($_POST as $key => $val) {
12 if (in_array($key, $usedvars)) continue;
13 if (is_array($val)) $val = implode(",",$val);
14 fwrite($fp,"export ".$key."='".$val."'\n");
15 }
16 fclose($fp);
17 shell_exec("sudo ./helper --post-install $pkg ".$_POST['tmp_dir']);
18 }
20 if (isset($_POST['suggested'])) {
21 foreach ($_POST['suggested'] as $pkg) {
22 if (!strstr(" ".$_POST['toconfigure']." ", " ".$pkg." "))
23 $_POST['toconfigure'] .= " ".$pkg;
24 }
25 unset($_POST['suggested']);
26 }
28 $output = '';
29 if (!empty($_POST['toconfigure'])) {
30 $pkgs = explode(" ",$_POST['toconfigure']);
31 foreach ($pkgs as $key => $pkg) {
32 shell_exec("sudo ./helper --pre-install $pkg ".$_POST['tmp_dir']);
33 $output = shell_exec("./helper --get-form $pkg ".
34 $_POST['tmp_dir']);
35 unset($pkgs[$key]);
36 $_POST['toconfigure'] = implode(" ", $pkgs);
37 $output .= shell_exec("./helper --list-suggested $pkg ".
38 $_POST['tmp_dir']." ".$_POST['packages']);
39 if ($output == "") {
40 shell_exec("sudo ./helper --post-install $pkg ".
41 $_POST['tmp_dir']);
42 continue;
43 }
44 ?>
46 <div class="box">
47 <h3>[Step 4/5] <?php echo $pkg; ?> configuration</h3>
49 <form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post">
51 <input name="configuring" value="<?php echo $pkg; ?>" type="hidden" />
52 <div class="large">
53 <?php
54 echo $output;
55 post_hidden();
56 ?>
57 </div>
59 <div align="center">
60 <input name="continue" value="Continue" type="submit" />
61 </div>
63 </form>
64 </div>
66 <?php
67 echo shell_exec("./helper --get-note $pkg ".$_POST['tmp_dir']);
68 break;
69 }
71 }
72 ?>