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
ae361bc5
Commit
ae361bc5
authored
Aug 06, 2019
by
Thomas Löffler
Browse files
Remove unused fields and add TCA for new password hash field
parent
b34c203a
Pipeline
#7417
passed with stages
in 2 minutes and 42 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
extensions/t3o_ldap/Classes/Connectors/Ldap.php
View file @
ae361bc5
...
...
@@ -511,16 +511,13 @@ class Ldap implements \Psr\Log\LoggerAwareInterface
if
(
$this
->
isSaltedPassword
(
$user
->
getPassword
())
===
false
)
{
/** @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_sha512'
);
}
// if hash fields are filled, store them into ldap user and remove them afterwards
if
(
$this
->
isSaltedPassword
(
$user
->
getPassword
())
&&
(
$myProfileUser
->
getHashSha1
()
||
$myProfileUser
->
getHashCryptSha512
()))
{
$ldapUserArray
[
'userPassword'
][]
=
$myProfileUser
->
getHashSha1
();
$ldapUserArray
[
'userPassword'
][]
=
$myProfileUser
->
getHashCryptSha512
();
$myProfileUser
->
setHashCrypt
(
''
);
$myProfileUser
->
setHashCryptSha512
(
''
);
$myProfileRepository
->
update
(
$myProfileUser
);
GeneralUtility
::
makeInstance
(
\
TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager
::
class
)
->
persistAll
();
...
...
extensions/t3o_ldap/Classes/Utility/PasswordHashing.php
View file @
ae361bc5
...
...
@@ -33,10 +33,6 @@ class PasswordHashing
$ret
=
false
;
if
(
trim
(
$clearText
)
!==
''
)
{
switch
(
$algorithm
)
{
case
'sha1'
:
$passwordHash
=
sha1
(
$clearText
,
true
);
$ret
=
'{SHA}'
.
base64_encode
(
$passwordHash
);
break
;
case
'crypt_sha512'
:
$characters
=
array_merge
(
range
(
'0'
,
'9'
),
...
...
extensions/t3omy/Configuration/TCA/Overrides/fe_users.php
View file @
ae361bc5
...
...
@@ -32,23 +32,9 @@ $feUsersColumns = [
'type'
=>
'input'
],
],
'hash_
md5
'
=>
[
'hash_
crypt_sha512
'
=>
[
'exclude'
=>
0
,
'label'
=>
'MD5 Hash of password'
,
'config'
=>
[
'type'
=>
'none'
],
],
'hash_sha1'
=>
[
'exclude'
=>
0
,
'label'
=>
'SHA1 Hash of password'
,
'config'
=>
[
'type'
=>
'none'
],
],
'hash_crypt'
=>
[
'exclude'
=>
0
,
'label'
=>
'Crypt Hash of password'
,
'label'
=>
'Crypt SHA512 Hash of password'
,
'config'
=>
[
'type'
=>
'none'
],
...
...
@@ -56,7 +42,7 @@ $feUsersColumns = [
];
$fields
=
'github, twitter, facebook, terms_version'
;
$passwordHashFields
=
'hash_
md5, hash_sha1, hash_crypt
'
;
$passwordHashFields
=
'hash_
crypt_sha512
'
;
\
TYPO3\CMS\Core\Utility\ExtensionManagementUtility
::
addToAllTCAtypes
(
'fe_users'
,
...
...
extensions/t3omy/ext_tables.sql
View file @
ae361bc5
...
...
@@ -7,7 +7,6 @@ CREATE TABLE fe_users (
facebook
VARCHAR
(
255
),
terms_version
VARCHAR
(
255
),
hash_sha1
VARCHAR
(
255
)
DEFAULT
''
NOT
NULL
,
hash_crypt_sha512
VARCHAR
(
255
)
DEFAULT
''
NOT
NULL
);
...
...
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