Requesttracker - autoadd usernames from ldap: Difference between revisions

From Skytech
Jump to navigation Jump to search
(Created page with "Category:Linux = Autoadd LDAP usernames from autocreated tickets = Find this file: <pre> /usr/share/request-tracker4/lib/RT/Interface/Email.pm </pre> Before the <code> my (…")
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 7: Line 7:
</pre>
</pre>


Before the
Before the <code> my ( $Val, $Message ) = $NewUser->Create( </code>
<pre>
my ( $Val, $Message ) = $NewUser->Create(
[ ... ]
</pre>
add something like (you of course need to decide/alter the if statement regarding domainname):
add something like (you of course need to decide/alter the if statement regarding domainname):


Line 14: Line 18:
if ($Address =~ /\@<domain>/i)
if ($Address =~ /\@<domain>/i)
{
{
$RT::Logger->debug("unity3d :: Updating old user [ $Address ] to .. ");
$RT::Logger->debug("DEBUG :: Updating old user [ $Address ] to .. ");
($Username) = $Address =~ m/(.*)@/;
($Username) = $Address =~ m/(.*)@/;
$RT::Logger->debug("[ $Username ] \n");
$RT::Logger->debug("[ $Username ] \n");

Latest revision as of 11:32, 3 February 2012


Autoadd LDAP usernames from autocreated tickets

Find this file:

/usr/share/request-tracker4/lib/RT/Interface/Email.pm

Before the

 
my ( $Val, $Message ) = $NewUser->Create( 
[ ... ]

add something like (you of course need to decide/alter the if statement regarding domainname):

## Hack to get correct LDAP usernames into DB (only on emails ending with @<domain>)
if ($Address =~ /\@<domain>/i)
{
    $RT::Logger->debug("DEBUG :: Updating old user [ $Address ] to .. ");
    ($Username) = $Address =~ m/(.*)@/;
    $RT::Logger->debug("[ $Username ] \n");
}
## End hack