Book Image

PrestaShop Module Development

By : Fabien Serny
Book Image

PrestaShop Module Development

By: Fabien Serny

Overview of this book

Table of Contents (19 chapters)
PrestaShop Module Development
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Securing your module


In this section, we will work on the mymodcarrier module.

Protecting your module against directory listing

Directory listing is enabled on a lot of web servers, and sometimes you can't disable it (it depends on your hosting provider). In our case, if someone wants to see the content of our module, he just has to write the path of the module in his browser.

In my case, the URL will be http://localhost/prestashop/modules/mymodcarrier/. If I enter this URL, the browser will display the following screen:

To avoid this behavior, just add an index.php file in all the directories. In our case, it will be in:

/modules/mymodcarrier/

/modules/mymodcarrier/classes/

/modules/mymodcarrier/controllers/

/modules/mymodcarrier/controllers/front/

/modules/mymodcarrier/controllers/hook/

/modules/mymodcarrier/install/

/modules/mymodcarrier/views/

/modules/mymodcarrier/views/img/

/modules/mymodcarrier/views/js/

/modules/mymodcarrier/views/templates/

/modules/mymodcarrier/views/templates...