This topic is locked

Single signon

4/21/2008 6:38:56 AM
PHPRunner General questions
K
kklh author

Hi
When i am trying the code for Single sign on i get this error .
Parse error: syntax error, unexpected T_STRING, expecting '(' in C:\EasyPHP\www\inventar\include\events.php on line 91
The code is:
// Put your code here.

echo "Your message";
//** Custom code ****

// put your custom code here
if Request.ServerVariables("LOGON_USER")<>"" then

SESSION("UserID") = Request.ServerVariables("LOGON_USER")

SESSION("AccessLevel") = ACCESS_LEVEL_USER

Response.Redirect "Menu.asp"

end if
Tried the code both in loginonload and before process
reg. Kim.

Alexey admin 4/21/2008

Kim,
I'm afraid Single sign on is not possible with PHP.

The solution you found will work with another our product - ASPRunner

http://www.xlinesoft.com/asprunner/

S
spintz 4/21/2008

ASPRunner is not required for SSO use.
Try
$_SERVER['LOGON_USER']
instead of
Request.ServerVariables("LOGON_USER")
And if that doesn't work, do a print_r( $_SERVER ), and look for the SSO "username" key,value pair. A better print_r (easier to read) would be -
echo nl2br( print_r( $_SERVER, true ) );
If you can't find it with this, let me know. I already have PHPRunner working with SSO and can help you more. Stick with PHP, ASP is evil!

K
kklh author 4/22/2008

ASPRunner is not required for SSO use.

Try
$_SERVER['LOGON_USER']
instead of
Request.ServerVariables("LOGON_USER")
And if that doesn't work, do a print_r( $_SERVER ), and look for the SSO "username" key,value pair. A better print_r (easier to read) would be -
echo nl2br( print_r( $_SERVER, true ) );
If you can't find it with this, let me know. I already have PHPRunner working with SSO and can help you more. Stick with PHP, ASP is evil!


Hi Spintz Thankyou .
But it dosnt work when i do the print _r $_SERVER, i dont get a $_server['logon_user'] only the http cookie has a userid and password.
Kim

S
spintz 4/22/2008

Why are you set on finding a LOGON_USER var? The variable I get from our HTTP headers is REMOTE_USER.
You need to talk to the person that setup and configured SSO and find out what data is set in the HTTP headers, or if you can get HTTP Headers rewritten. I did not setup the SSO, but would imagine each program is different and that each program offers different configurations. We are using CA Netegirty.

J
Jane 4/22/2008

Kim,
you've mixed PHP and ASP code.

Try to use this code in the PHPRunner:

if ($_SERVER["LOGON_USER"))

{

$_SESSION["UserID"] = $_SERVER["LOGON_USER");

$_SESSION["AccessLevel"] = ACCESS_LEVEL_USER;

header("Location: menu.php");

exit();

}

K
kklh author 4/22/2008

Kim,

you've mixed PHP and ASP code.

Try to use this code in the PHPRunner:


Hi Jane
Thanks for your help but it dont work.
KIm

J
Jane 4/22/2008

You can check list of all $_SERVER variables in the PHP manual:

http://php.net/manual/en/reserved.variables.php

K
kklh author 4/23/2008

You can check list of all $_SERVER variables in the PHP manual:

http://php.net/manual/en/reserved.variables.php


Hi
It works now, should just use this variable for userid
if ($GLOBALS['UserID'])

{

$_SESSION["UserID"] = ($GLOBALS['UserID']);

$_SESSION["AccessLevel"] = ACCESS_LEVEL_USER;

header("Location: nybrugere_list.php");

exit();

}
regs. KIm.

K
kklh author 4/23/2008



Hi
It works now, should just use this variable for userid
if ($GLOBALS['UserID'])

{

$_SESSION["UserID"] = ($GLOBALS['UserID']);

$_SESSION["AccessLevel"] = ACCESS_LEVEL_USER;

header("Location: nybrugere_list.php");

exit();

}
regs. KIm.


Didnt work anyway.
Kim

S
spintz 4/23/2008

Again, you need to talk to your network/web administrator and find out which SSO system you're using and how it's configured. You need to find out what specific variable is being set in the HTTP Headers. It seems you're just taking shots in the dark at what it should be.