jQuery User v1.0.1

jQuery Plugn Macros

Configuration

Name Type Description
currentUrl String Is appended to the current page url to make the url to POST the login request to. Default /.ajax
afterLoginUrl Null|String

The page to redirect to after login. There are 4 possibilities:

  • null = do a location.reload()
  • "none" - literal value "none" means no redirect
  • "something" or "" = a relative path, will be avaluated relative to the user's url (returned in cookie)
  • "/dashboard" = an absolute path, will be used exactly as given
logoutSelector String Selector for logout link or button
valiationMessageSelector String Selector for validation message
requiredFieldsMessage String Error message when required fields are invalid
loginFailedMessage String Error message when login is failed
userNameProperty String Property name to use in sending username to server
passwordProperty String Property name to use in sending password to server
loginCallback Function Callback will be called after successful login

 

Default Configuration

{
    urlSuffix: '/.dologin',
    afterLoginUrl: null,
    logoutSelector: '.logout',
    valiationMessageSelector: '.email span',
    requiredFieldsMessage: 'Please enter your credentials.',
    loginFailedMessage: 'Sorry, those login details were not recognised.',
    userNameProperty: '_loginUserName',
    passwordProperty: '_loginPassword',
    emailErrorMessage: 'Please check the format of your email address, it should read like ben@somewhere.com',
    requiredErrorMessage: 'Please enter all required fields',
    loginCallback: function() {

    }
}