Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
services
t3o sites
voting.typo3.org
extensions
election
Commits
1b6e054e
Commit
1b6e054e
authored
Dec 23, 2015
by
Oliver Eglseder
Browse files
[TASK] Filter test requests
parent
949e70f3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Classes/Controller/FeElectionController.php
View file @
1b6e054e
...
...
@@ -31,11 +31,36 @@ class FeElectionController extends ActionController
*/
protected
$hashService
=
null
;
/**
* @throws \TYPO3\CMS\Extbase\Mvc\Exception\InvalidArgumentNameException
* @throws \TYPO3\CMS\Extbase\Mvc\Exception\NoSuchArgumentException
*/
public
function
initializeVoteAction
()
{
if
(
$this
->
request
->
hasArgument
(
'electionInvitation'
))
{
$electionInvitation
=
$this
->
request
->
getArgument
(
'electionInvitation'
);
if
(
$electionInvitation
===
'-1'
)
{
$this
->
response
->
appendContent
(
'TEST SUCCESSFUL'
);
$this
->
request
->
setArgument
(
'electionInvitation'
,
null
);
$this
->
actionMethodName
=
'voidAction'
;
}
}
}
/**
*
*/
public
function
voidAction
()
{
return
''
;
}
/**
* @param ElectionInvitation $electionInvitation
* @param string $hmac
* @return string
*/
public
function
voteAction
(
ElectionInvitation
$electionInvitation
,
$hmac
)
public
function
voteAction
(
ElectionInvitation
$electionInvitation
=
null
,
$hmac
=
''
)
{
$saltedEmail
=
$electionInvitation
->
getSecret
()
.
$electionInvitation
->
getElector
()
->
getEmail
();
if
(
$this
->
hashService
->
validateHmac
(
$saltedEmail
,
$hmac
))
{
...
...
Classes/Domain/Model/ElectionCircular.php
View file @
1b6e054e
...
...
@@ -21,6 +21,7 @@ use TYPO3\CMS\Extbase\Object\ObjectManager;
use
TYPO3\CMS\Extbase\Security\Cryptography\HashService
;
use
TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController
;
use
TYPO3\Election\Controller\FeElectionController
;
use
TYPO3\Election\Domain\Repository\ConfigurationRepository
;
/**
* Class ElectionCircular
...
...
@@ -102,11 +103,12 @@ class ElectionCircular extends AbstractEntity
$dummyElector
->
setEmail
(
'kasper@typo3.org'
);
$dummyElectionInvitation
=
new
ElectionInvitation
();
$dummyElectionInvitation
->
setElector
(
$dummyElector
);
$dummyElectionInvitation
->
_setProperty
(
'uid'
,
9999999
);
$dummyElectionInvitation
->
_setProperty
(
'uid'
,
-
1
);
$dummyElectionInvitation
->
setSecret
(
'foooBAAAAArrrrr'
);
$dummyConfiguration
=
new
Configuration
();
$dummyConfiguration
->
setPluginPid
(
1
);
return
$this
->
getRenderedBody
(
$dummyConfiguration
,
$dummyElectionInvitation
);
return
$this
->
getRenderedBody
(
GeneralUtility
::
makeInstance
(
ObjectManager
::
class
)
->
get
(
ConfigurationRepository
::
class
)
->
findCurrent
(),
$dummyElectionInvitation
);
}
/**
...
...
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