Fixed error when trying to view an account when not signed into one yourself
Added login/create account buttons if you're viewing an account and want to make your own
This commit is contained in:
parent
89d49325cb
commit
6df3b6cfa7
@ -69,10 +69,12 @@ try { // Try opening the SQL database connection
|
||||
<body>
|
||||
<div id="accountDetailsTitlePanel">
|
||||
<?php
|
||||
if (mb_strtolower($username) == mb_strtolower($_SESSION["username"])) {
|
||||
echo "<h2 id=\"adminHeader\">My Account</h2>";
|
||||
} else {
|
||||
echo "<h2 id=\"adminHeader\">$username's Account</h2>";
|
||||
if (isset($_SESSION["userID"])) {
|
||||
if (mb_strtolower($username) == mb_strtolower($_SESSION["username"])) {
|
||||
echo "<h2 id=\"adminHeader\">My Account</h2>";
|
||||
} else {
|
||||
echo "<h2 id=\"adminHeader\">$username's Account</h2>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
@ -103,36 +105,38 @@ try { // Try opening the SQL database connection
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
if (mb_strtolower($username) == mb_strtolower($_SESSION["username"])) {
|
||||
echo ("
|
||||
<div id=\"accountSocialsPanel\">
|
||||
<h3>Edit</h3>
|
||||
<p class=\"newLine\"></p>
|
||||
<div class=\"accountDetailsLeftSide\">
|
||||
<p>Twitch (name):</p>
|
||||
<p>YouTube (name):</p>
|
||||
<p>YouTube (link):</p>
|
||||
<p>Discord (name):</p>
|
||||
<p>Discord (UserID):</p>
|
||||
<p> </p>
|
||||
<p><a href=\"/admin/user_management/change_password.php\" id=\"changePasswordButton\" style=\"text-align:center;\" class=\"disabled\">Change Password</a></p>
|
||||
<p>(coming soon!)</p>
|
||||
</div>
|
||||
<div class=\"accountDetailsRightSide\">
|
||||
<form id=\"editUserDetails\" action=\"/admin/user_management/edit_user.php\" method=\"post\">
|
||||
<p><input type=\"text\" placeholder=\"" . $userDetails["twitch"] . "\" id=\"twitch\" name=\"twitch\"></p>
|
||||
<p><input type=\"text\" placeholder=\"" . $userDetails["youtube"] . "\" id=\"youtube\" name=\"youtube\"></p>
|
||||
<p><input type=\"text\" placeholder=\"" . $userDetails["youtubeLink"] . "\" id=\"youtubeLink\" name=\"youtubeLink\"></p>
|
||||
<p><input type=\"text\" placeholder=\"" . $userDetails["discord"] . "\" id=\"discord\" name=\"discord\"></p>
|
||||
<p><input type=\"text\" placeholder=\"" . $userDetails["discordLink"] . "\" id=\"discordLink\" name=\"discordLink\"></p>
|
||||
if (isset($_SESSION["userID"])) {
|
||||
if (mb_strtolower($username) == mb_strtolower($_SESSION["username"])) {
|
||||
echo ("
|
||||
<div id=\"accountSocialsPanel\">
|
||||
<h3>Edit</h3>
|
||||
<p class=\"newLine\"></p>
|
||||
<div class=\"accountDetailsLeftSide\">
|
||||
<p>Twitch (name):</p>
|
||||
<p>YouTube (name):</p>
|
||||
<p>YouTube (link):</p>
|
||||
<p>Discord (name):</p>
|
||||
<p>Discord (UserID):</p>
|
||||
<p> </p>
|
||||
<div class=\"accountUpdateButton\">
|
||||
<input type=\"submit\" id=\"submitButton\" value=\"Update\">
|
||||
</div>
|
||||
</form>
|
||||
<p><a href=\"/admin/user_management/change_password.php\" id=\"changePasswordButton\" style=\"text-align:center;\" class=\"disabled\">Change Password</a></p>
|
||||
<p>(coming soon!)</p>
|
||||
</div>
|
||||
<div class=\"accountDetailsRightSide\">
|
||||
<form id=\"editUserDetails\" action=\"/admin/user_management/edit_user.php\" method=\"post\">
|
||||
<p><input type=\"text\" placeholder=\"" . $userDetails["twitch"] . "\" id=\"twitch\" name=\"twitch\"></p>
|
||||
<p><input type=\"text\" placeholder=\"" . $userDetails["youtube"] . "\" id=\"youtube\" name=\"youtube\"></p>
|
||||
<p><input type=\"text\" placeholder=\"" . $userDetails["youtubeLink"] . "\" id=\"youtubeLink\" name=\"youtubeLink\"></p>
|
||||
<p><input type=\"text\" placeholder=\"" . $userDetails["discord"] . "\" id=\"discord\" name=\"discord\"></p>
|
||||
<p><input type=\"text\" placeholder=\"" . $userDetails["discordLink"] . "\" id=\"discordLink\" name=\"discordLink\"></p>
|
||||
<p> </p>
|
||||
<div class=\"accountUpdateButton\">
|
||||
<input type=\"submit\" id=\"submitButton\" value=\"Update\">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
");
|
||||
");
|
||||
}
|
||||
} else {
|
||||
echo ("
|
||||
<div id=\"accountSocialsPanel\">
|
||||
|
@ -22,7 +22,6 @@ try { // Try opening the SQL database connection
|
||||
if (isset($results)) {
|
||||
if (mb_strtolower($_GET["username"]) != mb_strtolower($results["username"])) {
|
||||
$userExists = false;
|
||||
echo "NO USER";
|
||||
} else {
|
||||
$userExists = true;
|
||||
}
|
||||
@ -73,7 +72,7 @@ try { // Try opening the SQL database connection
|
||||
echo "<h2>USER NOT FOUND!</h2>";
|
||||
echo "<p>This person may have played some games with us, but hasn't registered an account yet.</p>";
|
||||
echo "<p>Please check back later!</p>";
|
||||
echo "<p></p>";
|
||||
echo "<p> </p>";
|
||||
echo "</div>";
|
||||
}
|
||||
?>
|
||||
@ -98,6 +97,9 @@ try { // Try opening the SQL database connection
|
||||
// If someone is logged in, give them the opportunity to log out
|
||||
if (isset($_SESSION["userID"])){
|
||||
echo "<a href=\"../logout.php?redirect=\" class=\"subNavLink\" id=\"loginButton\">LOGOUT</a>";
|
||||
} else {
|
||||
echo "<a href=\"/login_page.php \" target=\"dataFrame\" class=\"subNavLink\">SIGN IN</a>";
|
||||
echo "<a href=\"/create_account.php \" target=\"dataFrame\" class=\"subNavLink\">CREATE AN ACCOUNT</a>";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user