Index: topia-security/src/java/org/codelutin/topia/security/entities/user/TopiaUserImpl.java diff -u topia-security/src/java/org/codelutin/topia/security/entities/user/TopiaUserImpl.java:1.1 topia-security/src/java/org/codelutin/topia/security/entities/user/TopiaUserImpl.java:1.2 --- topia-security/src/java/org/codelutin/topia/security/entities/user/TopiaUserImpl.java:1.1 Wed Sep 13 08:45:10 2006 +++ topia-security/src/java/org/codelutin/topia/security/entities/user/TopiaUserImpl.java Wed Sep 13 14:26:18 2006 @@ -1,23 +1,37 @@ +/* *##% +* Copyright (C) 2002, 2003, 2004, 2005 Code Lutin, +* Cédric Pineau, Benjamin Poussin, +* +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*##%*/ + package org.codelutin.topia.security.entities.user; import static org.codelutin.topia.security.TopiaSecurityUtil.hash; -import org.codelutin.topia.security.entities.user.TopiaUser; -import org.codelutin.topia.security.entities.user.TopiaUserAbstract; - public class TopiaUserImpl extends TopiaUserAbstract implements TopiaUser { private static final long serialVersionUID = 1L; public boolean isCorrectPassword(String password) { if (this.password == null) { - if (password != null) { - return false; - } - } else if (!this.password.equals(hash(password))) { - return false; + return password == null; + } else{ + return this.password.equals(hash(password)); } - return true; } public void setPassword(String newPassword) { @@ -30,5 +44,5 @@ } setPassword(newPassword); } - + }