Improved parameter checking

This commit is contained in:
Craig Andrews 2009-11-18 12:57:37 -05:00
parent ad627ac451
commit 1d6bacc681
2 changed files with 3 additions and 1 deletions

View File

@ -2,7 +2,7 @@
/**
* StatusNet, the distributed open-source microblogging tool
*
* Superclass for plugins that do authentication and/or authorization
* Superclass for plugins that do authentication
*
* PHP version 5
*

View File

@ -63,6 +63,8 @@ class LdapAuthenticationPlugin extends AuthenticationPlugin
if(!isset($this->attributes['username'])){
throw new Exception("must specify a username attribute");
}
if($this->password_changeable && (! isset($this->attributes['password']) || !isset($this->password_encoding))){
throw new Exception("if password_changeable is set, the password attribute and password_encoding must also be specified");
}
//---interface implementation---//