Hi,

I have a CForm (Definiton + Template) and a login-function in flow. Now I want to combine these two.

function loginpage() {
   var loginForm = new Form("forms/LoginForm_d.xml");
   loginForm.showForm("form/LoginForm");
}

function login() {
   var message = false;
       var username = cocoon.request.get("username");
       var password = cocoon.request.get("password");

       account = getStore().readAccount(username, password);;
       if (account == null) {
           return message;
       } else {
            message = "true";
return message; }
   }
}

Is it possible (and wise) to change the loginpage()-function like this:

function loginpage() {
   while(true){
       var loginForm = new Form("forms/LoginForm_d.xml");
       loginForm.showForm("form/LoginForm");
       var loggedin = login();
       if(loggedin == "true") break;
}

Since this approach doesn't seem quite right and efficient to me:
- Is there a better approach? (I guess there is)
- Any suggestions how I can solve this problem?

Thanks
Jonny

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to