From: ivan Date: Fri, 14 Jul 2006 01:42:42 +0000 (+0000) Subject: add the small FS::CurrentUser::BootstrapUser class for... surprise... bootstrapping X-Git-Tag: BEFORE_FINAL_MASONIZE~80 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=22beb7aa1be0c71984c87fed7982299c315ce254 add the small FS::CurrentUser::BootstrapUser class for... surprise... bootstrapping --- diff --git a/FS/FS/CurrentUser.pm b/FS/FS/CurrentUser.pm index 37ed3592a..a2dfd714c 100644 --- a/FS/FS/CurrentUser.pm +++ b/FS/FS/CurrentUser.pm @@ -21,7 +21,9 @@ FS::CurrentUser - Package representing the current user sub load_user { my( $class, $user ) = @_; #, $pass - return "" if $upgrade_hack; + if ( $upgrade_hack ) { + return new FS::CurrentUser::BootstrapUser; + } #return "" if $user =~ /^fs_(queue|selfservice)$/; @@ -49,5 +51,16 @@ Creepy crawlies =cut +package FS::CurrentUser::BootstrapUser; + +sub new { + my $proto = shift; + my $class = ref($proto) || $proto; + my $self = {}; + bless ($self, $class); +} + +sub AUTOLOAD { 1 }; + 1; diff --git a/FS/FS/UID.pm b/FS/FS/UID.pm index 1f51ca69c..0d32002b2 100644 --- a/FS/FS/UID.pm +++ b/FS/FS/UID.pm @@ -74,7 +74,7 @@ sub forksuidsetup { $user = shift; if ( $FS::CurrentUser::upgrade_hack ) { - $user = ''; + $user = 'fs_bootstrap'; } else { croak "fatal: adminsuidsetup called without arguements" unless $user;