init commit
This commit is contained in:
commit
87952f36ff
8 changed files with 1910 additions and 0 deletions
22
public/auth.php
Normal file
22
public/auth.php
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
//Scrape current list of registered streamers from the json file that contains them from a non-web accessible folder
|
||||
$validStreamers = json_decode(file_get_contents(realpath('../auth.json')));
|
||||
|
||||
//For each streamer
|
||||
foreach($validStreamers as $curStreamer){
|
||||
//If the given stream key matches the current registered streamer
|
||||
if(password_verify($_POST['name'], $curStreamer->hash)){
|
||||
//Log Stream
|
||||
file_put_contents("status.json", json_encode(array("status"=>array("name"=>$curStreamer->name, "time"=>time()))));
|
||||
|
||||
//Redirect to the public stream
|
||||
header("Location: rtmp://127.0.0.1/public/index");
|
||||
|
||||
//Prevent further execution
|
||||
die();
|
||||
}
|
||||
}
|
||||
|
||||
//If we fell through the loop with no matches, return 403 forbidden
|
||||
http_response_code(403);
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue