Forum OpenACS Q&A: Why unique screen_name in users table

Is there any reason why the screen name must be unique? I want to make some changes to the forum package. That is

- admin can decide of the forum is anonymous or not
- what should be used as author (Full name, First name, Screen name).

But since many users might simply use their first name as their screen name I wonder why we should have screen_name in the users table a unique attribute.

Can someone help?

Greetings,
Nima

Collapse
Posted by Jeff Lu on
Hi Nima,

I think screen name should really be unique. You see there can be people with the same first and last name. If you allow the users to have a same screen name. This can happen.

Example:
There are 3 users signing up in forums.
  • User #1: John Smith, with screen name john
  • User #2: Joe bloggs, with screen name Joe
  • User #3: John Smith, with screen name john
Situation:

User 1 posts in a forum, User 2 replies, User 3, having the same name as User 1 posts and flames user 2. User 2 gets angry at User 1. He doesn't know that User 1 and User 3 have same names.

In this situation it is wise to have a unique screen name. I hope this helps.
Collapse
Posted by Bart Teeuwisse on
Nima,

other packages use screen name too. IRC logger for example uses it to lookup the real name of a handle in an IRC channel. For this the screen name needs to be unique too.

/Bart

Collapse
Posted by Nima Mazloumi on
That makes sense. But what can I do if the screen name is left blank? I have then many users posting with an empty author field.

I have to offer the forum admin the choice to create an anonymous forum. So what shall I do to have unique aliases in the forum but not empty ones. I could go over the users table and automatically create screen names as a combination of first_names and a counter. What do you think of that? If a user wants to change his screen name he has to find then a unique one later on.

Collapse
Posted by Nima Mazloumi on
What about using first_names + user_id as the initial screen name?
Collapse
Posted by Nima Mazloumi on
Something like this:

update users set screen_name = (select first_names from persons p where p.person_id = user_id) || user_id;

Collapse
Posted by Jeff Lu on

If you do not have a user base yet, what you can do is make the screen name field a required one when users sign up.

If not, just set the screen name as the user id for the meantime to ensure it is unique, then just notify the users.

By the way, what version of openacs are you using?

Collapse
Posted by Jeff Lu on

One more package that needs screen name is Lars Blogger.

What you can do, is when users log in to forums, you check if the screen name is empty. Then redirect to a page that says you need the screen name set up first before they can post. And of course create a hyperlink to update their screen name.

I think you can find a code snippet for this in lars-blogger package. Lars-blogger requires screen name in version 5.0.4, you might want to take a look there.

Collapse
Posted by Nima Mazloumi on
Thanks alot. I use dotLRN 2.0.1
Collapse
Posted by Nima Mazloumi on
Jeff...do you know where in lars-blogger this feature is used? I grep-ed for the screen name but couldn't find anything.
Collapse
Posted by Jeff Lu on
Hi Nima,
It is in index.tcl and index.adp, try grepping for "screen_name" instead of screen_name.
Oh by the way, I am using Lars blogger 1.0.2, on openacs 5.0.4.

Cheers!!