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
83$meta['_basic']   = array('fieldset');
84$meta['title']    = array('string');
85$meta['start']    = array('string','_caution' => 'warning','_pattern' => '!^[^:;/]+$!'); // don't accept namespaces
86$meta['lang']     = array('dirchoice','_dir' => DOKU_INC.'inc/lang/');
87$meta['template'] = array('dirchoice','_dir' => DOKU_INC.'lib/tpl/','_pattern' => '/^[\w-]+$/');
88$meta['tagline']  = array('string');
89$meta['sidebar']  = array('string');
90$meta['license']  = array('license');
91$meta['savedir']  = array('savedir','_caution' => 'danger');
92$meta['basedir']  = array('string','_caution' => 'danger');
93$meta['baseurl']  = array('string','_caution' => 'danger');
94$meta['cookiedir'] = array('string','_caution' => 'danger');
95$meta['dmode']    = array('numeric','_pattern' => '/0[0-7]{3,4}/'); // only accept octal representation
96$meta['fmode']    = array('numeric','_pattern' => '/0[0-7]{3,4}/'); // only accept octal representation
97$meta['allowdebug']  = array('onoff','_caution' => 'security');
98
99$meta['_display']    = array('fieldset');
100$meta['recent']      = array('numeric');
101$meta['recent_days'] = array('numeric');
102$meta['breadcrumbs'] = array('numeric','_min' => 0);
103$meta['youarehere']  = array('onoff');
104$meta['fullpath']    = array('onoff','_caution' => 'security');
105$meta['typography']  = array('multichoice','_choices' => array(0,1,2));
106$meta['dformat']     = array('string');
107$meta['signature']   = array('string');
108$meta['showuseras'] = array(
109    'multichoice',
110    '_choices' => array('loginname', 'username', 'username_link', 'email', 'email_link')
111);
112$meta['toptoclevel'] = array('multichoice','_choices' => array(1,2,3,4,5));   // 5 toc levels
113$meta['tocminheads'] = array('multichoice','_choices' => array(0,1,2,3,4,5,10,15,20));
114$meta['maxtoclevel'] = array('multichoice','_choices' => array(0,1,2,3,4,5));
115$meta['maxseclevel'] = array('multichoice','_choices' => array(0,1,2,3,4,5)); // 0 for no sec edit buttons
116$meta['camelcase']   = array('onoff','_caution' => 'warning');
117$meta['deaccent']    = array('multichoice','_choices' => array(0,1,2),'_caution' => 'warning');
118$meta['useheading']  = array('multichoice','_choices' => array(0,'navigation','content',1));
119$meta['sneaky_index'] = array('onoff');
120$meta['hidepages']   = array('regex');
121
122$meta['_authentication'] = array('fieldset');
123$meta['useacl']      = array('onoff','_caution' => 'danger');
124$meta['autopasswd']  = array('onoff');
125$meta['authtype']    = array('authtype','_caution' => 'danger');
126$meta['passcrypt']   = array('multichoice','_choices' => array(
127    'smd5','md5','apr1','sha1','ssha','lsmd5','crypt','mysql','my411','kmd5','pmd5','hmd5',
128    'mediawiki','bcrypt','djangomd5','djangosha1','djangopbkdf2_sha1','djangopbkdf2_sha256',
129    'sha512','argon2i','argon2id'
130));
131$meta['defaultgroup']= array('string');
132$meta['superuser']   = array('string','_caution' => 'danger');
133$meta['manager']     = array('string');
134$meta['profileconfirm'] = array('onoff');
135$meta['rememberme'] = array('onoff');
136$meta['disableactions'] = array(
137    'disableactions',
138    '_choices' => array(
139        'backlink',
140        'index',
141        'recent',
142        'revisions',
143        'search',
144        'subscription',
145        'register',
146        'resendpwd',
147        'profile',
148        'profile_delete',
149        'edit',
150        'wikicode',
151        'check',
152        'rss'
153    ),
154    '_combine' => array(
155        'subscription' => array('subscribe', 'unsubscribe'),
156        'wikicode' => array('source', 'export_raw')
157    )
158);
159$meta['auth_security_timeout'] = array('numeric');
160$meta['securecookie'] = array('onoff');
161$meta['remote']       = array('onoff','_caution' => 'security');
162$meta['remoteuser']   = array('string');
163
164$meta['_anti_spam']  = array('fieldset');
165$meta['usewordblock']= array('onoff');
166$meta['relnofollow'] = array('onoff');
167$meta['indexdelay']  = array('numeric');
168$meta['mailguard']   = array('multichoice','_choices' => array('visible','hex','none'));
169$meta['iexssprotect']= array('onoff','_caution' => 'security');
170
171$meta['_editing']    = array('fieldset');
172$meta['usedraft']    = array('onoff');
173$meta['htmlok']      = array('onoff','_caution' => 'security');
174$meta['phpok']       = array('onoff','_caution' => 'security');
175$meta['locktime']    = array('numeric');
176$meta['cachetime']   = array('numeric');
177
178$meta['_links']    = array('fieldset');
179$meta['target____wiki']      = array('string');
180$meta['target____interwiki'] = array('string');
181$meta['target____extern']    = array('string');
182$meta['target____media']     = array('string');
183$meta['target____windows']   = array('string');
184
185$meta['_media']      = array('fieldset');
186$meta['mediarevisions']  = array('onoff');
187$meta['gdlib']       = array('multichoice','_choices' => array(0,1,2));
188$meta['im_convert']  = array('im_convert');
189$meta['jpg_quality'] = array('numeric','_pattern' => '/^100$|^[1-9]?[0-9]$/');  //(0-100)
190$meta['fetchsize']   = array('numeric');
191$meta['refcheck']    = array('onoff');
192
193$meta['_notifications'] = array('fieldset');
194$meta['subscribers']    = array('onoff');
195$meta['subscribe_time'] = array('numeric');
196$meta['notify']         = array('email', '_multiple' => true);
197$meta['registernotify'] = array('email', '_multiple' => true);
198$meta['mailfrom']       = array('email', '_placeholders' => true);
199$meta['mailreturnpath']       = array('email', '_placeholders' => true);
200$meta['mailprefix']     = array('string');
201$meta['htmlmail']       = array('onoff');
202$meta['dontlog'] = array(
203    'disableactions',
204    '_choices' => array(
205        'error',
206        'debug',
207        'deprecated',
208    ),
209);
210
211$meta['_syndication'] = array('fieldset');
212$meta['sitemap']     = array('numeric');
213$meta['rss_type']    = array('multichoice','_choices' => array('rss','rss1','rss2','atom','atom1'));
214$meta['rss_linkto']  = array('multichoice','_choices' => array('diff','page','rev','current'));
215$meta['rss_content'] = array('multichoice','_choices' => array('abstract','diff','htmldiff','html'));
216$meta['rss_media']   = array('multichoice','_choices' => array('both','pages','media'));
217$meta['rss_update']  = array('numeric');
218$meta['rss_show_summary'] = array('onoff');
219$meta['rss_show_deleted'] = array('onoff');
220
221$meta['_advanced']   = array('fieldset');
222$meta['updatecheck'] = array('onoff');
223$meta['userewrite']  = array('multichoice','_choices' => array(0,1,2),'_caution' => 'danger');
224$meta['useslash']    = array('onoff');
225$meta['sepchar']     = array('sepchar','_caution' => 'warning');
226$meta['canonical']   = array('onoff');
227$meta['fnencode']    = array('multichoice','_choices' => array('url','safe','utf-8'),'_caution' => 'warning');
228$meta['autoplural']  = array('onoff');
229$meta['compress']    = array('onoff');
230$meta['cssdatauri']  = array('numeric','_pattern' => '/^\d+$/');
231$meta['gzip_output'] = array('onoff');
232$meta['send404']     = array('onoff');
233$meta['compression'] = array('compression','_caution' => 'warning');
234$meta['broken_iua']  = array('onoff');
235$meta['xsendfile']   = array('multichoice','_choices' => array(0,1,2,3),'_caution' => 'warning');
236$meta['renderer_xhtml'] = array('renderer','_format' => 'xhtml','_choices' => array('xhtml'),'_caution' => 'warning');
237$meta['readdircache'] = array('numeric');
238$meta['search_nslimit'] = array('numeric', '_min' => 0);
239$meta['search_fragment'] = array('multichoice','_choices' => array('exact', 'starts_with', 'ends_with', 'contains'),);
240$meta['trustedproxy'] = array('regex');
241
242$meta['_feature_flags'] = ['fieldset'];
243$meta['defer_js']       = ['onoff'];
244
245$meta['_network']    = array('fieldset');
246$meta['dnslookups']  = array('onoff');
247$meta['jquerycdn']   = array('multichoice', '_choices' => array(0,'jquery', 'cdnjs'));
248$meta['proxy____host'] = array('string','_pattern' => '#^(|[a-z0-9\-\.+]+)$#i');
249$meta['proxy____port'] = array('numericopt');
250$meta['proxy____user'] = array('string');
251$meta['proxy____pass'] = array('password','_code' => 'base64');
252$meta['proxy____ssl']  = array('onoff');
253$meta['proxy____except'] = array('string');
254