Store in GIT

This commit is contained in:
2026-06-17 15:46:26 +02:00
parent 47150cc7ca
commit 876ad89e72
134 changed files with 31034 additions and 0 deletions
+41
View File
@@ -0,0 +1,41 @@
<?php
require("../../../inc/connect.php");
require("../../../inc/session.php");
require("stream_verify.php");
$stream = $_POST['id'];
$name = $_POST['name'];
$ip = $_POST['ip'];
$port = $_POST['port'];
$path = $_POST['path'];
//Check if stream editing is allowed
$sql = "SELECT `name` FROM `stream` WHERE `dev_id`=$deviceid AND `id`=$stream";
$query = ExecQuery($mysqli, $sql);
if($query->num_rows < 1)
{
error("streams", "You are not allowed to edit that stream");
}
//Fix input
$ip = rtrim($ip, "/");
$ip = ltrim($ip, "http://");
$ip = ltrim($ip, "https://");
$path = ltrim($path, "/");
//Check if stream is valid
$resp = stream_verify($ip, $port, $path);
if($resp === false)
{
error("streams", "Invalid stream");
}
$ip = $resp;
//Update stream
$sql = "UPDATE `stream` SET `name`='$name', `ip`='$ip', `port`='$port', `path`='$path' WHERE `id`=$stream";
ExecQuery($mysqli, $sql);
success("streams", "The stream has been updated");
?>