Could the power failure be a red herring? Were you messing with Service ACLs recently? You could have disallowed all users from using the GUI with a Service ACL.
If you can SSH in, you can add yourself back into the loginwindow access group, by doing something like this:
sudo dseditgroup -o edit -a $USER -t user com.apple.access_loginwindow
That is, you're using
sudo to use superuser powers to run
dseditgroup to edit your DirectoryServices groups. The operation is an
edit, you're adding user
$USER (whoever you SSH'd in as), the record type is
user, and the group to add it to is
After that, once you've got GUI access again, I'd recommend using the Server Admin tool in the GUI to review and edit your Service ACLs (SACLs). The methods provided to edit SACLs from the command-line leave a lot to be desired.