home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2000 January / PCW0001.ISO / software / sw / outils / rebol031.exe / rebol.r < prev    next >
Encoding:
Text File  |  1999-09-03  |  3.9 KB  |  150 lines

  1. REBOL[
  2.     Title:   "REBOL Extended Definitions"
  3.     Date:    cvs-date "$Date: 1999/09/03 17:55:08 $"
  4.     ;Version: "$Revision: 1.3 $"
  5.     Rights: "Copyright (C) REBOL Technologies 1997-1999"
  6. ]
  7.  
  8. set-user: func [
  9.     "Create a default user.r preferences file."
  10.     /local ask-it questions
  11. ][
  12.     system/user/email:
  13.     system/schemes/default/host:
  14.     system/schemes/default/proxy/host:
  15.     system/schemes/default/proxy/port-id:
  16.     system/schemes/default/proxy/type: none
  17.  
  18.     ;-- Use Query Dialect:
  19.     questions: [
  20.         {
  21.         Some network functions, such as sending email or
  22.         using anonymous FTP, require you to provide an email
  23.         address.  (Or, you just press ENTER to skip it.)
  24.         
  25.         Email address?} [
  26.             either empty? answer [questions: skip questions 2][
  27.                 system/user/email: to-email answer]
  28.         ]
  29.         {
  30.         To send email you also need to provide the name of
  31.         your email server (such as mail.domain.com). If you
  32.         don't know it, check the configuration of your email
  33.         program or ask your network administrator.
  34.         
  35.         Email server name?} [system/schemes/default/host: answer]
  36.         {
  37.         REBOL can connect directly to the Internet or through
  38.         a firewall via a proxy server.  If it's a direct
  39.         connection, just press ENTER.  To set the proxy
  40.         settings, you will need the proxy server's host name,
  41.         TCP/IP port number, and proxy type.  Ask your network
  42.         administrator if necessary.
  43.  
  44.         Do you require a proxy server?}
  45.         {
  46.         What is the host name of your proxy server? }
  47.             [system/schemes/default/proxy/host: answer]
  48.         {
  49.         What is the TCP/IP port number used to connect to
  50.         your proxy server?} 
  51.             [system/schemes/default/proxy/port-id: to-integer answer]
  52.         {
  53.         Type the number of the proxy type you are using:
  54.             1 - SOCKS version 5
  55.             2 - SOCKS version 4
  56.             3 - GENERIC (CERN)
  57.  
  58.         Which number?} [
  59.             if none? system/schemes/default/proxy/type:
  60.                 pick [socks socks4 generic] to-integer answer
  61.                     [barf-here]
  62.         ]
  63.         {
  64.         Would you like to verify your network settings by
  65.         sending a test email message to REBOL.com? If it
  66.         fails with an error, your settings are not correct
  67.         or your system is not connected to the Internet.
  68.  
  69.         Send a test message?} [
  70.             either find/match answer "y" [
  71.                 print "Sending message now..."
  72.                 send luke@rebol.com "Testing!"
  73.                 print "Message was sent."
  74.             ][
  75.                 print "Okay. You can try email out later."
  76.             ]
  77.         ]
  78.     ]
  79.  
  80.     ask-it: [answer: ask append insert trim questions/1 newline " "]
  81.     until [
  82.         do ask-it
  83.         tail? either block? questions/2 [
  84.             while [error? try questions/2] ask-it
  85.             questions: skip questions 2
  86.         ][
  87.             questions: either find/match answer "y" [next questions][
  88.                 tail questions]
  89.         ]
  90.     ]
  91.     
  92.     if any [
  93.         not exists? %user.r 
  94.         confirm "^/Overwrite the current user.r file? "
  95.     ][
  96.         print "^/Creating user.r file in current directory.^/"
  97.         write %user.r trim reform [{
  98.             REBOL [
  99.                 Title: "User Preferences"
  100.                 Date: } now {
  101.             ]
  102.  
  103.             set-net [}
  104.                 system/user/email
  105.                 system/schemes/default/host
  106.                 none
  107.                 system/schemes/default/proxy/host
  108.                 system/schemes/default/proxy/port-id
  109.                 system/schemes/default/proxy/type
  110.             {]
  111.             }
  112.         ]
  113.         print trim {
  114.             To change these settings, type "set-user" at the
  115.             prompt or edit your user.r file.
  116.         }
  117.     ]
  118.     exit
  119. ]
  120.  
  121. if not any [
  122.     exists? %user.r
  123.     exists? join system/options/home %user.r
  124.     system/options/quiet
  125. ][
  126.     print ""
  127.     print trim {
  128.         PLEASE NOTE:
  129.         Your user preferences file (user.r) was not found.
  130.         For your network functions to work properly, you
  131.         need to provide network setup information.
  132.     }
  133.     if confirm "Would you like to setup networking now? " [
  134.         set-user
  135.         print "REBOL is now ready for network operation."
  136.     ]
  137. ]
  138.  
  139. feedback: func ["Provide feedback to REBOL Technologies" /local file] [
  140.     file: %feedback.r
  141.     any [
  142.         if exists? file [do file true]
  143.         if exists? system/options/home/:file [do system/options/home/:file true]
  144.         print "Feedback.r script was not found."
  145.     ]
  146.     exit
  147. ]
  148.  
  149.  
  150.