home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR21 / DOUGM.ZIP / DM168SRC.ZIP / NOVELL.C < prev    next >
Text File  |  1992-07-30  |  1KB  |  44 lines

  1. char* UserName (void)
  2. {
  3.   WORD   connectionNumber;
  4.   char   userName[48];
  5.   WORD   objectType;
  6.   long   objectID;
  7.   BYTE   loginTime[7];
  8.   int    ccode;
  9.  
  10.   connectionNumber = GetConnectionNumber();
  11.   ccode = GetConnectionInformation( connectionNumber,
  12.                      userName,
  13.                      &objectType,
  14.                      &objectID,
  15.                      loginTime );
  16.  
  17.   return (userName);
  18. };
  19.  
  20. boolean IsMember (char *group)
  21. {
  22.   char objectName[48];
  23.   char propertyName[16];
  24.   char memberName[48];
  25.   WORD objectType, memberType;
  26.  
  27.     /* if this is not done, the following will return false values
  28.        if the netware shell is not loaded */
  29.   if( !GetConnectionNumber() )
  30.       return(NO);
  31.  
  32.   strcpy (objectName, UserName ());
  33.   objectType = OT_USER;
  34.   strcpy (propertyName, "GROUPS_I'M_IN");
  35.   strcpy (memberName, group);
  36.   memberType = OT_USER_GROUP;
  37.  
  38.   if ( IsBinderyObjectInSet (objectName, objectType, propertyName, 
  39.                                   memberName, memberType) )
  40.       return (NO);
  41.   else
  42.       return (YES);
  43. };
  44.