What am I missing on this?
I created a Login Notification and in the Rule for when the notification is created, I added statements to CREATE an access record for the person logging in. So far, nothing. Am I correct in assuming that the Login Notification is created with each Login? Does the Notification have to be SENT (I tried that too)? I'm missing something here about when this notification occurs.
I don't see login notifications being used in any of the same apps. No help there.
Using Login Notification to create access log
Following login notification rules work for me:
1) Creates a log of users and updates certain attributes of the LoggedInRegularUser BO:
CREATE UsersLog WITH UsersLog.IpAddress=LoginNotification.RemoteAddress,
UsersLog.Name=LoginNotification.LoginName,
UsersLog.Time=CURRENT_TIMESTAMP,
UsersLog.LogType='Login',
UsersLog.AccessLevelName=LoggedInSystemUser.AccessLevel
LoggedInRegularUser.LastLoginTime=CURRENT_TIMESTAMP
LoggedInRegularUser.LastRemoteAddress=LoginNotification.RemoteAddress
INCREASE LoggedInRegularUser.NbrLogins BY 1
2) Sends an administrator a message that a user has logged into the system. This can be enabled / disabled via a SystemSetting:
If SystemSettings.EmailLogins='Yes'
Then
SEND OutgoingEmail_Admin_UserLoggedIn TO SystemSettings
Tom
1) Creates a log of users and updates certain attributes of the LoggedInRegularUser BO:
CREATE UsersLog WITH UsersLog.IpAddress=LoginNotification.RemoteAddress,
UsersLog.Name=LoginNotification.LoginName,
UsersLog.Time=CURRENT_TIMESTAMP,
UsersLog.LogType='Login',
UsersLog.AccessLevelName=LoggedInSystemUser.AccessLevel
LoggedInRegularUser.LastLoginTime=CURRENT_TIMESTAMP
LoggedInRegularUser.LastRemoteAddress=LoginNotification.RemoteAddress
INCREASE LoggedInRegularUser.NbrLogins BY 1
2) Sends an administrator a message that a user has logged into the system. This can be enabled / disabled via a SystemSetting:
If SystemSettings.EmailLogins='Yes'
Then
SEND OutgoingEmail_Admin_UserLoggedIn TO SystemSettings
Tom
Since you seem to be interested in Login stuff, I use the following rules to:
1) I keep a log of bad login attempts
2) I get an immediate email when it occurs so that I can contact a user that is having a problem.
Place the following rule in the "When LoginAttemptNotification is received" section of LoginAttemptNotification
If EXISTS SystemUser WHERE (SystemUser.LoginName=LoginAttemptNotification.LoginName) Then
CREATE UsersFailedLogins WITH UsersFailedLogins.IpAddress=LoginAttemptNotification.RemoteAddress,UsersFailedLogins.Name=LoginAttemptNotification.LoginName,UsersFailedLogins.Time=CURRENT_TIMESTAMP,UsersFailedLogins.Reason='Invalid Password'
Else
CREATE UsersFailedLogins WITH UsersFailedLogins.IpAddress=LoginAttemptNotification.RemoteAddress,UsersFailedLogins.Name=LoginAttemptNotification.LoginName,UsersFailedLogins.Time=CURRENT_TIMESTAMP,UsersFailedLogins.Reason='Invalid User Name'
I then have a rule for the UsersFailedLogins BO:
If UsersFailedLogins IS NEW Then
SEND OutgoingEmail_InvalidLogin TO SystemSettings
Tom
1) I keep a log of bad login attempts
2) I get an immediate email when it occurs so that I can contact a user that is having a problem.
Place the following rule in the "When LoginAttemptNotification is received" section of LoginAttemptNotification
If EXISTS SystemUser WHERE (SystemUser.LoginName=LoginAttemptNotification.LoginName) Then
CREATE UsersFailedLogins WITH UsersFailedLogins.IpAddress=LoginAttemptNotification.RemoteAddress,UsersFailedLogins.Name=LoginAttemptNotification.LoginName,UsersFailedLogins.Time=CURRENT_TIMESTAMP,UsersFailedLogins.Reason='Invalid Password'
Else
CREATE UsersFailedLogins WITH UsersFailedLogins.IpAddress=LoginAttemptNotification.RemoteAddress,UsersFailedLogins.Name=LoginAttemptNotification.LoginName,UsersFailedLogins.Time=CURRENT_TIMESTAMP,UsersFailedLogins.Reason='Invalid User Name'
I then have a rule for the UsersFailedLogins BO:
If UsersFailedLogins IS NEW Then
SEND OutgoingEmail_InvalidLogin TO SystemSettings
Tom