Fix bug 4651
Customize the layout & action of login & query view