UniGUI Expiry Link Anonymizer
Let’s write a simple UniGUI link anonymizer with a limited link expiration date. First, let’s make a simple option – relying on the API of a third-party service. Our task is only to attach a time limit to such a link. Naturally, if we use a third-party service, then smart people will simply copy the anonymized link after clicking. But you can also download all the content with the substitution of links – and for most simple sites this method will work. But for now, let’s not complicate things and do everything on the API of a third-party service. The purpose of this post is to figure out how this can be done on UniGUI.
This is what the program will look like.
Intermediate form – for those who accidentally entered
By default, the login form is loaded into UniGUI, if it exists. Or, you can set the parameter Visible: = True to it in the object inspector and then it will be shown first.
So, if the user types in the address bar
, then we show him the login form, in OnShow we will write the following
That is, if there is no such parameter, we hide the login form from a random user.
How to show hide password on login form?
How to add a CAPTCHA to a login form?
How do I handle the Enter button?
Centering elements and creating a CAPTCHA
Actually here we encrypt our original link
1. We do all kinds of checks – for emptiness, whether there are already such encrypted parameters. In parallel, select the GET parameters, if they were
2. Add our parameters – should I use a third-party service? Should you use a time limit?
In principle, nothing complicated, but there were a couple of moments with the peculiarities of UniGUI itself.
Intermediate HELLO form
The purpose of this form is to say hello to a random passer-by or make a redirect to the required resource, if we found the necessary one in the GET parameters …
Here, all the main action will take place in AfterSHow, because it worked incorrectly in OnSHow Redirect …