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