Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
qfq
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
typo3
qfq
Commits
a7495dae
Commit
a7495dae
authored
6 years ago
by
Marc Egger
Browse files
Options
Downloads
Patches
Plain Diff
Password.php: make Password functions static, run Typo3 bootstrap
parent
4cc6bd5c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!122
F7165 fe user registration
Pipeline
#1497
passed
6 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
extension/Source/core/typo3/Password.php
+16
-6
16 additions, 6 deletions
extension/Source/core/typo3/Password.php
with
16 additions
and
6 deletions
extension/Source/core/typo3/Password.php
+
16
−
6
View file @
a7495dae
...
...
@@ -25,10 +25,10 @@ class Password {
* @param string $newPassword
* @return string
*/
public
function
getHash
(
$newPassword
)
{
public
static
function
getHash
(
$newPassword
)
{
$saltedPassword
=
md5
(
$newPassword
);
// Use md5 as fallback
$this
->
t3AutoloadIfNotRunning
();
self
::
t3AutoloadIfNotRunning
();
if
(
\TYPO3\CMS\Saltedpasswords\Utility\SaltedPasswordsUtility
::
isUsageEnabled
(
'FE'
))
{
$objSalt
=
\TYPO3\CMS\Saltedpasswords\Salt\SaltFactory
::
getSaltingInstance
(
NULL
);
if
(
is_object
(
$objSalt
))
{
...
...
@@ -46,9 +46,9 @@ class Password {
* @param string $password
* @return bool
*/
public
function
checkPassword
(
$saltedPassword
,
$password
)
{
public
static
function
checkPassword
(
$saltedPassword
,
$password
)
{
$this
->
t3AutoloadIfNotRunning
();
self
::
t3AutoloadIfNotRunning
();
$success
=
FALSE
;
if
(
\TYPO3\CMS\Saltedpasswords\Utility\SaltedPasswordsUtility
::
isUsageEnabled
(
'FE'
))
{
$objSalt2
=
\TYPO3\CMS\Saltedpasswords\Salt\SaltFactory
::
getSaltingInstance
(
$saltedPassword
);
...
...
@@ -62,11 +62,21 @@ class Password {
/**
* Load Typo3 autoloader if Typo3 is not instantiated
*/
public
function
t3AutoloadIfNotRunning
()
{
public
static
function
t3AutoloadIfNotRunning
()
{
if
(
!
isset
(
$GLOBALS
[
'TSFE'
]
))
{
if
(
!
class_exists
(
'\TYPO3\CMS\Saltedpasswords\Utility\SaltedPasswordsUtility'
))
{
//TODO: Get absolute 'path' via QFQ config
require
__DIR__
.
'/../../../../../../typo3_src/vendor/autoload.php'
;
// run typo3 bootstrap if not yet happened. Necessary if run in unittest.
if
(
!
defined
(
'TYPO3_MODE'
))
{
\TYPO3\CMS\Core\Core\Bootstrap
::
getInstance
()
->
setRequestType
(
TYPO3_REQUESTTYPE_AJAX
)
->
baseSetup
(
0
);
// Alternate error fix if you don't want to run Typo3 bootstrap:
// error_reporting(E_ALL & ~(E_STRICT | E_NOTICE | E_DEPRECATED));
define
(
'TYPO3_MODE'
,
'FE'
);
}
}
}
}
\ No newline at end of file
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