Invisible button
Invisible button
how can i make a button visible ONLY if the user's name is xyz?
Re: Invisible button
Hi,
this is not a very SmartFoxServer related question. It has to do more with the tools you're using to build your interface.
In terms of code you would just need to check the user's name which is done by calling user.getName() on any user object. By the way, you haven't even specified which client technology you're using...
One small advice: it doesn't sound seem a particularly great idea to hardcode a specific user name inside your client to check for a specific user and trigger some special buttons.
What happens if at some point the user's name changes? Or if you need to check more than one user name?
Also people might decompile the code and figure out how to trigger this "hidden function".
It would be much better to create an optional button (i.e. one that appears only to certain people) by using SFS2X user privileges. For example by checking that a user has his/her privileges set to Admin.
Cheers
this is not a very SmartFoxServer related question. It has to do more with the tools you're using to build your interface.
In terms of code you would just need to check the user's name which is done by calling user.getName() on any user object. By the way, you haven't even specified which client technology you're using...
One small advice: it doesn't sound seem a particularly great idea to hardcode a specific user name inside your client to check for a specific user and trigger some special buttons.
What happens if at some point the user's name changes? Or if you need to check more than one user name?
Also people might decompile the code and figure out how to trigger this "hidden function".
It would be much better to create an optional button (i.e. one that appears only to certain people) by using SFS2X user privileges. For example by checking that a user has his/her privileges set to Admin.
Cheers
Who is online
Users browsing this forum: No registered users and 113 guests