tiny-slitaz view step4.php @ rev 6

Refresh style (thanks Aleksej)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Nov 01 16:56:16 2015 +0100 (2015-11-01)
parents 577e6e91216d
children 69b7df0ddb67
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 fwrite($fp,"export ".$key."='".$val."'\n");
14 }
15 fclose($fp);
16 shell_exec("sudo ./helper --post-install $pkg ".$_POST['tmp_dir']);
17 }
19 $output = '';
20 if (!empty($_POST['toconfigure'])) {
21 $pkgs = explode(" ",$_POST['toconfigure']);
22 foreach ($pkgs as $key => $pkg) {
23 shell_exec("sudo ./helper --pre-install $pkg ".$_POST['tmp_dir']);
24 $output = shell_exec("./helper --get-form $pkg ".
25 $_POST['tmp_dir']);
26 unset($pkgs[$key]);
27 $_POST['toconfigure'] = implode(" ", $pkgs);
28 if ($output == "") {
29 shell_exec("sudo ./helper --post-install $pkg ".
30 $_POST['tmp_dir']);
31 continue;
32 }
33 ?>
35 <div class="box">
36 <h3>[Step 4/5] <?php echo $pkg; ?> configuration</h3>
38 <form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post">
40 <input name="configuring" value="<?php echo $pkg; ?>" type="hidden" />
41 <div class="large">
42 <?php
43 echo $output;
44 post_hidden();
45 ?>
46 </div>
48 <div align="center">
49 <input name="continue" value="Continue" type="submit" />
50 </div>
52 </form>
53 </div>
55 <?php
56 echo shell_exec("./helper --get-note $pkg ".$_POST['tmp_dir']);
57 break;
58 }
60 }
61 ?>