mirror of
https://git.teknik.io/Teknikode/Teknik.git
synced 2023-08-02 14:16:22 +02:00
Fixed 'GetLastAccountActivity' throwing an exception if an account portion doesn't exist.
This commit is contained in:
parent
ec6cedbba2
commit
c6d836dac2
@ -1,4 +1,4 @@
|
|||||||
using nClam;
|
using nClam;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Data.Entity;
|
using System.Data.Entity;
|
||||||
@ -538,7 +538,15 @@ Thank you for your continued use of Teknik!
|
|||||||
}
|
}
|
||||||
|
|
||||||
#region Inactivity Finding
|
#region Inactivity Finding
|
||||||
DateTime lastActivity = UserHelper.GetLastAccountActivity(db, config, user);
|
DateTime lastActivity = DateTime.Now;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
lastActivity = UserHelper.GetLastAccountActivity(db, config, user);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
TimeSpan inactiveTime = DateTime.Now.Subtract(lastActivity);
|
TimeSpan inactiveTime = DateTime.Now.Subtract(lastActivity);
|
||||||
|
|
||||||
|
@ -108,6 +108,7 @@ sales
|
|||||||
save
|
save
|
||||||
search
|
search
|
||||||
security
|
security
|
||||||
|
server admin
|
||||||
sessions
|
sessions
|
||||||
settings
|
settings
|
||||||
sftp
|
sftp
|
||||||
@ -141,4 +142,4 @@ widgets
|
|||||||
wiki
|
wiki
|
||||||
www
|
www
|
||||||
xfn
|
xfn
|
||||||
xmpp
|
xmpp
|
||||||
|
@ -89,17 +89,26 @@ namespace Teknik.Areas.Users.Utility
|
|||||||
{
|
{
|
||||||
DateTime lastActive = new DateTime(1900, 1, 1);
|
DateTime lastActive = new DateTime(1900, 1, 1);
|
||||||
|
|
||||||
DateTime emailLastActive = UserEmailLastActive(config, GetUserEmailAddress(config, user.Username));
|
if (UserEmailExists(config, GetUserEmailAddress(config, user.Username)))
|
||||||
if (lastActive < emailLastActive)
|
{
|
||||||
lastActive = emailLastActive;
|
DateTime emailLastActive = UserEmailLastActive(config, GetUserEmailAddress(config, user.Username));
|
||||||
|
if (lastActive < emailLastActive)
|
||||||
|
lastActive = emailLastActive;
|
||||||
|
}
|
||||||
|
|
||||||
DateTime gitLastActive = UserGitLastActive(config, user.Username);
|
if (UserGitExists(config, user.Username))
|
||||||
if (lastActive < gitLastActive)
|
{
|
||||||
lastActive = gitLastActive;
|
DateTime gitLastActive = UserGitLastActive(config, user.Username);
|
||||||
|
if (lastActive < gitLastActive)
|
||||||
|
lastActive = gitLastActive;
|
||||||
|
}
|
||||||
|
|
||||||
DateTime userLastActive = UserLastActive(db, config, user);
|
if (UserExists(db, user.Username))
|
||||||
if (lastActive < userLastActive)
|
{
|
||||||
lastActive = userLastActive;
|
DateTime userLastActive = UserLastActive(db, config, user);
|
||||||
|
if (lastActive < userLastActive)
|
||||||
|
lastActive = userLastActive;
|
||||||
|
}
|
||||||
|
|
||||||
return lastActive;
|
return lastActive;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user