Blacklisting and whitelisting the submissions
Being able to blacklist and whitelist the submissions is also important to include trusted users or exclude abusive ones.
In our case, we're going to set up two arrays, one for blacklisted numbers and one for whitelisted numbers.
If a phone sends an image, we'll first check to see whether the phone number is in the blacklist and if not, then we'll check the whitelist.
If the phone number is in the blacklist, then we ignore it. If it's in the whitelist, then we skip the filtering we placed in the previous recipe and upload the photo directly to the gallery.
Just like the previous recipe, we won't change all of the files. We will just update our previously updated gallery. The files that we will change are config.php
, functions.php
, and listener.php
.
Getting ready
The complete code for this recipe can be found in the Code/Recipe5/
folder.
How to do it…
Let's set up a blacklist and whitelist on our photo gallery now.
Let's update
config.php
with our Twilio...