the interface of the KaosCube
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

241 lines
4.5 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. <!doctype html>
  2. <?php
  3. $lang=$_GET['lang'];
  4. if ( in_array ($lang, array('en-US'))){
  5. $loc = "$lang".".utf8";
  6. $loc1 = $lang;
  7. }
  8. else {
  9. $loc = "de-DE";
  10. $loc1 = "de-DE";
  11. }
  12. $color=$_GET['color'];
  13. if (strlen($color) <= 1){
  14. $color = "deeppink";
  15. }
  16. include "Spyc.php";
  17. $localeYaml = Spyc::YAMLLoad('locale.yaml');
  18. $domain = "messages";
  19. setlocale(LC_MESSAGES, $loc);
  20. setlocale(LC_ALL, $loc);
  21. $results = putenv("LC_ALL=$loc");
  22. $results = putenv("LC_MESSAGES=$loc");
  23. ?>
  24. <head>
  25. <meta charset="utf-8"/>
  26. <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  27. <title><?php echo $localeYaml['title'][$loc1]?></title>
  28. <link rel="stylesheet" href="css/index.css">
  29. </head>
  30. <style>
  31. body {
  32. background: <?php echo $color?>;
  33. }
  34. input[type="text"] {
  35. background: <?php echo $color?>;
  36. }
  37. input[type="text"]:focus {
  38. background: <?php echo $color?>;
  39. }
  40. </style>
  41. <body>
  42. <center>
  43. <div id="containerdiv">
  44. <a href="/"><p id="linktext"><b><?php echo $localeYaml['connect'][$loc1]?></b></p></a>
  45. <a href="changeKCPW.php"><p id="linktext"><?php echo $localeYaml['changePassword'][$loc1]?></p></a>
  46. <a href="info.php"><p id="linktext"><?php echo $localeYaml['info'][$loc1]?></p></a>
  47. <a href="onion.php"><p id="linktext"><?php echo $localeYaml['onionFeatures'][$loc1]?></p></a>
  48. <a href="freedom.php"><p id="linktext"><?php echo $localeYaml['freedom'][$loc1]?></p></a>
  49. </div>
  50. </center>
  51. <br><br><br>
  52. <center>
  53. <img src="images/info_graffiti_digitalized.png">
  54. </center>
  55. <?php
  56. $shellcommand2 = "nmcli c show > connections.csv";
  57. $output = shell_exec($shellcommand2);
  58. ?>
  59. <br><br><br><br><br><br>
  60. <center>
  61. <?php echo $localeYaml['connections'][$loc1]?>
  62. <table id="demo"><tr>
  63. <th></th>
  64. <th></th>
  65. <th></th>
  66. <th></th>
  67. </tr>
  68. <?php
  69. // (A) OPEN CSV FILE
  70. $stream = fopen("connections.csv", "r");
  71. // (B) EXTRACT ROWS & COLS
  72. while (($row = fgets($stream)) !== false) {
  73. echo "<tr>";
  74. $col = preg_split( '/\s{2,}/', $row, -1, PREG_SPLIT_NO_EMPTY );
  75. // var_dump( preg_split( '/\s{2,}/', $row ) );
  76. $n = 0;
  77. $id = 'oi';
  78. foreach ($col as $c)
  79. {
  80. $n+=1;
  81. echo "<td>$c</td>";
  82. if ($n==1)
  83. {
  84. $id=substr($c, 0, -1);
  85. }
  86. }
  87. echo "</tr>";
  88. }
  89. // (C) CLOSE CSV FILE
  90. fclose($stream);
  91. ?></table>
  92. </center>
  93. </br></br></br></br>
  94. <?php
  95. $shellcommand3 = "nmcli dev status > devices.csv";
  96. $output = shell_exec($shellcommand3);
  97. ?>
  98. <br><br><br><br><br><br>
  99. <center>
  100. <?php echo $localeYaml['devices'][$loc1]?>
  101. <table id="demo"><tr>
  102. <th></th>
  103. <th></th>
  104. <th></th>
  105. <th></th>
  106. </tr>
  107. <?php
  108. // (A) OPEN CSV FILE
  109. $stream = fopen("devices.csv", "r");
  110. // (B) EXTRACT ROWS & COLS
  111. while (($row = fgets($stream)) !== false) {
  112. echo "<tr>";
  113. $col = preg_split( '/\s{2,}/', $row, -1, PREG_SPLIT_NO_EMPTY );
  114. // var_dump( preg_split( '/\s{2,}/', $row ) );
  115. $n = 0;
  116. $id = 'oi';
  117. foreach ($col as $c)
  118. {
  119. $n+=1;
  120. echo "<td>$c</td>";
  121. if ($n==1)
  122. {
  123. $id=substr($c, 0, -1);
  124. }
  125. }
  126. echo "</tr>";
  127. }
  128. // (C) CLOSE CSV FILE
  129. fclose($stream);
  130. ?></table>
  131. </center>
  132. </br></br></br></br>
  133. <?php
  134. $shellcommand2 = "nmcli -t --fields SSID,RATE,BARS,SECURITY dev wifi list > ssids.csv";
  135. $output = shell_exec($shellcommand2);
  136. ?>
  137. <center>
  138. <?php echo $localeYaml['ssids'][$loc1]?>
  139. <table id="demo"><tr>
  140. <th>SSID</th>
  141. <th>RATE</th>
  142. <th>BARS</th>
  143. <th>SEC</th>
  144. </tr>
  145. <?php
  146. // (A) OPEN CSV FILE
  147. $stream = fopen("ssids.csv", "r");
  148. // (B) EXTRACT ROWS & COLS
  149. while (($row = fgets($stream)) !== false) {
  150. echo "<tr>";
  151. $col = preg_split( '/:/', $row, -1, PREG_SPLIT_NO_EMPTY );
  152. // var_dump( preg_split( '/\s{2,}/', $row ) );
  153. $n = 0;
  154. $id = 'oi';
  155. foreach ($col as $c)
  156. {
  157. $n+=1;
  158. echo "<td>$c</td>";
  159. if ($n==1)
  160. {
  161. $id=substr($c, 0, -1);
  162. }
  163. }
  164. echo "</tr>";
  165. }
  166. // (C) CLOSE CSV FILE
  167. fclose($stream);
  168. ?></table>
  169. </center>
  170. </br></br></br></br>
  171. <footer>
  172. <center>
  173. <a href="mailto:contact@cannabinieri.de"><p id="linktext"><?php echo $localeYaml['contact'][$loc1]?></p></a>
  174. <p>© 2022 by Cannabinieri </p>
  175. <address>
  176. https://www.cannabinieri.de<br>
  177. E-Mail: contact@cannabinieri.de<br><br>
  178. </address>
  179. </center>
  180. </footer>
  181. </center>
  182. <center>
  183. <div id="containerdiv2">
  184. <a href="?color=deeppink"><p id="linktext"><b>pink</b></p></a>
  185. <a href="?color=lightblue"><p id="linktext">azurro</p></a>
  186. </div>
  187. </center>
  188. </body>
  189. </html>