diff options
author | Thierry Vignaud <tv@mandriva.org> | 2009-07-28 12:33:38 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2009-07-28 12:33:38 +0000 |
commit | 8585f58cc94e9cd73ef28c9a2bcbb8106353358f (patch) | |
tree | b3ba4d3b80c9a62de663c9974eb2360f9b2eb93b /mdkapplet-restricted-helper | |
parent | 35db8adc23041e6aaf4c2b41849167e0749f7f97 (diff) | |
download | mgaonline-8585f58cc94e9cd73ef28c9a2bcbb8106353358f.tar mgaonline-8585f58cc94e9cd73ef28c9a2bcbb8106353358f.tar.gz mgaonline-8585f58cc94e9cd73ef28c9a2bcbb8106353358f.tar.bz2 mgaonline-8585f58cc94e9cd73ef28c9a2bcbb8106353358f.tar.xz mgaonline-8585f58cc94e9cd73ef28c9a2bcbb8106353358f.zip |
(xml2perl) factorize code (needed for next commit)
Diffstat (limited to 'mdkapplet-restricted-helper')
-rwxr-xr-x | mdkapplet-restricted-helper | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/mdkapplet-restricted-helper b/mdkapplet-restricted-helper index f2737061..55e55265 100755 --- a/mdkapplet-restricted-helper +++ b/mdkapplet-restricted-helper @@ -116,17 +116,10 @@ my $error; sub add_restricted_medium { my ($email, $password) = @_; - my $res = get_from("https://my.mandriva.com/rest/authenticate", + my $res = get_from("https://my.mandriva.com/rest/authenticate2", [ 'username', $email, 'password', $password, 'return', 'userdata' ]); - my $ref = eval { XML::Simple->new->XMLin($res->{_content}) }; - if (my $err = $@) { - warn ">> XML error: $err\n"; - $ref = { - code => 1, - message => $err, - }; - } + my $ref = xml2perl($res); if ($ref->{code} != 0) { my $in = interactive->vnew; |