home *** CD-ROM | disk | FTP | other *** search
/ Media Share 13 / mediashare_13.zip / mediashare_13 / ZIPPED / NETWORK / GP25.ZIP / SERVLI.PRG < prev    next >
Text File  |  1994-03-18  |  5KB  |  173 lines

  1. *       *********************************************************
  2. *       *                                                         
  3. *       * 03/18/94             SERVLI.PRG                07:25:20 
  4. *       *                                                         
  5. *       *********************************************************
  6. *       *                                                         
  7. *       * Author's Name                                           
  8. *       *                                                         
  9. *       * Copyright (c) 1994 Company Name                         
  10. *       * Address                                                 
  11. *       * City,     Zip                                           
  12. *       *                                                         
  13. *       * Description:                                            
  14. *       * This program was automatically generated by GENSCRN.    
  15. *       *                                                         
  16. *       *********************************************************
  17.  
  18.  
  19. #REGION 0
  20. REGIONAL m.currarea, m.talkstat, m.compstat
  21.  
  22. IF SET("TALK") = "ON"
  23.     SET TALK OFF
  24.     m.talkstat = "ON"
  25. ELSE
  26.     m.talkstat = "OFF"
  27. ENDIF
  28. m.compstat = SET("COMPATIBLE")
  29. SET COMPATIBLE FOXPLUS
  30.  
  31. *       *********************************************************
  32. *       *                                                         
  33. *       *                MS-DOS Window definitions                
  34. *       *                                                         
  35. *       *********************************************************
  36. *
  37.  
  38. IF NOT WEXIST("_qof0fwpj0")
  39.     DEFINE WINDOW _qof0fwpj0 ;
  40.         FROM INT((SROW()-16)/2),INT((SCOL()-61)/2) ;
  41.         TO INT((SROW()-16)/2)+15,INT((SCOL()-61)/2)+60 ;
  42.         TITLE " Server Login " ;
  43.         FLOAT ;
  44.         NOCLOSE ;
  45.         SHADOW ;
  46.         NOMINIMIZE ;
  47.         DOUBLE ;
  48.         COLOR SCHEME 5
  49. ENDIF
  50.  
  51.  
  52. *       *********************************************************
  53. *       *                                                         
  54. *       *          SERVLI/MS-DOS Setup Code - SECTION 2           
  55. *       *                                                         
  56. *       *********************************************************
  57. *
  58.  
  59. #REGION 1
  60. Private cPassword, nExit, nServer, aServArry, nServers,n , nDeletes
  61. external array aServArry
  62. push key clear
  63. nServer=1
  64. nExit=2
  65. cPassword=space(40)
  66. cUserID=space(40)
  67. nServers=n_GetSList('aServArry')
  68. nDeletes=0
  69. for n=alen(aServArry,1) to 1 step -1
  70.     if n_attached(aServArry[n])
  71.         =adel(aServArry,n)
  72.         nDeletes=nDeletes+1
  73.     endif
  74. endfor
  75. if nDeletes=nServers
  76.     =msgwin('You are already logged into all servers')
  77.     return
  78. endif
  79. Declare aServArry[nServers-nDeletes]
  80.  
  81.  
  82. *       *********************************************************
  83. *       *                                                         
  84. *       *               SERVLI/MS-DOS Screen Layout               
  85. *       *                                                         
  86. *       *********************************************************
  87. *
  88.  
  89. #REGION 1
  90. IF WVISIBLE("_qof0fwpj0")
  91.     ACTIVATE WINDOW _qof0fwpj0 SAME
  92. ELSE
  93.     ACTIVATE WINDOW _qof0fwpj0 NOSHOW
  94. ENDIF
  95. @ 2,4 SAY "Server Name:" ;
  96.     SIZE 1,12, 0
  97. @ 7,7 SAY "Password:" ;
  98.     SIZE 1,9, 0
  99. @ 5,8 SAY "User ID:" ;
  100.     SIZE 1,8, 0
  101. @ 1,19 GET nServer ;
  102.     PICTURE "@^" ;
  103.     FROM aServArry ;
  104.     SIZE 3,28 ;
  105.     DEFAULT 1 ;
  106.     COLOR SCHEME 5, 6
  107. @ 5,20 GET cUserID ;
  108.     SIZE 1,27 ;
  109.     DEFAULT " " ;
  110.     PICTURE "@!"
  111. @ 7,20 GET cPassword ;
  112.     SIZE 1,27 ;
  113.     DEFAULT " " ;
  114.     PICTURE "@!"
  115. @ 11,12 GET nExit ;
  116.     PICTURE "@*HT \!\<OK;\?Cancel" ;
  117.     SIZE 1,16,1 ;
  118.     DEFAULT 1
  119.  
  120. IF NOT WVISIBLE("_qof0fwpj0")
  121.     ACTIVATE WINDOW _qof0fwpj0
  122. ENDIF
  123.  
  124. READ CYCLE
  125.  
  126. RELEASE WINDOW _qof0fwpj0
  127.  
  128. #REGION 0
  129. IF m.talkstat = "ON"
  130.     SET TALK ON
  131. ENDIF
  132. IF m.compstat = "ON"
  133.     SET COMPATIBLE ON
  134. ENDIF
  135.  
  136.  
  137. *       *********************************************************
  138. *       *                                                         
  139. *       *               SERVLI/MS-DOS Cleanup Code                
  140. *       *                                                         
  141. *       *********************************************************
  142. *
  143.  
  144. #REGION 1
  145. cServer=n_defservr()
  146. if nExit=1 and not empty(cUserid)
  147.     nResult=n_login(cUserID, cPassword,aServArry[nServer])
  148.     do case
  149.         case nResult=0
  150.             cMsg='Login Successful!'
  151.             append blank
  152.             =N_DefServr(aServArry[nServer])
  153.             replace ServName with aServArry[nServer], serialno with n_SerialNo(), MaxConns with n_maxconns(), version with N_ServVers()
  154.         case nResult=197    &&    Intruder detection activated
  155.             cMsg='Intruder detection activated for account!'
  156.         case nResult=220    &&    Account Disabled
  157.             cMsg='Account has been disabled!'
  158.         case nResult=252
  159.             cMsg='No such object!'
  160.         case nResult=254    &&    Login Disabled
  161.             cMsg='Login disabled on server!'
  162.         case nResult=255    &&    No Response From Server
  163.             cMsg='No Response from server!'
  164.         otherwise
  165.             cMsg='Unknown error number '+str(nResult,3)+'.'
  166.     endcase
  167.     if nResult!=0
  168.         =n_ServDtch(aServArry[nServer])
  169.         =n_defservr(cServer)
  170.     endif
  171.     =msgwin(cMsg,.t.)
  172. endif
  173. pop key