2
0
forked from Wavyzz/dolibarr

Qual: Clean code of login methods

Fix: Share same method for point of sale and rest of dolibarr
This commit is contained in:
Laurent Destailleur
2011-05-30 13:45:51 +00:00
parent 9bed8bb31b
commit 0e7d0d00f1
8 changed files with 102 additions and 116 deletions

View File

@@ -26,8 +26,9 @@
/**
* Return list of login methods provided by external third party modules.
* @return array
* Return a login if login/pass was successfull using an external login method
* @return string Login or ''
* TODO Provide usertotest, passwordtotest and entitytotest by parameters
*/
function getLoginMethod()
{
@@ -56,8 +57,9 @@ function getLoginMethod()
// Call function to check user/password
$usertotest=$_POST["username"];
$passwordtotest=$_POST["password"];
$entitytotest=$_POST["entity"];
$function='check_user_password_'.$mode;
$login=$function($usertotest,$passwordtotest);
$login=$function($usertotest,$passwordtotest,$entitytotest);
if ($login)
{
$conf->authmode=$mode; // This properties is defined only when logged
@@ -543,7 +545,7 @@ function dol_efc_config()
function getRandomPassword()
{
global $db,$conf,$langs,$user;
$generated_password='';
if ($conf->global->USER_PASSWORD_GENERATED)
{