Jump to content

Is the current logged in Admin username available as a variable?


cwispy

Recommended Posts

Hi,

 

I looked through the docs, but I did not see any reference for the currently logged in admin's username. I was wondering if this is already available in a var from the server create functions, or will I need to query the database for the username?

 

Thanks

 

cwispy

Link to comment
Share on other sites

Thanks for the reply Kian. I am wanting to use it in the server module create function to pass to ISPConfig added by field. I thought I may have to do an extra sql lookup to get the username, but thought I would ask in case I had missed seeing the admin's name in a var somewhere.

Link to comment
Share on other sites

if the server module create function run by logged-in administrator this variable can be found in $_SESSION,

$_SESSION['adminid']
[php]

you can use the following query to get Admin Username:
[php]
$getAdminUsername = full_query("SELECT `username` FROM `tbladmins` WHERE `id`='{$_SESSION['adminid']}'");
$getAdminUsername = mysql_fetch_assoc($getAdminUsername);

echo $getAdminUsername['username']; // Admin Username

Link to comment
Share on other sites

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.   Paste as plain text instead

  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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated