Active Directory/Search for a user: Difference between revisions
Content added Content deleted
Line 25: | Line 25: | ||
ldap_msgfree(*result); /* free messages */ |
ldap_msgfree(*result); /* free messages */ |
||
ldap_unbind(ld); /* disconnect */</lang> |
ldap_unbind(ld); /* disconnect */</lang> |
||
=={{header|Eiffel}}== |
|||
<lang Eiffel> |
|||
feature -- Validation |
|||
is_user_credential_valid (a_domain, a_username, a_password: READABLE_STRING_GENERAL): BOOLEAN |
|||
-- Is the pair `a_username'/`a_password' a valid credential in `a_domain'? |
|||
local |
|||
l_domain, l_username, l_password: WEL_STRING |
|||
do |
|||
create l_domain.make (a_domain) |
|||
create l_username.make (a_username) |
|||
create l_password.make (a_password) |
|||
Result := cwel_is_credential_valid (l_domain.item, l_username.item, l_password.item) |
|||
end |
|||
</lang> |
|||
Because Active Directory is a Windows OS facility, in Eiffel we must use the WEL (Windows Eiffel Library) components. Thus, the code above is not cross-platform. Moreover, the call to `cwel_is_credential_valid' is shown below: |
|||
<lang Eiffel> |
|||
cwel_is_credential_valid (a_domain, a_username, a_password: POINTER): BOOLEAN |
|||
external |
|||
"C inline use %"wel_user_validation.h%"" |
|||
alias |
|||
"return cwel_is_credential_valid ((LPTSTR) $a_domain, (LPTSTR) $a_username, (LPTSTR) $a_password);" |
|||
end |
|||
</lang> |
|||
=={{header|Java}}== |
=={{header|Java}}== |