Ability to tokenize script output to set tokens

Version 1.441

Feature
Finished

This feature will give an embedded tokenizer script the ability to have it's output tokenized. The main benefit of this is to allow the setting of tokens for use farther down in the output. For example, if you want a |DOMAIN| token to be set via GET.. but it's not available, say for example you're at the Admin Level, where a DOMAIN isn't set, you could use the API to get this info, then have your script output a standard token variable setting code. Note, that because the script is tokenized piror to running, you must make sure that any strings you set are not seen by DA as a token, else it will be swapped with "none" prior to the script running. An example skin would be: |?domain=testing.com| |$/usr/local/bin/php <?php echo "|"; echo "?domain=domain.com|\n"; ?> DONE| Domain is |domain|<br> Which will output: Domain is domain.com Note, how we set the "domain" token to testing.com, just so that we can see for sure that the output from the script is overriding the previous setting (setting it to testing.com is not actually needed, it's just there to ensure the script output parsing is working). Also, note how the echo "|"; is set onto it's own line, before the next echo. This is because this code: echo "|?domain=domain.com|\n"; would be seen by the tokenizer prior to the script actually running.. and would be either "none" or completely blank, eg "\n"; hence the need to fool the tokenizer on the first pass.. and output a valid tokenizable output for the 2nd post-script pass. By default this feature is disabled. It may be enabled in the future. The internal default is: tokenize_script_output=0 to enable it, add: tokenize_script_output=1 to your directadmin.conf and restart directadmin.

Interested to try DirectAdmin? Get a 30-day Free Trial!