dolibarr 21.0.0-beta
|
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. | |
checkLoginPassEntity ($usertotest, $passwordtotest, $entitytotest, $authmode, $context='') | |
Return a login if login/pass was successful. | |
if(!function_exists( 'dol_loginfunction')) | makesalt ($type=CRYPT_SALT_LENGTH) |
Initialise the salt for the crypt function. | |
encodedecode_dbpassconf ($level=0) | |
Encode or decode database password in config file. | |
getRandomPassword ($generic=false, $replaceambiguouschars=null, $length=32) | |
Return a generated password using default module. | |
dolJSToSetRandomPassword ($htmlname, $htmlnameofbutton='generate_token', $generic=1) | |
Output javascript to autoset a generated password using default module into a HTML element. | |
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 successful.
string | $usertotest | Login value to test |
string | $passwordtotest | Password value to test |
int | string | $entitytotest | Instance of data we must check |
string[] | $authmode | Array list of selected authentication mode array('http', 'dolibarr', 'xxx'...) |
'api'|'dav'|'ws'|'' | $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 59 of file security2.lib.php.
References $conf, $context, dol_buildpath(), dol_osencode(), and dol_syslog().
Referenced by check_authentication(), and Login\index().
dol_getwebuser | ( | $mode | ) |
Return user/group account of web server.
string | $mode | 'user' or 'group' |
Definition at line 37 of file security2.lib.php.
dolJSToSetRandomPassword | ( | $htmlname, | |
$htmlnameofbutton = 'generate_token', | |||
$generic = 1 ) |
Output javascript 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 |
int | $generic | 1=Return a generic pass, 0=Return a pass following setup rules |
Definition at line 576 of file security2.lib.php.
References $conf, and dol_escape_js().
Referenced by FormSetupItem\generateInputFieldSecureKey().
encodedecode_dbpassconf | ( | $level = 0 | ) |
Encode or decode database password in config file.
int | $level | Encode level: 0 no encoding, 1 encoding |
Definition at line 383 of file security2.lib.php.
References conf(), dol_decode(), dol_encode(), dol_syslog(), and dolDecrypt().
getRandomPassword | ( | $generic = false, | |
$replaceambiguouschars = null, | |||
$length = 32 ) |
Return a generated password using default module.
bool | $generic | true=Create generic password (32 chars/numbers), false=Use the configured password generation module |
?array<string> | $replaceambiguouschars Discard ambiguous characters. For example array('I'). | |
int | $length | Length of random string (Used only if $generic is true) |
Definition at line 489 of file security2.lib.php.
References $conf, and getDolGlobalString().
Referenced by addFileIntoDatabaseIndex(), ActionsAdherentCardCommon\assign_values(), ActionsContactCardCommon\assign_values(), CommonObject\getLastMainDocLink(), BlockedLog\getSignature(), CommonObject\indexFile(), Adherent\setPassword(), and User\setPassword().
if(!function_exists('dol_loginfunction')) makesalt | ( | $type = CRYPT_SALT_LENGTH | ) |
Initialise the salt for the crypt function.
int | $type | 2 =>Return a salt for DES encryption 12=>Return a salt for MD5 encryption Undefined=>Return a salt for default encryption |
Definition at line 346 of file security2.lib.php.
References dol_strlen(), and dol_syslog().
Referenced by MailmanSpip\add_to_spip().