“.$user.” “.$pswd.”“;
$ch = curl_init();
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$params);
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
$result=curl_exec ($ch);
curl_close ($ch);

if(strpos($result,’false’) == false){
$authResponse = new SimpleXMLElement($result);

if($authResponse->authenticated==”true”){
$custId = $authResponse->customer->{‘cust-id’};
$loginSerNo = $authResponse->session->{‘login-serno’}
;
$sessionID = $authResponse->session->{
‘session-id’}
;
$breadcrumb = $authResponse->session->{
‘breadcrumb-session-id’}
;
$_SESSION[“roles”]=””;
for($k=0; $ksession->roles->role); $k++) {
$_SESSION[“roles”].= $authResponse->session->roles->role[$k].”,”;
}
setcookie(“ssisid”, $sessionID, time() + 3600, ‘/’, ‘cmss.org’);
setcookie(“ssalogin”, “yes”,time() + 3600, ‘/’, ‘cmss.org’);
setcookie(“p_cust_id”, $custId,time() + 3600, ‘/’, ‘cmss.org’);
setcookie(“login_serno”, $loginSerNo,time() + 3600, ‘/’, ‘cmss.org’);
setcookie(“BREADCRUMB_SESSION_ID”, $breadcrumb,time() + 3600, ‘/’, ‘cmss.org’);

$_SESSION[‘authenticated’]=true;
if($_SESSION[‘fwd’]!=””)
{
$redirectUrl = str_replace(‘p_cust_id%3D1245378′,’p_cust_id=’.$custId,$_SESSION[‘fwd’]);
$_SESSION[‘fwd’]=”;
echo(““);
//header(‘Location:’.$redirectUrl);
}
else{
header(‘Location: /members-only’);
}
exit;
} else {
$_SESSION[‘failureMsg’] = $authResponse->{
‘authentication-message’}
;
setcookie (“ssisid”, “”, time() – 3600, ‘/’, ‘cmss.org’);
setcookie(“ssalogin”, “”,time() – 3600, ‘/’, ‘cmss.org’);
setcookie(“p_cust_id”, “”,time() – 3600, ‘/’, ‘cmss.org’);
}
} else {
$_SESSION[‘failureMsg’] = “Invalid username or password”;
setcookie (“ssisid”, “”, time() – 3600, ‘/’, ‘cmss.org’);
setcookie(“ssalogin”, “”,time() – 3600, ‘/’, ‘cmss.org’);
setcookie(“p_cust_id”, “”,time() – 3600, ‘/’, ‘cmss.org’);
}
}
if ($_REQUEST[‘getemployerinfo’]==”1″){
if (isset($_COOKIE[‘p_cust_id’])){
$url = ‘https://ams.cmss.org/cmsschrein/CENEMPWEBSVCLIB.GET_EMPLOYERS_XML’;
$params = “p_input_xml_doc=“.$user.”

“.$pswd.”“;
$ch = curl_init();
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$params);
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
$employmentResult=curl_exec ($ch);
curl_close ($ch);
$empResponse = new SimpleXMLElement($employmentResult);
foreach ($empResponse->employment as $employment) {
echo($employment->{
’employer-name’}
);
}
}
} else
if ($_REQUEST[‘geteeventinfo’]==”1”){
if (isset($_COOKIE[‘p_cust_id’])){
$url = ‘https://ams.cmss.org/cmsschrein/EVTSSAWEBSVCLIB.GET_EVENTREG_INFO_XML’;
$params = “p_input_xml_doc=“.$user.”

“.$pswd.”
“;
$user_agent = “Mozilla/5.0 (compatible; MSIE 5.01; Windows NT 5.0)”;
$ch = curl_init();
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$params);
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
$evtResult=curl_exec ($ch);
curl_close ($ch);
$evtResponse= new SimpleXMLElement($evtResult);
foreach ($evtResponse->registration as $registration ) {
echo($registration ->{
‘registration-name’}
);
}
}
} else
if (isset($_COOKIE[‘p_cust_id’]) && $_SESSION[‘authenticated’] && !$_SESSION[‘forcelogout’]){
?>





echo “Invalid username or password.
“;
}
?>

User Name:

Password: