Page 1 of 1

i just wanna know if someone is logged in LOL

Posted: Sat Oct 27, 2007 11:50 pm
by gtron
I have a pretty complex page that runs a lot of unix apps back-end style and i need someone to be a member of the site to be able to use this tool. i'm using a wrapper which i dont care for iframes as it is but that's besides the point. i have to laugh lol because i've spent the better half of a day on this and it seems like it should be so simple. anyway, here's what i got (try to laugh with me and not at me)....

Code: Select all

define( '_VALID_MOS', 1 );
require( '/home/xxxxxxx/public_html/globals.php' );
include ('/home/xxxxxx/public_html/includes/joomla.php' );
global $mainframe, $my ;
?>
<HTML><HEAD>
<?php
if ($my->id) {

*FUN CODE GOES HERE

}
else{
echo "<p><font color=red>You must login to use the auditor.</font></p>";}



any help at all will get ya a durb... j/k ;)

oh yea... 1.0.13

Re: i just wanna know if someone is logged in LOL

Posted: Fri Nov 02, 2007 2:26 pm
by TheVigilante
I think you should check the $user->guest variable which is 0 if the user is logged in I believe. In Joomla 1.5 I do:

$user = & JFactory::getUser();
if($user->guest)
{

}

Re: i just wanna know if someone is logged in LOL

Posted: Sat Nov 10, 2007 8:55 am
by dattard
Your code looks ok. The $my->id is the way to determine whether someone is logged on as far as i know.