home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / www / amitrix / awebftp.lha / AWebFTPConfig.awebrx < prev    next >
Text File  |  1996-07-07  |  2KB  |  73 lines

  1. /*
  2.   Configuration for AWebFTP AREXX plugin for AWeb-II
  3.    by Gabiele Favrin (gfavrin@mbox.vol.it)
  4.   Version 1.0 - 30/06/1996 by AmiTrix Development (support@amitrix.com)
  5. */
  6.  
  7. /* Main Script */
  8. fname = 'T:config.html'
  9. save_dir = 'ram:'
  10. AmiFTPexe = ''
  11.  
  12. options results
  13. if ~show('L','rexxsupport.library') then 
  14.   if ~addlib('rexxsupport.library',0,-30,0) then 
  15.     exit(20)
  16.  
  17. parse arg arguements
  18. parse source prog_type result_flag called resolved ext host .
  19.  
  20. last_slash = lastpos('/',called)
  21. last_colon = lastpos(':',called)
  22.  
  23. dir_pos = max(last_slash,last_colon)
  24. if dir_pos > 0 then
  25.   current_dir = left(called,dir_pos)
  26.  else
  27.    current_dir = '' 
  28.  
  29. Address Value host
  30.  
  31.  
  32. if Open(config_fp,current_dir||"AWebFTP.config",r) then
  33.   do
  34.     save_dir = readln(config_fp)
  35.     AmiFTPexe = readln(config_fp)
  36.     call close(config_fp)
  37.    end
  38.  
  39. if arguements = '' then
  40.     if open(HTML_fp,fname,w) then
  41.       do
  42.     call writeln(HTML_fp,'<html><head><title>')
  43.     call writeln(HTML_fp,addr)
  44.     call writeln(HTML_fp,'</title></head><body><h1>AWebFTP Configuration</h1>')
  45.     call writeln(HTML_fp,'<form action="x-aweb:rexx/'||called||'">')
  46.         call writeln(HTML_fp,'<pre>*Default Save Directory:'left(' ',4)'<input size=60 maxlength=255 name="save_dir" value="'save_dir'"><br>')
  47.         call writeln(HTML_fp,' AmiFTP Executable Path:'left(' ',4)'<input size=60 maxlength=255 name="AmiFTPexe" value="'AmiFTPexe'"><br>')
  48.         call writeln(HTML_fp,'* Required Parameters')
  49.         call writech(HTML_fp,'<hr>AWebFTP by Josef Faulkner (panther@gate.net) IRC: Josef')
  50.     call writeln(HTML_fp,left(' ',17)'<input type="submit" value="  Save  "></form>')
  51.     call writeln(HTML_fp,'</body></html>')
  52.     call close(HTML_fp)
  53.     'OPEN file://localhost/'fname 'RELOAD'
  54.        end
  55.      else 
  56.        address command 'RequestChoice "AWebFTP Config" "Error" "Ok" >NIL:'   
  57.  else 
  58.    do
  59.  
  60.      interpret translate(strip(arguements),';',' ')
  61.  
  62.      if Open(save_config_fp,current_dir||"AWebFTP.config",w) then
  63.        do
  64.          call writeln(save_config_fp,translate(save_dir,,';'))
  65.          call writeln(save_config_fp,translate(AmiFTPexe,,';'))
  66.          call close(save_config_fp)
  67.         end
  68.  
  69.      address command 'DELETE' fname
  70.     end    
  71.  
  72. exit
  73.