Jump to content

Recommended Posts

Posted

Hello,

I'm creating a module where I would like a logged in pilot to view ONLY their info.

I have based the module on the Roster module that has been referenced in the forums and tutorials (It's basically a copy of the Roster module showing extra columns that I added for different bank accounts).

Is there a variable that returns the users id, like '$whoami' or '$myid'? Something that returns who is accessing the page so they only see their information.

Thanks,

raptor

EDIT: I found that this works after much trial and error:

$query = "SELECT * FROM ".TABLE_PREFIX."pilots WHERE pilotid = ".Auth::$userinfo->pilotid."";

  • Administrators
Posted

If the pilot is logged in you should be able to use the existing user info from the Auth class. The code below should give you a raw dump of what information is available to you in that variable.

<?php
var_dump(Auth::$userinfo);
?>

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...