Prefix random usernames with "weblite"
This commit is contained in:
parent
fdfa9e902c
commit
6bd0d8ad7e
2 changed files with 8 additions and 4 deletions
|
|
@ -389,8 +389,12 @@ class Util {
|
|||
}
|
||||
|
||||
/** Generate a random user name */
|
||||
randomUser() {
|
||||
return "weblite-" + this.randomString(
|
||||
randomUser(prefix) {
|
||||
var pfx = prefix ? prefix.replace(/[^0-9a-zA-Z\-_]/gi, '') : null;
|
||||
if (!pfx || pfx.length == 0) {
|
||||
pfx = "weblite-";
|
||||
}
|
||||
return pfx + this.randomString(
|
||||
12,
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue