02-05-2015, 02:49 PM | #1 |
Junior Member
Join Date: Jan 2015
Posts: 28
|
ispmgr 5 business: event handler
Hello,
I am trying to write event handler that will be executed after new user is added. I can not get it working, seems that handler is not registered. Content of /usr/local/mgr5/etc/xml/ispmgr_mod_useradd.xml Code:
<?xml version="1.0" encoding="UTF-8"?> <mgrdata> <handler name="uh-useradd.php" type="cgi"> <event after="yes">user.add</event> </handler> </mgrdata> Code:
#!/usr/bin/php-cgi <?php file_put_contents('/usr/local/mgr5/var/uh-ispmgr.log', "\n".date('Y-m-d H:i:s'), FILE_APPEND); BTW: I used such an approach in version 4 of ispsystem products and there was no problem. Thanks, -Maciej |
02-09-2015, 02:57 PM | #4 |
ISPsystem team
Join Date: Jun 2013
Posts: 233
|
I have plugin works with next xml file:
# cat /usr/local/mgr5/etc/xml/ispmgr_mod_useradd.xml <?xml version="1.0" encoding="UTF-8"?> <mgrdata> <handler name="uh-useradd.php" type="cgi"> <event name="user.add.finish" after="yes" /> </handler> </mgrdata> OR # cat /usr/local/mgr5/etc/xml/ispmgrnode_mod_useradd.xml <?xml version="1.0" encoding="UTF-8"?> <mgrdata> <handler name="uh-useradd.php" type="cgi"> <event name="user.edit" after="yes" /> </handler> </mgrdata> If you want to have plugin for ispmgrnode you need to add this file on a all nodes. |
|
|