nodebb-plugin-restrict-usernames
Advanced tools
Comparing version 0.5.1 to 0.6.0
@@ -97,4 +97,4 @@ 'use strict'; | ||
} | ||
for (const { rule } of rules) { | ||
if (new RegExp(rule).test(username)) { | ||
for (const { rule, insensitive } of rules) { | ||
if (new RegExp(rule, insensitive === 'on' ? 'iu' : 'u').test(username)) { | ||
throw new Error('[[restrict-usernames:error.username-blacklisted]]'); | ||
@@ -110,2 +110,3 @@ } | ||
plugin.settings = await meta.settings.get(plugin.id); | ||
console.log(plugin.settings); | ||
} | ||
@@ -112,0 +113,0 @@ return data; |
{ | ||
"name": "nodebb-plugin-restrict-usernames", | ||
"version": "0.5.1", | ||
"version": "0.6.0", | ||
"description": "Set rules for what usernames are allowed on your forum", | ||
@@ -5,0 +5,0 @@ "main": "library.js", |
@@ -38,10 +38,3 @@ { | ||
], | ||
"scripts": [ | ||
"static/lib/main.js" | ||
], | ||
"acpScripts": [ | ||
"static/lib/acp-main.js" | ||
], | ||
"modules": { | ||
"../client/restrict-usernames.js": "./static/lib/restrict-usernames.js", | ||
"../admin/plugins/restrict-usernames.js": "./static/lib/admin.js" | ||
@@ -48,0 +41,0 @@ }, |
@@ -20,3 +20,4 @@ { | ||
"filter.regex.name": "Custom blacklist (words or regex)", | ||
"filter.regex.description": "If enabled, registering with a username that matches any of the rules will be rejected. Rules are matched using JavaScript regex, but for basic usage just inputting the word will match it as is. Just be weary of special characters like parentheses or periods, which need to be escaped by prepending them with \\" | ||
"filter.regex.description": "If enabled, registering with a username that matches any of the rules will be rejected. Rules are matched using JavaScript regex, but for basic usage just inputting the word will match it as is. Just be weary of special characters like parentheses or periods, which need to be escaped by prepending them with \\", | ||
"insensitive": "(case insensitive)" | ||
} |
@@ -9,3 +9,4 @@ { | ||
"error.special-characters": "Nazwa użytkownika nie może zawierać znaków specjalnych", | ||
"error.no-letters": "Nazwa użytkownika musi zawierać przy najmniej jedną literę" | ||
"error.no-letters": "Nazwa użytkownika musi zawierać przy najmniej jedną literę", | ||
"insensitive": "(ignoruje wielkość liter)" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
60398
343