In this post I will cover the use of the Smarty Template Engine (version 4.0.0) (https://www.smarty.net/) in an introductory way.
Smarty is a engine to manage templates in projects developed in PHP language. Its objective is to enable the separation of the application logic part (php language) and the presentation part (html / css). Thus, we will have a application logic (with the implementation of business rules, data access, distributed form / cookies) and another presentation layer (to present the application layout).
One of the big problems we face on our websites is the use of forms by “bots” in order to spread “spams” and that ends up causing a super use of our server resources, such as CPU and memory.
Basically, this procedure is the result of algorithms that identify the forms of our sites (contact for example) and start submitting information in them too much and automatically. With this, the production of “spam” ends up becoming a problem for our email services or even for our application’s database
A security feature in system authentication that has become quite popular recently is 2-step verification. The main banking and brokerage applications use their own apps to generate tokens that are dynamic (they are constantly updated in low cycles of time), and used as a 2nd factor for system access (the 1st factor is the traditional username/mail and password ).
However, if you do not want to implement your own token generator, you can use Google Authenticator, an application with the mentioned features (available for Android and IOS) and that can be easily integrated into your application or web system. In this post, I’m going to show you how to integrate your php application with Google Authenticator.
I was developing a small project ( app for Android) in Cordova ( https://cordova.apache.org ), and this project one of the requirements was to send notifications push ( push notifications ) to the application through the Service Cloud Messaging Google Firebase ( https://console.firebase.google.com ).
The procedure for implementing this task is relatively simple. Just access the Google Firebase console, create a new project, enter the information (name, package, etc …), configure it for Android and finally download the file google-services.json