Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
services
Archive
t3o
my.typo3.org
Commits
e0dbc43d
Commit
e0dbc43d
authored
Aug 03, 2019
by
Thomas Löffler
Browse files
Remove md5 and crypt from user model and add crypt_sha512
parent
366392b1
Pipeline
#7387
passed with stages
in 2 minutes and 40 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
extensions/t3o_ldap/Classes/Connectors/Ldap.php
View file @
e0dbc43d
...
...
@@ -512,19 +512,16 @@ class Ldap implements \Psr\Log\LoggerAwareInterface
/** @var \T3o\T3oLdap\Utility\PasswordHashing $passwordHashing */
$passwordHashing
=
GeneralUtility
::
makeInstance
(
\
T3o\T3oLdap\Utility\PasswordHashing
::
class
);
$ldapUserArray
[
'userPassword'
][]
=
$passwordHashing
->
getPasswordHash
(
$user
->
getPassword
(),
'sha1'
);
$ldapUserArray
[
'userPassword'
][]
=
$passwordHashing
->
getPasswordHash
(
$user
->
getPassword
(),
'crypt'
);
$ldapUserArray
[
'userPassword'
][]
=
$passwordHashing
->
getPasswordHash
(
$user
->
getPassword
(),
'md5'
);
$ldapUserArray
[
'userPassword'
][]
=
$passwordHashing
->
getPasswordHash
(
$user
->
getPassword
(),
'crypt_sha512'
);
}
// if hash fields are filled, store them into ldap user and remove them afterwards
if
(
$this
->
isSaltedPassword
(
$user
->
getPassword
())
&&
(
$myProfileUser
->
getHashMd5
()
||
$myProfileUser
->
getHashSha1
()
||
$myProfileUser
->
getHashCrypt
()))
{
if
(
$this
->
isSaltedPassword
(
$user
->
getPassword
())
&&
(
$myProfileUser
->
getHashSha1
()
||
$myProfileUser
->
getHashCrypt
Sha512
()))
{
$ldapUserArray
[
'userPassword'
][]
=
$myProfileUser
->
getHashSha1
();
$ldapUserArray
[
'userPassword'
][]
=
$myProfileUser
->
getHashCrypt
();
$ldapUserArray
[
'userPassword'
][]
=
$myProfileUser
->
getHashMd5
();
$ldapUserArray
[
'userPassword'
][]
=
$myProfileUser
->
getHashCryptSha512
();
$myProfileUser
->
setHashCrypt
(
''
);
$myProfileUser
->
setHashMd5
(
''
);
$myProfileUser
->
setHashSha1
(
''
);
$myProfileUser
->
setHashCryptSha512
(
''
);
$myProfileRepository
->
update
(
$myProfileUser
);
GeneralUtility
::
makeInstance
(
\
TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager
::
class
)
->
persistAll
();
}
...
...
extensions/t3omy/Classes/Domain/Model/MyProfile.php
View file @
e0dbc43d
...
...
@@ -28,11 +28,6 @@ class MyProfile extends \In2code\Femanager\Domain\Model\User
*/
protected
$termsVersion
=
''
;
/**
* @var string
*/
protected
$hashMd5
=
''
;
/**
* @var string
*/
...
...
@@ -41,7 +36,7 @@ class MyProfile extends \In2code\Femanager\Domain\Model\User
/**
* @var string
*/
protected
$hashCrypt
=
''
;
protected
$hashCrypt
Sha512
=
''
;
/**
* @return string
...
...
@@ -107,16 +102,6 @@ class MyProfile extends \In2code\Femanager\Domain\Model\User
$this
->
termsVersion
=
$termsVersion
;
}
public
function
getHashMd5
():
string
{
return
$this
->
hashMd5
;
}
public
function
setHashMd5
(
string
$hashMd5
)
{
$this
->
hashMd5
=
$hashMd5
;
}
public
function
getHashSha1
():
string
{
return
$this
->
hashSha1
;
...
...
@@ -127,13 +112,13 @@ class MyProfile extends \In2code\Femanager\Domain\Model\User
$this
->
hashSha1
=
$hashSha1
;
}
public
function
getHashCrypt
():
string
public
function
getHashCrypt
Sha512
():
string
{
return
$this
->
hashCrypt
;
return
$this
->
hashCrypt
Sha512
;
}
public
function
setHashCrypt
(
string
$hashCrypt
)
public
function
setHashCrypt
Sha512
(
string
$hashCrypt
Sha512
):
void
{
$this
->
hashCrypt
=
$hashCrypt
;
$this
->
hashCrypt
Sha512
=
$hashCrypt
Sha512
;
}
}
extensions/t3omy/ext_tables.sql
View file @
e0dbc43d
...
...
@@ -7,9 +7,8 @@ CREATE TABLE fe_users (
facebook
VARCHAR
(
255
),
terms_version
VARCHAR
(
255
),
hash_md5
VARCHAR
(
255
)
DEFAULT
''
NOT
NULL
,
hash_sha1
VARCHAR
(
255
)
DEFAULT
''
NOT
NULL
,
hash_crypt
VARCHAR
(
255
)
DEFAULT
''
NOT
NULL
hash_crypt
_sha512
VARCHAR
(
255
)
DEFAULT
''
NOT
NULL
);
CREATE
TABLE
old_users
(
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment