Jump to content

Recommended Posts

Posted

Ok, I've been banging my head against user authentication and PHP for 2 days trying to get the username to check they should have access to the page or system they are on. I think I've got the backend all sorted (samba, winbind etc) & I've got the adLdap scripts and that all just about works, it is just the coding that is now causing me grief, getting the remote user variable.

 

& then the thought came to me, should I just run up a new Server 2012 R2 instance and WAMP it up, transfer the current apps over and just use IIS and standard permissions?

 

Thoughts?

Posted

Do you have the username in a variable already?

 

It should be easy once you have that, just include it at the top of the page in the header file, something like this

 

IF (($user->data['user_id'] == ANONYMOUS))
	{
	    echo "</pre><li>/images/icons/user.png Login | Reg?</li>";<br>	} ELSE <br>	{ <br>	    echo "<li>/images/icons/user.png ".$user->data['username_clean']."</li>";<br>

  • Thanks 1
Posted
Or just use IIS with Windows Authentication, the variable of the username is then $_SERVER['AUTHENTICATED_USER'] (Which is actually domain\user - and then you can use explode to split it in an array and then just use the username)
  • Thanks 1
Posted
Ta all. I had a brilliant idea over lunch. I can be really decadent and have both. An Apache server on 2012R2 for internal apps that need SSO and a LAMP server for external apps that include their own auth systems. :D Best of both worlds.

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...