chrismitchell Posted August 9, 2011 Share Posted August 9, 2011 Hi everyone, I'm hoping someone can let me know why this is happening.. I have used the Uploader V6.1 script to make a secure upload site for a client. Now it works perfectly apart from one thing. If you are already logged in and you return to the main domain it shows both the main homepage and the page for people logged in. I've been looking at this code for far too long I think.. I was wondering if someone could have a look see and let me know if there is something i've missed? <?php if ( !isset ( $page_title ) ) $page_title = 'Welcome the Justupload'; if ( !isset ( $content ) ) $content = 'No content specified.'; // check for unread messages $has_unread = false; if ( $UPL['USER']['logged_in'] ) { $messages =& $UPL['USER']['messages']; reset ( $messages ); while ( list ( $i, $message ) = each ( $messages ) ) { if ( !$message['read'] ) $has_unread = true; } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <meta http-equiv="Content-type" content="text/html; charset=iso-8859-1" /> <title>Welcome to Justupload</title> <link rel="stylesheet" type="text/css" href="templates/default2/style.css" media="all"> <script type="text/javascript" src="templates/default2/javascript.js"></script> </head> <body class="bg" onunload="window.open('account.php?action=logout');" > <div class="redbartop"></div> <noscript> <p style="text-align:center;font-size:1.2em;color:red;font-weight:bold;">Please enable Javascript to properly access this service.</p> </noscript> <br/> <div id="container1"> <a href="http://www.justupload.co.uk/account.php?action=logout"><img id="logo" src="http://www.justupload.co.uk/images/justdigitallogo.png" /></a> <?php /* If user is logged in, show this menu */ if ( $UPL['USER']['logged_in'] ) : ?> <div id="container"> <div id="container2"> <?php /* If user is logged in, show this menu */ if ( $UPL['USER']['logged_in'] ) : ?> <div id="top"> Welcome <span style="color:#E51B24;"><?=$UPL['USER']['name']?>!</span> <a href="account.php?action=logout" onclick="return confirm('Confirm logout?');">Please logout you are when finished</a>. </div> <div id="menu"> <div id="menu_links"> <div style="float:left;"> <?php /* If user is logged in, show this menu */ if ( $UPL['USER']['logged_in'] ) : ?> <a href="myfiles.php">My Files</a> <a href="upload.php">Upload</a> <?php /* Otherwise, show this menu instead */ else: ?> <a href="account.php?action=login">Login</a> <a href="account.php?action=register">Register</a> <?php endif; ?> </div> <?php /* If user is logged in, show this menu */ if ( $UPL['USER']['logged_in'] ) : ?> <div style="float:right;"> <a href="usercp.php">User Control Panel</a> <a href="account.php?action=logout" onclick="return confirm('Confirm logout?');">Logout</a> </div> <?php endif;?> </div> </div> <?php /* Otherwise, show this menu instead */ else: ?> <?php endif; ?> <div id="message"> <div style="float:left;width:98%;" id="message_content"><!-- --></div> <div style="float:right;width:10px;text-align:right;"><img src="templates/default2/images/close.gif" alt="" onclick="showIt('message',false);" style="cursor:pointer;" /></div> <div class="spacer"><!-- --></div> </div> <div id="content"> <?=$content?> </div> </div> </div> </div> <?php /* Otherwise, show this menu instead */ else: ?> <div id="container3"> <div id="content"> <?=$content?> </div> </div> <?php endif; ?> <div id="credit"> <?php /* If user is logged in, show this menu */ if ( $UPL['USER']['logged_in'] ) : ?> <p style="color:#fff;font-size:18px;">browser based - no software - no hassle</p> <?php /* Otherwise, show this menu instead */ else: ?> <img src="http://www.justupload.co.uk/test/templates/default2/images/Icon.png"/> <?php endif; ?> <br/> <a style="color:#fff;fontsize:9px;text-align:center;font-weight:normal;" href="http://www.nemodesigns.com/webdesign.html">Pixels by Nemo Designs</a><br/> <?php /* Show this link if user is a mod or admin */ if ( $UPL['USER']['level'] >= LEVEL_MODERATOR ) : ?> <br /> <a href="admin.php">Go to Admin section</a> <?php endif; ?> </div> <!-- post processing --> <?php /* Show message if there are unread messages */ if ( $has_unread ) : ?> <script type="text/javascript"> help ( 'You have a new message. <a href="usercp.php?action=pm" class="special">Click here</a> to view your messages.' ); </script> <?php endif; ?> </body> </html> What i would love to do is either force the user to go to a different location if they are logged in and they go to the main url or to log them off when they close the window or something like that.. i've tried all number of things and nothing seems to work.. I'm hoping that someone on here has had similar problems with this and knows of a solution Thanks everyone Chris Quote Link to comment Share on other sites More sharing options...
chrismitchell Posted August 10, 2011 Author Share Posted August 10, 2011 This is now resolved.. it needed a php redirect in the index.php to force it to another page if the user was logged on Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.