- site/colorlock.py: both XWikis force black and white with !important (a HIGH CONTRAST DARK THEME block in the skin's cssVariablesInit.css). On our pages only, the design's colours win: each inline colour made !important, and a stylesheet scoped to the page root (.ssos) for the rest. Used by site/com/build.py and site/org/build.py; the .com reinstalled with it. - site/org/inquiries (Captain Bob, 2026-11-07): the .com's inquiries go to an admin-only master/detail on the .org -- Inquiries.WebHome (Live Data table), one page per inquiry under Inquiries.Entries with a sheet and a status, PublicInquiry (public) filing them with its author's rights and echoing nothing a visitor sends; a hidden trap field for robots. The .com form posts there. Installed and tested: a guest's inquiry filed and deleted; one whose name and message were script macros was stored as text, nothing ran. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GE3SDvQn5EoxdGufk84zz2
42 lines
2.4 KiB
Plaintext
42 lines
2.4 KiB
Plaintext
{{velocity}}
|
|
## Receives the inquiry form on starshipos-f18.com (POST) and files it as a page under
|
|
## Inquiries.Entries, which only the administrator can read. It runs with this page's author's
|
|
## rights (getDocumentAsAuthor, saveAsAuthor): a guest can reach nothing but this. Nothing a visitor
|
|
## sends is ever written into this page's output or an entry's title: with this author's rights,
|
|
## text that reached the wiki markup could run a macro.
|
|
#macro (field $n $max)#set ($v = "$!request.getParameter($n)")#set ($v = $v.trim())#if ($v.length() > $max)#set ($v = $v.substring(0, $max))#end#end
|
|
#if ($request.method != 'POST')
|
|
This page receives the inquiry form on [[starshipos-f18.com>>https://starshipos-f18.com/bin/view/Inquiries/]].
|
|
#else
|
|
#field('website' 200)#set ($trap = $v)
|
|
#field('name' 200)#set ($name = $v)
|
|
#field('email' 200)#set ($email = $v)
|
|
#field('organization' 200)#set ($org = $v)
|
|
#field('topic' 100)#set ($topic = $v)
|
|
#field('message' 10000)#set ($message = $v)
|
|
#set ($wants = "$!request.getParameter('announcements')" != '')
|
|
#if ($trap != '')
|
|
## a robot filled the field people cannot see: say thanks, keep nothing
|
|
{{html}}<p>Thank you. Your inquiry has been received.</p>{{/html}}
|
|
#elseif ($name == '' || $message == '' || !$email.matches('^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$'))
|
|
{{html}}<p>Your inquiry was not sent: a name, a valid e-mail address and a message are needed. <a href="https://starshipos-f18.com/bin/view/Inquiries/">Back to the form</a>.</p>{{/html}}
|
|
#else
|
|
#set ($stamp = $datetool.format('yyyyMMdd-HHmmss', $datetool.date))
|
|
#set ($ref = "Inquiries.Entries.I${stamp}-$mathtool.random(1000, 9999)")
|
|
#set ($entry = $xwiki.getDocumentAsAuthor($ref))
|
|
#set ($d = $entry.setTitle("Inquiry $stamp"))
|
|
#set ($o = $entry.newObject('Inquiries.Code.InquiryClass'))
|
|
#set ($d = $o.set('name', $name))
|
|
#set ($d = $o.set('email', $email))
|
|
#set ($d = $o.set('organization', $org))
|
|
#set ($d = $o.set('topic', $topic))
|
|
#set ($d = $o.set('message', $message))
|
|
#if ($wants)#set ($d = $o.set('announcements', 1))#else#set ($d = $o.set('announcements', 0))#end
|
|
#set ($d = $o.set('source', 'starshipos-f18.com'))
|
|
#set ($d = $o.set('status', 'new'))
|
|
#set ($d = $entry.saveAsAuthor('An inquiry from the .com form'))
|
|
{{html}}<p>Thank you. Your inquiry has been received; every message is read by a human, and replies usually come within a few days.</p><p><a href="https://starshipos-f18.com/">Back to starshipos-f18.com</a></p>{{/html}}
|
|
#end
|
|
#end
|
|
{{/velocity}}
|