View Single Post
Old 12-26-2011, 04:39 PM   #3
Junior Member
 
Join Date: Dec 2011
Posts: 3
michal is on a distinguished road
Default

Quote:
Originally Posted by slava View Post
This is exactly what I needed, thank you!

However it seems that I am unable to get it working. What I have done (following the first link):

Code:
# cat /usr/local/ispmgr/etc/ispmgr_mod_perms.xml
<?xml version="1.0" encoding="UTF-8"?>
<mgrdata>
  <handler name="perms_user.pl" type="cgi">
    <event after="yes">user.edit</event>
  </handler>
</mgrdata>
Code:
# cat /usr/local/ispmgr/addon/perms_user.pl
#!/usr/bin/perl

use CGI;
my $Q = new CGI;
$func = $Q->param("func");
$elid = $Q->param("elid");
 
 
if ($func eq "user.edit") {
  if ($Q->param("sok") && $elid eq "") {
    # a user is created 
    $name = $Q->param("name");
 
    #system("/usr/local/sbin/setperms_user.sh $name");
  }
}
print "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<doc/>\n";
(I commented out the "system" command just to make sure it doesn't negatively affect the result.)

And permissions:
Code:
-r-xr-x--- 1 root root 354 Dec 26 13:44 /usr/local/ispmgr/addon/perms_user.pl
-rw-r--r-- 1 root root 158 Dec 26 13:33 /usr/local/ispmgr/etc/ispmgr_mod_perms.xml
And of course I restarted the ISPmanager. What I get when I now click on "Create user" button, is usual form, but with error message "malformed result" (filling the form and sending it results in the same error). I failed with bash script (ISPmanager was waiting and waiting and didn't show the form) so I decided to follow the guide as close as possible, but it doesn't work. I am doing something wrong?

I'm working with ISPmanager-Pro 4.3.53.1.
michal is offline   Reply With Quote