Did you check the migration guide at https://world.mendix.com/display/refguide5/Moving+from+4+to+5 ? This looks like an example of one of the listed breaking changes.
"The parameterless constructor for UserAction has been removed. Constructing a UserAction always requires an IContext now. Changes are only necessary for custom user actions which are NOT defined as custom Java action in the Modeler, e.g. an action which replaces the LoginAction using an action listener."
Since you are using IPRangeCheckerLoginAction this seems to be exactly the case here.
Also, I really urge you to move to the latest 5.x version, it's far more stable than 5.1.1.