TheDrunkenEpic

Hello, I'm Wilhelm, a PHP developer, and this is my little corner of the internet where I can discuss things that interest me and, hopefully, you too. :-)


Currently Reading:

12Mar 2008

Pseudo Membership Campfire Service

I went ahead and threw together a campfire service that allows you to utilize an already existing membership system from a 3rd-party application you might already be hosting on your site. Basically, if you have a supported application installed and a user, who is logged into said application, visits your Symphony site, this service will generate XML with their logon information.

What this allows you to do is create members only areas within your Symphony install. Let's say you have a Vanilla forum on your site and you only want your Vanilla users to be able to comment on your blog articles. All you have to do is attach the appropriate datasource to your page or master wrapper and then put something like the following in your XSL template:

<xsl:choose>
    <xsl:when test="external-member-check/registered = 'true'">
        SHOW COMMENT FORM
    </xsl:when>
    <xsl:otherwise>
        Sorry, only forum members can comment ...
    </xsl:otherwise>
</xsl:choose>

Now you can create members-only areas within your site. I also have the datasources returning the user's group id ( if applicable ), so you can show different types of content / functionality based on group assignments.

Here is the XML that's returned:

// When logged in:
<external-member-check software="vanilla">
    <name>Wilhelm Murdoch</name>
    <registered>true</registered>
    <id>5</id>
    <group>2</group>
</external-member-check>


// When NOT logged in:
<external-member-check software="vanilla">
    <name>Guest</name>
    <registered>false</registered>
    <id />
    <group />
</external-member-check>

So far there is support for the following forum solutions: MyTopix, PunBB, Vanilla

I need some testers to help out with... testing. Also, if you want to create more datasources for different applications, go ahead and send your finished versions to me and I'll add it to the service. Credit, of course, will be given to the code authors.

A link to the download at Overture. Scroll to the bottom of the first post.


TrackBack: http://www.thedrunkenepic.com/home/articles/trackback/99/

Leave a Comment: