Issue #1303620 and #1310634 by JohnV and Jim Kirkpatrick: fixes to 'log in as another user' feature, plus new block for ip logins.