user and password protection

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Ruud Jonk
    Forum Member
    • Oct 2004
    • 26

    user and password protection

    Well, here I am again, i have searched the password protection items in the forum and didn´t find exactly what I´m Looking for.

    I want to hava a popup at the startup of the program where the user has to put in its username and password. This is for a program that I make for some friends, i want to put in all there usernames and passwords in the program.
    I want the program to check that the username and password match with each other and if it does, the program wil load further and if they don´t match the program wil exit.

    Does any one have an idee how to do this?

    Thanks for taking a look at my problem.

    Ruud
  • Corey
    Indigo Rose Staff Alumni
    • Aug 2002
    • 9745

    #2
    Hi Ruud. Well there are many ways to do this, depending on the level of security you require. Here is a very simple example I just created which simple compares user input against a table of user values. All the actions are in the global functions area, except for the single function call in the page's OnShow event area:



    Very simple but probably sufficient for applications you are distributing to friends. if you need more security you can easily elaborate on the concept to include comparing encrypted input against a remote database or web script. Hope that helps, if you have any question after checking out the example file just let me know.

    Comment

    • Ruud Jonk
      Forum Member
      • Oct 2004
      • 26

      #3
      thanks corey for your help, only i cant open the file, it gives an error that it cant open the zip


      okey i got it to work on an other computer, im gonna take a look at it now
      thanks corey


      yessss this was exactly what i was looking for

      again thanks corey for your help

      Ruud
      Last edited by Ruud Jonk; 12-30-2004, 03:56 AM. Reason: whoops

      Comment

      • Corey
        Indigo Rose Staff Alumni
        • Aug 2002
        • 9745

        #4
        Happy to help Ruud. Have a great New Years eve!!!

        Comment

        • Ruud Jonk
          Forum Member
          • Oct 2004
          • 26

          #5
          o sorry corey, found out it is almost exactly what i needed, it seems that the password for corey also works with adam.. i want it that the password that is set at corey only works with username corey

          Sorry, i have to ask you again for some help


          Ruud

          Comment

          • Corey
            Indigo Rose Staff Alumni
            • Aug 2002
            • 9745

            #6
            Hee, oops my bad. Fixed, just download it again. Not enough coffee today.

            Comment

            • Ruud Jonk
              Forum Member
              • Oct 2004
              • 26

              #7
              yeah that's it, perfect, thanks again.

              you also have a great New Years eve

              Ruud

              Comment

              • clientele
                Forum Member
                • Dec 2004
                • 75

                #8
                What if you dont want the application to exit but just stay on the page the user was on. I was trying a few things but nothing seems to work. thanks

                Comment

                • Corey
                  Indigo Rose Staff Alumni
                  • Aug 2002
                  • 9745

                  #9
                  Hi. Just go into the global functions area of the example and head down tot he end of the actions, there you will see two Application.Exit actions. You can replace those with any action(s) you like... Hope that helps.

                  Comment

                  • clientele
                    Forum Member
                    • Dec 2004
                    • 75

                    #10
                    Originally posted by Corey
                    Hi. Just go into the global functions area of the example and head down tot he end of the actions, there you will see two Application.Exit actions. You can replace those with any action(s) you like... Hope that helps.
                    where is says application exit I replaced it with page jump , thats suppose to lead to the page the user is on if they get the password wrong but instead it goes in to the page that was passworded. So in other words no luck.

                    Comment

                    • Corey
                      Indigo Rose Staff Alumni
                      • Aug 2002
                      • 9745

                      #11
                      If you post your project I can have a look...

                      Comment

                      • clientele
                        Forum Member
                        • Dec 2004
                        • 75

                        #12
                        Originally posted by Corey
                        If you post your project I can have a look...
                        Well its your code but with the page jump action instead of the application exit action:

                        -- create a table of user data
                        users = {elite="15"};


                        -- create a function to check the user name first
                        function authenticate()


                        -- prompt user to input user name
                        name = Dialog.Input("Enter Name", "User Name? (Get user name at www.elite15.com)", "", MB_ICONQUESTION);


                        -- walk through table and check for name
                        found = 0;
                        for user,pass in users do
                        if name==user then
                        found=1;
                        end
                        end


                        -- if username is valid then do password check
                        if found == 1 then

                        -- prompt user to input user name
                        password = Dialog.Input("Enter Password", "Enter your password!", "", MB_ICONQUESTION);

                        -- check password against table data
                        if password==users[name] then
                        found=2;
                        end

                        -- finish password check
                        end


                        -- deliver error message for bad user name and exit
                        if found==0 then
                        Dialog.Message("Authentication Error", "Sorry, that user name doesn't match our records.");
                        Page.Jump("Page1");
                        end



                        -- deliver error message for bad password and exit
                        if found==1 then
                        Dialog.Message("Authentication Error", "Sorry, that password doesn't match our records.");
                        Page.Jump("Page1");
                        end


                        -- end main function
                        end

                        Comment

                        • clientele
                          Forum Member
                          • Dec 2004
                          • 75

                          #13
                          Sorry to hit you with another question (even though the other one isnt sovled yet) well actually 2. First one, i need to have the entry in the user name and password fields come up as stars or dots, right now they come out as normal text or numeric. Second question is there a way to have the password entered only once so the user would not have to enter the password everytime they had to enter the section. Thanks hope you have a good New Year 2005!

                          Comment

                          • Corey
                            Indigo Rose Staff Alumni
                            • Aug 2002
                            • 9745

                            #14
                            Hi.

                            1. Fixed. See attached file.

                            2. You can adapt the project to use a page with an input field instead of an input dialog if you like. Input fields have an option for password masking. There are code examples of that in the help file.

                            3. Yes it would be easy to write a registry key to store the password data, info about writing registry keys is in the help files including code examples. Also I think there are some posts on that around here if you do a forum search. Be careful with how you set it up though, as this sort of defeats the whole purpose of password protecting something...

                            Hope that helps.
                            Attached Files

                            Comment

                            • clientele
                              Forum Member
                              • Dec 2004
                              • 75

                              #15
                              Ok got my project to switch back to the home page if the password doesnt take instead of closing thats alot for your help.

                              Comment

                              Working...
                              X