diff options
author | bugreport%peshkin.net <> | 2004-08-11 22:53:43 +0200 |
---|---|---|
committer | bugreport%peshkin.net <> | 2004-08-11 22:53:43 +0200 |
commit | d306c2edbbc171d5345b3378bd76ed5b69984316 (patch) | |
tree | 9810bba5d11c730fd4412a962dfd263655793470 /Bugzilla/User.pm | |
parent | def7903801fcdbab2f227688375f38c5cb490f27 (diff) | |
download | bugzilla-d306c2edbbc171d5345b3378bd76ed5b69984316.tar.gz bugzilla-d306c2edbbc171d5345b3378bd76ed5b69984316.tar.xz |
Bug 241903: Add Environment Variable Authentication for apache auth and SSO
patch by erik
r=joel
a=justdave
Diffstat (limited to 'Bugzilla/User.pm')
-rw-r--r-- | Bugzilla/User.pm | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Bugzilla/User.pm b/Bugzilla/User.pm index a40450076..38453841b 100644 --- a/Bugzilla/User.pm +++ b/Bugzilla/User.pm @@ -79,6 +79,7 @@ sub _create { 'name' => '', 'login' => '', 'showmybugslink' => 0, + 'flags' => {}, }; bless ($self, $class); return $self unless $cond && $val; @@ -139,6 +140,19 @@ sub email { $_[0]->{login}; } sub name { $_[0]->{name}; } sub showmybugslink { $_[0]->{showmybugslink}; } +sub set_flags { + my $self = shift; + while (my $key = shift) { + $self->{'flags'}->{$key} = shift; + } +} + +sub get_flag { + my $self = shift; + my $key = shift; + return $self->{'flags'}->{$key}; +} + # Generate a string to identify the user by name + email if the user # has a name or by email only if she doesn't. sub identity { @@ -1109,6 +1123,21 @@ all MySQL supported, this will go away. Returns C<1> if the user can bless at least one group. Otherwise returns C<0>. +=item C<set_flags> +=item C<get_flag> + +User flags are template-accessible user status information, stored in the form +of a hash. For an example of use, when the current user is authenticated in +such a way that they are allowed to log out, the 'can_logout' flag is set to +true (1). The template then checks this flag before displaying the "Log Out" +link. + +C<set_flags> is called with any number of key,value pairs. Flags for each key +will be set to the specified value. + +C<get_flag> is called with a single key name, which returns the associated +value. + =back =head1 SEE ALSO |