You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

265 lines
13 KiB

  1. <?php
  2. /**
  3. * Metadata for configuration manager plugin
  4. *
  5. * Note: This file is loaded in Loader::loadMeta().
  6. *
  7. * Format:
  8. * $meta[<setting name>] = array(<handler class id>,<param name> => <param value>);
  9. *
  10. * <handler class id> is the handler class name without the "setting_" prefix
  11. *
  12. * Defined classes (see core/Setting/*):
  13. * Generic
  14. * -------------------------------------------
  15. * '' - default class ('setting'), textarea, minimal input validation, setting output in quotes
  16. * 'string' - single line text input, minimal input validation, setting output in quotes
  17. * 'numeric' - text input, accepts numbers and arithmetic operators, setting output without quotes
  18. * if given the '_min' and '_max' parameters are used for validation
  19. * 'numericopt' - like above, but accepts empty values
  20. * 'onoff' - checkbox input, setting output 0|1
  21. * 'multichoice' - select input (single choice), setting output with quotes, required _choices parameter
  22. * 'email' - text input, input must conform to email address format, supports optional '_multiple'
  23. * parameter for multiple comma separated email addresses
  24. * 'password' - password input, minimal input validation, setting output text in quotes, maybe encoded
  25. * according to the _code parameter
  26. * 'dirchoice' - as multichoice, selection choices based on folders found at location specified in _dir
  27. * parameter (required). A pattern can be used to restrict the folders to only those which
  28. * match the pattern.
  29. * 'multicheckbox'- a checkbox for each choice plus an "other" string input, config file setting is a comma
  30. * separated list of checked choices
  31. * 'fieldset' - used to group configuration settings, but is not itself a setting. To make this clear in
  32. * the language files the keys for this type should start with '_'.
  33. * 'array' - a simple (one dimensional) array of string values, shown as comma separated list in the
  34. * config manager but saved as PHP array(). Values may not contain commas themselves.
  35. * _pattern matching on the array values supported.
  36. * 'regex' - regular expression string, normally without delimiters; as for string, in addition tested
  37. * to see if will compile & run as a regex. in addition to _pattern, also accepts _delimiter
  38. * (default '/') and _pregflags (default 'ui')
  39. *
  40. * Single Setting
  41. * -------------------------------------------------
  42. * 'savedir' - as 'setting', input tested against initpath() (inc/init.php)
  43. * 'sepchar' - as multichoice, selection constructed from string of valid values
  44. * 'authtype' - as 'setting', input validated against a valid php file at expected location for auth files
  45. * 'im_convert' - as 'setting', input must exist and be an im_convert module
  46. * 'disableactions' - as 'setting'
  47. * 'compression' - no additional parameters. checks php installation supports possible compression alternatives
  48. * 'licence' - as multichoice, selection constructed from licence strings in language files
  49. * 'renderer' - as multichoice, selection constructed from enabled renderer plugins which canRender()
  50. * 'authtype' - as multichoice, selection constructed from the enabled auth plugins
  51. *
  52. * Any setting commented or missing will use 'setting' class - text input, minimal validation, quoted output
  53. *
  54. * Defined parameters:
  55. * '_caution' - no value (default) or 'warning', 'danger', 'security'. display an alert along with the setting
  56. * '_pattern' - string, a preg pattern. input is tested against this pattern before being accepted
  57. * optional all classes, except onoff & multichoice which ignore it
  58. * '_choices' - array of choices. used to populate a selection box. choice will be replaced by a localised
  59. * language string, indexed by <setting name>_o_<choice>, if one exists
  60. * required by 'multichoice' & 'multicheckbox' classes, ignored by others
  61. * '_dir' - location of directory to be used to populate choice list
  62. * required by 'dirchoice' class, ignored by other classes
  63. * '_combine' - complimentary output setting values which can be combined into a single display checkbox
  64. * optional for 'multicheckbox', ignored by other classes
  65. * '_code' - encoding method to use, accepted values: 'base64','uuencode','plain'. defaults to plain.
  66. * '_min' - minimum numeric value, optional for 'numeric' and 'numericopt', ignored by others
  67. * '_max' - maximum numeric value, optional for 'numeric' and 'numericopt', ignored by others
  68. * '_delimiter' - string, default '/', a single character used as a delimiter for testing regex input values
  69. * '_pregflags' - string, default 'ui', valid preg pattern modifiers used when testing regex input values, for more
  70. * information see http://php.net/manual/en/reference.pcre.pattern.modifiers.php
  71. * '_multiple' - bool, allow multiple comma separated email values; optional for 'email', ignored by others
  72. * '_other' - how to handle other values (not listed in _choices). accepted values: 'always','exists','never'
  73. * default value 'always'. 'exists' only shows 'other' input field when the setting contains value(s)
  74. * not listed in choices (e.g. due to manual editing or update changing _choices). This is safer than
  75. * 'never' as it will not discard unknown/other values.
  76. * optional for 'multicheckbox', ignored by others
  77. *
  78. * The order of the settings influences the order in which they apppear in the config manager
  79. *
  80. * @author Chris Smith <chris@jalakai.co.uk>
  81. */
  82. $meta['_basic'] = ['fieldset'];
  83. $meta['title'] = ['string'];
  84. $meta['start'] = ['string', '_caution' => 'warning', '_pattern' => '!^[^:;/]+$!']; // don't accept namespaces
  85. $meta['lang'] = ['dirchoice', '_dir' => DOKU_INC . 'inc/lang/'];
  86. $meta['template'] = ['dirchoice', '_dir' => DOKU_INC . 'lib/tpl/', '_pattern' => '/^[\w-]+$/'];
  87. $meta['tagline'] = ['string'];
  88. $meta['sidebar'] = ['string'];
  89. $meta['license'] = ['license'];
  90. $meta['savedir'] = ['savedir', '_caution' => 'danger'];
  91. $meta['basedir'] = ['string', '_caution' => 'danger'];
  92. $meta['baseurl'] = ['string', '_caution' => 'danger'];
  93. $meta['cookiedir'] = ['string', '_caution' => 'danger'];
  94. $meta['dmode'] = ['numeric', '_pattern' => '/0[0-7]{3,4}/']; // only accept octal representation
  95. $meta['fmode'] = ['numeric', '_pattern' => '/0[0-7]{3,4}/']; // only accept octal representation
  96. $meta['allowdebug'] = ['onoff', '_caution' => 'security'];
  97. $meta['_display'] = ['fieldset'];
  98. $meta['recent'] = ['numeric'];
  99. $meta['recent_days'] = ['numeric'];
  100. $meta['breadcrumbs'] = ['numeric', '_min' => 0];
  101. $meta['youarehere'] = ['onoff'];
  102. $meta['fullpath'] = ['onoff', '_caution' => 'security'];
  103. $meta['typography'] = ['multichoice', '_choices' => [0, 1, 2]];
  104. $meta['dformat'] = ['string'];
  105. $meta['signature'] = ['string'];
  106. $meta['showuseras'] = ['multichoice', '_choices' => ['loginname', 'username', 'username_link', 'email', 'email_link']];
  107. $meta['toptoclevel'] = ['multichoice', '_choices' => [1, 2, 3, 4, 5]]; // 5 toc levels
  108. $meta['tocminheads'] = ['multichoice', '_choices' => [0, 1, 2, 3, 4, 5, 10, 15, 20]];
  109. $meta['maxtoclevel'] = ['multichoice', '_choices' => [0, 1, 2, 3, 4, 5]];
  110. $meta['maxseclevel'] = ['multichoice', '_choices' => [0, 1, 2, 3, 4, 5]]; // 0 for no sec edit buttons
  111. $meta['camelcase'] = ['onoff', '_caution' => 'warning'];
  112. $meta['deaccent'] = ['multichoice', '_choices' => [0, 1, 2], '_caution' => 'warning'];
  113. $meta['useheading'] = ['multichoice', '_choices' => [0, 'navigation', 'content', 1]];
  114. $meta['sneaky_index'] = ['onoff'];
  115. $meta['hidepages'] = ['regex'];
  116. $meta['_authentication'] = ['fieldset'];
  117. $meta['useacl'] = ['onoff', '_caution' => 'danger'];
  118. $meta['autopasswd'] = ['onoff'];
  119. $meta['authtype'] = ['authtype', '_caution' => 'danger'];
  120. $meta['passcrypt'] = ['multichoice',
  121. '_choices' => [
  122. 'smd5',
  123. 'md5',
  124. 'apr1',
  125. 'sha1',
  126. 'ssha',
  127. 'lsmd5',
  128. 'crypt',
  129. 'mysql',
  130. 'my411',
  131. 'kmd5',
  132. 'pmd5',
  133. 'hmd5',
  134. 'mediawiki',
  135. 'bcrypt',
  136. 'djangomd5',
  137. 'djangosha1',
  138. 'djangopbkdf2_sha1',
  139. 'djangopbkdf2_sha256',
  140. 'sha512',
  141. 'argon2i',
  142. 'argon2id']
  143. ];
  144. $meta['defaultgroup'] = ['string'];
  145. $meta['superuser'] = ['string', '_caution' => 'danger'];
  146. $meta['manager'] = ['string'];
  147. $meta['profileconfirm'] = ['onoff'];
  148. $meta['rememberme'] = ['onoff'];
  149. $meta['disableactions'] = ['disableactions',
  150. '_choices' => [
  151. 'backlink',
  152. 'index',
  153. 'recent',
  154. 'revisions',
  155. 'search',
  156. 'subscription',
  157. 'register',
  158. 'resendpwd',
  159. 'profile',
  160. 'profile_delete',
  161. 'edit',
  162. 'wikicode',
  163. 'check',
  164. 'rss'
  165. ],
  166. '_combine' => [
  167. 'subscription' => ['subscribe', 'unsubscribe'],
  168. 'wikicode' => ['source', 'export_raw']
  169. ]
  170. ];
  171. $meta['auth_security_timeout'] = ['numeric'];
  172. $meta['securecookie'] = ['onoff'];
  173. $meta['samesitecookie'] = ['multichoice', '_choices' => ['', 'Lax', 'Strict', 'None']];
  174. $meta['remote'] = ['onoff', '_caution' => 'security'];
  175. $meta['remoteuser'] = ['string'];
  176. $meta['remotecors'] = ['string', '_caution' => 'security'];
  177. $meta['_anti_spam'] = ['fieldset'];
  178. $meta['usewordblock'] = ['onoff'];
  179. $meta['relnofollow'] = ['onoff'];
  180. $meta['indexdelay'] = ['numeric'];
  181. $meta['mailguard'] = ['multichoice', '_choices' => ['visible', 'hex', 'none']];
  182. $meta['iexssprotect'] = ['onoff', '_caution' => 'security'];
  183. $meta['_editing'] = ['fieldset'];
  184. $meta['usedraft'] = ['onoff'];
  185. $meta['locktime'] = ['numeric'];
  186. $meta['cachetime'] = ['numeric'];
  187. $meta['_links'] = ['fieldset'];
  188. $meta['target____wiki'] = ['string'];
  189. $meta['target____interwiki'] = ['string'];
  190. $meta['target____extern'] = ['string'];
  191. $meta['target____media'] = ['string'];
  192. $meta['target____windows'] = ['string'];
  193. $meta['_media'] = ['fieldset'];
  194. $meta['mediarevisions'] = ['onoff'];
  195. $meta['gdlib'] = ['multichoice', '_choices' => [0, 1, 2]];
  196. $meta['im_convert'] = ['im_convert'];
  197. $meta['jpg_quality'] = ['numeric', '_pattern' => '/^100$|^[1-9]?\d$/']; //(0-100)
  198. $meta['fetchsize'] = ['numeric'];
  199. $meta['refcheck'] = ['onoff'];
  200. $meta['_notifications'] = ['fieldset'];
  201. $meta['subscribers'] = ['onoff'];
  202. $meta['subscribe_time'] = ['numeric'];
  203. $meta['notify'] = ['email', '_multiple' => true];
  204. $meta['registernotify'] = ['email', '_multiple' => true];
  205. $meta['mailfrom'] = ['email', '_placeholders' => true];
  206. $meta['mailreturnpath'] = ['email', '_placeholders' => true];
  207. $meta['mailprefix'] = ['string'];
  208. $meta['htmlmail'] = ['onoff'];
  209. $meta['dontlog'] = ['disableactions', '_choices' => ['error', 'debug', 'deprecated']];
  210. $meta['logretain'] = ['numeric', '_min' => 0, '_pattern' => '/^\d+$/'];
  211. $meta['_syndication'] = ['fieldset'];
  212. $meta['sitemap'] = ['numeric'];
  213. $meta['rss_type'] = ['multichoice', '_choices' => ['rss', 'rss1', 'rss2', 'atom', 'atom1']];
  214. $meta['rss_linkto'] = ['multichoice', '_choices' => ['diff', 'page', 'rev', 'current']];
  215. $meta['rss_content'] = ['multichoice', '_choices' => ['abstract', 'diff', 'htmldiff', 'html']];
  216. $meta['rss_media'] = ['multichoice', '_choices' => ['both', 'pages', 'media']];
  217. $meta['rss_update'] = ['numeric'];
  218. $meta['rss_show_summary'] = ['onoff'];
  219. $meta['rss_show_deleted'] = ['onoff'];
  220. $meta['_advanced'] = ['fieldset'];
  221. $meta['updatecheck'] = ['onoff'];
  222. $meta['userewrite'] = ['multichoice', '_choices' => [0, 1, 2], '_caution' => 'danger'];
  223. $meta['useslash'] = ['onoff'];
  224. $meta['sepchar'] = ['sepchar', '_caution' => 'warning'];
  225. $meta['canonical'] = ['onoff'];
  226. $meta['fnencode'] = ['multichoice', '_choices' => ['url', 'safe', 'utf-8'], '_caution' => 'warning'];
  227. $meta['autoplural'] = ['onoff'];
  228. $meta['compress'] = ['onoff'];
  229. $meta['cssdatauri'] = ['numeric', '_pattern' => '/^\d+$/'];
  230. $meta['gzip_output'] = ['onoff'];
  231. $meta['send404'] = ['onoff'];
  232. $meta['compression'] = ['compression', '_caution' => 'warning'];
  233. $meta['broken_iua'] = ['onoff'];
  234. $meta['xsendfile'] = ['multichoice', '_choices' => [0, 1, 2, 3], '_caution' => 'warning'];
  235. $meta['renderer_xhtml'] = ['renderer', '_format' => 'xhtml', '_choices' => ['xhtml'], '_caution' => 'warning'];
  236. $meta['readdircache'] = ['numeric'];
  237. $meta['search_nslimit'] = ['numeric', '_min' => 0];
  238. $meta['search_fragment'] = ['multichoice', '_choices' => ['exact', 'starts_with', 'ends_with', 'contains']];
  239. $meta['trustedproxy'] = ['regex'];
  240. $meta['_feature_flags'] = ['fieldset'];
  241. $meta['defer_js'] = ['onoff'];
  242. $meta['hidewarnings'] = ['onoff'];
  243. $meta['_network'] = ['fieldset'];
  244. $meta['dnslookups'] = ['onoff'];
  245. $meta['jquerycdn'] = ['multichoice', '_choices' => [0, 'jquery', 'cdnjs']];
  246. $meta['proxy____host'] = ['string', '_pattern' => '#^(|[a-z0-9\-\.+]+)$#i'];
  247. $meta['proxy____port'] = ['numericopt'];
  248. $meta['proxy____user'] = ['string'];
  249. $meta['proxy____pass'] = ['password', '_code' => 'base64'];
  250. $meta['proxy____ssl'] = ['onoff'];
  251. $meta['proxy____except'] = ['string'];