Patch title: Release 89 bulk changes
Abstract:
File: /fullpliant/logical.page
Key:
    Removed line
    Added line
   
module "/pliant/language/unsafe.pli"
module "/pliant/language/context.pli"
module "/pliant/language/stream.pli"
module "this_computer.pli"
module "/pliant/protocol/dns/name.pli"
module "/pliant/protocol/http/site.pli"
module "/pliant/fullpliant/user.pli"
module "/pliant/admin/file.pli"
module "/pliant/linux/kernel/device.pli"
module "/pliant/util/crypto/rsa.pli"
module "/pliant/util/remote/common.pli"
module "/pliant/appli/database/light.pli"
module "logical.pli"


        header "Files"
          if (file_query lc_root:name standard)=undefined
            [The files tree does not exist yet.] ; eol
          table columns 2 border 0
            for (var Int lap) 0 3
              cell
                page button (shunt lap=0 "Install files tree
                  var Str path := lc_root name
                  part create_directories
                    file_tree_create path+"pliant_security/"
                    file_tree_create path+"pliant_data/"
                    file_tree_create path+"tmp/"
                  if lap=0 or lap=2
                    part copy_pliant
                      file_tree_copy "/pliant/" path+"pliant
                      file_copy "/index.page" path+"pliant/i
                      var Array:FileInfo files := file_list 
                      for (var Int i) 0 files:size-1
                        if files:i:extension<>".dump"
                          file_copy "/binary/"+files:i:name 
                  if lap=0 or lap=1
                    part copy_bin
                      file_tree_create path+"bin/"
                      file_link "file:/pliant/binary/pliant-
                      file_link "file:/pliant/binary/pliant-
                      file_copy "file:/bin/tar" path+"bin/ta
                      # tar extra executables
                      file_copy "file:/bin/gzip" path+"bin/g
                      if lc_user:name=0
                        file_copy "file:/bin/insmod" path+"b
                        file_copy "file:/bin/rmmod" path+"bi
                    part copy_lib
                      file_tree_create path+"lib/"
                      file_copy "file:/lib/libc.so.6" path+"
                      file_copy "file:/lib/libdl.so.2" path+
                      file_copy "file:/lib/ld-linux.so.2" pa
                      file_copy "file:/lib/libm.so.6" path+"
                      file_copy "file:/usr/lib/libz.so.1" pa
                      file_copy "file:/lib/libz.so.1" path+"
                      file_copy "file:/usr/lib/libjpeg.so" p
                      file_copy "file:/lib/libjpeg.so" path+
                      # tar extra DLLs
                      file_copy "file:/lib/libpthread.so.0" 
                      file_copy "file:/lib/librt.so.1" path+
                    part create_dev
                      file_tree_create path+"dev/"
                      kernel_make_device path+"dev/null"
                      kernel_make_device path+"dev/random"
                  if lap=0 or lap=3
                    part this_computer_database
                      if not (name parse any:(var Str v_name
                        v_name := name ; v_domain := ""
                      data_write path+"pliant_security/this_
                      data_write path+"pliant_security/this_
                      data_write path+"pliant_security/this_
                      data_write path+"pliant_security/this_
                      data_write path+"pliant_security/this_
                      data_write path+"pliant_security/this_
                      data_write path+"pliant_security/this_
                      data_write path+"pliant_security/this_
                      data_write path+"pliant_security/this_
                      data_write path+"pliant_security/this_
                      data_write path+"pliant_security/this_
                      data_write path+"pliant_security/this_
                  if lap=0
                    part users_database
                      var (Link Database:UserDatabase) logic
                      logical_users load path+"pliant_securi
                      each u user_database:data:user
                        var CBool admin := false
                        each r u:right
                          if r:right="administrator"
                            admin := true
                        if admin or keyof:u="anonymous"
                          logical_users:data:user create key
                          data_copy u (logical_users:data:us
                      logical_users store
                    part site_database
                      name_database store
                      file_copy "security:/name.pdb" path+"p
                      var (Link Database:NameSecretDatabase)
                      nsdb load path+"pliant_security/name_s
                      nsdb:data:host create name
                      data_copy name_secret_database:data:ho
                      nsdb store
                      var (Link Database:SiteDatabase) sdb :
                      sdb load path+"pliant_security/site.pd
                      var (Link Database:SiteSecretDatabase)
                      ssdb load path+"pliant_security/site_s
                      each a_site site
                        if a_site:computer=name
                          sdb:data:site create keyof:a_site
                          data_copy site_database:data:site:
                          ssdb:data:site create keyof:a_site
                          data_copy site_secret_database:dat
                      sdb store
                      ssdb store
                  if lap=0
                    part set_rights
                      file_tree_rights path lc_user:name lc_
                      file_rights "file:/tmp/" undefined und
                  reload_page
              cell
                if lap=0
                  [Copy all files from the physical to the l
                eif lap=1
                  [Copy only /bin /lib and others OS related
                eif lap=2
                  [Copy only Pliant tree.]
                eif lap=3
                  [Overwrite only this_computer.pdb]
            cell
              button "Adjust files owner" noeol
                file_tree_rights lc_root:name lc_user:name l
                reload_page
            cell
              [Logical computers usually run as normal user,
            cell
              button "Delete .dump files" noeol
                var Str path := lc_root name
                var Array:FileInfo files := file_list path+"
                for (var Int i) 0 files:size-1
                  if files:i:extension=".dump"
                    file_delete files:i:name
                reload_page
            cell
              [Drop .dump file so that Pliant will recompile
            cell
              button "Delete all files"
                var Str path := lc_root name
                [You are going to remove all files in ]
                fixed
                  text path
                eol
                [Are you sure that you really want to do tha
                button "yes" noeol
                  file_tree_delete path
                  file_delete "file:/logical/"
                  goto_backward
                button "no"
                  goto_backward
            cell
              [Delete absoluely all logical computer files.]
  cell (italic text:computer_fullname)
  cell
    text (string memory_current_consumed\2^20)+" / "+(string
    total_used += memory_current_consumed
    total_assigned += memory_assigned
  cell void
  cell void
  cell void
  cell italic:[total]
  cell
    text (string total_used\2^20)+" / "+(string total_assign
  cell void
  cell void
  cell void
input "Logical computer name: " (var Str lid) noeol
page button "Create" noeol
  var Int p := 90
  part check_port
    each h name_database:data:host
module "/pliant/language/unsafe.pli"
module "/pliant/language/context.pli"
module "/pliant/language/stream.pli"
module "this_computer.pli"
module "/pliant/protocol/dns/name.pli"
module "/pliant/protocol/http/site.pli"
module "/pliant/fullpliant/user.pli"
module "/pliant/admin/file.pli"
module "/pliant/linux/kernel/device.pli"
module "/pliant/util/crypto/rsa.pli"
module "/pliant/util/remote/common.pli"
module "/pliant/appli/database/light.pli"
module "logical.pli"


        header "Files"
          if (file_query lc_root:name standard)=undefined
            [The files tree does not exist yet.] ; eol
          table columns 2 border 0
            for (var Int lap) 0 3
              cell
                page button (shunt lap=0 "Install files tree
                  var Str path := lc_root name
                  part create_directories
                    file_tree_create path+"pliant_security/"
                    file_tree_create path+"pliant_data/"
                    file_tree_create path+"tmp/"
                  if lap=0 or lap=2
                    part copy_pliant
                      file_tree_copy "/pliant/" path+"pliant
                      file_copy "/index.page" path+"pliant/i
                      var Array:FileInfo files := file_list 
                      for (var Int i) 0 files:size-1
                        if files:i:extension<>".dump"
                          file_copy "/binary/"+files:i:name 
                  if lap=0 or lap=1
                    part copy_bin
                      file_tree_create path+"bin/"
                      file_link "file:/pliant/binary/pliant-
                      file_link "file:/pliant/binary/pliant-
                      file_copy "file:/bin/tar" path+"bin/ta
                      # tar extra executables
                      file_copy "file:/bin/gzip" path+"bin/g
                      if lc_user:name=0
                        file_copy "file:/bin/insmod" path+"b
                        file_copy "file:/bin/rmmod" path+"bi
                    part copy_lib
                      file_tree_create path+"lib/"
                      file_copy "file:/lib/libc.so.6" path+"
                      file_copy "file:/lib/libdl.so.2" path+
                      file_copy "file:/lib/ld-linux.so.2" pa
                      file_copy "file:/lib/libm.so.6" path+"
                      file_copy "file:/usr/lib/libz.so.1" pa
                      file_copy "file:/lib/libz.so.1" path+"
                      file_copy "file:/usr/lib/libjpeg.so" p
                      file_copy "file:/lib/libjpeg.so" path+
                      # tar extra DLLs
                      file_copy "file:/lib/libpthread.so.0" 
                      file_copy "file:/lib/librt.so.1" path+
                    part create_dev
                      file_tree_create path+"dev/"
                      kernel_make_device path+"dev/null"
                      kernel_make_device path+"dev/random"
                  if lap=0 or lap=3
                    part this_computer_database
                      if not (name parse any:(var Str v_name
                        v_name := name ; v_domain := ""
                      data_write path+"pliant_security/this_
                      data_write path+"pliant_security/this_
                      data_write path+"pliant_security/this_
                      data_write path+"pliant_security/this_
                      data_write path+"pliant_security/this_
                      data_write path+"pliant_security/this_
                      data_write path+"pliant_security/this_
                      data_write path+"pliant_security/this_
                      data_write path+"pliant_security/this_
                      data_write path+"pliant_security/this_
                      data_write path+"pliant_security/this_
                      data_write path+"pliant_security/this_
                  if lap=0
                    part users_database
                      var (Link Database:UserDatabase) logic
                      logical_users load path+"pliant_securi
                      each u user_database:data:user
                        var CBool admin := false
                        each r u:right
                          if r:right="administrator"
                            admin := true
                        if admin or keyof:u="anonymous"
                          logical_users:data:user create key
                          data_copy u (logical_users:data:us
                      logical_users store
                    part site_database
                      name_database store
                      file_copy "security:/name.pdb" path+"p
                      var (Link Database:NameSecretDatabase)
                      nsdb load path+"pliant_security/name_s
                      nsdb:data:host create name
                      data_copy name_secret_database:data:ho
                      nsdb store
                      var (Link Database:SiteDatabase) sdb :
                      sdb load path+"pliant_security/site.pd
                      var (Link Database:SiteSecretDatabase)
                      ssdb load path+"pliant_security/site_s
                      each a_site site
                        if a_site:computer=name
                          sdb:data:site create keyof:a_site
                          data_copy site_database:data:site:
                          ssdb:data:site create keyof:a_site
                          data_copy site_secret_database:dat
                      sdb store
                      ssdb store
                  if lap=0
                    part set_rights
                      file_tree_rights path lc_user:name lc_
                      file_rights "file:/tmp/" undefined und
                  reload_page
              cell
                if lap=0
                  [Copy all files from the physical to the l
                eif lap=1
                  [Copy only /bin /lib and others OS related
                eif lap=2
                  [Copy only Pliant tree.]
                eif lap=3
                  [Overwrite only this_computer.pdb]
            cell
              button "Adjust files owner" noeol
                file_tree_rights lc_root:name lc_user:name l
                reload_page
            cell
              [Logical computers usually run as normal user,
            cell
              button "Delete .dump files" noeol
                var Str path := lc_root name
                var Array:FileInfo files := file_list path+"
                for (var Int i) 0 files:size-1
                  if files:i:extension=".dump"
                    file_delete files:i:name
                reload_page
            cell
              [Drop .dump file so that Pliant will recompile
            cell
              button "Delete all files"
                var Str path := lc_root name
                [You are going to remove all files in ]
                fixed
                  text path
                eol
                [Are you sure that you really want to do tha
                button "yes" noeol
                  file_tree_delete path
                  file_delete "file:/logical/"
                  goto_backward
                button "no"
                  goto_backward
            cell
              [Delete absoluely all logical computer files.]
  cell (italic text:computer_fullname)
  cell
    text (string memory_current_consumed\2^20)+" / "+(string
    total_used += memory_current_consumed
    total_assigned += memory_assigned
  cell void
  cell void
  cell void
  cell italic:[total]
  cell
    text (string total_used\2^20)+" / "+(string total_assign
  cell void
  cell void
  cell void
input "Logical computer name: " (var Str lid) noeol
page button "Create" noeol
  var Int p := 90
  part check_port
    each h name_database:data:host
      if h:physical=computer_fullname and h:http_port=p
      if h:physical=computer_fullname and h:http_port=p or p=110 # 110 is POP3
        p += 10
        restart check_port
  name_database:data:host create lid
  name_database:data:host:lid physical := computer_fullname
  name_database:data:host:lid http_port := p
  name_database:data:host:lid remote_port := remote_tcp_port
  this_computer "logical" lid "automatic" := "false"
  this_computer "logical" lid "cooped" := "true"
  this_computer "logical" lid "remote" := "true"
  this_computer "logical" lid "memory" := string memory_assi
  reload_page
button "Delete"
  this_computer:env:"logical" delete lid
  name_database:data:host delete lid
  reload_page
        p += 10
        restart check_port
  name_database:data:host create lid
  name_database:data:host:lid physical := computer_fullname
  name_database:data:host:lid http_port := p
  name_database:data:host:lid remote_port := remote_tcp_port
  this_computer "logical" lid "automatic" := "false"
  this_computer "logical" lid "cooped" := "true"
  this_computer "logical" lid "remote" := "true"
  this_computer "logical" lid "memory" := string memory_assi
  reload_page
button "Delete"
  this_computer:env:"logical" delete lid
  name_database:data:host delete lid
  reload_page