aboutsummaryrefslogtreecommitdiffstats
path: root/fritz
diff options
context:
space:
mode:
Diffstat (limited to 'fritz')
-rwxr-xr-xfritz11
1 files changed, 8 insertions, 3 deletions
diff --git a/fritz b/fritz
index eae7fd2..34df968 100755
--- a/fritz
+++ b/fritz
@@ -32,19 +32,24 @@ sub login {
my $req = HTTP::Request->new(GET => $url);
my $res = $ua->request($req);
die "login http request #1 failed" unless $res->is_success;
+ #print $res->content;
my $xml = XMLin($res->content);
# construct response
my $cr = $xml->{'Challenge'} . "-" . $passwd;
$cr =~ s/(.)/$1 . chr(0)/eg; # to utf16
my $md5 = lc(md5_hex($cr));
- $url = "http://${host}/login_sid.lua?response=" .
- $xml->{'Challenge'} . "-" . $md5;
-
+ $url = "http://${host}/login_sid.lua"
+ . "?username=" . $cfg->param('user')
+ . ";response=" . $xml->{'Challenge'} . "-" . $md5;
+ #print $url . "\n";
+ #print Dumper($xml);
+
# login and get session id
$req = HTTP::Request->new(GET => $url);
$res = $ua->request($req);
die "login http request #2 failed" unless $res->is_success;
+ #print $res->content;
$xml = XMLin($res->content);
$sid = $xml->{'SID'};
die "login failed" if $sid eq "0000000000000000";