dolibarr
x.y.z
|
Set of function used for dolibarr security (not common functions). More...
Go to the source code of this file.
Functions | |
dol_getwebuser ($mode) | |
Return user/group account of web server. More... | |
checkLoginPassEntity ($usertotest, $passwordtotest, $entitytotest, $authmode, $context='') | |
Return a login if login/pass was successfull. More... | |
if(!function_exists('dol_loginfunction')) | makesalt ($type=CRYPT_SALT_LENGTH) |
Fonction pour initialiser un salt pour la fonction crypt. More... | |
encodedecode_dbpassconf ($level=0) | |
Encode or decode database password in config file. More... | |
getRandomPassword ($generic=false, $replaceambiguouschars=null, $length=32) | |
Return a generated password using default module. More... | |
dolJSToSetRandomPassword ($htmlname, $htmlnameofbutton='generate_token') | |
Ouput javacript to autoset a generated password using default module into a HTML element. More... | |
Set of function used for dolibarr security (not common functions).
Warning, this file must not depends on other library files, except function.lib.php because it is used at low code level.
Definition in file security2.lib.php.
checkLoginPassEntity | ( | $usertotest, | |
$passwordtotest, | |||
$entitytotest, | |||
$authmode, | |||
$context = '' |
|||
) |
Return a login if login/pass was successfull.
string | $usertotest | Login value to test |
string | $passwordtotest | Password value to test |
string | $entitytotest | Instance of data we must check |
array | $authmode | Array list of selected authentication mode array('http', 'dolibarr', 'xxx'...) |
string | $context | Context checkLoginPassEntity was created for ('api', 'dav', 'ws', '') |
Show Dolibarr default login page. Part of this code is also duplicated into main.inc.php::top_htmlhead
Translate | $langs | Lang object (must be initialized by a new). |
Conf | $conf | Conf object |
Societe | $mysoc | Company object |
Definition at line 57 of file security2.lib.php.
dol_getwebuser | ( | $mode | ) |
Return user/group account of web server.
string | $mode | 'user' or 'group' |
Definition at line 35 of file security2.lib.php.
dolJSToSetRandomPassword | ( | $htmlname, | |
$htmlnameofbutton = 'generate_token' |
|||
) |
Ouput javacript to autoset a generated password using default module into a HTML element.
string | $htmlname | HTML name of element to insert key into |
string | $htmlnameofbutton | HTML name of button |
Definition at line 567 of file security2.lib.php.
encodedecode_dbpassconf | ( | $level = 0 | ) |
Encode or decode database password in config file.
int | $level | Encode level: 0 no encoding, 1 encoding |
Definition at line 382 of file security2.lib.php.
getRandomPassword | ( | $generic = false , |
|
$replaceambiguouschars = null , |
|||
$length = 32 |
|||
) |
Return a generated password using default module.
boolean | $generic | true=Create generic password (32 chars/numbers), false=Use the configured password generation module |
array | $replaceambiguouschars | Discard ambigous characters. For example array('I'). |
int | $length | Length of random string (Used only if $generic is true) |
Definition at line 482 of file security2.lib.php.
if (!function_exists( 'dol_loginfunction')) makesalt | ( | $type = CRYPT_SALT_LENGTH | ) |
Fonction pour initialiser un salt pour la fonction crypt.
int | $type | 2=>renvoi un salt pour cryptage DES 12=>renvoi un salt pour cryptage MD5 non defini=>renvoi un salt pour cryptage par defaut |
Definition at line 345 of file security2.lib.php.