Logged In: NO

In case you wonder why... The original function is awkard in
several ways, including:

- attempts to insert a temporary entry to the DB, instead of
updating the existing one
- forgets that all "NOT NULL" fields have to be provided on
insert!
- Checks the rights after inserting the temporary entry,
instead of doing it right away (Please note that I didn't check
the "goodwhereperm" function, hope it does the right thing!)
- messes with "autoincrement"