Function: IsUserAdmin

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • RizlaUK
    Indigo Rose Customer
    • May 2006
    • 5552

    Function: IsUserAdmin

    Hey guys, as i dont still dont have vista again i am unable to test this function

    would someone please test this for me, it all looks good to me...but one can never tell

    Code:
    -- Check if user is admin (returns true if admin, false if not)
    function IsUserAdmin()
    	local strSystem=System.GetOSName()
    	local tbUserInfo=System.GetUserInfo()
    	if strSystem == "Windows Vista" then
    		if tbUserInfo.IsAdmin then
    			if tbUserInfo.IsVistaAdminLimitedToken then
    				return false
    			else
    				return true
    			end
    	 	else
    	 		return false
    	 	end
    	else
    		if tbUserInfo.IsAdmin then
    			return true
    	 	else
    	 		return false
    	 	end
    	end
    end
    
    -- Test
    if IsUserAdmin() then
    	Dialog.Message("Notice", "User Is Admin", MB_OK, MB_ICONNONE, MB_DEFBUTTON1);
    else
    	Dialog.Message("Notice", "User Is NOT Admin", MB_OK, MB_ICONNONE, MB_DEFBUTTON1);
    end
    Embrace change in your life, you never know, it could all work out for the best
  • Worm
    Indigo Rose Customer
    • Jul 2002
    • 3971

    #2
    works here.. Vista Home Premium

    Comment

    • RizlaUK
      Indigo Rose Customer
      • May 2006
      • 5552

      #3
      Woooo........worm got vista at last :yes

      lol,

      Cheers worm
      Embrace change in your life, you never know, it could all work out for the best

      Comment

      • Worm
        Indigo Rose Customer
        • Jul 2002
        • 3971

        #4
        yea... I made the dive. I figured since I had to reload everything after I blew my HD away, I may as well jump into the world of Vista.

        Comment

        • RizlaUK
          Indigo Rose Customer
          • May 2006
          • 5552

          #5
          yeah, makes sence

          sorry, but i have to ask

          dose the timer plugin cause the *vista* error on your system ?

          not that im bugging you or anything, just if it dose cause the error, then its one step closer to fixing it
          Embrace change in your life, you never know, it could all work out for the best

          Comment

          • Worm
            Indigo Rose Customer
            • Jul 2002
            • 3971

            #6
            I'm still recovering from the stress of the reinstall.

            To be honest, I've not even installed any of my plugins yet. Hopefully this weekend will give a couple spare moments to dedicate to getting everything back to par.

            Comment

            • longedge
              Indigo Rose Customer
              • Aug 2003
              • 2498

              #7
              Originally posted by Worm View Post
              I'm still recovering from the stress of the reinstall.
              I can remember the time when I used to format and re-install at least once a year. It seems too much hassle nowadays. Sends a shudder down my back just thinking about it now.

              Comment

              • Worm
                Indigo Rose Customer
                • Jul 2002
                • 3971

                #8
                mine wasn't on purpose... mine was an Oh sh!t! still can't believe I did it

                Comment

                • RizlaUK
                  Indigo Rose Customer
                  • May 2006
                  • 5552

                  #9
                  Code:
                  mine was an Oh sh!t! still can't believe I did it
                  lol, i did mine about 3 weeks ago, was testing some app securty and kinda messed up the registry, its hastle free for me now tho, every thing i need to get started (drivers n apps) all in a handy installer, i just sit here for an hour clickin "Next"

                  anyway, i lke the feel of a fresh system, always so much faster
                  Embrace change in your life, you never know, it could all work out for the best

                  Comment

                  • ShadowUK
                    No longer a forum member
                    • Oct 2007
                    • 1322

                    #10
                    I'm using ubuntu right now

                    Comment

                    Working...
                    X