diff --git a/admin/index.php b/admin/index.php index 77b1933..f90b7cf 100644 --- a/admin/index.php +++ b/admin/index.php @@ -6,20 +6,27 @@ header( "refresh:2;url=/" ); exit(); } -$conn = new mysqli($servername, $username, $password, $dbname); -if ($conn->connect_error) { - die("Connection failed: " . $conn->connect_error); -} -$query = mysqli_query($conn, "SELECT * FROM login WHERE username = '".$_SESSION['logged_in_user']."'"); -$numrows = mysqli_num_rows($query); -while ($row = mysqli_fetch_assoc($query)) -{ - $pwrow = $row['password']; -} -if ($_SESSION['hashed_pass'] == $pwrow) { + +if ($useSQL == true) { + $conn = new mysqli($servername, $username, $password, $dbname); + if ($conn->connect_error) { + die("Connection failed: " . $conn->connect_error); + } + $stmt = $conn->prepare("SELECT * FROM login WHERE username = ?"); + $stmt->bind_param("s", $_SESSION['logged_in_user']); + $stmt->execute(); + $result = $stmt->get_result(); + while ($row = $result->fetch_assoc()) + { + $pwrow = $row['password']; + } + if ($_SESSION['hashed_pass'] == $pwrow) { } else { session_destroy(); } +} else { + session_destroy(); +} ?> diff --git a/config.php b/config.php index 2887ffe..bec3a7e 100644 --- a/config.php +++ b/config.php @@ -26,7 +26,7 @@ $defaultLang = "en"; // If the user is logged out or doesn't have a language set this will be the default $defaultLoadCommentsSetting = "nothing"; // If the user is logged out or doesn't have a comments loading preference set this will be the default (nothing / noreplies / showall) $adminuser = "GoldDominik893"; // The user on liberatube you want to have access to the admin dashboard - $testinstance = true; // Whether this is a test instance. A disclaimer will be shown, (true / false) + $testinstance = false; // Whether this is a test instance. A disclaimer will be shown, (true / false) $allowProxy = "false"; // Choose if the users can proxy video data through the server, (true / false / downloads) $useReturnYTDislike = true; // Choose whether the server contacts the return youtube dislike api for an estimate of the dislikes, (true / false) \ No newline at end of file diff --git a/images.php b/images.php index 8d3fb21..091bb8b 100644 --- a/images.php +++ b/images.php @@ -1,3 +1,2 @@ \ No newline at end of file +header('Location: https://golddominik893.github.io/file-hosting/images/'.mt_rand(1, 15).'.jpeg'); \ No newline at end of file diff --git a/videodata/hls.php b/videodata/hls.php index bb48d72..aa68705 100644 --- a/videodata/hls.php +++ b/videodata/hls.php @@ -71,4 +71,3 @@ header('Location: '.$selectedNonHlsUrl); } exit; -?> \ No newline at end of file diff --git a/videodata/poster.php b/videodata/poster.php index 8d0f7cc..e148a3c 100644 --- a/videodata/poster.php +++ b/videodata/poster.php @@ -12,4 +12,3 @@ parse_str($url_components['query'], $params); header('Location: '.$InvVIServer.'/vi/' . $params['id'] . '/maxres.jpg'); exit; -?> \ No newline at end of file