Sign in to follow this  
Followers 0
Lakai[NL]

Limiting Users

8 posts in this topic

Hi,

I have a nifty program that I made for myself and some friends for at school that can perform certain tasks, but I was wondering what the best way was that I could limit who actually uses it would be. I was thinking that I could just make a config file, with a bunch of jibberish, and that the program would read a certain line in that to verify it and would then allow the person to run it, but then someone could just get a copy of the config file and normal file and run it. Anyone have any ideas as to how I could limit the users??

I was thinking that maybe I could limit it by the usernames that we use to login with. At school we have usernames like joschmo so would there be a way to allow someone to run a program if they were logged in under a certain username?

I know this really isn't _that big of a deal_ but I just don't want to have the admins figure out that a bunch of students have it because one person kept on sharing it and then make a big deal about it.

Thanks.

Share this post


Link to post
Share on other sites



What about having a username-check, as you suggested, in the start ? Maybe by having the allowed usernames in

an array, loop through it, and if @Username matches one of the listed usernames then the script continues while

exiting if it doesn't match any of them.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Thanks for the reply.

What about having a username-check, as you suggested, in the start ? Maybe by having the allowed usernames in

an array, loop through it, and if @Username matches one of the listed usernames then the script continues while

exiting if it doesn't match any of them.

When you click start, above all the icons it displays the username you logged in with. Is there a place where that information is stored so I could read a config file or something that might hold that information?

If I just made allowed usernames an array, couldn't someone just type in an "allowed" username and run the program kinda like a password?

I made a net send utility that had a password on it, but someone with a flash drive saved it to there, gave it to all their friends and within a week the admin already had a fix for it, that is why I am trying to fix this so this won't be repeated...

Edited by Lakai[NL]

Share this post


Link to post
Share on other sites

I didn't entirely understand that last part, but to get the username you just use the mentioned @Username-macro.

Share this post


Link to post
Share on other sites

What is this @username macro? I tried using help but nothing came up, perhaps you could enlighten me...

Sorry if I am being too noob for you, I recently got back into autoit and would like to complete this...

Share this post


Link to post
Share on other sites

What is this @username macro? I tried using help but nothing came up, perhaps you could enlighten me...

MsgBox(64, "Logged in user", @Username)oÝ÷ Ù¢rK^jëh×6$aUsers = StringSplit("Helge|Lakai|Appelsin", "|")
$fMatch = False

For $i = 1 To $aUsers[0]
    If @UserName = $aUsers[$i] Then
        $fMatch = True
        ExitLoop
    EndIf
Next

If $fMatch = False Then
    MsgBox(16, "Error", "*sniff sniff*")
    Exit
EndIf

MsgBox(64, "Welcome", "Step right in.")

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Helge,

Thank you! Works perfect!

Also THANK YOU Valuater now I can add those other attributes if I ever need to! Btw, Nice features in that includes!

Btw Valu, how did you get your blacklist function to work? That would be very nifty if you could just upload a users.txt file to a webserver and have your application check your website to see if that username is in there and if it is it would allow them to run the program.

Edited by Lakai[NL]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0