user.isGuest()

Post here your suggestions for new possible features in SmartFoxServer.

Moderators: Lapo, Bax

Post Reply
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

user.isGuest()

Post by BigFIsh »

It could be nice to have a boolean flag for guest user type.

i.e. user.isGuest()

Sometimes, we would like to limit the functionality for guest users. It's a little tricky to determine if that user is a guest or not. Or did I miss something :)
Smartfox's forum is my daily newspaper.
Gnoll
Posts: 128
Joined: 10 Mar 2009, 10:14

Post by Gnoll »

Good idea I think,
currently you could use getName() and substr the first 5 letters however a boolean will be helpful.

Gnoll
mhdside
Posts: 236
Joined: 04 May 2008, 07:57
Location: Egypt

Post by mhdside »

I don't see this as a big need, as guests are already identified by their names.

even if you want a fast way to determine guests you can make a simple function like this:

Code: Select all

function isGuest(user:User):Boolean
{
    if (user.getName().subString(0, 5) == "guest")
        return true;

    return false;
}
Mahmoud Badri
Senior actionscript developer
http://www.el3ab.com
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

User permissions is one interesting area we'd like to cover in the next major release. Thanks for the submission
Lapo
--
gotoAndPlay()
...addicted to flash games
Post Reply