NetTalk Central

Author Topic: Conditionally skip Login Form  (Read 4016 times)

Mike McLoughlin

  • Full Member
  • ***
  • Posts: 126
    • View Profile
    • Clarion Templates
    • Email
Conditionally skip Login Form
« on: August 03, 2009, 04:12:47 AM »
Sometimes I need to bypass the Login Form, based on a command line parameter, and go straight into the app menu.

I have been trying a few things but can't get round the need to chain to Framepage.

Is there a way to conditionally change the default start page (loginpage) for one session?

Or is there a cleaner way to do the above?

regards

Mike

Mike McLoughlin

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Conditionally skip Login Form
« Reply #1 on: August 03, 2009, 10:34:46 PM »
Hi Mike,

By command line parameter, do you mean something on the URL?

Probably the easiest way to have a "conditional" first page is to use a NetWebPage, and then (conditionally) embed a tag to the LoginForm, or (conditionally) display some other html.

In other words don't look at conditionally _skipping_ the login, look at conditionally _including_ it.

Cheers
Bruce


Mike McLoughlin

  • Full Member
  • ***
  • Posts: 126
    • View Profile
    • Clarion Templates
    • Email
Re: Conditionally skip Login Form
« Reply #2 on: August 04, 2009, 03:04:27 AM »
Hi Bruce

Yes when I said "command line" I meant the URL - if the web app is being called from another site the Passowrd etc is already known so I want the user to go straight in without filling out the same password etc again.

I tried your idea and used "IntroPage" as the Default Page.  Then in LoginPage I check for a user in the URL and if none I call this routine.

LoginPage  Routine
  packet = clip(packet) & |
    '<<!-- Net:LoginPage --><13,10>'&|
    ''


But all I get is a blank screen

Could I use LoginPage(p_web) instead?

Mike
Mike McLoughlin

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Conditionally skip Login Form
« Reply #3 on: August 04, 2009, 10:32:32 PM »
What template type is
IntroPage?
LoginPage?

I assume you meant
>> Then in [DefaultPage] I check for a user

I'm guessing LoginPage is a NetWebPage. But you can't embed a _page_ in a page. So what you want to do is embed a control - most likely a NetWebForm on your page.

Cheers
Bruce

Mike McLoughlin

  • Full Member
  • ***
  • Posts: 126
    • View Profile
    • Clarion Templates
    • Email
Re: Conditionally skip Login Form
« Reply #4 on: August 05, 2009, 03:05:56 PM »
I got it working the way I want by putting my code in a routine in FramePage and calling it only if certain values were being passed in the URL.

thanks

Mike
Mike McLoughlin