dolibarr 19.0.3
functions_http.php File Reference

Authentication functions for HTTP Basic. More...

Go to the source code of this file.

Functions

 check_user_password_http ($usertotest, $passwordtotest, $entitytotest)
 Check validity of user/password/entity If test is ko, reason must be filled into $_SESSION["dol_loginmesg"].
 
 decodeHttpBasicAuth ($value)
 Decode the value found into the Authorization HTTP header.
 

Detailed Description

Authentication functions for HTTP Basic.

Definition in file functions_http.php.

Function Documentation

◆ check_user_password_http()

check_user_password_http ( $usertotest,
$passwordtotest,
$entitytotest )

Check validity of user/password/entity If test is ko, reason must be filled into $_SESSION["dol_loginmesg"].

Parameters
string$usertotestLogin
string$passwordtotestPassword
int$entitytotestNumber of instance (always 1 if module multicompany not enabled)
Returns
string Login if OK, '' if KO

Definition at line 34 of file functions_http.php.

References dol_syslog().

◆ decodeHttpBasicAuth()

decodeHttpBasicAuth ( $value)

Decode the value found into the Authorization HTTP header.

Ex: "Authorization: Basic bG9naW46cGFzcw==", $value is "Basic bG9naW46cGFzcw==" and after base64decode is "login:pass" Note: the $_SERVER["REMOTE_USER"] contains only the login used in the HTTP Basic form Method not used yet, but we keep it for some dev/test purposes.

Parameters
string$valueEx: $_SERVER["REMOTE_USER"]
Returns
Object object.login & object.password

Definition at line 62 of file functions_http.php.