1 package FS::CurrentUser;
3 use vars qw($CurrentUser $upgrade_hack);
5 #not at compile-time, circular dependancey causes trouble
6 #use FS::Record qw(qsearchs);
13 FS::CurrentUser - Package representing the current user
22 my( $class, $user ) = @_; #, $pass
24 if ( $upgrade_hack ) {
25 return $CurrentUser = new FS::CurrentUser::BootstrapUser;
28 #return "" if $user =~ /^fs_(queue|selfservice)$/;
30 #not the best thing in the world...
31 eval "use FS::Record qw(qsearchs);";
33 eval "use FS::access_user;";
36 $CurrentUser = qsearchs('access_user', {
42 die "unknown user: $user" unless $CurrentUser; # or bad password
55 package FS::CurrentUser::BootstrapUser;
59 my $class = ref($proto) || $proto;
61 bless ($self, $class);