bugzilla-4intranet/Bugzilla/CustisLocalBugzillas.pm

37 lines
1.0 KiB
Perl
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#!/usr/bin/perl
# äÌÑ ÐÅÒÅÎÁÐÒÁ×ÌÅÎÉÑ × Ó×ÏÀ ÂÁÇÚÉÌÌÕ
package Bugzilla::CustisLocalBugzillas;
use strict;
our %localizer = (
'[^\@]+\@custis\.ru' => "http://bugs.office.custis.ru/bugs/",
'[^\@]+\@(sportmaster\.ru|ilion\.ru|sportmaster\.com\.ua|scn\.ru|mbr\.ru|ilion\.ru|vek\.ru|bis\.overta\.ru)' => "http://penguin.office.custis.ru/bugzilla/",
'[^\@]+\@(sobin\.ru)' => "http://sobin.office.custis.ru/sbbugs/",
'[^\@]+\@(yandex\.ru)' => "http://wws-fomin.office.custis.ru/bugzilla/",
'[^\@]+\@(hrendel\.ru)' => "http://ws-fomin.office.custis.ru/bugzilla/",
);
sub CorrectLinksToLocalBugzilla
{
my ($userlogin, $msg) = (@_);
foreach my $regemail1 (keys %localizer)
{
if ($userlogin =~ /$regemail1/s)
{
foreach my $regemail2 (keys %localizer)
{
if ($userlogin !~ /$regemail2/s)
{
$msg =~ s/\Q$localizer{$regemail2}\E/$localizer{$regemail1}/gs;
}
}
}
}
return $msg;
}
1;
__END__