mlanthaler: Fixed typo and updated docBlock (merged from gsoc branch, r42439)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@42972 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Andrew O'Neil 2007-10-02 22:18:45 +00:00
parent 588b091770
commit c7231c6935

View File

@ -24,16 +24,19 @@ class MemberAuthenticator extends Authenticator {
* {@link Form::sessionMessage()} * {@link Form::sessionMessage()}
* @return bool|Member Returns FALSE if authentication fails, otherwise * @return bool|Member Returns FALSE if authentication fails, otherwise
* the member object * the member object
* @see Security::setDefaultAdmin()
*/ */
public static function authenticate(array $RAW_data, Form $form = null) { public static function authenticate(array $RAW_data, Form $form = null) {
$SQL_user = Convert::raw2sql($RAW_data['Email']); $SQL_user = Convert::raw2sql($RAW_data['Email']);
// Default login (see {@setDetaultAdmin()}) // Default login (see Security::setDefaultAdmin())
if(Security::check_default_admin($RAW_data['Email'], $RAW_data['Password'])) { if(Security::check_default_admin($RAW_data['Email'], $RAW_data['Password'])) {
$member = Security::findAnAdministrator(); $member = Security::findAnAdministrator();
} else { } else {
$member = DataObject::get_one("Member", "Email = '$SQL_user' AND Password IS NOT NULL"); $member = DataObject::get_one("Member", "Email = '$SQL_user' AND Password IS NOT NULL");
if($member && ($member->checkPassword($RAW_data['Password']) == false)) $member = null; if($member && ($member->checkPassword($RAW_data['Password']) == false)) {
$member = null;
}
} }
if($member) { if($member) {