public
Description: PunBB Authentication, jQuery Plugin
Homepage: http://jasonleveille.com/2009/01/punbb-authentication-jquery-plugin/
Clone URL: git://github.com/leveille/punbbauth.git
name age message
file README.markdown Wed Jan 21 10:21:01 -0800 2009 Update README Included information re. same or... [leveille]
file example.html Wed Jan 21 09:49:38 -0800 2009 Added example html file [leveille]
file jquery.punbbauth.js Wed Jan 21 09:24:47 -0800 2009 Corrected submit bind recursive loop bug [leveille]
README.markdown

PunBB Authentication JQuery Plugin

Provides an easy way to hook into PunBB auth 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 the 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

Examples

BIND TO LOGIN FORM

ex. 1

$('.punbb').punbbauth();                    //assumes a username fieldname of username
                                            //assumes a password fieldname of password
                                            //also assumes form class structure: <form ... class="punbb login" ... >

ex. 2

$('.punbb').punbbauth({
    app_uname_field : 'uname_fieldname',    //username fieldname: <input name="uname_fieldname" />                                
    app_pword_field : 'pword_fieldname'     //password fieldname: <input name="pword_fieldname" />
                                            //also assumes form class structure: <form ... class="punbb login" ... >
});

BIND TO LOGOUT LINK

ex. 1

$('.punbb').punbbauth();                    //assumes link class structure: <a ... class="punbb logout">...</a>

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

$('.punbb').punbbauth({
    punbb_username : 'username', 
    punbb_password : 'password'             //assumes link class structure: <a ... class="punbb access">...</a>
});