Changes for page Mail test
Last modified by Administrator on 13.11.2023 12:51
From version 5.1
edited by Administrator
on 13.11.2023 12:51
on 13.11.2023 12:51
Change comment:
There is no comment for this version
To version 2.2
edited by Administrator
on 08.09.2023 13:45
on 08.09.2023 13:45
Change comment:
allow edit právo pro XWiki.gol128
Summary
-
Page properties (1 modified, 0 added, 0 removed)
-
Objects (0 modified, 0 added, 1 removed)
Details
- Page properties
-
- Content
-
... ... @@ -1,6 +1,40 @@ 1 +{{velocity}} 2 +#if($xwiki.hasAccessLevel('admin')) 3 +#if("$!{request.action}" == 'send_mail' && "$!{request.lastname}" == '') 4 + ## Check submission and honey pot. 5 + #if("$!request.recipient" != '' && "$!request.subject" != '') 6 + #set($result = $xwiki.mailsender.sendTextMessage("nobody@vsb.cz", $request.recipient, $request.subject, "$!request.message")) 7 + #if($result == -1) 8 + {{error}}A problem occurred while sending the mail: $context.error{{/error}} 9 + #else 10 + {{info}}Everything went OK.{{/info}} 11 + #end 12 + #else 13 + {{error}}Please specify at least a recipient and a subject{{/error}} 14 + #end 15 +#end 1 1 2 - 3 -Test notifikace o změně stránky 4 - 5 - 6 -=== === 17 +{{html wiki=true}} 18 +<form action="" method="post"> 19 + <input name="action" value="send_mail" type="hidden" /> 20 + ## this is a honey-pot hidden text field hat hopefully robots will not leave empty 21 + <div class="hidden"> 22 + <input name="lastname" type="text" /> 23 + </div> 24 + <fieldset> 25 + **TO:**<br /> 26 + <input type="text" name="recipient" /><br /> 27 + **SUBJECT:**<br /> 28 + <input type="text" name="subject" /><br /> 29 + **MESSAGE:**<br /> 30 + <textarea name="message" style="width:99%;" rows=10>Your test message here.</textarea> 31 + </fieldset> 32 + <div> 33 + <span class="buttonwrapper"><input type="submit" class="button" value="Send" /></span> 34 + </div> 35 +</form> 36 +{{/html}} 37 +#else 38 +{{error}}Oops. Area restricted to Admins, sorry.{{/error}} 39 +#end 40 +{{/velocity}}
- XWiki.XWikiRights[1]
-
- Allow/Deny
-
... ... @@ -1,1 +1,0 @@ 1 -Allow - Groups
-
... ... @@ -1,1 +1,0 @@ 1 -XWiki.XWikiAdminGroup - Levels
-
... ... @@ -1,1 +1,0 @@ 1 -edit,script,delete