02-23-2013, 10:54 PM | #1 |
Junior Member
Join Date: Feb 2013
Posts: 2
|
Running command on user.edit and user.create
Hi
I've created a hook running on change or creation of user. My XML looks like this, /usr/local/ispmgr/etc/ispmgr_newrelic.xml Code:
<?xml version="1.0" encoding="UTF-8"?> <mgrdata> <handler name="newrelic.pl" type="cgi"> <event after="yes">user.edit</event> <event after="yes">user.create</event> </handler> </mgrdata> Code:
#!/usr/bin/perl use CGI; my $Q = new CGI; $note = $Q->param("note"); if ($note ne "!new_relic") { # a user is created or changed $name = $Q->param("name"); open(FH,">","/var/www/$name/.htaccess") or die "$!"; print FH "<IfModule mod_php5.c>\n"; print FH " php_value newrelic.appname $name\n"; print FH "</IfModule>\n"; close FH; } print "<?xml version=\"1.0\" encoding=\"UTF-8\"?>OK-RELIC\n<doc/>\n"; .. but it doesn't. I can run the file myself with success, but when it comes to ISPManager, I think it isn't even running it. What is wrong with this?? Greetings, Niclas Hedam Server Administrator Last edited by Niclas Hedam; 02-23-2013 at 10:58 PM. Reason: grammar |
02-23-2013, 11:03 PM | #2 |
Junior Member
Join Date: Feb 2013
Posts: 2
|
Typical.
Right after creating this, I seem to find out that the file is required to start with ispmgr_mod |
02-25-2013, 03:36 AM | #3 |
Support team
Join Date: Nov 2011
Posts: 77
|
Hello,
Yes, you are right. You can read more in our documentation http://en.ispdoc.com/index.php/Writing_plug-ins |
|
|