PostNuke Help

Previous
pnUserLogOut

Home
up

Next
pnUserValidateVar


pnUserSetVar

set user variable

Synopsis

bool pnUserSetVar()(name, value);

Description

pnUserSetVar() sets a user-specific variable on the PostNuke system.

Parameters

name

The name of a user variable to set

value

The value to set the named user variable to

Return Values

This function returns true if the update is successful, false if the variable validation fails. 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 raises ID_NOT_EXIST if the user id is unknown. This function raises MODULE_FILE_NOT_EXIST if a authentication module file doesn't exist. This function raises MODULE_FUNCTION_NOT_EXIST if a authentication module function doesn't exist. This function raises MODULE_NOT_EXIST if the authentication module doesn't exist. This function raises NOT_LOGGED_IN if the user is not logged in. This function raises NO_PERMISSION if you don't have right permission to set variable value. This function raises UNKNOWN for internal problems. This function raises VARIABLE_NOT_REGISTERED if the metadata of variable you are trying to update is not registered.

Notes

The user-specific variables available with this release of the API listed in the documentation for pnUserGetVar() See the User Variable section in the PostNuke Module Development Guide for getting an explanation on user variables.

Examples

// Update the user's email address
if (!pnUserSetVar('email', 'foo@bar.net')) {
  die('Problem setting user variable');
}
       

See Also

pnUserGetVar()


Previous
pnUserLogOut

Home
up

Next
pnUserValidateVar