2007-08-21 16:33:14 +00:00
|
|
|
#!/usr/bin/perl
|
2008-04-06 12:16:18 +00:00
|
|
|
|
|
|
|
#LibreSSL - CAcert web application
|
|
|
|
#Copyright (C) 2004-2008 CAcert Inc.
|
|
|
|
#
|
|
|
|
#This program is free software; you can redistribute it and/or modify
|
|
|
|
#it under the terms of the GNU General Public License as published by
|
|
|
|
#the Free Software Foundation; version 2 of the License.
|
|
|
|
#
|
|
|
|
#This program is distributed in the hope that it will be useful,
|
|
|
|
#but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
#GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
#You should have received a copy of the GNU General Public License
|
|
|
|
#along with this program; if not, write to the Free Software
|
|
|
|
#Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
|
2007-08-21 16:33:14 +00:00
|
|
|
use LWP::UserAgent;
|
|
|
|
$ua = LWP::UserAgent->new(agent => 'Translingo Client 1.0');
|
|
|
|
use HTTP::Request::Common qw(POST);
|
|
|
|
|
|
|
|
$ua->cookie_jar({});
|
2008-09-07 02:47:20 +00:00
|
|
|
$ua->timeout(10000);
|
2007-08-21 16:33:14 +00:00
|
|
|
|
2008-08-16 00:01:32 +00:00
|
|
|
my $req = POST 'http://translingo.cacert.org/login.php',
|
2007-08-21 16:33:14 +00:00
|
|
|
[
|
|
|
|
];
|
|
|
|
# ggf. Referer faken
|
2008-08-16 00:01:32 +00:00
|
|
|
$req->referer('http://translingo.cacert.org/');
|
2007-08-21 16:33:14 +00:00
|
|
|
$ua->request($req)->as_string;
|
|
|
|
|
|
|
|
# 1.Test - Umgebung
|
2008-08-16 00:01:32 +00:00
|
|
|
my $req = POST 'http://translingo.cacert.org/login.php',
|
2007-08-21 16:33:14 +00:00
|
|
|
[
|
|
|
|
username => 'support@cacert.org',
|
|
|
|
password => 'ilccSSAMNIemU',
|
|
|
|
submit => 'Login',
|
|
|
|
];
|
|
|
|
# ggf. Referer faken
|
2008-08-16 00:01:32 +00:00
|
|
|
$req->referer('http://translingo.cacert.org/');
|
2007-08-21 16:33:14 +00:00
|
|
|
$ua->request($req)->as_string;
|
|
|
|
|
|
|
|
# 2.Test - FileUpload
|
2008-08-16 00:01:32 +00:00
|
|
|
my $req = POST 'http://translingo.cacert.org/upload.php',
|
2007-08-21 16:33:14 +00:00
|
|
|
Content_Type => 'form-data',
|
|
|
|
Content => [
|
|
|
|
project => '1',
|
|
|
|
fileformat => '1',
|
|
|
|
pofile => ["messages.po" => "messages.po", 'Content_Type' => "application/x-gettext"],
|
|
|
|
];
|
|
|
|
print $ua->request($req)->as_string;
|
|
|
|
|