[rt-devel] file in extension lib path isnt' parsed

Christian Loos cloos at netcologne.de
Wed Aug 29 01:59:37 EDT 2012


Am 28.08.2012 18:23, schrieb Thomas Sibley:
> How are you determining that it's not parsed?  (You haven't sent the
> User_Vendor.pm to the list, so we can't know.)

Here is my User_Vendor.pm:

package RT::User;

use strict;
no warnings qw(redefine);

# TODO: why this only works in /opt/rt4/local/lib/RT/ and not here
sub _VendorAccessible {
    {
        WorkPhone   => { public => 1 },
        MobilePhone => { public => 1 },
        Comments    => { public => 1 },
    }
}

sub ValidatePassword {
    my $self = shift;
    my $password = shift;

    if ( length($password) < RT->Config->Get('MinimumPasswordLength') ) {
        return ( 0, $self->loc("Password needs to be at least [_1]
characters long", RT->Config->Get('MinimumPasswordLength')) );
    }

    # NOTE: stricter password check
    if ( $password !~ /^.*(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9]).*$/ ) {
        return ( 0, $self->loc("Password must contain lower case
letters, capital letters and numbers") );
    }

    return 1;
}

1;


The _VendorAccessible part was necessary because I set this in
RT_SiteConfig.pm:
Set($MoreAboutRequestorExtraInfo,"WorkPhone, MobilePhone");

The password check don't work and privileged user don't see WorkPhone
and MobilePhone if the file is in
/opt/rt4/local/plugins/RT-Extension-NetCologne/lib/RT/
but both things work if the file is in
/opt/rt4/local/lib/RT/

Chris


More information about the rt-devel mailing list