PHP-console under MODx Revolution
Continuing article distinguished bezumkin, I want to share one small but very useful module for the admin panel of MODx Revolution. That is to say, the Ajax console to run PHP code (of course on the server side) and output the results to the browser.
PS I do Not have further comment at the expense of safety. If you do not know MODx Revolution, it is better not to say anything. Just before posting for security read here.

!!! Don't forget after installation to test this model on vulnerability. How to do it? Try not being authored in the admin interface to query the type of vasat/connectors/console/console.php?action=exec&code=kakoj-libakode
If in the answer you will get any result, bother additional protection in the connector file. I have a Revo 2.1.3, no additional hacks are not required.
Why should he? In working with the site constantly there are various small necessity: a pack of documents to update, or walk the section, and for each document to create a child, etc. So, it is usually just a few lines of code and to execute this small code takes more time to create the file handler.
Now these queries can easily be run straight from the admin panel.
How to create the components described in the above article. Files of this component can be downloaded here.
So, if you have not changed the file structure of your site, put the files from this archive, create a new component console, the component set the path {core_path}components/console/.
Then go to the tab Actions, create a new activity console, the controller console point.

There create a new menu item.

All now update a page in the admin and can test your new component.
Nice, it would be necessary to arrange everything in the installation package (someone will draw? By the way, and detailed a topic to write a description of the package build process), and codemirror to tie to it and hang the event of the request when pressing Ctrl+Enter. Who will do?
Article based on information from habrahabr.ru
PS I do Not have further comment at the expense of safety. If you do not know MODx Revolution, it is better not to say anything. Just before posting for security read here.

!!! Don't forget after installation to test this model on vulnerability. How to do it? Try not being authored in the admin interface to query the type of vasat/connectors/console/console.php?action=exec&code=kakoj-libakode
If in the answer you will get any result, bother additional protection in the connector file. I have a Revo 2.1.3, no additional hacks are not required.
Why should he? In working with the site constantly there are various small necessity: a pack of documents to update, or walk the section, and for each document to create a child, etc. So, it is usually just a few lines of code and to execute this small code takes more time to create the file handler.
Now these queries can easily be run straight from the admin panel.
How to create the components described in the above article. Files of this component can be downloaded here.
So, if you have not changed the file structure of your site, put the files from this archive, create a new component console, the component set the path {core_path}components/console/.
Then go to the tab Actions, create a new activity console, the controller console point.

There create a new menu item.

All now update a page in the admin and can test your new component.
Nice, it would be necessary to arrange everything in the installation package (someone will draw? By the way, and detailed a topic to write a description of the package build process), and codemirror to tie to it and hang the event of the request when pressing Ctrl+Enter. Who will do?
Comments
Post a Comment