PunBB Authentication JQuery Plugin

I have finally created my first jQuery plugin. The punbbauth plugin should provide an easy way to sync authentication between your application and PunBB.

This plugin provides an easy way to hook into PunBB authentication login/logout. Hooks should be applied to your own applications login form and logout link. Another option is available to hook into an “access” link, however this will likely not see much use under most normal circumstances.

This plugin does not attempt to solve the issue of syncing your application with punbb. Rather, it attempts to solve the issue of single sign on when a user logs into your application.

Gotchas

As the plugin uses XHR to communicate with PunBB, it’s usage is of course limited to the XHR same origin policy.

Download

http://jasonleveille.com/play/leveille-punbbauth-0.9.1-1-g7f97514.tar.gz

Examples

BIND TO LOGIN FORM

ex. 1

1: //assumes a username fieldname of username
2: //assumes a password fieldname of password

$('.punbb').punbbauth();

ex. 2

1: //app_uname_field: <input name="uname_fieldname" />
2: //app_pword_field: <input name="pword_fieldname" />
3: //assumes form class structure: <form class="punbb login">

$('.punbb').punbbauth({
    app_uname_field : 'uname_fieldname',
    app_pword_field : 'pword_fieldname'
});

BIND TO LOGOUT LINK

ex. 1

1: //assumes link class structure: <a class="punbb logout">...</a>

$('.punbb').punbbauth();

BIND TO ACCESS LINK

NOTE: This will likely not see very much use, as it requires access to a plain text password. See notes below

ex. 1

1: //assumes link class structure: <a class="punbb access">...</a>

$('.punbb').punbbauth({
    punbb_username : 'username',
    punbb_password : 'password'
});

1 Comment for "PunBB Authentication JQuery Plugin"

Comment 1 leveille - Gravatar leveille

This is my very first jQuery plugin. Take a look at the source code. If you think it's trash, or that I could have done something better (or if you're wondering why I wasted my time with this), let me know.

Wed, 21 Jan 2009 12:58:55 +0000 Link

Comments have been disabled for this post.