home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / clipper / nettos11.zip / BINDERY / ACCLEVL.PRG next >
Text File  |  1993-03-30  |  3KB  |  107 lines

  1. /*
  2.  * File......: ACCLEVL.PRG
  3.  * Author....: Kevin Maher/Steve Tyrakowski
  4.  * CIS ID....: 73766,1224
  5.  * Date......: $Date$
  6.  * Revision..: $Revision$
  7.  * Log file..: $Logfile$
  8.  *
  9.  * This is an original work by Kevin Maher and Steve Tyrakowski
  10.  * and is placed in the public domain.
  11.  *
  12.  * Modification history:
  13.  * ---------------------
  14.  *
  15.  * $Log$
  16.  *
  17.  */
  18.  
  19.  
  20. /*  $DOC$
  21.  *  $FUNCNAME$
  22.  *     FN_bAccLev()
  23.  *  $CATEGORY$
  24.  *     Bindery
  25.  *  $ONELINER$
  26.  *     Get Bindery Access Level
  27.  *  $SYNTAX$
  28.  *
  29.  *     FN_bAccLev() => aAccess
  30.  *
  31.  *  $ARGUMENTS$
  32.  *
  33.  *     None
  34.  *
  35.  *  $RETURNS$
  36.  *
  37.  *     <aAccess>
  38.  *
  39.  *     Is an array of three elements for a work stations access level
  40.  *     to a file server's bindery.
  41.  *
  42.  *   aAccess[1] is the Property write security as an integer.
  43.  *            The integer indicates who can add properties
  44.  *            to the bindery object.
  45.  *
  46.  *   aAccess[2] is the Property read security as an integer.
  47.  *            The integer indicates who can read and scan
  48.  *            properties for a bindery object.
  49.  *
  50.  *           ┌─────────────────────────────────┐
  51.  *           │ Read and Write Security Levels  │
  52.  *           ├──┬──────────────────────────────┤
  53.  *           │ 0│ Anyone                       │
  54.  *           ├──┼──────────────────────────────┤
  55.  *           │ 1│ Logged                       │
  56.  *           ├──┼──────────────────────────────┤
  57.  *           │ 2│ Object                       │
  58.  *           ├──┼──────────────────────────────┤
  59.  *           │ 3│ Supervisor                   │
  60.  *           ├──┼──────────────────────────────┤
  61.  *           │ 4│ Netware Operating System     │
  62.  *           └──┴──────────────────────────────┘
  63.  *
  64.  *    aAccess[x,3] is the ObjectId of the logged bindery object.
  65.  *
  66.  *  $DESCRIPTION$
  67.  *
  68.  *    This function returns an array with the read and write security
  69.  *    access levels to the bindery and the logged bindery id.
  70.  *    If an error occurs the function will return nil.
  71.  *
  72.  *  $EXAMPLES$
  73.  *
  74.  *    aSecurity := FN_bAccLev()
  75.  *    QOut(aSecurity[1],aSecurity[2],aSecurity[3])
  76.  *     return ( nil )
  77.  *
  78.  *  $END$
  79.  */
  80.  
  81. #include "ftint86.ch"
  82. #include "netto.ch"
  83.  
  84. #define NW_LOG 227
  85.  
  86. #ifdef FT_TEST
  87.  
  88.   FUNCTION MAIN()
  89.   LOCAL aSecurity
  90.     aSecurity := FN_bAccLev()
  91.     QOut("     Write       Read      Id")
  92.     QOut(aSecurity[1],aSecurity[2],aSecurity[3])
  93.   RETURN ( nil )
  94.  
  95. #endif
  96.  
  97. FUNCTION FN_bAccLev
  98. LOCAL cReceive := Space(5)
  99. LOCAL aRetVal
  100.   IF _fnReq(NW_LOG,Chr(70), @cReceive) == ESUCCESS  // 46h API request code
  101.     aRetVal := {Int(BYTE2I(Left(cReceive,1)) / 16); // property_write_security
  102.          , Int(BYTE2I(Left(cReceive,1)) % 16); // property_read_security
  103.          , HILO2L(Substr(cReceive,2,4)) } // user id
  104.   ENDIF
  105.  
  106. RETURN aRetVal
  107.