summaryrefslogtreecommitdiff
path: root/rt/bin
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2013-06-04 00:16:28 -0700
committerIvan Kohler <ivan@freeside.biz>2013-06-04 00:16:28 -0700
commit7588a4ac90a9b07c08a3107cd1107d773be1c991 (patch)
tree55b8bedb5f899e705da0ba7f608267943bf89e94 /rt/bin
parent98d2b25256055abb0dfcb9f586b434474fa97afd (diff)
RT 4.0.13
Diffstat (limited to 'rt/bin')
-rwxr-xr-xrt/bin/rt47
-rw-r--r--rt/bin/rt-crontool.in21
-rw-r--r--rt/bin/rt-mailgate.in2
-rw-r--r--rt/bin/rt.in47
4 files changed, 24 insertions, 93 deletions
diff --git a/rt/bin/rt b/rt/bin/rt
index 89873f5d6..ed87f84cf 100755
--- a/rt/bin/rt
+++ b/rt/bin/rt
@@ -3,7 +3,7 @@
#
# COPYRIGHT:
#
-# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC
+# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC
# <sales@bestpractical.com>
#
# (Except where explicitly superseded by other copyright notices)
@@ -50,6 +50,7 @@
# Abhijit Menon-Sen <ams@wiw.org>
use strict;
+use warnings;
if ( $ARGV[0] && $ARGV[0] =~ /^(?:--help|-h)$/ ) {
require Pod::Usage;
@@ -67,6 +68,7 @@ use HTTP::Request::Common;
use HTTP::Headers;
use Term::ReadLine;
use Time::Local; # used in prettyshow
+use File::Temp;
# strong (GSSAPI based) authentication is supported if the server does provide
# it and the perl modules GSSAPI and LWP::Authen::Negotiate are installed
@@ -119,9 +121,9 @@ sub DEBUG { warn @_ if $config{debug} >= shift }
# (XXX: Ask Autrijus how i18n changes these definitions.)
my $name = '[\w.-]+';
-my $CF_name = '[\sa-z0-9_ :()/-]+';
+my $CF_name = '[^,]+?';
my $field = '(?i:[a-z][a-z0-9_-]*|C(?:ustom)?F(?:ield)?-'.$CF_name.'|CF\.\{'.$CF_name.'\})';
-my $label = '[a-zA-Z0-9@_.+-]+';
+my $label = '[^,\\/]+';
my $labels = "(?:$label,)*$label";
my $idlist = '(?:(?:\d+-)?\d+,)*(?:\d+-)?\d+';
@@ -967,12 +969,8 @@ sub take {
sub grant {
my ($cmd) = @_;
- my $revoke = 0;
- while (@ARGV) {
- }
-
- $revoke = 1 if $cmd->{action} eq 'revoke';
- return 0;
+ whine "$cmd is unimplemented.";
+ return 1;
}
# Client <-> Server communication.
@@ -1470,23 +1468,20 @@ sub read_passwd {
sub vi {
my ($text) = @_;
- my $file = "/tmp/rt.form.$$";
my $editor = $ENV{EDITOR} || $ENV{VISUAL} || "vi";
local $/ = undef;
- open( my $handle, '>', $file ) or die "$file: $!\n";
+ my $handle = File::Temp->new;
print $handle $text;
close($handle);
- system($editor, $file) && die "Couldn't run $editor.\n";
+ system($editor, $handle->filename) && die "Couldn't run $editor.\n";
- open( $handle, '<', $file ) or die "$file: $!\n";
+ open( $handle, '<', $handle->filename ) or die "$handle: $!\n";
$text = <$handle>;
close($handle);
- unlink($file);
-
return $text;
}
@@ -1909,8 +1904,6 @@ Text:
ticket/1-3,5-7/history
user/ams
- user/ams/rights
- user/ams,rai,1/rights
For more information:
@@ -2028,20 +2021,6 @@ Text:
- edit
- create
- In addition, the following type-specific actions exist:
-
- - grant
- - revoke
-
- Attributes:
-
- The following attributes can be used with "rt show" or "rt edit"
- to retrieve or edit other information associated with users and
- groups:
-
- rights Global rights granted to this user.
- rights/<queue> Queue rights for this user.
-
--
Title: queue
@@ -2384,12 +2363,6 @@ Text:
--
-Title: grant
-Title: revoke
-Text:
-
---
-
Title: query
Text:
diff --git a/rt/bin/rt-crontool.in b/rt/bin/rt-crontool.in
index 86251a39f..5498da751 100644
--- a/rt/bin/rt-crontool.in
+++ b/rt/bin/rt-crontool.in
@@ -3,7 +3,7 @@
#
# COPYRIGHT:
#
-# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC
+# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC
# <sales@bestpractical.com>
#
# (Except where explicitly superseded by other copyright notices)
@@ -47,6 +47,7 @@
#
# END BPS TAGGED BLOCK }}}
use strict;
+use warnings;
use Carp;
# fix lib paths, some may be relative
@@ -153,17 +154,13 @@ my $void_scrip_action = RT::ScripAction->new( $CurrentUser );
#find a bunch of tickets
my $tickets = RT::Tickets->new($CurrentUser);
-my $search = $search->new(
+$search = $search->new(
TicketsObj => $tickets,
Argument => $search_arg,
CurrentUser => $CurrentUser
);
-
$search->Prepare();
-# TicketsFound is an RT::Tickets object
-my $tickets = $search->TicketsObj;
-
#for each ticket we've found
while ( my $ticket = $tickets->Next() ) {
print $ticket->Id() . ":\n" if ($verbose);
@@ -310,18 +307,6 @@ sub load_module {
}
-
-# =head2 loc LIST
-#
-# Localize this string, with the current user's currentuser object
-#
-# =cut
-
-sub loc {
- $CurrentUser->loc(@_);
-}
-
-
sub help {
print loc( "[_1] is a tool to act on tickets from an external scheduling tool, such as cron.", $0 )
diff --git a/rt/bin/rt-mailgate.in b/rt/bin/rt-mailgate.in
index 72cada613..be1c03224 100644
--- a/rt/bin/rt-mailgate.in
+++ b/rt/bin/rt-mailgate.in
@@ -3,7 +3,7 @@
#
# COPYRIGHT:
#
-# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC
+# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC
# <sales@bestpractical.com>
#
# (Except where explicitly superseded by other copyright notices)
diff --git a/rt/bin/rt.in b/rt/bin/rt.in
index 2a9f643c8..4a3eadadf 100644
--- a/rt/bin/rt.in
+++ b/rt/bin/rt.in
@@ -3,7 +3,7 @@
#
# COPYRIGHT:
#
-# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC
+# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC
# <sales@bestpractical.com>
#
# (Except where explicitly superseded by other copyright notices)
@@ -50,6 +50,7 @@
# Abhijit Menon-Sen <ams@wiw.org>
use strict;
+use warnings;
if ( $ARGV[0] && $ARGV[0] =~ /^(?:--help|-h)$/ ) {
require Pod::Usage;
@@ -67,6 +68,7 @@ use HTTP::Request::Common;
use HTTP::Headers;
use Term::ReadLine;
use Time::Local; # used in prettyshow
+use File::Temp;
# strong (GSSAPI based) authentication is supported if the server does provide
# it and the perl modules GSSAPI and LWP::Authen::Negotiate are installed
@@ -119,9 +121,9 @@ sub DEBUG { warn @_ if $config{debug} >= shift }
# (XXX: Ask Autrijus how i18n changes these definitions.)
my $name = '[\w.-]+';
-my $CF_name = '[\sa-z0-9_ :()/-]+';
+my $CF_name = '[^,]+?';
my $field = '(?i:[a-z][a-z0-9_-]*|C(?:ustom)?F(?:ield)?-'.$CF_name.'|CF\.\{'.$CF_name.'\})';
-my $label = '[a-zA-Z0-9@_.+-]+';
+my $label = '[^,\\/]+';
my $labels = "(?:$label,)*$label";
my $idlist = '(?:(?:\d+-)?\d+,)*(?:\d+-)?\d+';
@@ -967,12 +969,8 @@ sub take {
sub grant {
my ($cmd) = @_;
- my $revoke = 0;
- while (@ARGV) {
- }
-
- $revoke = 1 if $cmd->{action} eq 'revoke';
- return 0;
+ whine "$cmd is unimplemented.";
+ return 1;
}
# Client <-> Server communication.
@@ -1470,23 +1468,20 @@ sub read_passwd {
sub vi {
my ($text) = @_;
- my $file = "/tmp/rt.form.$$";
my $editor = $ENV{EDITOR} || $ENV{VISUAL} || "vi";
local $/ = undef;
- open( my $handle, '>', $file ) or die "$file: $!\n";
+ my $handle = File::Temp->new;
print $handle $text;
close($handle);
- system($editor, $file) && die "Couldn't run $editor.\n";
+ system($editor, $handle->filename) && die "Couldn't run $editor.\n";
- open( $handle, '<', $file ) or die "$file: $!\n";
+ open( $handle, '<', $handle->filename ) or die "$handle: $!\n";
$text = <$handle>;
close($handle);
- unlink($file);
-
return $text;
}
@@ -1909,8 +1904,6 @@ Text:
ticket/1-3,5-7/history
user/ams
- user/ams/rights
- user/ams,rai,1/rights
For more information:
@@ -2028,20 +2021,6 @@ Text:
- edit
- create
- In addition, the following type-specific actions exist:
-
- - grant
- - revoke
-
- Attributes:
-
- The following attributes can be used with "rt show" or "rt edit"
- to retrieve or edit other information associated with users and
- groups:
-
- rights Global rights granted to this user.
- rights/<queue> Queue rights for this user.
-
--
Title: queue
@@ -2384,12 +2363,6 @@ Text:
--
-Title: grant
-Title: revoke
-Text:
-
---
-
Title: query
Text: