 0f27c20d8d
			
		
	
	
		0f27c20d8d
		
	
	
	
	
		
			
			This is meant mainly for testing purposes and as a reference implementation showing how OSU SPP server could be implemented. This is not suitable for any real production use in its current form. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
		
			
				
	
	
		
			32 lines
		
	
	
	
		
			634 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
	
		
			634 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| 
 | |
| require('config.php');
 | |
| 
 | |
| $db = new PDO($osu_db);
 | |
| if (!$db) {
 | |
|    die($sqliteerror);
 | |
| }
 | |
| 
 | |
| if (isset($_GET["id"]))
 | |
| 	$id = preg_replace("/[^a-fA-F0-9]/", "", $_GET["id"]);
 | |
| else
 | |
| 	$id = 0;
 | |
| 
 | |
| $row = $db->query("SELECT rowid,* FROM sessions WHERE id='$id'")->fetch();
 | |
| if ($row == false) {
 | |
|    die("Session not found");
 | |
| }
 | |
| 
 | |
| $uri = $row['redirect_uri'];
 | |
| 
 | |
| header("Location: $uri", true, 302);
 | |
| 
 | |
| $user = $row['user'];
 | |
| $realm = $row['realm'];
 | |
| 
 | |
| $db->exec("INSERT INTO eventlog(user,realm,sessionid,timestamp,notes) " .
 | |
| 	  "VALUES ('$user', '$realm', '$id', " .
 | |
| 	  "strftime('%Y-%m-%d %H:%M:%f','now'), " .
 | |
| 	  "'redirected after user input')");
 | |
| 
 | |
| ?>
 |