diff options
author | ivan <ivan> | 2004-11-11 12:13:50 +0000 |
---|---|---|
committer | ivan <ivan> | 2004-11-11 12:13:50 +0000 |
commit | c582e92888b4a5553e1b4e5214cf35217e4a0cf0 (patch) | |
tree | 3fe7cd7bf22bd356b478f0de0dd8f0b140fcee23 /rt/lib/RT/Queue_Overlay.pm | |
parent | 289340780927b5bac2c7604d7317c3063c6dd8cc (diff) |
import rt 3.0.12
Diffstat (limited to 'rt/lib/RT/Queue_Overlay.pm')
-rw-r--r-- | rt/lib/RT/Queue_Overlay.pm | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/rt/lib/RT/Queue_Overlay.pm b/rt/lib/RT/Queue_Overlay.pm index fcc185b10..f40055b3b 100644 --- a/rt/lib/RT/Queue_Overlay.pm +++ b/rt/lib/RT/Queue_Overlay.pm @@ -48,6 +48,7 @@ no warnings qw(redefine); use vars qw(@STATUS @ACTIVE_STATUS @INACTIVE_STATUS $RIGHTS); use RT::Groups; use RT::ACL; +use RT::EmailParser; @ACTIVE_STATUS = qw(new open stalled); @@ -518,6 +519,8 @@ Email The email address of the new watcher. If a user with this If the watcher you\'re trying to set has an RT account, set the Owner paremeter to their User Id. Otherwise, set the Email parameter to their Email address. +Returns a tuple of (status/id, message). + =cut sub AddWatcher { @@ -602,10 +605,13 @@ sub _AddWatcher { # if the user doesn't exist, we need to create a new user my $new_user = RT::User->new($RT::SystemUser); + my ( $Address, $Name ) = + RT::EmailParser::ParseAddressFromHeader('', $args{'Email'}); + my ( $Val, $Message ) = $new_user->Create( - Name => $args{'Email'}, - EmailAddress => $args{'Email'}, - RealName => $args{'Email'}, + Name => $Address, + EmailAddress => $Address, + RealName => $Name, Privileged => 0, Comments => 'Autocreated when added as a watcher'); unless ($Val) { |