Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Administration Rights
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00690323
Message ID:
00693291
Vues:
20
Simon,

>Does anybody know how I can return a logical value from a command to see if the currently logged on user has full adminstration rights, i.e. to install a printer (PDF) from my application. I know you can detect this type of thing, but haven't come across any command to do this?

I've found the following code in another forum. I haven't tested it and I haven't looked through it, to see if this is going to do exactly what you need. But maybe it helps.

Armin
#define ADS_SECURE_AUTHENTICATION 1 
 
LOCAL loAd,loProvider,loWinNT,loUser,loGroup 
 
loAd = GETOBJECT("ADs:") 
FOR EACH loProvider IN loAd 
  IF loProvider.Name == "WinNT:" 
    loWinNT = loProvider 
    EXIT 
  ENDIF 
ENDFOR 
loUser = loWinNT.OpenDSObject("WinNT://"+ALLTRIM(STRTRAN(SYS(0)," # ","/")),"Administrator","",ADS_SECURE_AUTHENTICATION) 
FOR EACH loGroup IN loUser.Groups 
  ? loGroup.Name 
ENDFOR 
loGroup    = .NULL. 
loUser     = .NULL. 
loProvider = .NULL. 
loWinNT    = .NULL. 
loAd       = .NULL. 
RELEASE lo* 

Armin Neudert
Regional Director (Stuttgart) of German FoxPro User Group dFPUG

MCP for Visual FoxPro

Expert/Editor of the VFP section in the German Codezone community portal
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform