Hi Ralf,

if you're setting data in the %session object, the 1/0 - true/false issue
shouldn't matter.  But maybe I'm misunderstanding here, I would have to see
the pages for that.  If you're not satisfied with the workaround you have,
you should log this with support.

Alex

"Ralf Huwald" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi, Alex!
>
> "Alex Schaefer" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
> news:[EMAIL PROTECTED]
> > How about setting the %session data accordingly?  So, in your Login()
> method
> > do something like "set %session.Data("Login")=1".  Then check for this
> value
> > in the OnPreHttp() method of Main.csp and do a %response.Redirect() if
it
> > doesn't equal 1.
>
> Of course a %session.Data("Login") is set and checked at every page (and
> redirected in case of not logged in).
> My idea is, the cache-script returns 0 or 1 - which seems not to be the
same
> as false or true.
>
> I have a "workaround" for the submit-problem:
>
> <script language="JavaScript" type="text/javascript">
> function JLogin() {
>
>
if(#server(..Login(document.Form.Kunde.value,document.Form.Mitarbeiter.value
> ,document.Form.Kennwort.value))#==1) {
>   return true;
>   }
>  return false;
> }
> </script>
> ...
> <form action="Main.csp" name="Form" onSubmit="return JLogin();">
> ...
> </form>
>
> Ralf
>
> >
> > "Ralf Huwald" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> > > Hi, Kevin!
> > >
> > > I had a look at the presentation-examples. Sure, that way works. In my
> > > example i tried out something like this, which works also:
> > >
> > > <form name="Form">
> > > <input type="text" name="User">
> > > <input type="password" name="Password">
> > > <input type="button" name="Login" value="Login" onClick="return
> > > #server(..Login(Form.User.value,Form.Password.value))#;">
> > > </form>
> > > <script language="CACHE" method="Login"
> > > arguments="User:%String,Password:%String" returntype="%Boolean">
> > > ...
> > > if "wronglogin was entered" q 0
> > > &js< self.document.location='Main.csp';>
> > > q 1
> > > </script>
> > >
> > > The disadvantage of this solution is, you have to click at the
> > LoginButton.
> > > In a Submit-Form you just need to press ENTER. So i'd prefer the other
> > > version (which still is not working).
> > >
> > > Any ideas?!?
> > >
> > > Ralf
> > >
> > > "kevin furze" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
> > > news:[EMAIL PROTECTED]
> > > > there is a good working example of logging in (and detecting if
> > > > password has been entered) on the Mgateway utility site.
> > > >
> > > > look for the "Advanced CSP Presentation" - its written by Peter
> Cooper,
> > > > I just happen to post it to the utility site (with peter's
permission
> > > > of course)
> > > >
> > > > in this presentation, every page inherits a "master page" that
detects
> > > > if the password has been entered, if it has, then it allows
> > > > continuation else it forces the password to be entered.
> > > >
> > > > take a look - its a nice simple bit of code.
> > > >
> > > > kev
> > > >
> > >
> > >
> >
> >
>
>



Reply via email to