ID Card Management
In the User Authentication settings tab, in the Cards section, there are the following ID Card management options:
Enable registration of multiple cards - This is enabled by default. If disabled, when a new card is registered, the current cards are deleted.
Register cards as temporary - If this is enabled, ID cards can be registered as temporary.
Validity of temporary cards - Set the duration of the temporary cards validity in hours.
When an unknown ID card is swiped - These options dictate what should happen when an unknown ID card is swiped. The options are:
Authentication fails.
Allow the existing user to register the card - an existing user can enter their login details after swiping the card and the card is registered to that user on the server.
Register a new user - registers the card as a new user on the server, you can choose if you would like users registered this way to be automatically assigned to a particular user group.
Card code transformation - This transformation is used by Embedded terminals (with USB readers connected directly to the device) and by the reader for a HW terminal that is connected, usually, as a primary reader.
USB reader transformation - Check the box to apply the transformation to card readers connected to a PC USB slot. These card readers are usually used to recharge credit or to associate cards with user accounts.
![image-20240222-114551.png](../../../__attachments/1262846034/image-20240222-114551.png?inst-v=f576f6b0-eb9f-4035-8724-3dad44b7106e)
Adding cards manually is not possible when cards are synchronized from an LDAP source. The manually added cards will be deleted during the next LDAP synchronization, and overwritten by the cards from the LDAP source.
Adding multiple cards via the LDAP synchronization is supported.
ID Card Transformation
This topic discusses the ID Card transformation feature in MyQ. The transformation might be necessary if the customer needs to import card numbers from a third-party SW database and the card number format in this database doesn't match the format read by the MyQ card reader.
The third-party system card readers can give output in a different format than the card readers used in MyQ. In consequence, users card numbers imported from the third-party system can differ from the card numbers read by the MyQ card readers. To unify the format of the two outputs, you can define a specific sequence of commands that transforms the output of the MyQ card readers to the format used in the database of
the third-party system.
With most of the MyQ card readers, you can use the card reader configuration software to set the format directly on the reader. However, it is simpler and faster to set one or two universal MyQ transformations than to separately change settings of each card reader.
![ID card transformation example](../../../__attachments/1262846034/image-20201126-145619.png?inst-v=f576f6b0-eb9f-4035-8724-3dad44b7106e)
How to setup the card transformation:
On the User Authentication settings tab, in the Cards section and under Advanced, you can define and use a transformation for card readers and select to use it on a USB reader connected to the administrator PC. The USB reader can be used to recharge credit or associate cards.
Available options:
Card code transformation: This transformation is used by Embedded terminals (with USB readers connected directly to the device) and by the reader for a HW terminal that is connected, usually, as a primary reader.
USB reader transformation: Check the box to apply the transformation to card readers connected to a PC USB slot. These card readers are usually used to recharge credit or to associate cards with user accounts.
Defining the transformation
You can define the transformation by adding commands that can be found on this list. The commands have to be separated by a semicolon (;) and are read and executed from left to right. For example in the transformation CommandX;CommandY, Command X is executed first and Command Y, second.
All the commands, except for the + command, are applied in the following way:
The first command of the transformation and each command immediately behind the + command are applied to the initial card number. All other commands are applied to the result of their predecessors.
ID Card Transformation Commands
ltrim(number of characters) – Remove the first X characters from the left.
ltrim(2): 123456 —> 3456rtrim(number of characters) – Remove the first X characters from the right (the last X characters).
rtrim(2): 123456 —> 1234prepend(character string) – Add the string in front of the card number.
prepend(AB): 123456 —> AB123456append(character string) – Add the string behind the card number.
append(AB): 123456 —> 123456ABleft(number of characters) – Select the first X characters from the left (and remove the rest).
left(2): 123456 —>12right(number of characters) – Select the first X characters from the right.
right(2):123456 —> 56mid(number of characters, number of characters) – Remove X characters from the left, remove Y characters from the right and leave the characters in the middle.
mid(2,2): 123456 —> 34lpad(number of positions, symbol) – Complete the string to the length specified by the number of positions parameter by adding the value of the symbol parameter to the left (in front of the card number).
lpad(12,0): 123456 —> 000000123456hex2dec() – Transform the card number from hexadecimal mode to decimal mode.
hex2dec(): 1000AB —> 1048747dec2hex() – Transform the card number from decimal mode to hexadecimal mode.
dec2hex(): 1048747 —>1000ABhex2bin – Transform the card number from hexadecimal mode to binary mode.
hex2bin(): 1000AB —> 100000000000010101011bin2hex – Transform the card number from binary mode to hexadecimal mode.
bin2hex(): 100000000000010101011 —> 1000ABdec2bin – Transform the card number from decimal mode to binary mode.
dec2bin(): 100023 —> 11000011010110111bin2dec – Transform the card number from binary mode to decimal mode.
bin2dec(): 11000011010110111 —> 100023reverse() – Reverse the byte sequence, i.e. take all the characters by two and reverse the order of the pairs. (The last pair goes first, the second last goes second, etc.)
reverse(): 1234AB —> AB3412reverseString() – Reverse the character sequence. (The last character goes first, the second last goes second, etc.)
reverseString(): 1234AB —> BA4321reverseNibbleBits() – Convert each character from hexadecimal mode to binary mode, reverse the character sequence of each quadruple and convert the result back to hexadecimal mode.
reverseNibbleBits(): 10AB —> 0001 0000 1010 1011 —> 1000 0000 0101 1101 —> 805Dupper() – Converts the string to upper case.
upper(): Abcd —> ABCDplugin(reference) – Calls a card transformation plugin with the given reference. This option enables using custom PHP scripts for the transformation. For more information about this option, contact MyQ support.
asciiCode2ascii – Converts ASCII characters encoded as hex-digits to ASCII characters.
asciiCode2ascii(): 414F —> AO"string 1" + "string 2" – Merges the strings in front of and behind the + command.
"string 1":Either the initial card number (if there are no commands preceding the + symbol),
or the result of the last command before the + symbol (if there are no + commands preceding the + symbol),
or the result of the previous + command.
"string 2":Either the initial card number (if there are no commands behind the + symbol or if the next command is another + command),
or the result of the last command of the transformation (if there are no + commands behind the + symbol),
or the result of the last command before another + command.
ID card transformation example:
Card number: 10AB
Card code transformation: hex2bin();lpad(16,0);reverseString();ltrim(8);reverseString();bin2hex() + ltrim(4);lpad(4,10AB)
Result: 1010AB
Transformation process:
("10AB" —>"1 0000 1010 1011" —> "0001 0000 1010 1011" —> "1101 0101 0000 1000" —> "0000 1000" —> "0001 0000" —> "10") + ("10AB"" —> "" —> "10AB") ==> "1010AB"