signup.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <html>
  2. <head>
  3. <title>Hotspot 2.0 signup</title>
  4. </head>
  5. <body>
  6. <?php
  7. $id = $_GET["session_id"];
  8. require('config.php');
  9. $db = new PDO($osu_db);
  10. if (!$db) {
  11. die($sqliteerror);
  12. }
  13. $row = $db->query("SELECT realm FROM sessions WHERE id='$id'")->fetch();
  14. if ($row == false) {
  15. die("Session not found for id: $id");
  16. }
  17. $realm = $row['realm'];
  18. echo "<h3>Sign up for a subscription - $realm</h3>\n";
  19. $row = $db->query("SELECT value FROM osu_config WHERE realm='$realm' AND field='free_account'")->fetch();
  20. if ($row && strlen($row['value']) > 0) {
  21. echo "<p><a href=\"free.php?session_id=$id\">Sign up for free access</a></p>\n";
  22. }
  23. echo "<form action=\"add-mo.php\" method=\"POST\">\n";
  24. echo "<input type=\"hidden\" name=\"id\" value=\"$id\">\n";
  25. ?>
  26. Select a username and password. Leave password empty to get automatically
  27. generated and machine managed password.<br>
  28. Username: <input type="text" name="user"><br>
  29. Password: <input type="password" name="password"><br>
  30. <input type="submit" value="Complete subscription registration">
  31. </form>
  32. <?php
  33. echo "<p><a href=\"cert-enroll.php?id=$id\">Enroll a client certificate</a></p>\n"
  34. ?>
  35. </body>
  36. </html>