PostNuke Help

Previous
pnUserLoggedIn

Home
up

Next
pnUserLogOut


pnUserLogIn

log user in

Synopsis

bool pnUserLogIn(uname, pass, rememberme);

Description

pnUserLogIn() attempts to log the user in to the PostNuke system with the supplied parameters.

Parameters

uname

The username of the user attempting to log in

pass

The password of the user attempting to log in

rememberme

If true, PostNuke will attempt to remember this user's credentials as long as possible within the bounds of the security policy that has been laid down by the site administrator.

Return Values

This function returns true if the user is successfully logged in, otherwise it returns false. This function returns void if an exception was raised.

Exceptions

This function raises BAD_PARAM if you pass an invalid parameter. This function raises DATABASE_ERROR if an error occurs while querying data. This function throw back exceptions raised by other functions.

Examples

// Attempt to log user in
if (!pnUserLogIn(pnVarCleanFromInput('username'),
                 pnVarCleanFromInput('password'),
                 pnVarCleanFromInput('rememberme')) {
  die('Bad username/password');
} else {
  // User logged on successfully
}
       

See Also

pnUserLoggedIn(), pnUserLogOut()


Previous
pnUserLoggedIn

Home
up

Next
pnUserLogOut