Lasso Soft Inc. > Home

[ldap_validuser]

Linkldap_validuser
AuthorJason Huck
CategoryLDAP
Version8.5.x
Licensehttp://opensource.org/licenses/artistic-license.php
Posted05 Oct 2006
Updated05 Oct 2006
More by this author...

Description

A shortcut for basic validation via LDAP.

Sample Usage

var('isValid') = ldap_validuser(
    -host='0.0.0.0',
    -username='foo',
    -password='bar'
);

if($isValid);
    // do something
else;
    // do something else
/if;

Source Code

Click the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.

define_tag(
	'validuser',
	-namespace='ldap_',
	-req='host',
	-req='username',
	-req='password',
	-priority='replace',
	-description='Returns true if the given account authenticates against the given host.'
);
	local('ldap') = ldap;
	#ldap->open(#host);

	protect;	
		#ldap->authenticate(#username,#password);	
		local('valid' = true);
		
		handle_error;
			local('valid' = false);	
		/handle_error;
	/protect;

	#ldap->close;
	
	return(#valid);
/define_tag;

Comments

No comments

Please log in to comment

Subscribe to the LassoTalk mail list

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft