mirror of
https://github.com/Fluffy-Bean/image-gallery.git
synced 2024-12-28 02:16:17 +00:00
Moved files around and fixed bugs that caused me suffering due to it
This commit is contained in:
parent
4d2afac053
commit
182892b172
|
@ -4,31 +4,31 @@
|
|||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Account</title>
|
||||
<link rel="stylesheet" href="css/master.css">
|
||||
<link rel="stylesheet" href="../css/master.css">
|
||||
<link href="https://fonts.googleapis.com/css2?family=Rubik" rel="stylesheet">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Lexend+Deca:wght@600&display=swap">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Fira+Code:wght@500&display=swap">
|
||||
</head>
|
||||
<body>
|
||||
<?php include("ui/header.php"); ?>
|
||||
<?php include("../ui/header.php"); ?>
|
||||
|
||||
<div class="account-root">
|
||||
<h2>Account settings</h2>
|
||||
<?php
|
||||
if (isset($_SESSION["loggedin"]) && $_SESSION["loggedin"] === true) {
|
||||
echo "<p>O hi ".$_SESSION["username"].".</p>";
|
||||
echo "<a class='btn alert-low space-top' href='https://superdupersecteteuploadtest.fluffybean.gay/password-reset.php'><img class='svg' src='assets/icons/password.svg'>Reset Password</a>";
|
||||
echo "<a class='btn alert-low space-top' href='https://superdupersecteteuploadtest.fluffybean.gay/logout.php'><img class='svg' src='assets/icons/sign-out.svg'>Logout</a>";
|
||||
echo "<a class='btn alert-low space-top' href='https://superdupersecteteuploadtest.fluffybean.gay/account/password-reset.php'><img class='svg' src='../assets/icons/password.svg'>Reset Password</a>";
|
||||
echo "<a class='btn alert-low space-top' href='https://superdupersecteteuploadtest.fluffybean.gay/account/logout.php'><img class='svg' src='../assets/icons/sign-out.svg'>Logout</a>";
|
||||
} else {
|
||||
echo "<p class='space-bottom-large'>You must be logged in to change your account settings!</p>";
|
||||
echo "<a class='btn alert-high space-top-large' href='https://superdupersecteteuploadtest.fluffybean.gay/login.php'>Login!</a>";
|
||||
echo "<a class='btn alert-high space-top-large' href='https://superdupersecteteuploadtest.fluffybean.gay/account/login.php'>Login!</a>";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
include("ui/top.html");
|
||||
include("ui/footer.html");
|
||||
include("../ui/top.html");
|
||||
include("../ui/footer.php");
|
||||
?>
|
||||
</body>
|
||||
</html>
|
|
@ -4,15 +4,15 @@
|
|||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Login</title>
|
||||
<link rel="stylesheet" href="css/master.css">
|
||||
<link rel="stylesheet" href="../css/master.css">
|
||||
<link href="https://fonts.googleapis.com/css2?family=Rubik" rel="stylesheet">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Lexend+Deca:wght@600&display=swap">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Fira+Code:wght@500&display=swap">
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
include("ui/header.php");
|
||||
require_once("ui/conn.php");
|
||||
include("../ui/header.php");
|
||||
require_once("../ui/conn.php");
|
||||
|
||||
// Initialize the session
|
||||
session_start();
|
||||
|
@ -98,7 +98,7 @@
|
|||
<form class="flex-down between" method="POST" action="login.php" enctype="multipart/form-data">
|
||||
<input class="btn alert-default space-bottom" type="text" name="username" placeholder="Username">
|
||||
<input class="btn alert-default space-bottom-large" type="password" name="password" placeholder="Password">
|
||||
<button class="btn alert-high" type="submit" name="login"><img class="svg" src="assets/icons/sign-in.svg">Login</button>
|
||||
<button class="btn alert-high" type="submit" name="login"><img class="svg" src="../assets/icons/sign-in.svg">Login</button>
|
||||
</form>
|
||||
<?php
|
||||
if (isset($error)) {
|
||||
|
@ -108,12 +108,12 @@
|
|||
echo "<p class='alert alert-high space-top'>".$success."</p>";
|
||||
}
|
||||
?>
|
||||
<a class='btn alert-default space-top-large' href='https://superdupersecteteuploadtest.fluffybean.gay/signup.php'><img class="svg" src="assets/icons/sign-in.svg">Need an account? Sign up!</a>
|
||||
<a class='btn alert-default space-top-large' href='https://superdupersecteteuploadtest.fluffybean.gay/account/signup.php'><img class="svg" src="../assets/icons/sign-in.svg">Need an account? Sign up!</a>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
include("ui/top.html");
|
||||
include("ui/footer.html");
|
||||
include("../ui/top.html");
|
||||
include("../ui/footer.php");
|
||||
?>
|
||||
</body>
|
||||
</html>
|
|
@ -4,22 +4,22 @@
|
|||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Account</title>
|
||||
<link rel="stylesheet" href="css/master.css">
|
||||
<link rel="stylesheet" href="../css/master.css">
|
||||
<link href="https://fonts.googleapis.com/css2?family=Rubik" rel="stylesheet">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Lexend+Deca:wght@600&display=swap">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Fira+Code:wght@500&display=swap">
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
include("ui/header.php");
|
||||
include_once("ui/conn.php");
|
||||
include("../ui/header.php");
|
||||
include_once("../ui/conn.php");
|
||||
|
||||
// Initialize the session
|
||||
session_start();
|
||||
|
||||
// Check if the user is logged in, otherwise redirect to login page
|
||||
if(!isset($_SESSION["loggedin"]) || $_SESSION["loggedin"] !== true){
|
||||
header("location: https://superdupersecteteuploadtest.fluffybean.gay/login.php");
|
||||
header("location: https://superdupersecteteuploadtest.fluffybean.gay/account/login.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
@ -60,7 +60,7 @@
|
|||
if (mysqli_stmt_execute($stmt)) {
|
||||
// Password updated!!!! Now goodbye
|
||||
session_destroy();
|
||||
header("Location: https://superdupersecteteuploadtest.fluffybean.gay/login.php");
|
||||
header("Location: https://superdupersecteteuploadtest.fluffybean.gay/account/login.php");
|
||||
} else {
|
||||
$error = "Oopsie woopsie, somthing brokie :c";
|
||||
}
|
||||
|
@ -81,7 +81,7 @@
|
|||
<form class="flex-down between" method="POST" action="password-reset.php" enctype="multipart/form-data">
|
||||
<input class="btn alert-default space-bottom" type="password" name="new_password" placeholder="New Password">
|
||||
<input class="btn alert-default space-bottom" type="password" name="confirm_password" placeholder="Confirm Password">
|
||||
<button class="btn alert-low" type="submit" name="reset"><img class="svg" src="assets/icons/sign-in.svg">Reset</button>
|
||||
<button class="btn alert-low" type="submit" name="reset"><img class="svg" src="../assets/icons/sign-in.svg">Reset</button>
|
||||
</form>
|
||||
<?php
|
||||
if (isset($error)) {
|
||||
|
@ -91,8 +91,8 @@
|
|||
</div>
|
||||
|
||||
<?php
|
||||
include("ui/top.html");
|
||||
include("ui/footer.html");
|
||||
include("../ui/top.html");
|
||||
include("../ui/footer.php");
|
||||
?>
|
||||
</body>
|
||||
</html>
|
|
@ -4,26 +4,24 @@
|
|||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Sign Up</title>
|
||||
<link rel="stylesheet" href="css/master.css">
|
||||
<link rel="stylesheet" href="../css/master.css">
|
||||
<link href="https://fonts.googleapis.com/css2?family=Rubik" rel="stylesheet">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Lexend+Deca:wght@600&display=swap">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Fira+Code:wght@500&display=swap">
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
include("ui/header.php");
|
||||
include_once("ui/conn.php");
|
||||
include("../ui/header.php");
|
||||
include_once("../ui/conn.php");
|
||||
|
||||
// Validate susness of Username
|
||||
if (isset($_POST['signup'])) {
|
||||
if (empty(trim($_POST["username"]))) {
|
||||
// Username was taken
|
||||
$error = "Enter a username reeeee";
|
||||
//header("Location:signup.php?r=noUser");
|
||||
} elseif (!preg_match('/^[a-zA-Z0-9_]+$/', trim($_POST["username"]))) {
|
||||
// Username entered contains ilegal characters
|
||||
$error = "Very sus. Username can only contain letters, numbers, and underscores";
|
||||
//header("Location:signup.php?r=username");
|
||||
} else {
|
||||
// Prepare sql for sus
|
||||
$sql = "SELECT id FROM users WHERE username = ?";
|
||||
|
@ -40,7 +38,6 @@
|
|||
if (mysqli_stmt_num_rows($stmt) == 1) {
|
||||
// Username not entered
|
||||
$error = "Oopsie, username taken :c";
|
||||
//header("Location:signup.php?r=userTake");
|
||||
} else {
|
||||
$username = trim($_POST["username"]);
|
||||
}
|
||||
|
@ -56,11 +53,9 @@
|
|||
if (empty(trim($_POST["password"]))) {
|
||||
// No password entered
|
||||
$error = "Bruh, enter a password";
|
||||
//header("Location:signup.php?r=noPassword");
|
||||
} elseif(strlen(trim($_POST["password"])) < 6){
|
||||
// Password not long enough 👀
|
||||
$error = "(Password) Not long enough 👀";
|
||||
//header("Location:signup.php?r=passwordShort");
|
||||
} else {
|
||||
$password = trim($_POST["password"]);
|
||||
}
|
||||
|
@ -69,13 +64,11 @@
|
|||
if (empty(trim($_POST["confirm_password"]))) {
|
||||
// Did not confirm passowrd
|
||||
$error = "You must confirm password!!!!!";
|
||||
//header("Location:signup.php?r=noConfirm");
|
||||
} else {
|
||||
$confirm_password = trim($_POST["confirm_password"]);
|
||||
if (empty($error) && $confirm_password != $password) {
|
||||
// Password and re-entered Password does not match
|
||||
$error = "Passwords need to be the same, smelly smelly";
|
||||
//header("Location:signup.php?r=notSame");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -119,7 +112,7 @@
|
|||
<input class="btn alert-default space-bottom" type="password" name="password" placeholder="Password">
|
||||
<input class="btn alert-default space-bottom-large" type="password" name="confirm_password" placeholder="Re-enter Password">
|
||||
<input class="btn alert-default space-bottom-large" type="text" name="invite_code" placeholder="Invite Code">
|
||||
<button class="btn alert-high" type="submit" name="signup"><img class="svg" src="assets/icons/sign-in.svg">Sign Up</button>
|
||||
<button class="btn alert-high" type="submit" name="signup"><img class="svg" src="../assets/icons/sign-in.svg">Sign Up</button>
|
||||
<?php
|
||||
if (isset($error)) {
|
||||
echo "<p class='alert alert-low space-top'>".$error."</p>";
|
||||
|
@ -132,8 +125,8 @@
|
|||
</div>
|
||||
|
||||
<?php
|
||||
include("ui/top.html");
|
||||
include("ui/footer.html");
|
||||
include("../ui/top.html");
|
||||
include("../ui/footer.php");
|
||||
?>
|
||||
</body>
|
||||
</html>
|
2
edit.php
2
edit.php
|
@ -72,7 +72,7 @@
|
|||
|
||||
<?php
|
||||
include("ui/top.html");
|
||||
include("ui/footer.html");
|
||||
include("ui/footer.php");
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
}
|
||||
|
||||
// Check if ID of image in URL
|
||||
if (!isset($_GET['id'])) {
|
||||
if (empty($_GET['id'])) {
|
||||
// No ID toast
|
||||
echo "<p class='alert alert-low space-bottom-large'>No ID present</p>";
|
||||
|
||||
|
@ -147,7 +147,7 @@
|
|||
|
||||
<?php
|
||||
include("ui/top.html");
|
||||
include("ui/footer.html");
|
||||
include("ui/footer.php");
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -64,7 +64,7 @@
|
|||
|
||||
<?php
|
||||
include("ui/top.html");
|
||||
include("ui/footer.html");
|
||||
include("ui/footer.php");
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<footer class="footer-root flex-left around">
|
||||
<div class="footer-child center flex-down">
|
||||
<h3>Contact me</h3>
|
||||
<a href="https://t.me/Fluffy_Bean"><img class='svg' src='assets/icons/telegram-logo.svg'>Telegram</a>
|
||||
<a href="https://twitter.com/fluffybeanUwU"><img class='svg' src='assets/icons/twitter-logo.svg'>Twitter</a>
|
||||
<a href="https://github.com/Fluffy-Bean"><img class='svg' src='assets/icons/github-logo.svg'>GitHub</a>
|
||||
<a href="https://t.me/Fluffy_Bean"><img class='svg' src='<?php echo $dir; ?>telegram-logo.svg'>Telegram</a>
|
||||
<a href="https://twitter.com/fluffybeanUwU"><img class='svg' src='<?php echo $dir; ?>twitter-logo.svg'>Twitter</a>
|
||||
<a href="https://github.com/Fluffy-Bean"><img class='svg' src='<?php echo $dir; ?>github-logo.svg'>GitHub</a>
|
||||
</div>
|
||||
<div class="footer-child center flex-down">
|
||||
<h3>Information</h3>
|
|
@ -1,19 +1,28 @@
|
|||
<?php session_start(); ?>
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
if (is_dir("assets/icons/")) {
|
||||
$dir = "assets/icons/";
|
||||
} else {
|
||||
$dir = "../assets/icons/";
|
||||
}
|
||||
?>
|
||||
|
||||
<nav class="nav-root flex-left between">
|
||||
<div class="nav-name flex-left">
|
||||
<h3>Fluffys Amazing Gallery!</h3>
|
||||
</div>
|
||||
<div class="nav-links flex-left">
|
||||
<a class="btn alert-default" href="https://superdupersecteteuploadtest.fluffybean.gay"><img class="svg" src="assets/icons/house.svg"><span class="nav-hide">Home</span></a>
|
||||
<hr>
|
||||
<?php
|
||||
echo "<a class='btn alert-default' href='https://superdupersecteteuploadtest.fluffybean.gay'><img class='svg' src='".$dir."house.svg'><span class='nav-hide'>Home</span></a>";
|
||||
echo "<hr>";
|
||||
|
||||
if (isset($_SESSION["username"])) {
|
||||
echo "<a class='btn alert-default' href='https://superdupersecteteuploadtest.fluffybean.gay/upload.php'><img class='svg' src='assets/icons/upload.svg'><span class='nav-hide'>Upload</span></a>";
|
||||
echo "<a class='btn alert-default' href='https://superdupersecteteuploadtest.fluffybean.gay/upload.php'><img class='svg' src='".$dir."upload.svg'><span class='nav-hide'>Upload</span></a>";
|
||||
echo "<hr>";
|
||||
echo "<a class='btn alert-default' href='https://superdupersecteteuploadtest.fluffybean.gay/account.php'><img class='svg' src='assets/icons/user-circle.svg'><span class='nav-hide'>".$_SESSION["username"]."</span></a>";
|
||||
echo "<a class='btn alert-default' href='https://superdupersecteteuploadtest.fluffybean.gay/account/account.php'><img class='svg' src='".$dir."user-circle.svg'><span class='nav-hide'>".$_SESSION["username"]."</span></a>";
|
||||
} else {
|
||||
echo "<a class='btn alert-default' href='https://superdupersecteteuploadtest.fluffybean.gay/login.php'><img class='svg' src='assets/icons/user-circle-plus.svg'><span class='nav-hide'>Login</span></a>";
|
||||
echo "<a class='btn alert-default' href='https://superdupersecteteuploadtest.fluffybean.gay/account/login.php'><img class='svg' src='".$dir."user-circle-plus.svg'><span class='nav-hide'>Login</span></a>";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
|
|
@ -93,7 +93,7 @@
|
|||
|
||||
<?php
|
||||
include("ui/top.html");
|
||||
include("ui/footer.html");
|
||||
include("ui/footer.php");
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Reference in a new issue