Patch title: Release 94 bulk changes
Abstract:
File: /pliant/appli/file_browser.pli
Key:
    Removed line
    Added line
   
module "/pliant/protocol/http/server.pli"
module "/pliant/protocol/http/style/default.style"
module "/pliant/protocol/common/mime.pli"
module "/pliant/language/context.pli"
module "/pliant/language/compiler.pli"
module "/pliant/language/stream.pli"
module "/pliant/admin/file.pli"
module "/pliant/admin/execute.pli"
module "/pliant/util/encoding/http.pli"
module "/pliant/util/encoding/date.pli"
module "/pliant/protocol/http/webdav.pli"
if os_api="linux"
  module "/pliant/language/stream/pipe.pli"



module "/pliant/protocol/http/server.pli"
module "/pliant/protocol/http/style/default.style"
module "/pliant/protocol/common/mime.pli"
module "/pliant/language/context.pli"
module "/pliant/language/compiler.pli"
module "/pliant/language/stream.pli"
module "/pliant/admin/file.pli"
module "/pliant/admin/execute.pli"
module "/pliant/util/encoding/http.pli"
module "/pliant/util/encoding/date.pli"
module "/pliant/protocol/http/webdav.pli"
if os_api="linux"
  module "/pliant/language/stream/pipe.pli"



module "/pliant/appli/database.pli"
module "/pliant/storage/database.pli"

method page apply_uploaded_file src dest fileoptions0 -> sta
  arg_rw HtmlPage page ; arg Str src dest fileoptions0 ; arg
  var Str ext := dest (dest search "." dest:len) dest:len
  if ext=".pdb" and (data_file_switch src dest)=success
    return success
  if fullpliant and ext=".tgz" and file_os_name:dest=file_os
    file_delete "file:/boot/downgrade.tgz"  
    execute "pliant module /pliant/install/minimal.pli modul
    var Float remain := tar_timeout
    while remain>0 and (file_query "file:/boot/downgrade.tgz
      sleep 1
    if remain>0
      var Array:FileInfo files := file_list "file:/pliant/bi
      for (var Int i) 0 files:size-1
        if files:i:extension=".dump"
          file_delete files:i:name
      file_move src dest
      file_extract dest "file:/"
      file_delete dest
      page shutdown 120 "restart"
  eif fullpliant and ext=".tgz" and file_os_name:dest=file_o
    var Array:FileInfo files := file_list "file:/pliant/bina
    for (var Int i) 0 files:size-1
      if files:i:extension=".dump"
        file_delete files:i:name
    file_move src dest
    file_extract dest "file:/"
    file_delete dest
    page shutdown 120 "restart"

method page apply_uploaded_file src dest fileoptions0 -> sta
  arg_rw HtmlPage page ; arg Str src dest fileoptions0 ; arg
  var Str ext := dest (dest search "." dest:len) dest:len
  if ext=".pdb" and (data_file_switch src dest)=success
    return success
  if fullpliant and ext=".tgz" and file_os_name:dest=file_os
    file_delete "file:/boot/downgrade.tgz"  
    execute "pliant module /pliant/install/minimal.pli modul
    var Float remain := tar_timeout
    while remain>0 and (file_query "file:/boot/downgrade.tgz
      sleep 1
    if remain>0
      var Array:FileInfo files := file_list "file:/pliant/bi
      for (var Int i) 0 files:size-1
        if files:i:extension=".dump"
          file_delete files:i:name
      file_move src dest
      file_extract dest "file:/"
      file_delete dest
      page shutdown 120 "restart"
  eif fullpliant and ext=".tgz" and file_os_name:dest=file_o
    var Array:FileInfo files := file_list "file:/pliant/bina
    for (var Int i) 0 files:size-1
      if files:i:extension=".dump"
        file_delete files:i:name
    file_move src dest
    file_extract dest "file:/"
    file_delete dest
    page shutdown 120 "restart"
  eif fullpliant and os_api="linux" and ext=".tgz" and (file
  eif fullpliant and os_api="linux" and ext=".tgz" and (file_os_name:dest=file_os_name:"file:/boot/fullpliant.tgz" or file_os_name:dest=file_os_name:"file:/boot/kernel.tgz" or file_os_name:dest=file_os_name:"file:/boot/kernel_once.tgz")
    var Array:FileInfo files := file_list "file:/pliant/bina
    for (var Int i) 0 files:size-1
      if files:i:extension=".dump"
        file_delete files:i:name
    file_move src dest
    page shutdown 120 ""
    file_move "security:/" "file:/pliant_security.backup/"
    var Array:FileInfo files := file_list "file:/pliant/bina
    for (var Int i) 0 files:size-1
      if files:i:extension=".dump"
        file_delete files:i:name
    file_move src dest
    page shutdown 120 ""
    file_move "security:/" "file:/pliant_security.backup/"
    if file_os_name:dest=file_os_name:"file:/boot/kernel_once.tgz"
      file_move "file:/boot/kernel" "file:/boot/fullpliant"
    file_extract dest "file:/"
    file_extract dest "file:/"
    if file_os_name:dest=file_os_name:"file:/boot/kernel_once.tgz"
      file_move "file:/boot/kernel" "file:/boot/once"
      file_move "file:/boot/fullpliant" "file:/boot/kernel"
    file_tree_delete "security:/"
    file_move "file:/pliant_security.backup/" "security:/"
    pliant_load_module "/pliant/appli/file_browser/lilo.pli"
    file_tree_delete "security:/"
    file_move "file:/pliant_security.backup/" "security:/"
    pliant_load_module "/pliant/appli/file_browser/lilo.pli"
    if file_os_name:dest=file_os_name:"file:/boot/kernel.tgz
    if file_os_name:dest=file_os_name:"file:/boot/kernel.tgz" or file_os_name:dest=file_os_name:"file:/boot/kernel_once.tgz"
      file_tree_delete "file:/sbin/"
      file_tree_delete "file:/etc/"
      file_tree_delete "file:/usr/"
      file_tree_delete "file:/var/"
      file_delete "file:/boot/modules.tgz"
      file_tree_delete "file:/sbin/"
      file_tree_delete "file:/etc/"
      file_tree_delete "file:/usr/"
      file_tree_delete "file:/var/"
      file_delete "file:/boot/modules.tgz"
      file_move dest "file:/boot/modules.tgz"
      if file_os_name:dest=file_os_name:"file:/boot/kernel.tgz"
        file_move dest "file:/boot/modules.tgz"
      else
        file_delete dest
    else
      file_delete dest
    kernel_shutdown true
  var Str fileoptions := shunt fileoptions0<>"" fileoptions0
  status := file_move src dest
  if status=failure
    file_delete dest
    status := file_move src dest
  file_configure dest fileoptions



export '. apply_uploaded_file' '. file_browser'
    else
      file_delete dest
    kernel_shutdown true
  var Str fileoptions := shunt fileoptions0<>"" fileoptions0
  status := file_move src dest
  if status=failure
    file_delete dest
    status := file_move src dest
  file_configure dest fileoptions



export '. apply_uploaded_file' '. file_browser'