Skip Menu |

This queue is for tickets about the RTx-EmailCompletion CPAN distribution.

Report information
The Basics
Id: 43162
Status: resolved
Priority: 0/
Queue: RTx-EmailCompletion

People
Owner: Nobody in particular
Requestors: chris [...] improbable.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: LDAP-related code cleanup
If you're using RTx-EmailCompletion on a non-LDAP system you'll get a bunch of uninitialized variable errors from html/SelfService/Ajax/EmailCompletion. It seems like this should really get refactored into the main class so the HTML page doesn't have all of that setup logic inline: [Mon Feb 9 21:02:29 2009] [warning]: Use of uninitialized value $RT::EmailCompletionLdapServer in string eq at /usr/local/share/request-tracker3.8/plugins/RTx- EmailCompletion/html/SelfService/Ajax/EmailCompletion line 11. (/usr/local/share/request-tracker3.8/plugins/RTx- EmailCompletion/html/SelfService/Ajax/EmailCompletion:11) [Mon Feb 9 21:02:29 2009] [warning]: Use of uninitialized value $RT::LdapServer in string eq at /usr/local/share/request-tracker3.8/plugins/RTx- EmailCompletion/html/SelfService/Ajax/EmailCompletion line 11. (/usr/local/share/request-tracker3.8/plugins/RTx- EmailCompletion/html/SelfService/Ajax/EmailCompletion:11) [Mon Feb 9 21:02:30 2009] [warning]: Use of uninitialized value $RT::EmailCompletionLdapServer in string eq at /usr/local/share/request-tracker3.8/plugins/RTx- EmailCompletion/html/SelfService/Ajax/EmailCompletion line 11. (/usr/local/share/request-tracker3.8/plugins/RTx- EmailCompletion/html/SelfService/Ajax/EmailCompletion:11) [Mon Feb 9 21:02:30 2009] [warning]: Use of uninitialized value $RT::LdapServer in string eq at /usr/local/share/request-tracker3.8/plugins/RTx- EmailCompletion/html/SelfService/Ajax/EmailCompletion line 11. (/usr/local/share/request-tracker3.8/plugins/RTx- EmailCompletion/html/SelfService/Ajax/EmailCompletion:11) [Mon Feb 9 21:02:33 2009] [warning]: Use of uninitialized value $RT::EmailCompletionLdapServer in string eq at /usr/local/share/request-tracker3.8/plugins/RTx- EmailCompletion/html/SelfService/Ajax/EmailCompletion line 11. (/usr/local/share/request-tracker3.8/plugins/RTx- EmailCompletion/html/SelfService/Ajax/EmailCompletion:11) [Mon Feb 9 21:02:34 2009] [warning]: Use of uninitialized value $RT::LdapServer in string eq at /usr/local/share/request-tracker3.8/plugins/RTx- EmailCompletion/html/SelfService/Ajax/EmailCompletion line 11. (/usr/local/share/request-tracker3.8/plugins/RTx- EmailCompletion/html/SelfService/Ajax/EmailCompletion:11)
From: chris [...] improbable.org
On Mon Feb 09 17:36:00 2009, chris@improbable.org wrote: Show quoted text
> If you're using RTx-EmailCompletion on a non-LDAP system you'll get a > bunch of uninitialized variable errors from > html/SelfService/Ajax/EmailCompletion. It seems like this > should really get refactored into the main class so the HTML page > doesn't have all of that setup logic inline:
An initial patch looks like this: --- html/SelfService/Ajax/EmailCompletion 2007-11-12 16:30:01.000000000 -0500 +++ /usr/local/share/request-tracker3.8/plugins/RTx-EmailCompletion/html/SelfService/Ajax/EmailCompletion 2009-02-25 17:01:34.000000000 -0500 @@ -6,18 +6,23 @@ $RT::EmailCompletionSearchFields ||= [qw(EmailAddress)]; $RT::EmailCompletionSearch ||= 'LIKE'; -$RT::EmailCompletionLdapServer ||= $RT::LdapServer; +if (defined($RT::LdapServer)) { + unless (defined($RT::EmailCompletionLdapServer)) { + $RT::EmailCompletionLdapServer = $RT::LdapServer; + } + + if ($RT::EmailCompletionLdapServer eq $RT::LdapServer) { + $RT::EmailCompletionLdapUser = $RT::LdapUser unless defined($RT::EmailCompletionLdapUser); + $RT::EmailCompletionLdapPass = $RT::LdapPass unless defined($RT::EmailCompletionLdapPass); + } -if ($RT::EmailCompletionLdapServer eq $RT::LdapServer) { - $RT::EmailCompletionLdapUser ||= $RT::LdapUser; - $RT::EmailCompletionLdapPass ||= $RT::LdapPass; + + $RT::EmailCompletionLdapBase ||= $RT::LdapBase; + $RT::EmailCompletionLdapFilter ||= $RT::LdapFilter; } -$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 @@ -27,8 +32,7 @@ my $CurrentUser = $session{CurrentUser}; # by default SelfService users aren't allowed to use EmailCompletion -$m->abort - unless $CurrentUser->Privileged() or $RT::EmailCompletionUnprivileged; +$m->abort unless ($CurrentUser->Privileged() or $RT::EmailCompletionUnprivileged); my $Email;
done in 0.06