
use File::Path;

sub PreCreateForm()
{
   if($oSessionGL->getState('IsAnonymous'))
   {
      &Redirect(&GetAttr("SessionId"), "WWWdb:Index");
   }
   elsif($oSessionGL->getState('ActualLogin'))
   {
      my $cCacheDir =  sprintf ('%s/tmp/cache/%s/%s',
                                $ENV{"WWWDB_BASE_PATH"},
                                &GetAttr("DbDriver"),
                                &GetAttr("SessionId"));
      rmtree($cCacheDir);

      # delete all cach-files from this user
      #&CGI::Cache::SetRoot($cCacheDir);
      #&CGI::Cache::ExpireLRU(1);
      #$iCacheTimeoutMGL = 0;

      # dump out the cache-file, when the timeout is set
      &CGI::Cache::Stop(0);

      $oSessionGL->setState('ActualLogin', undef);

      &Redirect("0000000000000000", "WWWdb:Index");
   }

}

1;
