[prev in list] [next in list] [prev in thread] [next in thread] 

List:       webmin-l
Subject:    Re: [webmin-l] XML-RPC Issue
From:       "Jamie Cameron" <jcameron () webmin ! com>
Date:       2008-07-09 8:46:08
Message-ID: 1215593168.21034 () webmin ! com
[Download RAW message or body]

Unfortunately, there is no way currently with the XML-RPC API :-(

On 07/Jul/2008 22:51 Murray Trainer wrote ..
> Is there any way of making a post execution script work?  Maybe allow
> variables to be passed to the made_changes function?  We need to run
> some commands when selected new groups are created.
> 
> Thanks
> 
> Murray
> 
> > I think I see why - the XML RPC api is stateless, so the environment  
> > variables set are not available in the subsequent call. You dont  
> > really need to do this unless the server has a post -creation command  
> > defined though.
> > 
> >   - Jamie
> > 
> > 
> > On Jul 8, 2008, at 2:09 PM, Murray Trainer <mtrainer@central-data.net>  
> > wrote:
> > 
> > >> On 04/Jul/2008 01:56 Murray Trainer wrote ..
> > >>> Hi Jamie,
> > >>>
> > >>> I have got xml-rpc calls working for our admin user working fine.   
> > >>> I want to run
> > >>> the xml-rpc calls as another more restricted user.  When I do that  
> > >>> I get the error
> > >>> below:
> > >>>
> > >>> Method call failed : Fault returned from XML RPC Server, fault  
> > >>> code 1: Invalid
> > >>> user for RPC
> > >>>
> > >>> I can't see anywhere to allow the user to do xml-rpc calls?  If  
> > >>> you have to add
> > >>> some code please e-mail me a copy to test.
> > >>
> > >> You have to enable RPC on a per-user basis at Webmin Users ->  
> > >> username -> Global
> > >> ACL, by setting 'Can accept RPC calls' to 'Yes'.
> > >>
> > >> - Jamie
> > >>
> > >
> > > Thanks for the above - that fixed the issue.  I am now trying to  
> > > create
> > > a group and run the post execution script after the group is  
> > > created.  I
> > > can create the LDAP group OK but can't get the post execution script
> > > working.  My perl xml-rpc script is below.  I don't think the
> > > USERADMIN_* variables are being set correctly but the xmlrpc cgi
> > > script.
> > >
> > > Thanks
> > >
> > > Murray
> > >
> > >
> > > #!/usr/bin/perl
> > > # Create a new LDAP group
> > >
> > > use Frontier::Client;
> > > use Data::Dumper;
> > >
> > > $groupname = "mygroup";
> > > $gid = "1040";
> > > $action = 'CREATE_GROUP';
> > >
> > > chop($url = `cat url.txt`);
> > > eval {
> > >  $server = Frontier::Client->new('url' => $url);
> > >  };
> > > $@ && die "Failed to create server : $@";
> > >
> > > # Create the group object
> > >
> > > $group = {
> > >          'group' => $groupname,
> > >          'gid' => $gid,
> > >         };
> > >
> > > # Create LDAP group
> > > $server->call("ldap-useradmin::create_group", $group);
> > >
> > > print "Created LDAP group $username with uid $uid and gid
> > > $group->{'gid'}\n";
> > >
> > > $server->call("ldap-useradmin::set_group_envs", $group, $action );
> > > $server->call("ldap-useradmin::made_changes");
> > >
> > >
> > >
> > >
> > > --- 
> > > ----------------------------------------------------------------------
> > > Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
> > > Studies have shown that voting for your favorite open source project,
> > > along with a healthy diet, reduces your potential for chronic lameness
> > > and boredom. Vote Now at http://www.sourceforge.net/community/cca08
> > > -
> > > Forwarded by the Webmin mailing list at webadmin-list@lists.sourceforge.net
> > > To remove yourself from this list, go to
> > > http://lists.sourceforge.net/lists/listinfo/webadmin-list
> > >
> > 
> > -------------------------------------------------------------------------
> > Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
> > Studies have shown that voting for your favorite open source project,
> > along with a healthy diet, reduces your potential for chronic lameness
> > and boredom. Vote Now at http://www.sourceforge.net/community/cca08
> > -
> > Forwarded by the Webmin mailing list at webadmin-list@lists.sourceforge.net
> > To remove yourself from this list, go to
> > http://lists.sourceforge.net/lists/listinfo/webadmin-list
> 
> 
> -------------------------------------------------------------------------
> Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
> Studies have shown that voting for your favorite open source project,
> along with a healthy diet, reduces your potential for chronic lameness
> and boredom. Vote Now at http://www.sourceforge.net/community/cca08
> -
> Forwarded by the Webmin mailing list at webadmin-list@lists.sourceforge.net
> To remove yourself from this list, go to
> http://lists.sourceforge.net/lists/listinfo/webadmin-list

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
-
Forwarded by the Webmin mailing list at webadmin-list@lists.sourceforge.net
To remove yourself from this list, go to
http://lists.sourceforge.net/lists/listinfo/webadmin-list
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic