PostNuke Help |
||
|---|---|---|
Previous |
Next |
|
log user in
bool pnUserLogIn(uname, pass, rememberme);
pnUserLogIn() attempts to log the user in to the PostNuke system with the supplied parameters.
The username of the user attempting to log in
The password of the user attempting to log in
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.
This function returns true if the user is successfully logged in, otherwise it returns false. This function returns void if an exception was raised.
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.
// Attempt to log user in
if (!pnUserLogIn(pnVarCleanFromInput('username'),
pnVarCleanFromInput('password'),
pnVarCleanFromInput('rememberme')) {
die('Bad username/password');
} else {
// User logged on successfully
}
pnUserLoggedIn(), pnUserLogOut()
Previous |
Next |