简体   繁体   中英

secure or encrypt smarty plugins

I am working on CMS system using smarty. The one cms system could support multiple websites with multiple websites, multiple templates, multiple plugins and components...

Client can register and create his website using pre existing templates and choose components to display them on that template.

My Question is that How i can make those component secure or encrypted. so if client take his site away from the server to another server, he won't able to use those module, components etc. or atleast these would expire after certain time..

I am going to create these components using smarty plugins.

Is there any solution in php, smarty ?

Zend Server提供了这样的功能。

Instead of trying to secure the file itself, you may just make those templates private :

Set up the include_path of your php environment to a private folder, thus, your application can use the files in this folder, templates included. Your users however can't retrieve the files easily.

If you don't want to use something like the ionCube PHPEncoder which is able to do the job for Smarty (via a Patch), I would recommend you write a script that performs code obfuscation to your Smarty files to make it a real annoyance to de-obfuscate them. Ideally that would include variable obfuscation also but you then need to touch your PHP files also when handling the variables over to Smarty.

This is not great, but as said, when not using a real encoder there's not much you can do.

As before mentioned IONCube do the job well, but if you need some fast solution without crypt or embarrassing the code with such a tool, then you need to code something... I remenber sometime ago I did a kind of tool, I crypt the data, then put it inside a database and after a time I retrieve that data, off course checking the passphrase key. This is the way, but sometimes it can make your server very slow, specialy if you have a lot of users.

good Luck man!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM