TYPO3 typoscript: insert user IP address

raw

powermail-duplicates.ts

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# https://docs.typo3.org/typo3cms/extensions/powermail/stable/ForAdministrators/BestPractice/PreventDuplicates/Index.html
plugin.tx_powermail.settings.setup {
    # Prefill all fields {timestamppreventduplicates} with current timestamp
    #prefill.timestamppreventduplicates = TEXT
    #prefill.timestamppreventduplicates.data = date:U
    prefill.timestamppreventduplicates = COA
    prefill.timestamppreventduplicates {
        10 = TEXT
        10.data = date:U
        20 = TEXT
        20.value = -
        30 = TEXT
        30.data = getIndpEnv:REMOTE_ADDR
    }
 
    # turn unique validation off per default
    validation.unique.timestamppreventduplicates = 0
 
    # remove timestamp from powermail all variable
    excludeFromPowermailAllMarker {
        confirmationPage.excludeFromMarkerNames = timestamppreventduplicates
        submitPage.excludeFromMarkerNames = timestamppreventduplicates
        receiverMail.excludeFromMarkerNames = timestamppreventduplicates
        senderMail.excludeFromMarkerNames = timestamppreventduplicates
        optinMail.excludeFromMarkerNames = timestamppreventduplicates
    }
}
plugin.tx_powermail._LOCAL_LANG {
    default.validationerror_unique = Sie haben dieses Formular bereits abgeschickt.
    de.validationerror_unique = Sie haben dieses Formular bereits abgeschickt.
}
 
# turn validation on if GET/POST param with field timestamppreventduplicates exists
[globalVar = GP:tx_powermail_pi1|field|timestamppreventduplicates > 0]
plugin.tx_powermail.settings.setup.validation.unique.timestamppreventduplicates = 1
[end]
 
Christian Weiske Christian Weiske
owner

History