Allow php in plugin hooks

jmstacey

Verified User
Joined
Feb 12, 2004
Messages
3,888
Location
Colorado
It would be nice if DirectAdmin would allow php in the plugin hooks file. Such as user_txt.html

That way we could show or hide the link from our plugins depending on our own specified conditions.
I know you implemented an if/then system but that only works for skin and can't be used with plugins (that I know of)
If it can, let me know and mark this faulty :D

Whenever I add php to the user_txt.html file, I get the following error message
T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in........
 
I wouldn't mind this functionality either. This would allow Installatron to be hidden from users who have no scripts allocated to their account.

Phi1.
 
Great it's added! Waiting for this so long and again not working. Enviroment variables aren't passed. Crucial ones like:

USER
USERNAME
DOCUMENT_ROOT

So it would help testing something before releasing it for the Community. (DA) Next time we get panels that are crashing ;) Hehehe..

Ok. Someone found a solution to do this the hardway ? set_php_ini :p or something :)
 
Hello,

Remember that it's tokenized. It's not like a regular script, it's more like the skins.

So for variables, you'd use:

|USERNAME|

and for scripts, you'd use:
Code:
|$/usr/local/bin/php
<?
echo "Hello world! My Name is |USERNAME|";
?>
DONE|
John
 
Great you changed the version info message. ;)
There was a link to another feauture that explained to do it like:

echo getenv("username");

So don't say it's tokinized if you put the wrong info in it ;)

It was misleading in the first place in the version info message ;)
 
Yes, sorry for the confusion. I quickly added the link because someone else asked how to run php scripts in the hooks, so I did a search for the "|$/usr/local/bin/php", and added the link to that. ;)

John
 
Again it is not working as supposed to be :)

Let's say I have 2 plugins: awstats and log viewer

When I build a check into awstats to allow or deny the plugin and the specific user is denied. It doesn't output the link, ok?

So when nothing is being outputted. All plugins aren't showed!

Ok then I thought ok echo " "; just a space.

The the next plugins are showed but there's an empty line. Not really nice :)
 
Perhaps the if/then should be build into DirectAdmin and then the plugins would have to specify whether to show a link to the skin. Otherwise Directadmin thinks theres a plugin to show but since there's nothing there......
 
Back
Top