Fixed possible issue in TryCookieLogin (null username and/or loginKey).

This commit is contained in:
Dario Solera 2010-03-16 06:09:24 +00:00
parent 59a6592b76
commit 1f3023f33d
2 changed files with 4 additions and 2 deletions

View file

@ -635,6 +635,8 @@ namespace ScrewTurn.Wiki {
/// <param name="loginKey">The login key.</param>
/// <returns>The correct UserInfo object, or <c>null</c>.</returns>
public static UserInfo TryCookieLogin(string username, string loginKey) {
if(string.IsNullOrEmpty(username) || string.IsNullOrEmpty(loginKey)) return null;
if(username == "admin" && loginKey == ComputeLoginKey(username, Settings.ContactEmail, DateTime.MinValue)) {
// Just return, no notification to providers because the "admin" account is fictitious
return GetAdministratorAccount();