/
SecuritySettings.php
96 lines (85 loc) · 3.74 KB
/
SecuritySettings.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<?php
/**
* @copyright Roy Rosenzweig Center for History and New Media, 2007-2010
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @package Omeka
* @access private
*/
/**
* Security settings form.
*
* @internal This implements Omeka internals and is not part of the public API.
* @access private
* @package Omeka
* @copyright Roy Rosenzweig Center for History and New Media, 2007-2010
*/
class Omeka_Form_SecuritySettings extends Omeka_Form
{
public function init()
{
parent::init();
$this->setAttrib('id', 'settings-form');
$this->addElement('checkbox', File::DISABLE_DEFAULT_VALIDATION_OPTION,
array(
'label' => __('Disable File Upload Validation'),
'checked' => get_option(File::DISABLE_DEFAULT_VALIDATION_OPTION),
'description' => __('Check this field if you would like to allow any file to be uploaded to Omeka.')
)
);
$this->addElement('textarea', Omeka_Validate_File_Extension::WHITELIST_OPTION,
array(
'label' => __('Allowed File Extensions'),
'description' => __('List of allowed extensions for file uploads.'),
'value' => get_option(Omeka_Validate_File_Extension::WHITELIST_OPTION),
'cols'=>50,
'rows'=>5
)
);
$this->addElement('textarea', Omeka_Validate_File_MimeType::WHITELIST_OPTION,
array(
'label' => __('Allowed File Types'),
'description' => __('List of allowed MIME types for file uploads'),
'value' => get_option(Omeka_Validate_File_MimeType::WHITELIST_OPTION),
'cols' => 50,
'rows' => 13
)
);
$this->addElement('text', Omeka_Captcha::PUBLIC_KEY_OPTION,
array(
'label' => __('ReCaptcha Public Key'),
'description' => __('Public key from recaptcha.net. Both this and the private key must be filled in to secure public forms.'),
'value' => get_option(Omeka_Captcha::PUBLIC_KEY_OPTION)
)
);
$this->addElement('text', Omeka_Captcha::PRIVATE_KEY_OPTION,
array(
'label' => __('ReCaptcha Private Key'),
'description' => __('Private key from recaptcha.net. Both this and the public key must be filled in to secure public forms.'),
'value' => get_option(Omeka_Captcha::PRIVATE_KEY_OPTION)
)
);
$this->addElement('checkbox', 'html_purifier_is_enabled', array(
'checked' => (boolean)get_option('html_purifier_is_enabled'),
'description' => 'Check this field if you would like to filter HTML elements or attributes from form input.',
'label' => 'Enable HTML Filtering'
));
$this->addElement('textarea', 'html_purifier_allowed_html_elements', array(
'value' => get_option('html_purifier_allowed_html_elements'),
'label' => 'Allowed HTML Elements',
'description' => 'List of allowed HTML elements in form input.',
'cols' => 50,
'rows' => 5
));
$this->addElement('textarea', 'html_purifier_allowed_html_attributes', array(
'value' => get_option('html_purifier_allowed_html_attributes'),
'label' => 'Allowed HTML Attributes',
'description' => 'List of allowed HTML attributes in form input.',
'cols' => 50,
'rows' => 5
));
$this->addElement('submit', 'security_submit', array(
'label' => __('Save Changes'),
'class' => 'big green button'
));
}
}