Uutiset:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu
Advertisement:

Guest user id = -1

Aloittaja Real World, syyskuu 19, 2006, 12:07:19 IP

« edellinen - seuraava »

Real World

Can I just ask who in their right mind thought having the guest group = -1 was a good idea? Why not give it an ID like all other groups and store the guests user permissions in a row in the table. It just makes sense to me but maybe someone can explain the logic behind it.

Reason I ask is that I am trying to write a user module for my script that allows logins to be shared but all the other software I've integrated it with (vB, IPB etc.) have a normal guest id so you can use the guests group id as an array index ($group[$groupid] == x) for example. Passing -1 in will cause all manor of breakages. I'm not expecting you to change it but I felt the need to rant as I'm having to hack my software to bits to accomodate it   :-[

Compuart

I did think it was a good idea ;D Back when we started SMF, we wanted an easy one on one membergroup conversion from YaBB SE. YaBB SE had some groups pre-defined (admin: 1, global moderator:2, moderator: 3, Newbie: 4...Hero/god member: 8 ). The custom groups started at 9. SMF added two new pre-defined groups (guests and ungrouped members). In order to keep the YaBB SE groups as they were and still give the pre-defined groups a fixed number, we needed to go below the 1. So ungrouped members became 0 and guests became -1.
Hendrik Jan Visser
Former Lead Developer & Co-founder www.simplemachines.org
Personal Signature:
Realitynet.nl -> ExpeditieRobinson.net / PekingExpress.org / WieIsDeMol.Com

Advertisement: