TechMonkey Posted May 22, 2014 Posted May 22, 2014 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?
zag Posted May 22, 2014 Posted May 22, 2014 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> 1
SovietRussia Posted May 22, 2014 Posted May 22, 2014 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) 1
TechMonkey Posted May 22, 2014 Author Posted May 22, 2014 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. Best of both worlds.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now