Changes for page Get in Touch About Your XWiki Project
Last modified by Alex Cotiuga on 2026/07/27 06:09
From version 16.28
edited by Alex Cotiuga
on 2026/06/16 16:39
on 2026/06/16 16:39
Change comment:
There is no comment for this version
To version 17.2
edited by Alex Cotiuga
on 2026/07/03 15:32
on 2026/07/03 15:32
Change comment:
There is no comment for this version
Summary
-
Page properties (3 modified, 0 added, 0 removed)
-
Objects (2 modified, 0 added, 0 removed)
Details
- Page properties
-
- Default language
-
... ... @@ -1,1 +1,0 @@ 1 -en - Hidden
-
... ... @@ -1,1 +1,1 @@ 1 - false1 +true - Content
-
... ... @@ -3,33 +3,113 @@ 3 3 #set ($statusCode = 400) 4 4 #set ($message = 'The request could not be sent. Please try again or contact Agnease by email at alex@agnease.com.') 5 5 6 + #set ($className = 'Agnease.Code.ContactRequest.ContactRequestClass') 7 + #set ($allowedProperties = [ 8 + 'scope', 9 + 'alreadyUseXWiki', 10 + 'name', 11 + 'email', 12 + 'hosting', 13 + 'customDevelopment', 14 + 'timeline', 15 + 'users' 16 + ]) 17 + 6 6 #set ($name = '') 7 7 #set ($email = '') 20 + #set ($scope = '') 8 8 #set ($contactWebsite = '') 22 + #set ($startedAtRaw = '') 9 9 24 + ## Extract only the values we need for validation. 10 10 #foreach ($parameterName in $request.parameterNames) 11 - #set ($propertyName = $parameterName.split('_0_')[1]) 12 - #if ($propertyName == 'name') 13 - #set ($name = $stringtool.trim($request.get($parameterName))) 14 - #elseif ($propertyName == 'email') 15 - #set ($email = $stringtool.trim($request.get($parameterName))) 16 - #elseif ($propertyName == 'contactWebsite') 17 - #set ($contactWebsite = $stringtool.trim($request.get($parameterName))) 26 + #set ($propertyParts = $parameterName.split('_0_')) 27 + #if ($propertyParts.size() > 1) 28 + #set ($propertyName = $propertyParts[1]) 29 + #set ($propertyValue = $stringtool.trim($request.get($parameterName))) 30 + 31 + #if ($propertyName == 'name') 32 + #set ($name = $propertyValue) 33 + #elseif ($propertyName == 'email') 34 + #set ($email = $propertyValue) 35 + #elseif ($propertyName == 'scope') 36 + #set ($scope = $propertyValue) 37 + #elseif ($propertyName == 'contactWebsite') 38 + #set ($contactWebsite = $propertyValue) 39 + #elseif ($propertyName == 'contactStartedAt') 40 + #set ($startedAtRaw = $propertyValue) 41 + #end 18 18 #end 19 19 #end 20 20 21 - #if ("$!contactWebsite.trim()" != '') 22 - #set ($statusCode = 400) 23 - #set ($message = 'The request could not be sent. Please try again or contact Agnease by email.') 24 - #elseif ("$!name" == '' && "$!email" == '') 25 - #set ($statusCode = 400) 45 + #set ($spamScore = 0) 46 + 47 + ## Honeypot: real users should never fill this field. 48 + #if ("$!contactWebsite" != '') 49 + #set ($spamScore = $spamScore + 5) 50 + #end 51 + 52 + ## Submission timing check. 53 + #if ("$!startedAtRaw" == '') 54 + ## The field is expected from the real form, so missing it is suspicious. 55 + #set ($spamScore = $spamScore + 2) 56 + #else 57 + #set ($startedAt = $numbertool.toNumber($startedAtRaw)) 58 + #if ("$!startedAt" == '') 59 + #set ($spamScore = $spamScore + 2) 60 + #else 61 + #set ($now = $datetool.systemDate.time) 62 + #set ($elapsed = $now - $startedAt) 63 + 64 + ## Reject very fast submissions. 65 + #if ($elapsed > 0 && $elapsed < 10000) 66 + #set ($spamScore = $spamScore + 3) 67 + #end 68 + #end 69 + #end 70 + 71 + ## Random-looking name: long single token. 72 + #if ($name.length() >= 16 && !$name.contains(' ')) 73 + #set ($spamScore = $spamScore + 2) 74 + #end 75 + 76 + ## Random-looking project description: long single token. 77 + #if ($scope.length() >= 12 && !$scope.contains(' ')) 78 + #set ($spamScore = $spamScore + 2) 79 + #end 80 + 81 + ## Suspicious email local part with many dots and tiny fragments. 82 + #set ($emailParts = $email.split('@')) 83 + #if ($emailParts.size() == 2) 84 + #set ($localPart = $emailParts[0]) 85 + #set ($localFragments = $localPart.split('\.')) 86 + #set ($dotCount = $localFragments.size() - 1) 87 + #set ($oneCharFragments = 0) 88 + 89 + #foreach ($fragment in $localFragments) 90 + #if ($fragment.length() == 1) 91 + #set ($oneCharFragments = $oneCharFragments + 1) 92 + #end 93 + #end 94 + 95 + #if ($dotCount >= 4 && $oneCharFragments >= 3) 96 + #set ($spamScore = $spamScore + 2) 97 + #end 98 + #else 99 + #set ($spamScore = $spamScore + 2) 100 + #end 101 + 102 + ## Human-facing validation. 103 + #if ("$!name" == '' && "$!email" == '') 26 26 #set ($message = 'Please enter your name and email.') 27 27 #elseif ("$!name" == '') 28 - #set ($statusCode = 400) 29 29 #set ($message = 'Please enter your name.') 30 30 #elseif ("$!email" == '') 31 - #set ($statusCode = 400) 32 32 #set ($message = 'Please enter your email address.') 109 + #elseif ("$!scope" == '' || $scope.length() < 30) 110 + #set ($message = 'Please add a short description of your XWiki project, question or issue.') 111 + #elseif ($spamScore >= 3) 112 + #set ($message = 'The request could not be sent. Please add a clearer description of your XWiki request or contact Agnease by email.') 33 33 #else 34 34 #try('contactException') 35 35 #set ($now = $datetool.get('yyyyMMddHHmm')) ... ... @@ -36,11 +36,18 @@ 36 36 #set ($random = $mathtool.random(100000, 999999)) 37 37 #set ($uniqueName = "ContactRequest-${now}-${random}") 38 38 #set ($contactRequestDoc = $xwiki.getDocumentAsAuthor('ContactRequests.' + $uniqueName)) 39 - #set ($contactRequestObj = $contactRequestDoc.getObject( 'Agnease.Code.ContactRequest.ContactRequestClass', true))119 + #set ($contactRequestObj = $contactRequestDoc.getObject($className, true)) 40 40 121 + ## Save only known ContactRequest fields. 41 41 #foreach ($parameterName in $request.parameterNames) 42 - #set ($propertyName = $parameterName.split('_0_')[1]) 43 - #set ($discard = $contactRequestObj.set($propertyName, $request.get($parameterName))) 123 + #set ($propertyParts = $parameterName.split('_0_')) 124 + #if ($propertyParts.size() > 1) 125 + #set ($propertyName = $propertyParts[1]) 126 + 127 + #if ($allowedProperties.contains($propertyName)) 128 + #set ($discard = $contactRequestObj.set($propertyName, $request.get($parameterName))) 129 + #end 130 + #end 44 44 #end 45 45 46 46 #set ($discard = $contactRequestDoc.saveAsAuthor()) ... ... @@ -107,15 +107,16 @@ 107 107 <p class="xHint">* Your information will only be used to respond to this request.</p> 108 108 ## Hidden fields to catch requests filled by bots. 109 109 <div class="contact-hp-wrapper" aria-hidden="true"> 110 - <label for="contactWebsite">Website</label> 197 + <label for="Agnease.Code.ContactRequest.ContactRequestClass_0_contactWebsite">Website</label> 111 111 <input 112 - id="contactWebsite" 199 + id="Agnease.Code.ContactRequest.ContactRequestClass_0_contactWebsite" 113 113 type="text" 114 - name="contactWebsite" 201 + name="Agnease.Code.ContactRequest.ContactRequestClass_0_contactWebsite" 115 115 autocomplete="off" 116 116 tabindex="-1" 117 117 /> 118 118 </div> 206 + <input type="hidden" name="Agnease.Code.ContactRequest.ContactRequestClass_0_contactStartedAt" value="$datetool.systemDate.time" /> 119 119 <input id="contactSubmit" type="submit" class="btn btn-primary" value="Send my request"> 120 120 </form> 121 121 #end ... ... @@ -136,9 +136,13 @@ 136 136 {{/html}} 137 137 {{html clean="false"}} 138 138 </div> 139 - <div class="col-md-5"> 140 - <div class="widget"> 141 - <h4>$services.icon.renderHTML('check') How Agnease can help</h4> 227 + <div class="col-md-5 contact-side-panel"> 228 + <div class="split-copy contact-help-panel"> 229 + <h2> 230 + <i class="fa fa-check-circle" aria-hidden="true"></i> 231 + How Agnease can help 232 + </h2> 233 + 142 142 <ul> 143 143 <li>XWiki upgrades and long-term maintenance</li> 144 144 <li>Knowledge bases, intranets, SOP and documentation workflows</li> ... ... @@ -148,14 +148,21 @@ 148 148 <li>Security-aware reviews and platform stabilization</li> 149 149 </ul> 150 150 </div> 151 - <div class="widget"> 152 - <h4>$services.icon.renderHTML('right') What happens next?</h4> 153 - <ol> 154 - <li>Your request is reviewed.</li> 155 - <li>You receive a reply with clarifying questions or suggested next steps.</li> 156 - <li>If useful, we schedule a short call to discuss scope, timeline, and estimated effort.</li> 157 - </ol> 158 - </div> 243 + 244 + <ol class="process-list contact-process-list"> 245 + <li> 246 + <strong>Your request is reviewed</strong> 247 + The project description is checked to understand the context and initial scope. 248 + </li> 249 + <li> 250 + <strong>You receive a reply</strong> 251 + Agnease replies with clarifying questions or suggested next steps. 252 + </li> 253 + <li> 254 + <strong>A short call can be scheduled</strong> 255 + If useful, we discuss scope, timeline and estimated effort together. 256 + </li> 257 + </ol> 159 159 </div> 160 160 </div> 161 161 {{/html}}
- XWiki.JavaScriptExtension[0]
-
- code
-
... ... @@ -16,7 +16,6 @@ 16 16 errorBox.find('.box div p').text(''); 17 17 18 18 submitButton.prop('disabled', true); 19 - console.log(form.serializeArray()) 20 20 21 21 $.post({ 22 22 url: serviceURL,
- XWiki.StyleSheetExtension[0]
-
- code
-
... ... @@ -67,7 +67,7 @@ 67 67 font-weight: 700; 68 68 } 69 69 /* CSS for hidden field to identify requests filled by bots. */ 70 -.contact-hp-wrapper ss{70 +.contact-hp-wrapper { 71 71 position: absolute; 72 72 left: -9999px; 73 73 width: 1px;