* Add enclair_db option to UserDB.pm. Allows logging of enclair password
[interchange.git] / code / UserTag / var.tag
1 # Copyright 2002-2007 Interchange Development Group and others
2
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version.  See the LICENSE file for details.
7
8 # $Id: var.tag,v 1.12 2007-03-30 23:40:57 pajamian Exp $
9
10 UserTag var Order         name global filter
11 UserTag var Interpolate   1
12 UserTag var Version       $Revision: 1.12 $
13 UserTag var Routine       <<EOR
14 sub {
15         my ($key, $global, $filter) = @_;
16         my $value;
17         if ($global and $global != 2) {
18                 $value = $Global::Variable->{$key};
19         }
20         elsif ($Vend::Session->{logged_in} and defined $Vend::Cfg->{Member}{$key}) {
21                 $value = $Vend::Cfg->{Member}{$key};
22         }
23         else {
24                 $value = (
25                         $::Pragma->{dynamic_variables}
26                         ? Vend::Interpolate::dynamic_var($key)
27                         : $::Variable->{$key}
28                 );
29                 $value ||= $Global::Variable->{$key} if $global;
30         }
31         $value = filter_value($filter, $value, $key) if $filter;
32         return $value;
33 }
34 EOR