Documentation

login


login

This function sign in the user and save his information in _SESSION variable, so that the user stays logged on for the session.

User::login(get("login"), get("password"), $enable_cookies = true, get("logout"));

This function returns one of the LOGIN constants, so it can be LOGIN_LOGGED if already logged, LOGIN_DONE if login and password were correct and LOGIN_ERROR if incorrect. Call the login function to manage user authentication after you've connected the database.

If logout parameter is true, login call automatically the logout() function.

The authentication is done with login and password. To improve security, the password is combined to a "salt" and encrypted with MD5. The "salt" is renewed every time the user logs in.