Changeset 80 for lang/perl/plagger/lib/Plagger
- Timestamp:
- 09/11/07 06:10:23 (15 months ago)
- Files:
-
- 1 modified
-
lang/perl/plagger/lib/Plagger/Crypt/Keychain.pm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/plagger/lib/Plagger/Crypt/Keychain.pm
r79 r80 9 9 sub decrypt { 10 10 my ($self, $text) = @_; 11 my $u = URI-> ($text);11 my $u = URI->new($text); 12 12 # my $protocol = $u->scheme; 13 my $account_name = $u->user _info;13 my $account_name = $u->userinfo; 14 14 my $server_name = $u->host; 15 15 # my $port = $u->port; 16 16 my $path_to = $u->path; 17 17 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}); 19 19 if ($@) { 20 20 $self->context->log(error => "AppleScript error: $@"); … … 26 26 sub encrypt { 27 27 my($self, $text) = @_; 28 my $u = URI-> ($text);28 my $u = URI->new($text); 29 29 # 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; 32 31 my $server_name = $u->host; 33 32 # my $port_num = $u->port; 34 33 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/); 36 35 if ($@) { 37 36 $self->context->log(error => "AppleScript error: $@"); 38 37 return; 39 38 } 39 $u->userinfo($account_name); 40 40 return $u->as_string; 41 41 }
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)