Fix bug where users cannot log in

This issue is caused because of @logged_in_as not being checked if nil.
Update the created_at (a.k.a. posted time) if draft is published
Add flash[:error] to display error messages
Fix bug where exception is thrown when deleting users
Fix bug where no redirection occurs after deleting users

This is changed so that it redirects to "top#index" after deletion.
Fix bug where users with invalid passwords are created

This bug is caused by the passwords being checked after saving to the
database.