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.

120 lines
2.4 KiB

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. include "Spyc.php";
  13. $localeYaml = Spyc::YAMLLoad('locale.yaml');
  14. $domain = "messages";
  15. setlocale(LC_MESSAGES, $loc);
  16. setlocale(LC_ALL, $loc);
  17. $results = putenv("LC_ALL=$loc");
  18. $results = putenv("LC_MESSAGES=$loc");
  19. $results = bindtextdomain($domain,"./locale");
  20. ?>
  21. <head>
  22. <meta charset="utf-8"/>
  23. <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  24. <title><?php echo _($localeYaml['title'][$loc1])?></title>
  25. <link rel="stylesheet" href="css/index.css">
  26. </head>
  27. <body>
  28. <center>
  29. <div id="containerdiv">
  30. <a href="/"><p id="linktext"><b><?php echo _($localeYaml['connect'][$loc1])?></b></p></a>
  31. <a href="changeKCPW.php"><p id="linktext"><?php echo _($localeYaml['changePassword'][$loc1])?></p></a>
  32. <a href="info.php"><p id="linktext"><?php echo _($localeYaml['info'][$loc1])?></p></a>
  33. <a href="onion.php"><p id="linktext"><?php echo _($localeYaml['onionFeatures'][$loc1])?></p></a>
  34. </div>
  35. </center>
  36. <?php
  37. $shellcommand2 = "nmcli c show > connections.csv";
  38. $output = shell_exec($shellcommand2);
  39. ?>
  40. <br><br><br><br><br><br>
  41. <center>
  42. <table id="demo"><tr>
  43. <th></th>
  44. <th></th>
  45. <th></th>
  46. <th></th>
  47. </tr>
  48. <?php
  49. // (A) OPEN CSV FILE
  50. $stream = fopen("connections.csv", "r");
  51. // (B) EXTRACT ROWS & COLS
  52. while (($row = fgets($stream)) !== false) {
  53. echo "<tr>";
  54. $col = preg_split( '/\s{2,}/', $row, -1, PREG_SPLIT_NO_EMPTY );
  55. // var_dump( preg_split( '/\s{2,}/', $row ) );
  56. $n = 0;
  57. $id = 'oi';
  58. foreach ($col as $c)
  59. {
  60. $n+=1;
  61. echo "<td>$c</td>";
  62. if ($n==1)
  63. {
  64. $id=substr($c, 0, -1);
  65. }
  66. }
  67. echo "</tr>";
  68. }
  69. // (C) CLOSE CSV FILE
  70. fclose($stream);
  71. ?></table>
  72. </center>
  73. </br></br></br></br>
  74. <footer>
  75. <center>
  76. <a href="mailto:contact@cannabinieri.de"><p id="linktext"><?php echo _($localeYaml['contact'][$loc1])?></p></a>
  77. <p>© 2022 by Cannabinieri </p>
  78. <address>
  79. https://www.cannabinieri.de<br>
  80. E-Mail: contact@cannabinieri.de<br><br>
  81. </address>
  82. </center>
  83. </footer>
  84. </center>
  85. <center>
  86. <div id="containerdiv2">
  87. <a href="connect.html"><p id="linktext"><b>pink</b></p></a>
  88. <a href="connect_azurro.html"><p id="linktext">azurro</p></a>
  89. </div>
  90. </center>
  91. </body>
  92. </html>