I'm sorry that I don't have experience with setting up a wireless connection using a script at login. I'm sure their are other people around that have done it before and it would probably be the ideal solution.
The documentation for sudoers makes it look worse than it is to give you access for running a command for which a normal user doesn't have access to. I recently set up my regular user so it can use mount and umount. Here is an example:
As root, enter the command visudo
. This will take you into a vi editor used to modify the sudoers file. The nice thing about doing it this way is that the syntax of your entries will be checked when you save the file. The file should be pretty empty with several commented sections. Go to the bottom of the file where the User priviledge specification section starts.
In my example I entered the following:
This will allow user barney to use the mount and umount commands from any host without entering a password. barney
is the username, ALL
means from any host, NOPASSWD
doesn't ask for a password, and the commands you want to allow follow. They must include the full pathnames in order to work.
To use the mount or umount command barney would do the following.
sudo mount /mnt/cdrom
Obviously there are a lot more options and things you can do with sudo. This should get you started the quick way. If you run into any problems with using sudo, just ask.