hi
if users account is locked then after some hour(coming from database) the account will be unlocked.if user try to login i am showing him message you account has been locked and after no of hours your account will be unlocked.
below is code
see the bold part.what i want is suppose for user i added 1 hour lock time in setting then when after 5 attempts user's account has been locked faileddate gives the date & time of last failure attempt.Code:EXEC pr_Setting_Get @vPortalID, @nMemberID, @nProfileID, 93, 0, @vsSettingValue = @sSettingValue OUTPUT IF @sSettingValue <> '0' BEGIN IF CAST(@sSettingValue AS INT) <= (SELECT FailedAttempts FROM [Profile] WHERE ProfileID = @nProfileID) BEGIN --Check if Time to automatic un-lock of account (hours) EXEC pr_Setting_Get @vPortalID, @nMemberID, @nProfileID, 147, 0, @vsSettingValue = @sUnlockSettingValue OUTPUT IF @sUnlockSettingValue <> '0' BEGIN -- User logged in after locked time + setting value then unlock IF DATEADD(hh, -1 * CAST(@sUnlockSettingValue AS INT), GETDATE()) > (SELECT FailedDate FROM [Profile] WHERE ProfileID = @nProfileID) BEGIN UPDATE [Profile] SET FailedAttempts = 0 WHERE ProfileID = @nProfileID END ELSE BEGIN SELECT @rlLockedHours = CONVERT(DECIMAL(5,2),DATEDIFF(hh, GETDATE() ,DATEADD(hh,CAST(@sUnlockSettingValue AS INT),FailedDate))) FROM [Profile] WHERE ProfileID = @nProfileID RETURN -10 END END ELSE BEGIN RETURN -7 END END END
so when user locked i am getting 1 hour to remain for unlocking.but after again and again refresh still it is showing 1 hour reamining actually it should become 0.59 then 0.58 like this
what I am missing



LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks