You're going to have to fix this one of three ways, since logging in normally isn't possible anymore:
1. Using Single-User Mode to log in as root and fix the permissions - unless you know what you're doing at the command line, this can actually cause more problems than it solves. If you're comfortable at the command prompt, though, this is worth trying.
2. Archive and Install the OS, preserving users and network settings (if you have Snow Leopard, the installer does this for you when you reinstall).
3. Boot from the OS install disc. Repair Permissions via Disk Utility. Reboot back to your normal install. Repair permissions again. (The easiest method)