Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > TBDev
Reply
  #1  
Old 10th September 2019, 13:04
bizzarre13 bizzarre13 is offline
Member
 
Join Date: Apr 2013
P2P
Posts: 10
Default login/signup
How come users that are already logged in, can access these pages?
How can i redirect already logged in users if they try to access these pages?
login script:
Code:
<?
require_once("include/bittorrent.php");
dbconn();

unset($returnto);
if (!empty($_GET["returnto"])) {
	$returnto = $_GET["returnto"];
	if (!$_GET["nowarn"]) {

	}
}

?>
<title>.:: Login ::. </title> 
<style type="text/css">
<!--
.error {color:#A80000}
a, a:visited { color: #ffffff; text-decoration: none; }
a:hover { color: #FFF; text-decoration: none; }
body {
	background: #333;
	font-size:11px;
	font-family: Tahoma, Arial, sans-serif;
	color: #333333;
	margin: 0;
	padding: 0;
	margin-top: 0px;
margin-bottom: 0px;
background: url('/pic/login/loginbg.png');
background-position: center;
background-size: cover;
background-repeat: no-repeat;
background-attachment: fixed;
	
	background-color:#000000;

}
#layer03_holder {
margin-top: 150px;
margin-bottom: 0px;
padding-left: 0px;
padding-right: 0px;


}
#layer03_2 {
margin-top: 230px;
margin-bottom: 0px;
padding-left: 0px;
padding-right: 0px;

}
#wrapper {width:100%; border: none; text-align: center; margin:20px auto 0 auto; }
#main { text-align:left;padding:15px }
#header { margin: auto; width: 162px; height: 150px; margin-bottom: 5px; background-image: url('/pic/header2.jpg'); }
#footer { }
input.text { 
background: transparent;
border: #000000 0px solid;

}
}

u { text-decoration: none; color: #7bccff; }
.style4 {color: #CCCCCC}
.style9 {color: #FFFFFF}
.style20 {
	font-size: 9px;
	font-weight: bold;
}
.style21 {font-size: 10px}
.style22 {font-size: 12px}
.style23 {font-size: 12px; color: #FFFFFF; }
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /></head><body>

<form method="post" action="takelogin.php">

  <div id="layer03_holder" align="center">
    
    <table width="400"  height="400" background="pic/login/login.box.png" border="0">
      <tr>
        <td>

          <center id="layer03_2">
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
              <input class="text" size="25" name="username" type="text">   
            </p>
            <p>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input class="text" size="25" name="password" type="password">            
            <p>
            <table  border="0">
              <tr>
                <td height="41">
                  <span class="style9"><span class="style20"><span class="style21"><span class="style22"><a href="signup.php">Signup</a></span></span></span></span> <span class="style23">| <strong><a href="recover.php">Recover</a></strong></span><span class="style9">&nbsp;&nbsp;&nbsp;&nbsp;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input src="pic/login/login.png" class="submit" value="Log in!" border="0" type="image"></td>
              </tr>
            </table>
          </center>

		</td>
      </tr>
    </table>
  </div>
    <p class="style4">&nbsp;</p>
 
    </table>

</div>
</form></body></html>
<?

if (isset($returnto))
	print("<input type=\"hidden\" name=\"returnto\" value=\"" . htmlspecialchars($returnto) . "\" />\n");



?>
Reply With Quote
  #2  
Old 10th September 2019, 14:07
fireknight's Avatar
fireknight fireknight is offline
Administrator
 
Join Date: Aug 2010
Australia
Posts: 173
Default
Simple answer is because they can access the login page ( even when logged in ).


Why == because there is nothing to stop them accessing the page.

You need something to redirect them away from that page.
Not knowing what TBDev version you are using - this is off the top of my head and un tested.


login.php


Find
Code:
require_once("include/bittorrent.php");
dbconn();
Add this below
Code:
if ($CURUSER)
{
    header("Location: index.php");

    exit;
}

Hope this helps.
Reply With Quote
  #3  
Old 10th September 2019, 16:46
bizzarre13 bizzarre13 is offline
Member
 
Join Date: Apr 2013
P2P
Posts: 10
Default
it works like a charm, thank you!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +2. The time now is 00:19. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.