Forum OpenACS Q&A: Anonymous Forums

Collapse
Posted by Nima Mazloumi on
Hi all,

i extended the existing forums package to support an anonymous mode. Depending on the selected mode either only the screen name of a user is visible or the full name with a link to the user information page is offered.

The admin can change this setting on a forum level in the forum admin page.

I added a new function in /packages/acs-kernel/sql/postgresqlcommunity-core-create.sql to return the screen name of a user

Most of the changes are in user-history.*, forum-edit.*, forum-view.*, forum-procs.*, message-chunk.*

I can create a diff for these changes but there is an upgrade script required for the forums_forums table.

But at the moment a requirement is that each user must have a screen name or the field where the name of the user should be displayed is left blank which is bad. Jeff Lu suggested to serve an entry page in those cases where the screen name is empty (as is done in lars-blogger). I will integrate this feature next.

In the meantime I used this

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

to fill the screen_name field. A better solution would be to fill only those instances where the screen name is empty :)

So by now I only have one problem in the instance that a user posts in multiple different forums that have different modes. A clever person could navigate to the users history page and from there to a non-anonymous forum to figure out who this person was :( But I don't think that this is a difficult problem to solve.

Now my question is: Shall I post a patch or commit the work to HEAD? The reason why I as is because it seams that noone is maintaining the forums package.

Greetings,
Nima

Collapse
2: Re: Anonymous Forums (response to 1)
Posted by Nima Mazloumi on
Another issue with screen names is that at present one user could use the full name of another existing user as his screen name which could lead to serious problems since it is not possible to find out who really posted. Any ideas on that? I could include a check feature when a user changes his screen name to make sure the last name of another existing user is not used but this can be a resource consuming database call, no?
Collapse
3: Re: Anonymous Forums (response to 2)
Posted by Tilmann Singer on
Followup to irc discussion on that topic: there is already anonymous mode in forums, although I only got it to work by granting forum_create and forum_write on the forum to the Unregistered Visitor and reverting a recent change to forums-security-procs like this:

tils@rbfm:/var/lib/reboot.fm/rubi/packages/forums$ cvs diff tcl/forums-security-procs.tcl
cvs diff: warning: failed to open /home/tils/.cvspass for reading: No such file or directory
Index: tcl/forums-security-procs.tcl
===================================================================
RCS file: /cvsroot/openacs-4/packages/forums/tcl/forums-security-procs.tcl,v
retrieving revision 1.7.2.2
diff -r1.7.2.2 forums-security-procs.tcl
65c65,67
<        return [permission::permission_p -party_id $user_id -object_id $forum_id -privilege create]
---
<blockquote>        # quick fix for the custom priv mess: revert to check for
        # forum_create instead create -til
        return [permission::permission_p -party_id $user_id -object_id $forum_id -privilege forum_create]
</blockquote>
81c83,85
<        return [permission::permission_p -party_id $user_id -object_id $message_id -privilege write]
---
<blockquote>        # quick fix for the custom priv mess: revert to check for
        # forum_write instead write -til
        return [permission::permission_p -party_id $user_id -object_id $message_id -privilege forum_write]
</blockquote>

Collapse
4: Re: Anonymous Forums (response to 1)
Posted by Don Baccus on
Well we shouldn't be committing anything to HEAD for maintained core packages that only work for PG (or Oracle) rather than both RDBMS's.  This is one reason why the portal rewrite, for instance, will be staying in contrib for awhile.

Also changes of this scope need to be TIP'd - we don't make arbitrary significant functionality changes of this sort without formal discussion and approval.

Collapse
5: Re: Anonymous Forums (response to 1)
Posted by Nima Mazloumi on
Don, thank you for your guidlines. I finally found an extremely simple solution to enable anonymous posts:

I simply added the following line to /packages/dotlrn-forums/www/dotlrn-forums-admin-portlet.adp to make to existing links available:

Line 22
&lt;li&gt;&lt;a href="@url@"&gt;<span>#</span>dotlrn-forums.all_Forums#&lt;/a&gt; (&lt;a href="@url@/admin/"&gt;<span>#</span>dotlrn-forums.administer#&lt;/a&gt;)&lt;/li&gt;

Thus from the Admin-Page of the class both the lists of all forums available and the administration page for all forums are accessible. For both links I was not able to find a link to the corresponding page.

Now every class admin can access the permissions link for a forum and set create and write permissions for "The Public" to allow anonymous posts.

What do you think? Only dotlrn-forums-admin-portlet.adp got 2 new links and message keys. That's it! No major extension, no changes to forums-security-procs.tcl...