Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
03010ac7
Commit
03010ac7
authored
16 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Can still connect if option do not save clear password is reversed.
parent
3ad5d6b5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
htdocs/admin/security.php
+4
-1
4 additions, 1 deletion
htdocs/admin/security.php
htdocs/includes/login/functions_dolibarr.php
+14
-4
14 additions, 4 deletions
htdocs/includes/login/functions_dolibarr.php
htdocs/index.php
+3
-3
3 additions, 3 deletions
htdocs/index.php
with
21 additions
and
8 deletions
htdocs/admin/security.php
+
4
−
1
View file @
03010ac7
...
...
@@ -61,9 +61,11 @@ if ($_GET["action"] == 'activate_encrypt')
$db
->
begin
();
dolibarr_set_const
(
$db
,
"DATABASE_PWD_ENCRYPTED"
,
"1"
);
$sql
=
"UPDATE "
.
MAIN_DB_PREFIX
.
"user as u"
;
$sql
.
=
" SET
u.pass = NULL AND
u.pass_crypted = MD5(u.pass)"
;
$sql
.
=
" SET u.pass_crypted = MD5(u.pass)
, u.pass = NULL
"
;
$sql
.
=
" WHERE u.pass IS NOT NULL AND LENGTH(u.pass) < 32"
;
// Not a MD5 value
$sql
.
=
" AND MD5(u.pass) IS NOT NULL"
;
//print $sql;
$result
=
$db
->
query
(
$sql
);
...
...
@@ -75,6 +77,7 @@ if ($_GET["action"] == 'activate_encrypt')
}
else
{
$db
->
rollback
();
dolibarr_print_error
(
$db
,
''
);
}
}
...
...
This diff is collapsed.
Click to expand it.
htdocs/includes/login/functions_dolibarr.php
+
14
−
4
View file @
03010ac7
...
...
@@ -63,23 +63,33 @@ function check_user_password_dolibarr($usertotest,$passwordtotest)
// Check crypted password
$cryptType
=
''
;
if
(
$conf
->
global
->
DATABASE_PWD_ENCRYPTED
)
$cryptType
=
'md5'
;
if
(
!
empty
(
$conf
->
global
->
DATABASE_PWD_ENCRYPTED
))
$cryptType
=
$conf
->
global
->
DATABASE_PWD_ENCRYPTED
;
// By default, we used MD5
if
(
!
in_array
(
$cryptType
,
array
(
'md5'
)))
$cryptType
=
'md5'
;
// Check crypted password according to crypt algorithm
if
(
$cryptType
==
'md5'
)
{
if
(
md5
(
$passtyped
)
==
$passcrypted
)
$passok
=
true
;
if
(
md5
(
$passtyped
)
==
$passcrypted
)
{
$passok
=
true
;
dolibarr_syslog
(
"functions_dolibarr::check_user_password_dolibarr Authentification ok - "
.
$cryptType
.
" of pass is ok"
);
}
}
// For compatibility with old versions
if
(
!
$passok
)
{
if
((
!
$passcrypted
||
$passtyped
)
&&
(
$passtyped
==
$passclear
))
$passok
=
true
;
&&
(
$passtyped
==
$passclear
))
{
$passok
=
true
;
dolibarr_syslog
(
"functions_dolibarr::check_user_password_dolibarr Authentification ok - found pass in database"
);
}
}
// Password ok ?
if
(
$passok
)
{
dolibarr_syslog
(
"functions_dolibarr::check_user_password_dolibarr Authentification ok"
);
$login
=
$_POST
[
"username"
];
}
else
...
...
This diff is collapsed.
Click to expand it.
htdocs/index.php
+
3
−
3
View file @
03010ac7
...
...
@@ -19,9 +19,9 @@
*/
/**
\file htdocs/index.php
\brief Page accueil par defaut
\version $Id$
*
\file htdocs/index.php
*
\brief Page accueil par defaut
*
\version $Id$
*/
require
(
"./pre.inc.php"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment