Show
Ignore:
Timestamp:
09/11/07 06:10:23 (15 months ago)
Author:
otsune
Message:

fix same bug

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/plagger/lib/Plagger/Crypt/Keychain.pm

    r79 r80  
    99sub decrypt { 
    1010    my ($self, $text) = @_; 
    11     my $u = URI->($text); 
     11    my $u = URI->new($text); 
    1212#    my $protocol     = $u->scheme;  
    13     my $account_name = $u->user_info; 
     13    my $account_name = $u->userinfo; 
    1414    my $server_name  = $u->host;  
    1515#    my $port         = $u->port; 
    1616    my $path_to      = $u->path; 
    1717    my $result = 
    18     RunAppleScript(qq{tell application "Keychain Scripting"\nreturn password of last Internet key of current keychain whose server is "$server_name" and path is "$path_to"}); 
     18    RunAppleScript(qq{tell application "Keychain Scripting"\nreturn password of last Internet key of current keychain whose server is "$server_name" and path is "$path_to"\nend tell}); 
    1919    if ($@) { 
    2020        $self->context->log(error => "AppleScript error: $@"); 
     
    2626sub encrypt { 
    2727    my($self, $text) = @_; 
    28     my $u = URI->($text); 
     28    my $u = URI->new($text); 
    2929#    my $protocol     = $u->scheme;  
    30     my $account_name = $u->user_info; 
    31     my $clr_password = $u->password; $u->password(); 
     30    my ($account_name, $clr_password) = split /:/, $u->userinfo; 
    3231    my $server_name  = $u->host;  
    3332#    my $port_num     = $u->port; 
    3433    my $path_to      = $u->path; 
    35     RunAppleScript(qq/tell application "Keychain Scripting"\nmake new Internet key at current keychain with properties {account:"$account_name", password:"$clr_password", server:"$server_name", path:"$path_to"}/\nend tell); 
     34    RunAppleScript(qq/tell application "Keychain Scripting"\nmake new Internet key at current keychain with properties {account:"$account_name", password:"$clr_password", server:"$server_name", path:"$path_to"}\nend tell/); 
    3635    if ($@) { 
    3736        $self->context->log(error => "AppleScript error: $@"); 
    3837        return; 
    3938    } 
     39    $u->userinfo($account_name); 
    4040    return $u->as_string; 
    4141}