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

  1. /*
  2.  * File......: ISSUPEQ.PRG
  3.  * Author....: Rodgers Moore
  4.  * CIS ID....: 75730,2244
  5.  * Date......: $Date$
  6.  * Revision..: $Revision$
  7.  * Log file..: $Logfile$
  8.  *
  9.  * This is an original work by Rodgers Moore and is placed in the
  10.  * public domain.
  11.  *
  12.  * Modification history:
  13.  * ---------------------
  14.  *
  15.  * $Log$
  16.  *
  17.  */
  18.  
  19. #include "netto.ch"
  20.  
  21. /*  $DOC$
  22.  *  $FUNCNAME$
  23.  *      FN_ISSUPEQ()
  24.  *  $CATEGORY$
  25.  *      Bindery
  26.  *  $ONELINER$
  27.  *      Determine if connection/user is SUPERVISOR-equivalent
  28.  *  $SYNTAX$
  29.  *
  30.  *      fn_IsSupEq( [ <nConn> | <cUserName> ] ) -> lSuper_Equal
  31.  *
  32.  *  $ARGUMENTS$
  33.  *
  34.  *      <nConn> a numeric logical connection number of a station.
  35.  *        .or.
  36.  *      <cUserName> a character user name of a user.
  37.  *      If ommited defaults to the user of the current station.
  38.  *
  39.  *  $RETURNS$
  40.  *
  41.  *      If a connection number is passed as the argument:
  42.  *
  43.  *        Returns .T. if the user logged in at that station has Supervisor
  44.  *        equivalence, .F. if they do not.
  45.  *
  46.  *      If a user name is passed as the argument:
  47.  *
  48.  *        Returns .T. if the user is a Supervisor equivalent
  49.  *                .F. if they are not.
  50.  *
  51.  *  $DESCRIPTION$
  52.  *
  53.  *      This is a high-level wrapper of fn_bndoins() which tests for
  54.  *      Supervisor Equvalence.
  55.  *     
  56.  *  $EXAMPLES$
  57.  *
  58.  *      qout( fn_whoami(5)+" is "+if(fn_IsSupEq(5),"","not ")+"a Supervisor." )
  59.  *
  60.  *      qout( "Joe is "+if(fn_IsSupEq("JOE"),"","not ")+"a Supervisor." )
  61.  *
  62.  *  $SEEALSO$
  63.  *     fn_bndoins()
  64.  *  $INCLUDE$
  65.  *
  66.  *  $END$
  67.  */
  68.  
  69.  
  70. function fn_IsSupEq( Para1 )             //  NETWARE SUPERVISOR EQUIVALENCE
  71.    local objname, ;
  72.          supr_name   := fn_bndonam(1,OT_USER)    // GET SUPERVISOR'S USER NAME
  73.  
  74.    do case
  75.       case valtype(Para1) = 'N'
  76.          objname = fn_whoami(Para1)
  77.       case valtype(Para1) = 'C'
  78.          objname = Para1
  79.       otherwise
  80.          objname = fn_whoami()
  81.    endcase
  82.  
  83.    if empty(objname)
  84.       return(.F.)
  85.    endif
  86.  
  87.    return  fn_BndOInS( objname, OT_USER, "SECURITY_EQUALS", supr_name, OT_USER )
  88.  
  89.