httpRequestLogin
Manual Review Required
Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.
This function makes the user's browser show a 'basic authentication' login box. The result of the login is handled automatically by the server. If the user has not logged in satisfactorily, you should just call the httpRequestLogin function again. It is the script's responsibility to judge when the user is logged in satisfactorily - you can use the user variable can be used to check if the user has logged in with an account you are happy with. If the logged in user doesn't meet whatever criteria you have, you can just call httpRequestLogin again and they will be re-promoted for their password.
Syntax
bool httpRequestLogin ( )Returns
- bool: value
Returns true if the relevant headers and return codes have been set, false otherwise. Essentially, always returns true .
Code Examples
This example shows how you can make a page that only registered users can see.
<*if isGuestAccount(user) then httpRequestLogin()else *>Welcome to the top secret area for registered users!<*end *>