Results 1 to 7 of 7

Thread: Passing custom data to skin/template config

  1. #1
    Join Date
    Nov 2017
    Posts
    17

    Passing custom data to skin/template config

    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|

  2. #2
    Join Date
    Apr 2005
    Location
    GMT +7.00
    Posts
    12,494
    Hello,

    Not too sure whether I get your idea correct... Probably something like this could be helpful?

    - Custom Package Items skin up to 8 items (SKINS)
    https://www.directadmin.com/features.php?id=2006

    or this:

    - Ability to pass custom variables to pre/post.sh scripts from GET/POST
    https://www.directadmin.com/features.php?id=1780

    if not, then more search results can be found here https://www.directadmin.com/search_v...p?query=custom for a key word custom.

  3. #3
    Join Date
    Nov 2017
    Posts
    17
    Thank you Alex,
    This is what i'm looking for.

  4. #4
    Join Date
    Nov 2017
    Posts
    17
    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

  5. #5
    Join Date
    Apr 2005
    Location
    GMT +7.00
    Posts
    12,494
    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

  6. #6
    Join Date
    Nov 2017
    Posts
    17
    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

  7. #7
    Join Date
    Apr 2005
    Location
    GMT +7.00
    Posts
    12,494
    You can set

    |?MYVAR=anything-here|

    in a template or a custom section in directadmin interface.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •