Accidentally locked out of Mac
You'll probably need to recreate the group staff via the command line.
It should be in /etc/group.

You can check if it exists:

cat /etc/group | grep -i staff


I have staff as the following:

staff:*:20:root


You can create the group again and add root to that group, put it in the sameGroupID etc although I'm not sure if that will do the trick. I never had to do this before so I would recommend before you do anything to connect your Mac via FireWire to another Mac.

Restart your laptop while holding T so it acts like a FireWire drive (no files in use by the system) so you can copy the complete disk...

Easy way to clone would be something like Carbon Copy Cloner.
Other possibility is using the asr command in the Terminal.

The recreation of groups and adding users etc. can be done via the command dscl

There is someone else who had this kind of issue so you could also have a look here:
https://superuser.com/questions/477572/mac-osx-repair-staff-group