CurrentUserEmail

From Request Tracker Wiki
Jump to navigation Jump to search
Sort of a corollary to __CurrentUser__, which returns the Current user id in searches,
 __CurrentUserEmail__ allows you to search against the logged in user's email address.
 (Thus allowing the return of "MyRequestedTickets" from ver2 of RT by matching
 __CurrentUserEmail__ against Requestor in a search)
 
 1 - cd $rt_home
 2 - cp lib/RT/Tickets_Overlay_SQL.pm local/lib/RT/Tickets_Overlay_SQL.pm
 3 - apply the below diff (which really only adds the three lines.
 
 $ diff -c lib/RT/Tickets_Overlay_SQL.pm local/lib/RT/Tickets_Overlay_SQL.pm
 *** lib/RT/Tickets_Overlay_SQL.pm       Wed Jul 30 16:08:43 2008
 --- local/lib/RT/Tickets_Overlay_SQL.pm Wed Jul 30 17:25:34 2008
 ***************
 *** 294,299 ****
 --- 294,302 ----
         # replace __CurrentUser__ with id
         $val = $self->CurrentUser->id if $val eq '__CurrentUser__';
 
 +         # replace __CurrentUserEmail__ with email address
 +       $val = $self->CurrentUser->EmailAddress if $val eq '__CurrentUserEmail__';
 +
 
      my $subkey = '';
      if ($key =~ /^(.+?)\.(.+)$/) {