Fixed login for material uploading

Fixed login for material uploading

Written Friday 2 Oct

If you've been having problems with material uploading or editing, try now - I've fixed a host of bugs and creakiness in the login / logout functionality.

:)