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 | |
Hai Shalom | 39ba6fc | 2019-01-22 12:40:38 -0800 | [diff] [blame] | 18 | $row = $db->query("SELECT realm,test FROM sessions WHERE id='$id'")->fetch(); |
Dmitry Shmidt | df5a7e4 | 2014-04-02 12:59:59 -0700 | [diff] [blame] | 19 | if ($row == false) { |
Dmitry Shmidt | 912c6ec | 2015-03-30 13:16:51 -0700 | [diff] [blame] | 20 | die("Session not found for id: $id"); |
Dmitry Shmidt | df5a7e4 | 2014-04-02 12:59:59 -0700 | [diff] [blame] | 21 | } |
| 22 | $realm = $row['realm']; |
Hai Shalom | 39ba6fc | 2019-01-22 12:40:38 -0800 | [diff] [blame] | 23 | $test = $row['test']; |
| 24 | |
| 25 | if (strlen($test) > 0) { |
| 26 | echo "<p style=\"color:#FF0000\">Special test functionality: $test</red></big></p>\n"; |
| 27 | } |
Dmitry Shmidt | df5a7e4 | 2014-04-02 12:59:59 -0700 | [diff] [blame] | 28 | |
| 29 | echo "<h3>Sign up for a subscription - $realm</h3>\n"; |
| 30 | |
Hai Shalom | 39ba6fc | 2019-01-22 12:40:38 -0800 | [diff] [blame] | 31 | echo "<p>This page can be used to select between three different types of subscriptions for testing purposes.</p>\n"; |
| 32 | |
| 33 | echo "<h4>Option 1 - shared free access credential</h4>\n"; |
| 34 | |
Dmitry Shmidt | df5a7e4 | 2014-04-02 12:59:59 -0700 | [diff] [blame] | 35 | $row = $db->query("SELECT value FROM osu_config WHERE realm='$realm' AND field='free_account'")->fetch(); |
| 36 | if ($row && strlen($row['value']) > 0) { |
| 37 | echo "<p><a href=\"free.php?session_id=$id\">Sign up for free access</a></p>\n"; |
| 38 | } |
| 39 | |
Hai Shalom | 39ba6fc | 2019-01-22 12:40:38 -0800 | [diff] [blame] | 40 | echo "<h4>Option 2 - username/password credential</h4>\n"; |
| 41 | |
Dmitry Shmidt | df5a7e4 | 2014-04-02 12:59:59 -0700 | [diff] [blame] | 42 | echo "<form action=\"add-mo.php\" method=\"POST\">\n"; |
| 43 | echo "<input type=\"hidden\" name=\"id\" value=\"$id\">\n"; |
| 44 | ?> |
| 45 | Select a username and password. Leave password empty to get automatically |
| 46 | generated and machine managed password.<br> |
| 47 | Username: <input type="text" name="user"><br> |
| 48 | Password: <input type="password" name="password"><br> |
| 49 | <input type="submit" value="Complete subscription registration"> |
| 50 | </form> |
| 51 | |
| 52 | <?php |
Hai Shalom | 39ba6fc | 2019-01-22 12:40:38 -0800 | [diff] [blame] | 53 | echo "<h4>Option 3 - client certificate credential</h4>\n"; |
| 54 | |
Dmitry Shmidt | df5a7e4 | 2014-04-02 12:59:59 -0700 | [diff] [blame] | 55 | echo "<p><a href=\"cert-enroll.php?id=$id\">Enroll a client certificate</a></p>\n" |
| 56 | ?> |
| 57 | |
| 58 | </body> |
| 59 | </html> |