Jump to content
EduGeek EdSec 2026 is Go! 27th Oct in Derby! Join us for a day of EdTech security focused talks, networking, and an evening social ×

Recommended Posts

Posted (edited)

Not without knowing specifically which VLE you're using... but generally, find out the variable that holds the username, and echo it...

 

eg: For Moodle1/2

echo $USER->username;

Edited by Marci
Posted
That one should only work for VLEs running ntlm authentication via mod_ntlm or similar... like I said, it's specific to the VLE and how it's hosted as to how you can access it's variables. Without more detailed info, we're all just plucking feathers from our asses.
Posted
That one should only work for VLEs running ntlm authentication via mod_ntlm or similar... like I said, it's specific to the VLE and how it's hosted as to how you can access it's variables. Without more detailed info, we're all just plucking feathers from our asses.

 

 

 

hi there all i get is echo $USER->username;

 

displaying in ie.

Posted
Not without knowing specifically which VLE you're using...

like I said, it's specific to the VLE and how it's hosted as to how you can access it's variables. Without more detailed info, we're all just plucking feathers from our asses.

 

Which VLE are you using?

Posted

Moodle 1.9 should display logged in user in top right corner of every page by default.

In which moodle file are you inserting the code?

Posted
we are trying to get SSO working on moodle 1.9, and it seems to be failing, we are trying to test that ie is pulling the username from the machine correctly so that we can elminate that as the issuse.
Posted (edited)
In which moodle file are you inserting the code?

As per my above post...

 

but if SSO is failing, there wont' be a "logged in user" for Moodle to display, as the user hasn't logged in, cos it's failed, so it won't display anything inside Moodle.

 

SSO is NTLM, so therefore vikpaw's code above should work. Put

echo $_SERVER['LOGON_USER'];
?> 

in a file called test.php, upload it to somewhere on your website, visit it in a browser. If NTLM is picking up the user correctly it'll display the username on screen, which means it's failing because your Moodle config is incorrect. If however it DOESN'T display a name on screen, NTLM isn't working correctly and your web browser isn't able to retrieve the username from Windows.

Edited by Marci
Posted

Which is what the instructions in my post above are telling you how to do:

 

SSO is NTLM, so therefore vikpaw's code above should work. Put
echo $_SERVER['LOGON_USER'];
?> 

in a file called test.php, upload it to somewhere on your website, visit it in a browser. If NTLM is picking up the user correctly it'll display the username on screen, which means it's failing because your Moodle config is incorrect. If however it DOESN'T display a name on screen, NTLM isn't working correctly and your web browser isn't able to retrieve the username from Windows.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...