How to prevent ubuntu from connecting to wifi hotspots automatically

view story

http://askubuntu.com – Note: this question is distinct from "How to disable automatically connecting to WiFi?", as I do not wish to disable automatic WiFi connection in general. Problem: The Ubuntu WiFi module connects automatically in priority with WiFi networks without a password, even if there is a already known password-protected WiFi network nearby. Worse, most of the times these "unprotected" networks are in fact hotspots that require authentification from the browser. Example: I am at home, and most of the times my Ubuntu laptop will connect by itself to a nearby hotspot instead of choosing my local ADSL box (HowTos)