Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2006
    Posts
    346

    Code Check - Please

    Hi all,

    Having problem with my user login. My project exceeds the 1mb limit please download from http://www.hamiltonschools.org/hess/...ad/scctest.zip
    sorry for the size.

    The problem. If up Publish>Preview, login username and password = admin1. That works fine - Once you page jump on the top right there is a logoff button. Click that it page jumps to a loggoff page. On that page is a login button. Click that and it get a nil value. This is where I got stuck. It works fine in other apps just not this one. That why I included the entire project.

    If you page view it works fine!

    Any help would be great - Thanks

  2. #2
    Join Date
    Feb 2006
    Posts
    346
    This is the code that works on app start. Once you logff and click the login button which has the following code (same as on app start) I get "On Click, Attempt to call field 'ImportDataBase' (a nil value)." I don't understand why it works on startup and not on page jump to a logoff page. Attached is the same login script that works and is setup in my app - but fails to work in my app which can be downloaded from here. http://www.hamiltonschools.org/hess/...ad/scctest.zip


    Thanks

    Code:
    User.ImportDatabase("AutoPlay\\Users\\user.db");
    
    
    User.ImportDatabase = Application.RunScriptFile;
    
    function User.ExportDatabase(sFile)
    	local str = "";
    	
    	for i, v in User.N do
    		str = str.."User.Create(\""..v.."\", \""..User.P[i].."\");\r\n";
    	end
    	
    	TextFile.WriteFromString(sFile, str, false);
    end
    
    function User.GetUsers()
    	return User.N;
    end
    
    
    
    
    ------------------user login----------------
    
    userprompt = Dialog.Input("Login", "Please enter a username.");
    
    if (userprompt ~= "CANCEL") then
    	passprompt = Dialog.Input("Login", "Please enter a password.");
    
    	if (passprompt ~= "CANCEL") then
    		userauth = User.CheckAuthentication(userprompt, passprompt);
    
    		if (userauth == true) then
    		Dialog.TimedMessage("Login", "You have logged in successfully.", 2000, MB_ICONINFORMATION);
    			Page.Jump("Start");
    		else
    			--Dialog.TimedMessage("Login", "Failed to login.", 2000, MB_ICONINFORMATION);
    			Dialog.Message("Login Failed", "Please try again.");
    			     			
    userprompt = Dialog.Input("Login", "Please enter a username.");
    
    if (userprompt ~= "CANCEL") then
    	passprompt = Dialog.Input("Login", "Please enter a password.");
    
    	if (passprompt ~= "CANCEL") then
    		userauth = User.CheckAuthentication(userprompt, passprompt);
    
    		if (userauth == true) then
    		Dialog.TimedMessage("Login", "You have logged in successfully.", 2000, MB_ICONINFORMATION);
    			Page.Jump("Start");
    		else
    			Dialog.TimedMessage("Login Failed", "Now Exiting!", 2000, MB_ICONINFORMATION);
    			Application.Exit(0);
    
    		end
    	end
    end
    end
    end
    end
    Attached Files

Similar Threads

  1. Code Check requested? (re. FTP)
    By mystica in forum AutoPlay Media Studio 7.5
    Replies: 3
    Last Post: 09-29-2008, 01:52 AM
  2. Article: Using Authenticode Code Signing Certificates
    By Ted Sullivan in forum Setup Factory 8.0 Examples
    Replies: 4
    Last Post: 10-31-2007, 09:03 AM
  3. New Check Boxes on Preload code
    By civil78 in forum Setup Factory 7.0
    Replies: 3
    Last Post: 03-16-2006, 09:57 AM
  4. Need a code that will check for installed programs.
    By Quantrac in forum AutoPlay Media Studio 5.0
    Replies: 2
    Last Post: 02-07-2005, 12:07 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts