Passing custom data to skin/template config

as247

Verified User
Joined
Nov 25, 2017
Messages
22
Hi,
Is there anyway to passing custom data to skin/template?
Eg: I want to add USER_PHP_SECURE_MODE="ON" (my idea is using pre hook scripts)

so in config template
Code:
|*if USER_PHP_SECURE_MODE|
 disable_functions=exec,system,...
open_basedir = /home/|user|
|*endif|

and in skin

Code:
|*if USER_PHP_SECURE_MODE|
<span style="color:green;">ON</span>
|*else|
<span style="color:red;">OFF</span>
|*endif|
 
But on the second
I want to pass custom variable from pre/post sh scripts to config/template, not pass from GET/POST to scripts
 
I doubt it's possible the way you want it. Directadmin skin/templates can't read anything from pre/post scripts.

If the suggested idea does not fit your requirements I guess you need to find another way to achieve what you want, or open a ticket with directadmin developers and suggest a feature request to them.

This one probably could be useful to you:

- Custom Domain Items values available in virtual_host2.conf templates
https://www.directadmin.com/features.php?id=1978
 
Thank you.
Custom Package Items fit with my requirements. I found the way to pass data from pre/post hook script to config template. It's not support all, but we can pass some CUSTOM# token to apache config and php-fpm config.
I apply this guide https://help.directadmin.com/item.php?id=299 but not for httpd.conf, i'm applied for php-fpm.conf, php-fpm.conf only support 2 custom token CUSTOM1 and CUSTOM2, we may need more like MYVAR. but it's fine now for me :D
 
You can set

|?MYVAR=anything-here|

in a template or a custom section in directadmin interface.
 
Back
Top