This page, or parts of it, are still untranslated. Please translate it to the appropriate language (беларуская).
NoLicenseWarning адлюстроўвае папярэджанне, калі ўдзельнік спрабуе загрузіць файл без выбару ліцэнзіі. Удзельнік як і звычайна можа загрузіць файл, адправіўшы форму яшчэ раз, такім чынам скрыпт нясе вылучна інфарматыўную функцыю.
Installation
Configuration
You can configure whether the script should prevent users from uploading files without licenses or just let them know that selecting a license is strongly recommended (default) and which user groups won't be affected by this script. It's also possible to change the default warning and rejection messages.
Script settings
Script configuration is stored in the window.NoLicenseWarning object and following variables are available:
| Variable | Description | Data type | Default value |
|---|---|---|---|
forceLicense
|
Whether a license should be forced or not. | Boolean | false
|
excludedGroups
|
List of user groups that aren't affected by script. You can check user groups available on your wiki by visiting Special:ListGroupRights. | Array | ['bureaucrat', 'sysop', 'content-moderator', 'bot']
|
Code below contains example configuration that you can use by adding to the MediaWiki:Common.js page on your wiki:
// Configuration for NoLicenseWarning
window.NoLicenseWarning = {
forceLicense: true,
excludedGroups: [
'sysop',
'threadmoderator',
'content-moderator',
'rollback'
]
};
Custom messages
If you want to use different banner messages, add following code to the MediaWiki:Common.js page on your wiki:
// Prepare custom messages for NoLicenseWarning
window.dev = window.dev || {};
window.dev.i18n = window.dev.i18n || {};
window.dev.i18n.overrides = window.dev.i18n.overrides || {};
window.dev.i18n.overrides['NoLicenseWarning'] = window.dev.i18n.overrides['NoLicenseWarning'] || {};
// Add custom content instead of default messages
window.dev.i18n.overrides['NoLicenseWarning']['warning-text'] = 'Your custom warning message';
window.dev.i18n.overrides['NoLicenseWarning']['rejected-text'] = 'Your custom rejected message';
Other notes
- Users within global groups such as staff, wiki-specialist, etc. are never affected by this script. Local user groups exceptions can be configured in the
excludedGroupsarray. - It's possible for users to bypass this script by disabling JavaScript in their web browser or by using the
?usesitejs=0URL parameter (?safemode=1on UCP wikis). There's no technical solution available to prevent users from uploading unlicensed files with absolute effectiveness.