home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / clipper / nettos11.zip / BINDERY / LOGCTL.PRG < prev    next >
Text File  |  1993-02-23  |  3KB  |  102 lines

  1. /*
  2.  * File......: LOGCTL.TXT
  3.  * Author....: Glenn Scott
  4.  * CIS ID....: 71620,1521
  5.  * Date......: $Date$
  6.  * Revision..: $Revision$
  7.  * Log file..: $Logfile$
  8.  * 
  9.  * This is an original work by Glenn Scott and is placed in the
  10.  * public domain.
  11.  *
  12.  * Modification history:
  13.  * ---------------------
  14.  *
  15.  * $Log$
  16.  *
  17.  */
  18.  
  19.  
  20. /*  $DOC$
  21.  *  $FUNCNAME$
  22.  *     FN_LOGCTL()
  23.  *  $CATEGORY$
  24.  *     Bindery
  25.  *  $ONELINER$
  26.  *     Return a user's LOGIN_CONTROL property
  27.  *  $SYNTAX$
  28.  *
  29.  *     fn_logctl( [<cUser>] ) -> aCtlStruct
  30.  *
  31.  *  $ARGUMENTS$
  32.  *
  33.  *    <cUser>, the name of the user for which you want to retrieve
  34.  *    the LOGIN_CONTROL property value out of the bindery.  
  35.  *    Defaults to current user.
  36.  *
  37.  *  $RETURNS$
  38.  *
  39.  *    If the call is successful, an array is returned with the
  40.  *    following structure:
  41.  *
  42.  *             Index                      Contents
  43.  *             ------         -----------------------------------
  44.  *
  45.  *  $DESCRIPTION$
  46.  *
  47.  *  $EXAMPLES$
  48.  *
  49.  *  $SEEALSO$
  50.  *
  51.  *  $INCLUDE$
  52.  *
  53.  *  $END$
  54.  */
  55.  
  56.  
  57. #include "netto.ch"
  58.  
  59. #ifdef FT_TEST
  60.    function main( cUser )
  61.       default cUser to fn_whoami()
  62.  
  63.       cls
  64.       aeval( fn_logctl( cUser ), { |x| qout( x ) } )
  65.       return nil
  66. #endif
  67.  
  68.  
  69. function fn_logctl( cUser ) 
  70.    local cProp, aRes := {}
  71.  
  72.    default cUser to fn_whoami()
  73.  
  74.    cProp := fn_rdprova( cUser, OT_USER, "LOGIN_CONTROL" )
  75.    if fn_error() == 0
  76.       aRes :=  { ;
  77.          subs( cProp, 1, 3 ),           ; // Accounting expiration date
  78.          BYTE2I( subs( cProp, 4, 1 ) ) == -1 , ; // Account disabled flag
  79.          subs( cProp, 5, 3 ),           ; // Password expiration date
  80.          BYTE2I( subs( cProp, 8, 1 ) ), ; // Grace logins remaining
  81.          HILO2W( subs( cProp, 9, 2 ) ), ; // Password expiration interval
  82.          BYTE2I( subs( cProp, 11, 1 ) ),; // Grace login reset value
  83.          BYTE2I( subs( cProp, 12, 1 ) ),; // Minimum password length
  84.          HILO2W( subs( cProp, 13, 2 ) ),; // Maximum concurrent connections
  85.          subs( cProp, 15, 42 ),         ; // Allowed login time bitmap
  86.          subs( cProp, 57, 6 ),          ; // Last login date & time
  87.          BYTE2I( subs( cProp, 63, 1 ) ),; // Restriction flags
  88.          BYTE2I( subs( cProp, 64, 1 ) ),; // Unused
  89.          HILO2L( subs( cProp, 65, 4 ) ),; // Max disk usage in blocks
  90.          HILO2W( subs( cProp, 69, 2 ) ),; // Bad login count
  91.          HILO2L( subs( cProp, 71, 4 ) ),; // Next reset time
  92.          subs( cProp, 75 )              ; // Bad login address
  93.       }
  94.    endif
  95.  
  96.    return aRes
  97.  
  98.       
  99.  
  100.    
  101.  
  102.