one last question about login dialog :(

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • sillybob123
    Forum Member
    • Jul 2008
    • 32

    one last question about login dialog :(

    i promise this is the last one, i have got a log in working now but on the login dialog post where i got the plugins etc.. he posted an update which has a create new account feature but he didnt attach any extra plugins or files in order to make it "work"
    this is the code i have for the new account button



    Login.NewAccount("New Account", "Information", "Please Fill All Fields And Do Not Use Special Characters", "New Account", "User Name :", "Password :", "Password Again:", "Cancel", "OK");
    if (NewAcc.Result == "IDOK") then
    if (NewAcc.UserName == "") then Dialog.Message("Notice", "Please Eneter A Valid User Name", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
    else
    if (NewAcc.Password ~= NewAcc.Password2) then Dialog.Message("Notice", "Passwords Does Not Match", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
    else
    ----------------------------
    Dialog.Message("Notice", "New Account Created\r\nUserName : "..NewAcc.UserName.."\r\nPassword :"..NewAcc.Password, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
    ------------------------------
    end
    end
    end
  • ShadowUK
    No longer a forum member
    • Oct 2007
    • 1322

    #2
    Do something like.

    Code:
    TextFile.WriteFromString("C:\\users.lua", username.." = "..password, true);

    Comment

    • sillybob123
      Forum Member
      • Jul 2008
      • 32

      #3
      ?

      instead of the whole thing or insert it somewhere

      Comment

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

        #4
        Insert it somewhere.

        This is one without the login action plugin.

        Code:
        -- create the usr and password tables
        usr = {};
        pss = {};
        
        -- create the add user function
        function AddUser(usrname, pssword) usr[Table.Count(usr)+1]=usrname; pss[Table.Count(pss)+1]=pssword; end
        
        -- ask for import if we've already been used and exported.
        tFiles = Dialog.FileBrowse(true, "import users file (optional)", _SourceDrive, "User files (*.lua)|*.lua|", "users", "lua", false, true)
        
        -- if file specified, import it
        if tFiles[1] ~= "CANCEL" then Application.RunScriptFile(tFiles[1]); end
        
        -- ask for username
        sUser = Dialog.Input("Register", "Enter your username");
        
        -- check
        if (sUser ~= "CANCEL") then
        	-- ask for password
           sPass = Dialog.Input("Register", "Enter your password");
        
        	-- check
           if (sPass ~= "CANCEL") then
        		-- write
        		AddUser(sUser, sPass);
               TextFile.WriteFromString(_SourceDrive.."\\users.lua", "\r\nAddUser(\""..sUser.."\", \""..sPass.."\");\r\n", true);
           end
        end
        
        -- create the user string
        str = "currently registered users:\r\n";
        
        for i, v in usr do
        	str = str.."\r\n"..v.." (Password: "..pss[i]..")";
        end
        
        -- tell the users, people that have registered
        Dialog.Message("users registered", str.."\r\n\r\nRemember, you can add users by restarting the application.");
        Good luck.

        Comment

        • sillybob123
          Forum Member
          • Jul 2008
          • 32

          #5
          ?

          care to make an example please lol :( sos

          Comment

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

            #6
            That is the example, stick it in On Preload.

            Comment

            • reteset
              Indigo Rose Customer
              • May 2006
              • 1692

              #7
              Originally posted by sillybob123 View Post
              i promise this is the last one, i have got a log in working now but on the login dialog post where i got the plugins etc.. he posted an update which has a create new account feature but he didnt attach any extra plugins or files in order to make it "work"
              this is the code i have for the new account button
              i have included all required files to this post

              also you can get it from here


              there is a plugin ,you have to install it before use
              also there is an example which demonstrades the plugin
              if you want to use this plugin with another project ,also you have to add
              plugin to your new project via Plugins tab

              Plugin Installition :

              Code:
              1) Copy The "Login" Folder And Paste It Into Your
              AMS Installed Path\Plugins\Actions. For AMS6 Users, This Would Be
              "C:\Program Files\AutoPlay Media Studio 6.0\Plugins\Actions" Whereas
              For AMS7 Users, This Would Be
              "C:\Program Files\AutoPlay Media Studio 7.0\Plugins\Actions"
              
              2) Once You Have Copied The "Login" Folder To The Correct Directory,
              
              A) Open AutoPlay Media Studio
              B) Open A New Project
              C) Click On "Project"
              D) From This Menu, Select "Plugins"
              E) On The Dialog Check Login
              
              The Plugin Is Now Ready To Use
              Example Project Shows only :How To Open Dialogs and Get Return Values
              If You Want More That's Your job
              Thanks
              amsplugins.com Is Closed.

              Facebook Page

              Comment

              • sillybob123
                Forum Member
                • Jul 2008
                • 32

                #8
                ?

                still dosent work :( once i have made a user pass and retyped the pass and type them in on the login dialog it tells me it failed

                Comment

                Working...
                X