Skip to Content.
Sympa Menu

devel - [sympa-dev] Re: Re: Wrong preconditions testing in SOAP createList ? - Was: Re: Re: Re: authenticateAndRun for createList not working in SOAP server in 5.3.3 ?

Subject: Developers of Sympa

List archive

Chronological Thread  
  • From: address@concealed
  • To: "Stefan Hornburg (Racke)" <address@concealed>
  • Cc: "address@concealed" <address@concealed>
  • Subject: [sympa-dev] Re: Re: Wrong preconditions testing in SOAP createList ? - Was: Re: Re: Re: authenticateAndRun for createList not working in SOAP server in 5.3.3 ?
  • Date: Thu, 27 Sep 2007 08:22:58 +0200

Stefan Hornburg (Racke) wrote:
Olivier Berger wrote:
ping !

Is someone able to have a look at this problem (no tests needed... just
perl reading needed ;) ?
You are right. "unless ($reject){" should be replaced by "if ($reject){" .

This is really strange to me because it was introduce on /Thu May 11 2006 and never change but this function did work !

Anyway I applied the following patch to trunk version
http://sourcesup.cru.fr/cgi/viewvc.cgi/trunk/soap/sympasoap.pm?r1=4612&r2=4619

Thanks
Serge Aumont
/
Thanks in advance.

Le vendredi 21 septembre 2007 à 16:58 +0200, Olivier Berger a écrit :
Le vendredi 21 septembre 2007 à 16:29 +0200, Olivier Berger a écrit :
I'm using the soap client in Perl in which I did something like :
$reponse =
$soap->authenticateAndRun($user_email,$md5,'createList',['essai5','essai5','picoforge_publicproject_members','List
essai4 of project essai4','essai4'])
&print_result($reponse);
called with the listmaster user...

Having a look at the createList() code in sympasoap.pm, I see :

my $reject;
unless ($subject) {
$reject .= 'subject'; }
unless ($template) {
$reject .= ', template'; }
unless ($description) {
$reject .= ', description'; }
unless ($topics) {
$reject .= 'topics'; }
unless ($reject){
&Log::do_log('info', 'create_list %s@%s from %s refused, missing
parameter(s) %s', $listname,$robot,$sender,$reject);
die SOAP::Fault->faultcode('Server')
->faultstring('Missing parameter')
->faultdetail("Missing required parameter(s) : $reject");
}

Wouldn't it be :
*IF* ($reject){
&Log::do_log('info', 'create_list %s@%s from %s refused, missing
parameter(s) %s', $listname,$robot,$sender,$reject);
die SOAP::Fault->faultcode('Server')
->faultstring('Missing parameter')
->faultdetail("Missing required parameter(s) : $reject");
}
instead of unless ?

As I said, I'm not so perlist... but... with s/unless/if, I get createList to
work.

Your opinion ?

No knowledge of Perl whatsoever needed to see that the logic is wrong.

Regards
Racke






Archive powered by MHonArc 2.6.19+.

Top of Page