diff options
Diffstat (limited to 'src/main/java/com/gitblit/auth/PAMAuthProvider.java')
-rw-r--r-- | src/main/java/com/gitblit/auth/PAMAuthProvider.java | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/main/java/com/gitblit/auth/PAMAuthProvider.java b/src/main/java/com/gitblit/auth/PAMAuthProvider.java index bbc82d84..7e82bc63 100644 --- a/src/main/java/com/gitblit/auth/PAMAuthProvider.java +++ b/src/main/java/com/gitblit/auth/PAMAuthProvider.java @@ -26,8 +26,6 @@ import com.gitblit.Constants.AccountType; import com.gitblit.Keys; import com.gitblit.auth.AuthenticationProvider.UsernamePasswordAuthenticationProvider; import com.gitblit.models.UserModel; -import com.gitblit.utils.ArrayUtils; -import com.gitblit.utils.StringUtils; /** * Implementation of PAM authentication for Linux/Unix/MacOSX. @@ -104,13 +102,13 @@ public class PAMAuthProvider extends UsernamePasswordAuthenticationProvider { } UserModel user = userManager.getUserModel(username); - if (user == null) // create user object for new authenticated user + if (user == null) { + // create user object for new authenticated user user = new UserModel(username.toLowerCase()); + } // create a user cookie - if (StringUtils.isEmpty(user.cookie) && !ArrayUtils.isEmpty(password)) { - user.cookie = StringUtils.getSHA1(user.username + new String(password)); - } + setCookie(user, password); // update user attributes from UnixUser user.accountType = getAccountType(); |