$self->Load($Name);
}
- # $self->CurrentUser($self);
+ $self->CurrentUser($self);
}
# }}}
sub UserObj {
my $self = shift;
+ unless ($self->{'UserObj'}) {
use RT::User;
- my $user = RT::User->new($self);
-
- unless ($user->Load($self->Id)) {
+ $self->{'UserObj'} = RT::User->new($self);
+ unless ($self->{'UserObj'}->Load($self->Id)) {
$RT::Logger->err($self->loc("Couldn't load [_1] from the users database.\n", $self->Id));
}
- return ($user);
+
+ }
+ return ($self->{'UserObj'});
}
# }}}
Gecos => 'read',
RealName => 'read',
Password => 'neither',
- Lang => 'read',
EmailAddress => 'read',
Privileged => 'read',
IsAdministrator => 'read'
if ($identifier !~ /\D/) {
$self->SUPER::LoadById($identifier);
}
-
- elsif (UNIVERSAL::isa($identifier,"RT::User")) {
- # DWIM if they pass a user in
- $self->SUPER::LoadById($identifier->Id);
- }
else {
# This is a bit dangerous, we might get false authen if somebody
# uses ambigous userids or real names:
sub LanguageHandle {
my $self = shift;
- if ( ( !defined $self->{'LangHandle'} )
- || ( !UNIVERSAL::can( $self->{'LangHandle'}, 'maketext' ) )
- || (@_) ) {
- if ( (!$RT::SystemUser || $self->id == $RT::SystemUser->id() )) {
- @_ = qw(en-US);
- }
-
- elsif ( $self->Lang ) {
- push @_, $self->Lang;
- }
+ if ((!defined $self->{'LangHandle'}) ||
+ (!UNIVERSAL::can($self->{'LangHandle'}, 'maketext')) ||
+ (@_)) {
$self->{'LangHandle'} = RT::I18N->get_handle(@_);
}
-
# Fall back to english.
- unless ( $self->{'LangHandle'} ) {
+ unless ($self->{'LangHandle'}) {
die "We couldn't get a dictionary. Nye mogu naidti slovar. No puedo encontrar dictionario.";
}
- return ( $self->{'LangHandle'} );
+ return ($self->{'LangHandle'});
}
sub loc {
}
# }}}
-
-=head2 CurrentUser
-
-Return the current currentuser object
-
-=cut
-
-sub CurrentUser {
- my $self = shift;
- return($self);
-
-}
-
eval "require RT::CurrentUser_Vendor";
die $@ if ($@ && $@ !~ qr{^Can't locate RT/CurrentUser_Vendor.pm});
eval "require RT::CurrentUser_Local";