- my $identifier = shift;
- $self->LoadByCol("Name",$identifier);
-
-}
-# }}}
-
-# {{{ sub Load
-
-=head2 Load
-
-Loads a User into this CurrentUser object.
-Takes either an integer (users id column reference) or a Name
-The latter is deprecated. Instead, you should use LoadByName.
-Formerly, this routine also took email addresses.
-
-=cut
-
-sub Load {
- my $self = shift;
- my $identifier = shift;
-
- #if it's an int, load by id. otherwise, load by name.
- 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:
- $self->LoadByCol("Name",$identifier);
- }
-}
-
-# }}}
-
-# {{{ sub IsPassword
-
-=head2 IsPassword
-
-Takes a password as a string. Passes it off to IsPassword in this
-user's UserObj. If it is the user's password and the user isn't
-disabled, returns 1.
-
-Otherwise, returns undef.
-
-=cut
-
-sub IsPassword {
- my $self = shift;
- my $value = shift;
-
- return ($self->UserObj->IsPassword($value));
-}
-
-# }}}
-
-# {{{ sub Privileged
-
-=head2 Privileged
-
-Returns true if the current user can be granted rights and be
-a member of groups.
-
-=cut
-
-sub Privileged {
- my $self = shift;
- return ($self->UserObj->Privileged());