<!-- wp:heading {"align":"left"} -->
<h2 style="text-align:left">We're often asked curious pre-sales questions in the Selectec office</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>We recently had an interesting pre-sales question come in concerning an international construction company. At one of their sites, they issue temporary swipe cards to staff members if they accidentally lose or forget their regular swipe card.&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>The reason to block this is once the card is handed, back the next person to get that card may attempt to access PaperCut and would see the last persons print jobs.  As these are temporary cards and the "owner" changes regularly, they didn't want them to associate the cards with their PaperCut accounts using the 'self-association' feature built into the embedded software.&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:spacer {"height":20} -->
<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->

<!-- wp:heading {"level":3,"align":"left"} -->
<h3 style="text-align:left">How do you blacklist a card from being registered? </h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>In an ideal world, we would be able to tell the staff member not to do it, but heh, they already lost their card, so they are fancy-free and out to cause trouble! So we need to put some checks in.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>In this example, the customer had 20 guest cards that they wished to exclude from the self-association process. So, at first glance, our blog about&nbsp;<strong>granting temporary access to PaperCut</strong>&nbsp;might have helped.</p>
<!-- /wp:paragraph -->

<!-- wp:core-embed/wordpress {"url":"https://staging.selectec.com/grant-temporary-access-to-papercut/","type":"wp-embed","providerNameSlug":"select-technology-ltd","className":""} -->
<figure class="wp-block-embed-wordpress wp-block-embed is-type-wp-embed is-provider-select-technology-ltd"><div class="wp-block-embed__wrapper">
https://staging.selectec.com/grant-temporary-access-to-papercut/
</div></figure>
<!-- /wp:core-embed/wordpress -->

<!-- wp:paragraph -->
<p>However, that's not enough in this circumstance.&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>During a brainstorm that involved a mug of&nbsp;<a target="_blank" href="https://wearesneak.co.uk/" rel="noreferrer noopener">Sneak</a>, some (lightly salted) roasted fava beans and pre-ordering the new Ghost Recon game we came up with three ideas.</p>
<!-- /wp:paragraph -->

<!-- wp:spacer {"height":20} -->
<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->

<!-- wp:heading {"level":3,"align":"left"} -->
<h3 style="text-align:left">1. Use the ext-device.card-no-regex config key</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>The config key route allows you set a regular expression for card patterns that are allowed so if all the cards are 246068XXXX that they can't use and that pattern doesn't match any existing ones it would be worth using. You'll find more information on how to do this here.&nbsp;<a target="_blank" href="https://www.papercut.com/kb/Main/RegularExpressionsForCardNumbers" rel="noreferrer noopener">https://www.papercut.com/kb/Main/RegularExpressionsForCardNumbers</a>&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:spacer {"height":20} -->
<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->

<!-- wp:heading {"level":3,"align":"left"} -->
<h3 style="text-align:left">2. Make Internal Users</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>This one is a bit silly but silly works sometimes. There is no user limit since v19.0 so you could get away with simply making 20&nbsp;<a target="_blank" href="https://www.papercut.com/support/resources/manuals/ng-mf/applicationserver/topics/user-guest-internal.html" rel="noreferrer noopener">internal users</a>&nbsp;(or 10 if you use both card fields) and set the ID fields to the card number and disable the internal users so they can't log in.&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>PaperCut then won't allow that card to work as it is already registered.&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:spacer {"height":20} -->
<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->

<!-- wp:heading {"level":3,"align":"left"} -->
<h3 style="text-align:left">3. Look up card numbers in an external database</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>This route may be a bit overkill, but I'll let you decide!</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Setup an external database lookup for the card number for one user, then create a table with three columns (ID, Username, CardNumber).</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Then (and this is the magic) put all 20 card numbers in that database assigned to that one user, and disable that user within PaperCut.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>It works like option two but uses fewer users. For more information on external lookups, check out this <a href="https://www.papercut.com/support/resources/manuals/ng-mf/applicationserver/topics/user-card-id.html#user-card-db-lookup">article</a>.</p>
<!-- /wp:paragraph -->

<!-- wp:spacer {"height":50} -->
<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->

<!-- wp:heading {"level":3,"align":"left"} -->
<h3 style="text-align:left">Is that the best you can do?</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Well, no. We did feel bad, so during Pizza Friday, someone had the idea of knocking up a bit of Javascript that returns nothing to PaperCut when using one of the temporary cards. We didn't know what would happen if you return nothing to PaperCut and it is only possible as we have a list of cards, but the idea had merit.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Out of that merit came the following script:</p>
<!-- /wp:paragraph -->

<!-- wp:preformatted -->
<pre class="wp-block-preformatted">function convert(cardNumber) {
 var cardNumbers = ["CARD", "NUMBERS", "TO", "IGNORE", "R006F0120E071C9B9", "R006F0120A07912BF", "R006F0120DEAA514E" ];
 // If the number is not in our array
     if (cardNumbers.indexOf(cardNumber) == -1) {
     // return the cardNumber like normal
     return cardNumber;
     }
 // Anything under here applies to card numbers that are in our array
 // Return an empty card number
   return "";
 }</pre>
<!-- /wp:preformatted -->