add the small FS::CurrentUser::BootstrapUser class for... surprise... bootstrapping
authorivan <ivan>
Fri, 14 Jul 2006 01:42:42 +0000 (01:42 +0000)
committerivan <ivan>
Fri, 14 Jul 2006 01:42:42 +0000 (01:42 +0000)
FS/FS/CurrentUser.pm
FS/FS/UID.pm

index 37ed359..a2dfd71 100644 (file)
@@ -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;
 
index 1f51ca6..0d32002 100644 (file)
@@ -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;