source: main/trunk/greenstone2/macros/base.dm@ 29384

Last change on this file since 29384 was 28888, checked in by ak19, 10 years ago

First security commit. 1. Introducing the new securitools.h and .cpp files, which port the functions necessary to implement security in Greenstone from OWASP-ESAPI for Java, since OWASP's C++ version is largely not yet implemented, even though their code compiles. The newly added runtime-src/packages/security which contains OWASP ESAPI for C++ will therefore be removed again shortly. 2. receptionist.cpp now sets various web-encoded variants for each cgiarg macro, such as HTML entity encoded, attr encoded, javascript encoded (and css encoded variants). These are now used in the macro files based on which variant is suited to the context. 3. This commit further contains the minimum changes to protect the c, d, and p cgi variables.

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 13.7 KB
RevLine 
[7343]1# this file must be UTF-8 encoded
[148]2#######################################################################
3# GLOBAL MACROS
4#######################################################################
[128]5
[148]6package Global
[128]7
[644]8##########
[590]9
[1969]10_optsite_ {}
11
12
13##########
14
[876]15_htmlextra_ {}
[590]16
[11117]17# now defined in nav_css/nav_ns4 macro files
[2898]18#_starthighlight_ {<b><u>}
19#_endhighlight_ {</u></b>}
[590]20
[148]21#######################################################################
22# page content
23#
24# these should always be overridden for each page/collection
25#######################################################################
[128]26
[645]27_content_ {<p><h2>oops</h2>
[876]28_textdefaultcontent_}
29_pagetitle_ {_textdefaulttitle_}
[148]30_imagethispage_ {}
[548]31_iconcollection_ {}
[1272]32_collectionname_ {}
[128]33
[3878]34
35package Global
36
37
[1272]38_imagecollection_ {_If_("_iconcollection_" ne "",
[10872]39<a href="_httppageabout_"><img class="icon" src="_iconcollection_" alt="_collectionname_" title="_collectionname_"></a>,
[7394]40_imagecollectionv_)}
[1272]41_imagecollection_ [v=1] {_imagecollectionv_}
[11820]42_imagecollectionv_ {_If_(_collectionname_,<p class="collectiontitle"><a class="collectiontitle" href="_httppageabout_">_collectionname_</a></p>)}
[1272]43
[258]44#######################################################################
45# these width macros are read in by the server when calculating
46# width of navigation bar etc. There should be one for each
47# classification that this receptionist supports, one for the
48# search button, and the _pagewidth_ macro which is the total width
49# of the page
50#######################################################################
51
[651]52# width of tabs when displaying tables of contents
53_tabwidth_ {25}
54
[23060]55
56#_pagewidth_ {537}
57_pagewidth_ {_If_(_cgiargtalkback_ eq 1,480,537)}
58
[645]59# defaultwidth is the width buttons default to if not included in this list
60_defaultwidth_ {87}
61_searchwidth_ {_widthtsrchx_}
[8106]62
[148]63#######################################################################
64# Macros whose values are set from within the server at runtime. These
65# are here only for reference and to set default values if required.
66#######################################################################
[128]67
[1305]68# _win32_ will be set to 1 if we're on windows
69_win32_ {}
70
[283]71# all cgi args are set as _cgiargX_ macros - those I've put here
72# are those that need to default to something
[276]73_cgiargd_ {}
[283]74_cgiargcl_ {}
[276]75
[28888]76
[276]77# set from within the query action
78_hselection_ {}
79_jselection_ {}
80_nselection_ {}
[4781]81#level (granularity) selection for mgpp
[1120]82_gselection_ {}
[4781]83#level selection for form searching - dont have paragraph
84_gformselection_ {_gselection_}
[4758]85_fqfselection_ {}
[12778]86# sort field for lucene
87_sfselection_ {}
[22055]88# sort field for sql
89_sqlsfselection_ {}
[1419]90
91#######################################################################
[12175]92# navigation bar
[128]93#
[148]94#######################################################################
[12175]95# Most of the stuff to do with navigation bars is now defined in nav_css.dm
96# and nav_ns4.dm
[128]97
[15846]98_dynamicclassifiernavbarentries_ {}
[12175]99_navigationbar_ {}
100_widthtspace_ {2}
[10872]101
[12175]102_navlinktitle_ {_If_("_label_1__" eq "\_label_1_\_",_1_,_label_1__)}
103_navlinkalt_ {_If_("_textdescr_1__" ne "\_textdescr_1_\_", _textdescr_1__, _If_("_text_1__" eq "\_text_1_\_",_textdescrdefault_(_1_),_textdescrdefault_(_text_1__)) }
[218]104
[148]105#######################################################################
[10872]106# global navigation links
[148]107#######################################################################
[128]108
[11117]109# _globallinks_ is now defined in nav_css and nav_ns4 macro files
[128]110
[148]111#######################################################################
112# general web macros
113#######################################################################
114
[876]115_gsdltop_ {_top}
[128]116
[148]117#######################################################################
118# http macros
119#
[128]120# These contain the url without any quotes
[148]121#######################################################################
[128]122
[19110]123# _httpprefix_ and _httpweb_ defined by the server
124_httpimages_ {_httpweb_/images}
[19112]125_httpscript_ {_httpweb_/script}
126_httpstyle_ {_httpweb_/style}
[19110]127_httpflash_ {_httpweb_/flash}
128_httpjava_ {_httpweb_/java}
129
130# old macros, for backwards compatibility
131_httpimg_ {_httpimages_}
132
133# collection versions of the same directories
[8910]134_httpcimages_ {_httpcollection_/images}
[19112]135_httpcscript_ {_httpcollection_/script}
136_httpcstyle_ {_httpcollection_/style}
[19110]137_httpcflash_ {_httpcollection_/flash}
138_httpcjava_ {_httpcollection_/java}
139
[18692]140_httpassocdir_ {_httpcollection_/index/assoc}
[19110]141_httpdocimg_ {_httpassocdir_/_thisOID_}
142# old macros, for backwards compatibility
[18692]143_httpcollimg_ {_httpcollection_/index/assoc}
[876]144
[28888]145_httpcollection_ {_httpprefix_/collect/_cgiargcUrlsafe_}
[128]146
[10872]147_httppagex_ {_gwcgi_?e=_compressedoptions_&amp;a=p&amp;p=_1_}
148_httppagestatus_ {_gwcgi_?e=_compressedoptions_&amp;a=status&amp;p=frameset}
149_httppagetranslator_ {_gwcgi_?e=_compressedoptions_&amp;a=gti&amp;p=home}
150_httppagecollector_ {_gwcgi_?e=_compressedoptions_&amp;a=collector&amp;p=intro}
[11999]151_httppagedepositor_ {_gwcgi_?e=_compressedoptions_&amp;a=depositor&amp;p=select}
[6723]152_httppagegli_ {_httppagex_(gli)}
[148]153_httppageabout_ {_httppagex_(about)}
[548]154#_httppagehome_ {_httppagex_(home)}
[10872]155###_httppagehome_ {http://www.nzdl.org/cgi-bin/dblibrary?a=p&amp;p=home}
[28888]156_httppagehome_ {_gwcgi_?a=p&amp;p=home&amp;l=_cgiarglUrlsafe_&amp;w=_cgiargwUrlsafe_}
[128]157_httppagehelp_ {_httppagex_(help)}
158_httppagepref_ {_httppagex_(preferences)}
[2562]159_httppagedocs_ {_httppagex_(docs)}
[10872]160_httpclearhistory_ {_gwcgi_?e=_compressedoptions_&amp;a=dh}
[148]161
[128]162_httpgreenstone_ {_httppagex_(gsdl)}
[1107]163_httpdownload_ {http://www.nzdl.org/download}
[1111]164_httppublications_ {_httpdownload_/greenstone/publications}
[128]165
[28888]166_httpcurrentdocument_ {_gwcgi_?e=_compressedoptions_&amp;cl=_cgiargclUrlsafe_&amp;d=_cgiargdUrlsafe_}
[23395]167_httpquery_ {_gwcgi_?e=_compressedoptions_&amp;a=_If_("_cgiargqt_" eq "2",sqlq,q)}
168_httpsqlquery_ {_gwcgi_?e=_compressedoptions_&amp;a=sqlq&amp;qt=2}
[10872]169_httpBrowse_ {_gwcgi_?e=_compressedoptions_&amp;a=br}
[876]170
171# _httpdoc_ is the same as _httpdocument_ - _httpdocument_
172# may occasionally be altered by the server however
[10872]173_httpdocument_ {_gwcgi_?e=_compressedoptions_&amp;a=d}
174_httpdoc_ {_gwcgi_?e=_compressedoptions_&amp;a=d}
[876]175
[26977]176#_httpdocumenthandle_ {_httpprefix_handle/_1_/_2_}
177_httpdocumenthandle_ {_httpprefix_/collect/_1_/document/_2_}
[11999]178
[25674]179#httpsamepagelink is for Greenstone 3 (which uses RESTful urls),
180#leaving it empty for Greenstone 2 operates correctly, as it doesn't use RESTful urls.
181_httpsamepagelink_ {}
[10872]182_httpextlink_ {_gwcgi_?e=_compressedoptions_&amp;a=extlink}
183_httpbuild_ {_gwcgi_?e=_compressedoptions_&amp;a=bc}
[128]184
[10872]185# this is obsolete now (still used by collector). done by stylesheet instead
[129]186_httpiconchalk_ {_httpimg_/chalk.gif}
187_widthchalk_ {2000}
188_heightchalk_ {10}
189
190_httpicondivb_ {_httpimg_/divb.gif}
[10872]191# these sizes are obsolete, now done in style sheet
[218]192_widthdivb_ {_pagewidth_}
[129]193_heightdivb_ {17}
194
195_httpicongsdl_ {_httpimg_/gsdl.gif}
196_widthgsdl_ {140}
197_heightgsdl_ {77}
198
199_httpiconitext_ {_httpimg_/itext.gif}
200_widthitext_ {16}
201_heightitext_ {21}
202
[9332]203_httpiconiworld_ {_httpimg_/iworld.gif}
204_widthiworld_ {16}
205_heightiworld_ {21}
206
[7502]207_httpiconiunknown_ {_httpimg_/iunknown.gif}
208_widthiunknown_ {16}
209_heightiunknown_ {21}
210
[548]211_httpiconibtext_ {_httpimg_/ibtext.gif}
212_widthibtext_ {16}
213_heightibtext_ {21}
214
[2042]215_httpiconimpegvideo_ {_httpimg_/impegvid.gif}
[964]216_widthimpegvideo_ {29}
217_heightimpegvideo_ {32}
218
219_httpiconiqtvideo_ {_httpimg_/iqtvideo.gif}
220_widthiqtvideo_ {29}
221_heightiqtvideo_ {32}
222
223_httpiconirmvideo_ {_httpimg_/irmvideo.gif}
224_widthirmvideo_ {29}
225_heightirmvideo_ {32}
226
[129]227_httpiconless_ {_httpimg_/less.gif}
228_widthless_ {30}
229_heightless_ {16}
230
231_httpiconmore_ {_httpimg_/more.gif}
232_widthmore_ {30}
233_heightmore_ {16}
234
235_httpiconspacer_ {_httpimg_/spacer.gif}
236_widthspacer_ {42}
237_heightspacer_ {4}
238
239_httpicontabspace_ {_httpimg_/tabspace.gif}
240_widthtabspace_ {23}
[454]241_heighttabspace_ {1}
[129]242
[10872]243_httpicontspace_ {_httpimg_/bg_green.png}
[148]244_heighttspace_ {17}
245
[129]246_httpiconwarning_ {_httpimg_/warning.gif}
247_widthwarning_ {30}
248_heightwarning_ {29}
249
250_widthhhome_ {200}
251_heighthhome_ {57}
252
[148]253_httpiconarrrght_ {_httpimg_/arrrght.gif}
254_widtharrrght_ {23}
255_heightarrrght_ {15}
[129]256
[454]257_httpiconopenbook_ {_httpimg_/openbook.gif}
258_widthopenbook_ {28}
259_heightopenbook_ {23}
260
261_httpiconaopenbk_ {_httpimg_/aopenbk.gif}
262_widthaopenbk_ {28}
263_heightaopenbk_ {23}
264
265_httpiconopenfldr_ {_httpimg_/openfldr.gif}
266_widthopenfldr_ {23}
267_heightopenfldr_ {15}
268
269_httpiconaopenfdr_ {_httpimg_/aopenfdr.gif}
270_widthaopenfdr_ {23}
271_heightaopenfdr_ {15}
272
[148]273_httpiconbook_ {_httpimg_/book.gif}
274_widthbook_ {18}
275_heightbook_ {11}
[129]276
[454]277_httpiconabook_ {_httpimg_/abook.gif}
278_widthabook_ {18}
279_heightabook_ {11}
280
[148]281_httpiconbshelf_ {_httpimg_/bshelf.gif}
282_widthbshelf_ {20}
283_heightbshelf_ {16}
[129]284
[454]285_httpiconabshelf_ {_httpimg_/abshelf.gif}
286_widthabshelf_ {20}
287_heightabshelf_ {16}
[129]288
[454]289_httpiconsmtext_ {_httpimg_/smtext.gif}
290_widthsmtext_ {23}
291_heightsmtext_ {15}
292
293_httpiconasmtext_ {_httpimg_/asmtext.gif}
294_widthasmtext_ {23}
295_heightasmtext_ {15}
296
297_httpiconclsdfldr_ {_httpimg_/clsdfldr.gif}
298_widthclsdfldr_ {23}
299_heightclsdfldr_ {15}
300
301_httpiconaclsdfdr_ {_httpimg_/aclsdfdr.gif}
302_widthaclsdfdr_ {23}
303_heightaclsdfdr_ {15}
304
[2992]305_httpiconimidi_ {_httpimg_/imidi.gif}
306_widthimidi_ {16}
307_heightimidi_ {21}
308
309_httpiconimsword_ {_httpimg_/imsword.gif}
310_widthimsword_ {26}
311_heightimsword_ {26}
312
[11143]313_httpiconimp3_ {_httpimg_/imp3.gif}
[8917]314_widthimp3_ {25}
315_heightimp3_ {20}
316
[21747]317_httpiconiogg_ {_httpimg_/iogg.gif}
318_widthiogg_ {32}
319_heightiogg_ {30}
320
[1414]321_httpiconipdf_ {_httpimg_/ipdf.gif}
322_widthipdf_ {26}
323_heightipdf_ {26}
[454]324
[2014]325_httpiconips_ {_httpimg_/ips.gif}
326_widthips_ {25}
327_heightips_ {32}
328
[2982]329_httpiconippt_ {_httpimg_/ippt.gif}
330_widthippt_ {32}
331_heightippt_ {30}
332
[2569]333_httpiconirtf_ {_httpimg_/irtf.gif}
334_widthirtf_ {29}
335_heightirtf_ {32}
336
[2992]337_httpiconixls_ {_httpimg_/iexcel.gif}
338_widthixls_ {32}
339_heightixls_ {30}
[1414]340
[17860]341_httpiconspace_ {_httpimg_/space.gif}
342
[148]343#######################################################################
344# Icons
345#
[128]346# Must not include links (so they can be used as links). If you want to
347# include links use _image
[148]348#######################################################################
[128]349
[10597]350_iconnext_{<img src="_httpiconmore_" align="absbottom"
351width="_widthmore_" height="_heightmore_" border="0" alt="_texticonnext_" title="_texticonnext_">}
[548]352_iconnext_[v=1] {_texticonnext_}
[128]353
[10597]354_iconprev_{<img src="_httpiconless_" align="absbottom"
355width="_widthless_" height="_heightless_" border="0" alt="_texticonprev_" title="_texticonprev_">}
[548]356_iconprev_[v=1] {_texticonprev_}
[128]357
[10872]358_icontext_ {<img class="icon" src="_httpiconitext_" width="_widthitext_" height="_heightitext_" alt="_texticontext_" title="_texticontext_">}
[548]359_icontext_[v=1] {_texticontext_}
[128]360
[10872]361_iconworld_ {<img class="icon" src="_httpiconiworld_" width="_widthiworld_" height="_heightiworld_" alt="_texticonworld_" title="_texticonworld_">}
[9332]362_iconworld_[v=1] {_texticonworld_}
363
[10872]364_iconunknown_ {<img class="icon" src="_httpiconiunknown_" width="_widthiunknown_" height="_heightiunknown_" alt="_texticonunknown_" title="_texticonunknown_">}
[7502]365_iconunknown_[v=1] {_texticonunknown_}
366
[10872]367_iconblanktext_ {<img class="icon" src="_httpiconibtext_" width="_widthibtext_" height="_heightibtext_">}
[548]368_iconblanktext_[v=1] {}
[128]369
[10872]370_iconclosedbook_ {<img class="icon" src="_httpiconbook_" width="_widthbook_" height="_heightbook_" alt="_texticonclosedbook_" title="_texticonclosedbook_">}
[548]371_iconclosedbook_ [v=1] {<small><b>_texticonclosedbook_: </b></small>}
[876]372_iconclosedbook_ [v=1,l=zh]{<small><_font_><b>_texticonclosedbook_: </b></font></small>}
[128]373
[10872]374_icondoc_ {<img class="icon" src="_httpiconimsword_" width="_widthimsword_" height="_heightimsword_" alt="_texticonmsword_" title="_texticonmsword_">}
[10383]375_icondoc_[v=1] {_texticonmsword_}
[548]376
[10872]377_iconmp3_ {<img class="icon" src="_httpiconimp3_" width="_widthimp3_" height="_heightimp3_" alt="_texticonmp3_" title="_texticonmp3_">}
[8917]378_iconmp3_[v=1] {_texticonmp3_}
379
[10872]380_iconmidi_ {<img class="icon" src="_httpiconimidi_" width="_widthimidi_" height="_heightimidi_" alt="_texticonmidi_" title="_texticonmidi_">}
[2992]381_iconmidi_[v=1] {_texticonmidi_}
382
[21747]383_iconogg_ {<img class="icon" src="_httpiconiogg_" width="_widthiogg_" height="_heightiogg_" alt="_texticonogg_" title="_texticonogg_">}
384_iconogg_[v=1] {_texticonogg_}
385
[10872]386_iconpdf_ {<img class="icon" src="_httpiconipdf_" width="_widthipdf_" height="_heightipdf_" alt="_texticonpdf_" title="_texticonpdf_">}
[1414]387_iconpdf_[v=1] {_texticonpdf_}
388
[10872]389_iconps_ {<img class="icon" src="_httpiconips_" width="_widthips_" height="_heightips_" alt="_texticonps_" title="_texticonps_">}
[2014]390_iconps_[v=1] {_texticonps_}
391
[10872]392_iconppt_ {<img class="icon" src="_httpiconippt_" width="_widthippt_" height="_heightippt_" alt="_texticonppt_" title="_texticonppt_">}
[2982]393_iconppt_[v=1] {_texticonppt_}
394
[21747]395_iconrmvideo_ {<img class="icon" src="_httpiconirmvideo_" width="_widthirmvideo_" height="_heightirmvideo_" alt="_texticonrmvideo_" title="_texticonrmvideo_">}
396_iconrmvideo_[v=1] {_texticonrmvideo_}
397
[10872]398_iconrtf_ {<img class="icon" src="_httpiconirtf_" width="_widthirtf_" height="_heightirtf_" alt="_texticonrtf_" title="_texticonrtf_">}
[2569]399_iconrtf_[v=1] {_texticonrtf_}
400
[10872]401_iconxls_ {<img class="icon" src="_httpiconixls_" width="_widthixls_" height="_heightixls_" alt="_texticonxls_" title="_texticonxls_">}
[2992]402_iconxls_[v=1] {_texticonxls_}
[1444]403
[23747]404_icondocx_ {_icondoc_}
405_icondocx_[v=1] {_icondoc_}
406
407_iconpptx_ {_iconppt_}
408_iconpptx_[v=1] {_iconppt_}
409
410_iconxlsx_ {_iconxls_}
411_iconxlsx_[v=1] {_iconxls_}
412
413
[148]414#######################################################################
415# Image links
416#
[128]417# These might include a link (not like an _icon_
[148]418#######################################################################
[128]419
420
[10872]421_imagegreenstone_ {<img class="icon" src="_httpicongsdl_" width="_widthgsdl_" height="_heightgsdl_" alt="_textdescrgreenstone_" title="_textdescrgreenstone_">}
[128]422
[10872]423_imagegreenstone_[v=1] {_textdescrgreenstone_}
[129]424
[27099]425
[12569]426###########################################################################
427# Metadata formatting stuff
428#
429#
430###########################################################################
431package format
432
433# _1_ is Year, _2_ is month, _3_ is day
434_date_ {_If_("_3_" ne "",_3_ )_If_("_2_" ne "",_textmonth_2__ )_If_("_1_" ne "",_1_)}
435
Note: See TracBrowser for help on using the repository browser.