Skip to Content.
Sympa Menu

devel - Re: [sympa-dev] Soap Function to change owner with update_admin_user

Subject: Developers of Sympa

List archive

Chronological Thread  
  • From: David Verdin <address@concealed>
  • To: Tsapline Sylvain <address@concealed>
  • Cc: address@concealed
  • Subject: Re: [sympa-dev] Soap Function to change owner with update_admin_user
  • Date: Tue, 22 Jan 2008 09:52:05 +0100

The problem is: you just changed the value in memory, but not in the list's config file.
Updating the list's config is more complex than that. What if you have multiple owners ? If owners adresses are included from an external data source ?
You should have a look to the "do_edit_list()" sub in wwsympa.fcgi that is used to update list's config.

Anyway, we're thinking about giving the opportunity to update list's config through SOAP, but the complexity lies in the heterogeneity and variety of the parameters in Sympa.

Regards,

Tsapline Sylvain a écrit :
Hi
We partially succeed to implement a soap modifcation to allow owner update.
The call to the new soap function is successfull as well as the modification of the email owner.
Owner Email Modification appears in the database.
Problem is whenever the apache instance is restarted all the modifications are lost !
It seem to us to be a small bug :)
What would you recommend to make it work ?
Thanks in advance.
# diff sympasoap.pm sympasoap.pm.orig
678,740d677
< sub changeOwner {
< my $class = shift;
< my $listname = shift;
< my $newemail = shift;
<
< my $sender = $ENV{'USER_EMAIL'};
< my $robot = $ENV{'SYMPA_ROBOT'};
< my $remote_application_name = $ENV{'remote_application_name'};
<
< &Log::do_log('info', 'SOAP changeOwner(list = %s\@%s) from %s via proxy application %s', $listname,$robot,$sender,$remote_application_name);
<
< unless ($sender) {
< die SOAP::Fault->faultcode('Client')
< ->faultstring('User not specified')
< ->faultdetail('Use a trusted proxy or login first ');
< }
<
< my @resultSoap;
<
< unless ($listname) {
< die SOAP::Fault->faultcode('Client')
< ->faultstring('Incorrect number of parameters')
< ->faultdetail('Use : <list>');
< }
<
< unless ($newemail) {
< die SOAP::Fault->faultcode('Client')
< ->faultstring('Incorrect number of parameters')
< ->faultdetail('Use : <list>');
< }
<
< &Log::do_log('debug', 'SOAP changeOwner(%s,%s)', $listname,$robot);
<
< my $list = new List ($listname, $robot);
< unless ($list) {
< &Log::do_log('info', 'changeOwner %s@%s <mailto:%s@%s> from %s refused, unknown list', $listname,$robot,$sender);
< die SOAP::Fault->faultcode('Client')
< ->faultstring('unknown list')
< ->faultdetail("unknown list $listname");
< }
< < # check authorization
< my $jpi_val = $list->am_i('owner', $sender);
< &Log::do_log('info', 'changeOwner owner =%s', $jpi_val);
<
< unless (($list->am_i('owner', $sender)) || (&List::is_listmaster($sender))) {
< &Log::do_log('info', 'changeOwner %s from %s not allowed',$listname,$sender);
< die SOAP::Fault->faultcode('Client')
< ->faultstring('Not allowed')
< ->faultdetail("Not allowed");
< }
<
< if( !defined($list-> ($sender, 'owner', { 'email' => $newemail })) )
< {
< &Log::do_log('info','changeOwner: processing error !');
< die SOAP::Fault->faultcode('Client')
< ->faultstring('owner for list not changed.')
< ->faultdetail("list $listname can't change owner");
< }
<
< return 1;
< }
<
# diff sympa.wsdl sympa.wsdl.orig
224,233d223
< <message name="changeOwnerRequest">
< <part name="list" type="xsd:string"/>
< <part name="email" type="xsd:string"/>
< <part name="newemail" type="xsd:string"/>
< </message>
<
<
< <message name="changeOwnerResponse">
< <part name="return" type="xsd:boolean"/>
< </message>
314,317d303
< <operation name="chnageOwner">
< <input message="tns:changeOwnerRequest" />
< <output message="tns:changeOwnerResponse" />
< </operation>
572,584d557
< <operation name="changeOwner">
< <soap:operation soapAction="urn:sympasoap#changeOwner"/>
< <input>
< <soap:body use="encoded"
< namespace="urn:sympasoap"
< encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/ <http://schemas.xmlsoap.org/soap/encoding/%22/>>
< </input>
< <output>
< <soap:body use="encoded"
< namespace="urn:sympasoap"
< encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/ <http://schemas.xmlsoap.org/soap/encoding/%22/>>
< </output>
< </operation>

Sylvain Tsapline -----------------------------------
PROSODIE - Département Systèmes
PROSODIE - Direction des Architectures et des moyens techniques
e-mail : address@concealed
----------------------------------------------------
www.prosodie.com <http://www.prosodie.com/>


--
David Verdin
Comité réseau des universités




Archive powered by MHonArc 2.6.19+.

Top of Page