UserLoggedIn

UserLoggedIn

You can implement a handler named "UserLoggedIn" in your MWScript script.
MoneyWorks will send the UserLoggedIn message when a user logs in (network or local). This includes when the current user changes due to Switch User.

You can use this opportunity to load user-specific state. You can see who the current user is by looking at the Initials or Username global variable. In v7, you get this message even if password protection is not turned on.

Example

on UserLoggedIn
    SysLog( Initials + " just logged in")
end

As of v7.1, you can return 0 from this handler to refuse the login. Be very careful with this that you don't lock yourself out of your document.

on UserLoggedIn
    if(Username = "Peon" and DayOfWeek(Today()) > 5)
        Alert("No weekend work for you", "See you Monday")
        return 0
    endif
    return 1 // this is the default
end
Posted in Handlers | Comments Off on UserLoggedIn