{"type":"rich","version":"1.0","provider_name":"phorkie","provider_url":"https:\/\/p.cweiske.de\/","title":"TYPO3 typoscript: insert user IP address","author_name":"Christian Weiske","cache_age":86400,"width":900,"height":900,"html":"<!-- embedding all files of https:\/\/p.cweiske.de\/637 -->\n<link rel=\"stylesheet\" href=\"https:\/\/p.cweiske.de\/css\/embed.css\"\/>\n<div class=\"phork\" id=\"637\">\n    <div class=\"phork-file\">\n <div class=\"phork-content\">\n  \n<div class=\"document\">\n\n\n<p>Documentation: <a class=\"reference external\" href=\"https:\/\/docs.typo3.org\/m\/typo3\/reference-typoscript\/master\/en-us\/DataTypes\/Index.html#getindpenv\">https:\/\/docs.typo3.org\/m\/typo3\/reference-typoscript\/master\/en-us\/DataTypes\/Index.html#getindpenv<\/a><\/p>\n<pre class=\"literal-block\">\nfoo = TEXT\nfoo.data = getIndpEnv:REMOTE_ADDR\n<\/pre>\n<div class=\"section\" id=\"powermail-prevent-duplicate-submissions\">\n<h1>Powermail: Prevent duplicate submissions<\/h1>\n<p>See <a class=\"reference external\" href=\"https:\/\/docs.typo3.org\/typo3cms\/extensions\/powermail\/stable\/ForAdministrators\/BestPractice\/PreventDuplicates\/Index.html\">https:\/\/docs.typo3.org\/typo3cms\/extensions\/powermail\/stable\/ForAdministrators\/BestPractice\/PreventDuplicates\/Index.html<\/a><\/p>\n<\/div>\n<\/div>\n\n <\/div>\n <div class=\"phork-meta\">\n  <a href=\"https:\/\/p.cweiske.de\/637\/rev-raw\/74dc883e5a69f51ec4e41104131112566702de9c\/README.rst\" style=\"float: right\">view raw source<\/a>\n  <a href=\"https:\/\/p.cweiske.de\/637#README.rst\">README.rst<\/a>\n <\/div>\n<\/div>\n    <div class=\"phork-file\">\n <div class=\"phork-content\">\n  <style type=\"text\/css\">\/**\n * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2014 Benny Baumann\n * (http:\/\/qbnz.com\/highlighter\/ and http:\/\/geshi.org\/)\n *\/\n.typoscript .de1, .typoscript .de2 {font: normal normal 1em\/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;}\n.typoscript  {font-family:monospace;}\n.typoscript .imp {font-weight: bold; color: red;}\n.typoscript li, .typoscript .li1 {color: #DDD;}\n.typoscript .ln {width:1px;text-align:right;margin:0;padding:0 2px;vertical-align:top;}\n.typoscript .kw1 {color: #ed7d14;}\n.typoscript .kw2 {font-weight: bold;}\n.typoscript .kw3 {color: #990000; font-weight: bold;}\n.typoscript .kw4 {color: #990000; font-weight: bold;}\n.typoscript .kw5 {color: #990000; font-weight: bold;}\n.typoscript .kw6 {color: #990000; font-weight: bold;}\n.typoscript .kw7 {color: #990000; font-weight: bold;}\n.typoscript .kw8 {font-weight: bold;}\n.typoscript .kw9 {color: #990000; font-weight: bold;}\n.typoscript .co1 {color: #aaa; font-style: italic;}\n.typoscript .co2 {color: #aaa; font-style: italic;}\n.typoscript .coMULTI {color: #aaa; font-style: italic;}\n.typoscript .br0 {color: #009900;}\n.typoscript .sy0 {color: #339933; font-weight: bold;}\n.typoscript .sy1 {color: #009900; font-weight: bold;}\n.typoscript .st0 {color: #ac14aa;}\n.typoscript .nu0 {color: #cc0000;}\n.typoscript .me1 {color: #0000e0; font-weight: bold;}\n.typoscript .me2 {color: #0000e0; font-weight: bold;}\n.typoscript .re0 {color: #009900;}\n.typoscript .re1 {color: #009900; font-weight: bold;}\n.typoscript .re2 {color: #3366CC;}\n.typoscript .re3 {color: #000066; font-weight: bold;}\n.typoscript .re4 {color: #ed7d14;}\n.typoscript .re5 {color: #000066; font-weight: bold;}\n.typoscript .re6 {color: #009900;}\n.typoscript .re7 {color: #3366CC;}\n.typoscript span.xtra { display:block; }\n<\/style><div class=\"code\"><table class=\"typoscript\"><tbody><tr class=\"li1\"><td class=\"ln\"><pre class=\"de1\">1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n<\/pre><\/td><td class=\"de1\"><pre class=\"de1\"><span class=\"co2\"># https:\/\/docs.typo3.org\/typo3cms\/extensions\/powermail\/stable\/ForAdministrators\/BestPractice\/PreventDuplicates\/Index.html<\/span>\n<a href=\"http:\/\/documentation.typo3.org\/documentation\/tsref\/tlo-objects\/plugin\/\"><span class=\"kw3\">plugin<\/span><\/a><span class=\"sy0\">.<\/span>tx_powermail<span class=\"sy0\">.<\/span>settings<span class=\"sy0\">.<\/span>setup <span class=\"br0\">&#123;<\/span>\n&#160; &#160; <span class=\"co2\"># Prefill all fields {timestamppreventduplicates} with current timestamp<\/span>\n&#160; &#160; <span class=\"co2\">#prefill.timestamppreventduplicates = TEXT<\/span>\n&#160; &#160; <span class=\"co2\">#prefill.timestamppreventduplicates.data = date:U<\/span>\n&#160; &#160; prefill<span class=\"sy0\">.<\/span>timestamppreventduplicates <span class=\"sy0\">=<\/span> <a href=\"http:\/\/documentation.typo3.org\/documentation\/tsref\/cobjects\/COA\/\"><span class=\"kw4\">COA<\/span><\/a>\n&#160; &#160; prefill<span class=\"sy0\">.<\/span>timestamppreventduplicates <span class=\"br0\">&#123;<\/span>\n&#160; &#160; &#160; &#160; <span class=\"nu0\">10<\/span> <span class=\"sy0\">=<\/span> <a href=\"http:\/\/documentation.typo3.org\/documentation\/tsref\/cobjects\/TEXT\/\"><span class=\"kw4\">TEXT<\/span><\/a>\n&#160; &#160; &#160; &#160; <span class=\"nu0\">10<\/span><span class=\"sy0\">.<\/span>data <span class=\"sy0\">=<\/span> date<span class=\"sy0\">:<\/span>U\n&#160; &#160; &#160; &#160; <span class=\"nu0\">20<\/span> <span class=\"sy0\">=<\/span> <a href=\"http:\/\/documentation.typo3.org\/documentation\/tsref\/cobjects\/TEXT\/\"><span class=\"kw4\">TEXT<\/span><\/a>\n&#160; &#160; &#160; &#160; <span class=\"nu0\">20<\/span><span class=\"sy0\">.<\/span>value <span class=\"sy0\">=<\/span> -\n&#160; &#160; &#160; &#160; <span class=\"nu0\">30<\/span> <span class=\"sy0\">=<\/span> <a href=\"http:\/\/documentation.typo3.org\/documentation\/tsref\/cobjects\/TEXT\/\"><span class=\"kw4\">TEXT<\/span><\/a>\n&#160; &#160; &#160; &#160; <span class=\"nu0\">30<\/span><span class=\"sy0\">.<\/span>data <span class=\"sy0\">=<\/span> getIndpEnv<span class=\"sy0\">:<\/span>REMOTE_ADDR\n&#160; &#160; <span class=\"br0\">&#125;<\/span>\n&#160;\n&#160; &#160; <span class=\"co2\"># turn unique validation off per default<\/span>\n&#160; &#160; validation<span class=\"sy0\">.<\/span>unique<span class=\"sy0\">.<\/span>timestamppreventduplicates <span class=\"sy0\">=<\/span> <span class=\"nu0\">0<\/span>\n&#160;\n&#160; &#160; <span class=\"co2\"># remove timestamp from powermail all variable<\/span>\n&#160; &#160; excludeFromPowermailAllMarker <span class=\"br0\">&#123;<\/span>\n&#160; &#160; &#160; &#160; confirmationPage<span class=\"sy0\">.<\/span>excludeFromMarkerNames <span class=\"sy0\">=<\/span> timestamppreventduplicates\n&#160; &#160; &#160; &#160; submitPage<span class=\"sy0\">.<\/span>excludeFromMarkerNames <span class=\"sy0\">=<\/span> timestamppreventduplicates\n&#160; &#160; &#160; &#160; receiverMail<span class=\"sy0\">.<\/span>excludeFromMarkerNames <span class=\"sy0\">=<\/span> timestamppreventduplicates\n&#160; &#160; &#160; &#160; senderMail<span class=\"sy0\">.<\/span>excludeFromMarkerNames <span class=\"sy0\">=<\/span> timestamppreventduplicates\n&#160; &#160; &#160; &#160; optinMail<span class=\"sy0\">.<\/span>excludeFromMarkerNames <span class=\"sy0\">=<\/span> timestamppreventduplicates\n&#160; &#160; <span class=\"br0\">&#125;<\/span>\n<span class=\"br0\">&#125;<\/span>\n<a href=\"http:\/\/documentation.typo3.org\/documentation\/tsref\/tlo-objects\/plugin\/\"><span class=\"kw3\">plugin<\/span><\/a><span class=\"sy0\">.<\/span>tx_powermail<span class=\"sy0\">.<\/span>_LOCAL_LANG <span class=\"br0\">&#123;<\/span>\n&#160; &#160; default<span class=\"sy0\">.<\/span>validationerror_unique <span class=\"sy0\">=<\/span> Sie haben dieses Formular bereits abgeschickt<span class=\"sy0\">.<\/span>\n&#160; &#160; de<span class=\"sy0\">.<\/span>validationerror_unique <span class=\"sy0\">=<\/span> Sie haben dieses Formular bereits abgeschickt<span class=\"sy0\">.<\/span>\n<span class=\"br0\">&#125;<\/span>\n&#160;\n<span class=\"co2\"># turn validation on if GET\/POST param with field timestamppreventduplicates exists<\/span>\n<span class=\"br0\">&#91;<\/span><span class=\"re4\">globalVar<\/span> <span class=\"sy0\">=<\/span> GP<span class=\"sy0\">:<\/span><span class=\"re3\">tx_powermail_pi1<\/span><span class=\"sy0\">|<\/span>field<span class=\"sy0\">|<\/span>timestamppreventduplicates <span class=\"sy0\">&gt;<\/span> <span class=\"nu0\">0<\/span><span class=\"br0\">&#93;<\/span>\n<a href=\"http:\/\/documentation.typo3.org\/documentation\/tsref\/tlo-objects\/plugin\/\"><span class=\"kw3\">plugin<\/span><\/a><span class=\"sy0\">.<\/span>tx_powermail<span class=\"sy0\">.<\/span>settings<span class=\"sy0\">.<\/span>setup<span class=\"sy0\">.<\/span>validation<span class=\"sy0\">.<\/span>unique<span class=\"sy0\">.<\/span>timestamppreventduplicates <span class=\"sy0\">=<\/span> <span class=\"nu0\">1<\/span>\n<span class=\"br0\">&#91;<\/span><span class=\"re4\">end<\/span><span class=\"br0\">&#93;<\/span>\n&#160;<\/pre><\/td><\/tr><\/tbody><\/table><\/div>\n <\/div>\n <div class=\"phork-meta\">\n  <a href=\"https:\/\/p.cweiske.de\/637\/rev-raw\/74dc883e5a69f51ec4e41104131112566702de9c\/powermail-duplicates.ts\" style=\"float: right\">view raw source<\/a>\n  <a href=\"https:\/\/p.cweiske.de\/637#powermail-duplicates.ts\">powermail-duplicates.ts<\/a>\n <\/div>\n<\/div>\n<\/div>\n"}
