<%ARGS> <%INIT> $RT::EmailCompletionNonPrivileged ||= ''; $RT::EmailCompletionSearchFields ||= [qw(EmailAddress)]; $RT::EmailCompletionSearch ||= 'LIKE'; $RT::EmailCompletionLdapServer ||= $RT::LdapServer; if ($RT::EmailCompletionLdapServer eq $RT::LdapServer) { $RT::EmailCompletionLdapUser ||= $RT::LdapUser; $RT::EmailCompletionLdapPass ||= $RT::LdapPass; } $RT::EmailCompletionLdapBase ||= $RT::LdapBase; $RT::EmailCompletionLdapFilter ||= $RT::LdapFilter; $RT::EmailCompletionLdapAttrShow ||= "mail"; $RT::EmailCompletionLdapAttrSearch ||= [qw/mail/]; $RT::EmailCompletionLdapMinLength ||= 4; # for the moment we can only show one attribute # but later perhaps we could add some other fields (address, ...) $RT::EmailCompletionLdapAttrShow = $RT::EmailCompletionLdapAttrShow->[0] if ref($RT::EmailCompletionLdapAttrShow) eq "ARRAY"; my $CurrentUser = $session{CurrentUser}; # by default SelfService users aren't allowed to use EmailCompletion $m->abort unless $CurrentUser->Privileged() or $RT::EmailCompletionUnprivileged; my $Email; # whatever the argument, we want to find by email for (keys %ARGS) { $Email = $ARGS{$_}, last if defined $ARGS{$_}; } my ($emails, $ldaps) = RTx::EmailCompletion::search($Email, $CurrentUser); my $users = qq{'; $m->out($users); $m->abort; <%ONCE> use RTx::EmailCompletion;