[Rt-commit] rt branch, 4.0/rt-email-group-warnings, created. rt-4.0.13-85-ge4cabdf

Alex Vandiver alexmv at bestpractical.com
Thu Jun 20 23:59:32 EDT 2013


The branch, 4.0/rt-email-group-warnings has been created
        at  e4cabdf4a090e3cf6c057579b0b6a14bf7899c49 (commit)

- Log -----------------------------------------------------------------
commit 7d68f9b9d85f3dea8d6405037e2a9c3028cf5bed
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Thu Jun 20 20:58:41 2013 -0700

    Note that as RT::User->Load is used, the user/email must already exist

diff --git a/sbin/rt-email-group-admin.in b/sbin/rt-email-group-admin.in
index f626626..ac7645d 100644
--- a/sbin/rt-email-group-admin.in
+++ b/sbin/rt-email-group-admin.in
@@ -248,7 +248,8 @@ sub _list {
 =head2 create NAME [--comment] [--group GNAME] [--user UNAME]
 
 Creates new action with NAME and adds users and/or groups to its
-recipient list. Would be notify as comment if --comment specified.
+recipient list. Would be notify as comment if --comment specified.  The
+user, if specified, must already exist in RT.
 
 =cut
 
@@ -325,7 +326,8 @@ sub __check_user
 
 =head2 add NAME [--group GNAME] [--user UNAME]
 
-Adds groups and/or users to recipients of the action NAME.
+Adds groups and/or users to recipients of the action NAME.  The user, if
+specified, must already exist in RT.
 
 =cut
 

commit e4cabdf4a090e3cf6c057579b0b6a14bf7899c49
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Thu Jun 20 20:59:27 2013 -0700

    If __check_user returns false, attempting to use that value in a warning is pointless
    
    Store the original user or group, and use that value in the warning.

diff --git a/sbin/rt-email-group-admin.in b/sbin/rt-email-group-admin.in
index ac7645d..f6a055a 100644
--- a/sbin/rt-email-group-admin.in
+++ b/sbin/rt-email-group-admin.in
@@ -296,8 +296,9 @@ sub __create_empty {
 
 sub _check_groups
 {
-    return grep { $_ ? 1: do { print STDERR "Group '$_' skipped, doesn't exist\n"; 0; } }
-        map { __check_group($_) } @_;
+    return map {$_->[1]}
+        grep { $_->[1] ? 1: do { print STDERR "Group '$_->[0]' skipped, doesn't exist\n"; 0; } }
+        map { [$_, __check_group($_)] } @_;
 }
 
 sub __check_group
@@ -311,8 +312,9 @@ sub __check_group
 
 sub _check_users
 {
-    return grep { $_ ? 1: do { print STDERR "User '$_' skipped, doesn't exist\n"; 0; } }
-        map { __check_user($_) } @_;
+    return map {$_->[1]}
+        grep { $_->[1] ? 1: do { print STDERR "User '$_->[0]' skipped, doesn't exist\n"; 0; } }
+        map { [$_, __check_user($_)] } @_;
 }
 
 sub __check_user

-----------------------------------------------------------------------


More information about the Rt-commit mailing list