Looking up card/ID numbers from an external database

PaperCut NG can import card/ID numbers from Active Directory and LDAP. This is the recommended approach because it allows the card/ID numbers to be associated with users in a centralized location. For more information see the section called “Importing Card/Identity numbers from Active Directory or LDAP”.

Card numbers can also be imported using the import file described in the section called “Batch User Card/Identity Update” or the section called “Batch User Import File Format”.

In some circumstances the mapping between card/ID numbers and users may be stored in another external database (e.g. a database used for secure door access). In this case, it may be more convenient to lookup the card/ID numbers from this database in real-time.

Once the lookup is enabled, PaperCut NG will do the following when looking up a user by card/ID number:

  1. Lookup the card/ID in the PaperCut NG database.

  2. If not found, the card/ID will be looked up in the external database.

  3. If a match is found and the user exists in the PaperCut NG database the lookup is successful.

Database lookup configuration

To enable the card/ID to user lookup:

  1. Go to the OptionsAdvanced screen.

  2. Enable the Use external database for card number lookup option.

  3. Select the database type. If using Oracle or MySQL you must install the database driver as described in the external database chapter, and the application server must be restarted.

  4. Enter the database connection URL. For examples see the external database chapter.

  5. Enter the database username and password.

  6. Enter the SQL statement that maps the card/ID number to a username in your database. The SQL must return a single row with the first field being the username (as found in PaperCut NG). NOTE: The SQL statement should contain the replacement {cardnumber}.

Below is an example SQL statement. Note that the {cardnumber} replacement is not quoted.

select username from myusers where card = {cardnumber}

Testing

To test the lookup is working as expected:

  1. Go to the Users screen.

  2. Find a card number in your external database mapped to a username that exists in PaperCut NG.

  3. Enter this card number in the Quick Find field and press Go.

  4. Verify that the matching user is displayed. If the expected user is not displayed check the App. Log for errors.