Make custom package item available in config templates (httpd, openlitespeed, php-fpm...)

as247

Verified User
Joined
Nov 25, 2017
Messages
22
Custom package item introduced in 479 https://www.directadmin.com/features.php?id=479
Custom domain item introduced in 1775 https://www.directadmin.com/features.php?id=1775
Custom domain item available in config in https://www.directadmin.com/features.php?id=1978

I think it's easy to make custom package item available in config similar to what already done for custom domain item
|CUSTOM_DOMAIN_ITEM_%s| => available
|CUSTOM_PACKAGE_ITEM_%s| => Not available

My case:
I need a setting to disable dangerous php function for some users
So I use custom package item
secure_php=type=checkbox&string=Secure PHP&desc=Disable dangerous functions&checked=yes

so now i need to build php config based on secure_php checkbox is checked or not and I do it with following code
Code:
|*if CUSTOM_PACKAGE_ITEM_secure_php="on"|
php_admin_value[disable_functions] = exec,system,passthru,shell_exec
|*endif|
Unfortunately, |CUSTOM_PACKAGE_ITEM_secure_php| token is not available :(

So please add this feature, it help to use custom package item feature more efficiently, it will become very useful.


Thank you!
 

CanadaGuy

Verified User
Joined
Nov 14, 2019
Messages
158
I was working on something related to this before Christmas, see here:


and now I'm back at it and came across this thread, as well as another similar thread:


The common elements seem to be that the secure_php CB option seems difficult to override on a per-user or per-domain basis. Are there plans to make this a little more flexible? It seems to be a fairly general issue. Making it a package setting would be ideal as you'll likely either trust a user or not.
 
Last edited:
Top