> Anyone know an API call (or other method) to tell if the current user
> has Windows administrator rights?
Take a look at the NetUserGetLocalGroups API.
This might also help:
#define ADS_GROUP_TYPE_GLOBAL_GROUP 0x00000002
#define ADS_GROUP_TYPE_DOMAIN_LOCAL_GROUP 0x00000004
#define ADS_GROUP_TYPE_LOCAL_GROUP 0x00000004
#define ADS_GROUP_TYPE_UNIVERSAL_GROUP 0x00000008
#define ADS_GROUP_TYPE_SECURITY_ENABLED 0x80000000
* _______________________________________________________________
Function IsInRole
* Determine whether user is in specified role
* ===========================================
PARAMETERS cRole,cServer
LOCAL oWinNTSystemInfo, cDomain, cUserName
LOCAL oUser, oGroup, lResult
oWinNTSystemInfo = createobject("WinNTSystemInfo")
cDomain = oWinNTSystemInfo.DomainName
cUserName = oWinNTSystemInfo.UserName
lResult = .F.
Try
oUser = getobject("WinNT://" + cDomain + "/" + cUserName +
",user")
oGroup = getobject("WinNT://" + cServer + "/" + cRole +
",group")
If oGroup.IsMember(oUser.ADSPath)
lResult = .T.
Else
For Each oGroup in oGroup.Members
If lResult
Exit
Endif
If UPPER(oGroup.Class) = "GROUP" and ;
oGroup.GroupType =
ADS_GROUP_TYPE_GLOBAL_GROUP
lResult = IsInRole(oGroup.Name,cDomain)
Endif
Endfor
Endif
Catch to oException
Messagebox(oException.Message,0+16+0,"Error")
Endtry
Return lResult
Regards,
Scott
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED]
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.