Skip to content

Commit

Permalink
Fixed DNET-92 and DNET-93.
Browse files Browse the repository at this point in the history
  • Loading branch information
cincuranet committed Jun 9, 2007
1 parent b21822f commit 1342400
Showing 1 changed file with 7 additions and 5 deletions.
Expand Up @@ -1065,12 +1065,12 @@ public override int GetNumberOfUsersOnline()
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@ApplicationName", FbDbType.VarChar, 100).Value = ApplicationName;
cmd.Parameters.Add("@SinceLastInActive", FbDbType.TimeStamp).Value = compareTime;

FbParameter p = new FbParameter("@NUMBERUSERS", FbDbType.Integer);
p.Direction = ParameterDirection.Output;
cmd.Parameters.Add(p);
cmd.ExecuteNonQuery();

return (p.Value != null) ? ((int)p.Value) : -1;
}
}
Expand Down Expand Up @@ -1394,7 +1394,7 @@ private bool CheckPassword(string username, string password, bool updateLastLogi
cmd.Parameters.Add("@PasswordAttemptWindow", FbDbType.Integer).Value = PasswordAttemptWindow;
cmd.Parameters.Add("@LastLoginDate", FbDbType.TimeStamp).Value = isPasswordCorrect ? dtNow : lastLoginDate;
cmd.Parameters.Add("@LastActivityDate", FbDbType.TimeStamp).Value = isPasswordCorrect ? dtNow : lastActivityDate;

FbParameter p = new FbParameter("@RETURNCODE", FbDbType.Integer);
p.Direction = ParameterDirection.Output;
cmd.Parameters.Add(p);
Expand Down Expand Up @@ -1432,7 +1432,6 @@ private bool CheckPassword(string username, string password, bool updateLastLogi
cmd.Parameters.Add("@UpdateLastLoginActivityDate", FbDbType.Integer).Value = updateLastLoginActivityDate;
using (FbDataReader reader = cmd.ExecuteReader(CommandBehavior.SingleRow))
{
status = -1;
if (reader.Read())
{
password = reader.GetString(0);
Expand All @@ -1443,6 +1442,7 @@ private bool CheckPassword(string username, string password, bool updateLastLogi
isApproved = GetNullableBool(reader, 5);
lastLoginDate = GetNullableDateTime(reader, 6);
lastActivityDate = GetNullableDateTime(reader, 7);
status = GetNullableInt(reader, 8);
}
else
{
Expand All @@ -1454,6 +1454,7 @@ private bool CheckPassword(string username, string password, bool updateLastLogi
isApproved = false;
lastLoginDate = DateTime.UtcNow;
lastActivityDate = DateTime.UtcNow;
status = -1;
}
}
}
Expand Down Expand Up @@ -1488,13 +1489,14 @@ private bool CheckPassword(string username, string password, bool updateLastLogi
{
password = reader.GetString(0);
passwordFormat = reader.GetInt32(1);
status = GetNullableInt(reader, 2);
}
else
{
password = null;
passwordFormat = 0;
status = -1;
}
status = GetNullableInt(reader, 2);
}
}
}
Expand Down

0 comments on commit 1342400

Please sign in to comment.