Prev |  |

## 2.7. User authentication and session handling

### 2.7.1. user_authenticate

This hooks gives modules a chance to handle the user authentication (for example to authenticate against an external source like an LDAP server).

Call time:

Just before Phorum runs its own user authentication.

Hook input:

An array containing the following fields:

- type: either PHORUM_FORUM_SESSION or PHORUM_ADMIN_SESSION;
- username: the username of the user to authenticate;
- password: the password of the user to authenticate;
- user_id: Always NULL on input. This field implements the authentication state.

Hook output:

The same array as the one that was used for the hook call argument, possibly with the user_id field updated. This field can be set to one of the following values by a module:

- NULL: let Phorum handle the authentication
- FALSE: the authentication credentials are rejected
- 1234: the numerical user_id of the authenticated user

Prev | Up |
| Home |