[Rt-commit] [svn] r786 - in RT-Client: . lib/RT
autrijus at pallas.eruditorum.org
autrijus at pallas.eruditorum.org
Sat May 1 07:25:08 EDT 2004
Author: autrijus
Date: Sat May 1 07:25:08 2004
New Revision: 786
Modified:
RT-Client/ (props changed)
RT-Client/lib/RT/Client.pm
Log:
----------------------------------------------------------------------
r4326 at not: autrijus | 2004-05-01T11:24:32.457321Z
* retab everything to make dngor happy
----------------------------------------------------------------------
Modified: RT-Client/lib/RT/Client.pm
==============================================================================
--- RT-Client/lib/RT/Client.pm (original)
+++ RT-Client/lib/RT/Client.pm Sat May 1 07:25:08 2004
@@ -1,3 +1,5 @@
+# vim: expandtab shiftwidth=4
+
package RT::Client;
use 5.006;
@@ -28,10 +30,10 @@
# search / list
my $tickets = $rt->search(
- URI => 'tickets',
- Limit => "Priority > 5 and Status='new'",
- OrderBy => 'Subject',
- Order => 'DESC',
+ URI => 'tickets',
+ Limit => "Priority > 5 and Status='new'",
+ OrderBy => 'Subject',
+ Order => 'DESC',
);
# narrow search scope
@@ -45,16 +47,16 @@
# update / edit
my $group = $rt->edit(
- URI => 'groups/3',
- Set => { Disabled => 1 },
- Add => {},
- Delete => {},
+ URI => 'groups/3',
+ Set => { Disabled => 1 },
+ Add => {},
+ Delete => {},
);
# create / insert
my $queue = $rt->create(
- URI => 'queues',
- Set => { Name => 'Test Queue' },
+ URI => 'queues',
+ Set => { Name => 'Test Queue' },
);
=head1 DESCRIPTION
@@ -68,25 +70,25 @@
BEGIN {
my @delegate_map = qw(
- search list getFeed
- get show getEntry
- update edit updateEntry
- create insert createEntry
- delete remove deleteEntry
+ search list getFeed
+ get show getEntry
+ update edit updateEntry
+ create insert createEntry
+ delete remove deleteEntry
);
while (my ($key1, $key2, $value) = splice(@delegate_map, 0, 3)) {
- my $method = "SUPER::$value";
+ my $method = "SUPER::$value";
- no strict 'refs';
- *$key1 = *$key2 = sub {
- my $self = shift;
- my $uri = shift;
- return $self->can($method)->(
- $self,
- $self->server_uri($uri),
- @_,
- );
- };
+ no strict 'refs';
+ *$key1 = *$key2 = sub {
+ my $self = shift;
+ my $uri = shift;
+ return $self->can($method)->(
+ $self,
+ $self->server_uri($uri),
+ @_,
+ );
+ };
}
}
@@ -97,15 +99,15 @@
my $username = $self->username;
if (@_) {
- $self->SUPER::password(@_);
- defined $realm or return;
- defined $username or return;
+ $self->SUPER::password(@_);
+ defined $realm or return;
+ defined $username or return;
}
elsif (!defined $realm) {
- die 'Must set $self->server before retrieving $self->password';
+ die 'Must set $self->server before retrieving $self->password';
}
elsif (!defined $username) {
- die 'Must set $self->username before retrieving $self->password';
+ die 'Must set $self->username before retrieving $self->password';
}
return sha1_hex(join(':', $username, $realm, md5_hex($self->{password})));
@@ -120,8 +122,8 @@
sub server {
my $self = shift;
if (@_) {
- $self->{server} = shift;
- $self->realm($self->server_realm);
+ $self->{server} = shift;
+ $self->realm($self->server_realm);
}
return $self->{server};
}
@@ -137,9 +139,9 @@
my $res = $self->{ua}->request($req);
my $wsse = $res->header('WWW-Authenticate')
- or die "Bad RT server";
+ or die "Bad RT server";
$wsse =~ /\bWSSE (?=.*\bprofile="UsernameToken").*?\brealm="(.*?)"/
- or die "Bad WWW-Authenticate";
+ or die "Bad WWW-Authenticate";
return $1;
}
More information about the Rt-commit
mailing list