tag. These are *required* ?> eDirectory SOAP Authentication Service Example getProxy(); ### Authenticate the user $auth = $edirectory->remote_auth( $eid, $pass ); ### If a fault occurred (access denied), output error info if ($edirectory->getError()) { ### Give the reason why authentication failed print "Authentication FAILED: " . $edirectory->getError() . "
"; ### Make sure you exit after erroring exit; } ### return value $auth is a hash (associative array). To see it's structure, uncomment this: //print "
"; print_r( $auth ); exit;

    print "Authentication PASSED
"; ### Here is where you'd set your cookie or session variable to maintain a logged-in state ### For this demo, I print out the variables: print "
";
    print "FullName   = '" . $auth['fullname']   . "'
"; print "ShortName = '" . $auth['shortname'] . "'
"; print "FirstName = '" . $auth['firstname'] . "'
"; print "MiddleName = '" . $auth['middlename'] . "'
"; print "LastName = '" . $auth['lastname'] . "'
"; print "NickName = '" . $auth['nickname'] . "'
"; print "Email = '" . $auth['email'] . "'
"; print "District = '" . $auth['district'] . "'
"; print "Division = '" . $auth['division'] . "'
"; print "Flotilla = '" . $auth['flotilla'] . "'
"; ### $auth['offices'] is an array. Cycle through and print them out $i = 0; foreach( $auth['offices'] as $office) print "Office " . $i++ . " = '$office'
"; ### $auth['comps'] is an array. Cycle through and print them out $i = 0; foreach( $auth['comps'] as $comp) print "Comp " . $i++ . " = '$comp'
"; print "\n"; print "Request:\n" . htmlspecialchars( str_replace("><", ">\n<", $edirectory->request ) ) . "\n\n\n"; print "Response:\n" . htmlspecialchars( str_replace("><", ">\n<", $edirectory->response ) ) . "\n\n\n"; print "Debug:\n" . htmlspecialchars( str_replace("><", ">\n<", $soap_client->debug_str ) ) . "\n\n\n"; print "
"; /* Once you have this information (name, email, etc.) you can have some fun: * Display their name on the page, or forum messages, etc. * Make access decisions based on Offices held or District, Division, Flotilla */ } else { ### No form submitted yet, show it ?>

This site uses the same username and password as
the Auxiliary eDirectory

Please Log In
Auxiliary Employee ID
eDirectory Password