Username Generator

From UmsWiki
Jump to: navigation, search

This is used to generate usernames for users in UMS.

Steps

First you need to create some options for the setting your going to create later on.

Then add the database replacements.

Then create a setting with a list of prioritized options.

Finally add a username setting to the template that needs this.

Options

AddString

This option lets you add a fixed string to the username

UsernameGenerator Options AddString.jpg

AutoNumber

This option lets you add a number to the username.

UsernameGenerator Options AutoNumber.jpg


You can define the starting number and pad left to make sure it has the correct length.

If you set the start number to 1 and set pad left to 4, the number will be 0001

This number will automatically increase every time it is used to generate a new username.

If the username starts with AB then it will return AB0001

The username number is stored in the database in the table "UsernameGenerator_Numbers"

DBField

This option lets you take a field from the database table ImportFromDB and use as a starting string.

UsernameGenerator Options DBField.jpg

LowerCase

This lowercases the username.

UsernameGenerator Options LowerCase.jpg

Pad

This lets you pad the username either left or right with a character you specify and a length.

UsernameGenerator Options Pad.jpg

If you pad 4 right and the username is AB it will return AB00.

Replace

This lets you replace characters in the username with new characters or blank.

UsernameGenerator Options Replace.jpg


If you check "Use replace from database table" it will use this feature "Database replacements".

UsernameGenerator Options DBReplace.jpg


Replace all non alphanumeric

This will replace all characters in the username that are not within these ranges with the new string or blank

a-z

A-Z

0-9

-

UsernameGenerator Options ReplaceAllNonAlphanumeric.jpg

Substring

This will replace a part of the username with a new string or blank.

UsernameGenerator Options SubString.jpg

Uppercase

This uppercases the username.

UsernameGenerator Options UpperCase.jpg

Database replacements

Define the strings you want to have replace with new or blank string.

UsernameGenerator Database replacements.jpg

When it looks at a username it will run through all the rows and replace them if they are found.

Settings

This is where you create a prioritized list options. This setting is then attached to a template.

UsernameGenerator Settings.jpg