NetTalk Central

Author Topic: Page to display after user logs in  (Read 5402 times)

MikeR

  • Sr. Member
  • ****
  • Posts: 265
    • View Profile
    • Email
Page to display after user logs in
« on: May 31, 2018, 07:52:15 PM »
I would like to decide based on who is logging in what page to serve next.
there is place for a variable on the form 'URL on Save'
I have set it to a sessionvalue that i set in the validate login procedure in the webhandler but the formaction is set before the user logs in.
how do i use a variable here or cause the save button to serve the page i want ?


peterH

  • Sr. Member
  • ****
  • Posts: 413
    • View Profile
Re: Page to display after user logs in
« Reply #1 on: May 31, 2018, 08:16:23 PM »
Here's what I do in one of my apps:

Login form is a memory form with default form action set to Change. URL on Save is set to 'IndexPage' which is the default page after login for most users (but that could be blank and be handled in the code as well).

There's code in validateUpdate to check if the user is logging in for the first time in which case he's being sent to a different page using: p_web.script('location.href="firsttime"'). FirstTime is the name of a procedure. This idea could be expanded to any number of different pages.

I'm sure there are other ways to do this but it works nicely.

Peter

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: Page to display after user logs in
« Reply #2 on: June 01, 2018, 02:40:35 AM »
Thanks peterH
Interesting...
So, p_web.script('location.href="firsttime"') is for the Save button?
And for the Cancel button?
-----------
Regards
Alberto

Robert Iliuta

  • Sr. Member
  • ****
  • Posts: 472
    • View Profile
    • Email
Re: Page to display after user logs in
« Reply #3 on: June 02, 2018, 10:33:07 PM »
Hallo Michelis!

>>And for the Cancel button?
Cancel button on a login page? sorry but for what do you need a cancel button on a login page?
I never see a cancel button on a login page. (maybe just for a popup login window)

Robert

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: Page to display after user logs in
« Reply #4 on: June 04, 2018, 04:10:52 AM »
Im not talking about a login page, it may be usefull for any page in which you need to redirect the page to go, in any button, in a NT Form, you can set the page to go from the save and the cancel buttons, this pages cant be modified by clarion code, your code, using js let change the page to go with the save button, my question is how to d this with any other button like a cancel button.
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Page to display after user logs in
« Reply #5 on: June 05, 2018, 04:31:43 AM »
So let me summarize, to make sure I understand.

you wish to change the URL of a Save or Cancel button on the form, but AFTER the form has been generated.
So presumably based on something entered along the way? Of course though they may go directly from the entered field, to the button, which makes the process very tricky.

So I think maybe the answer to your question is a slightly different question. Instead of asking;

>> I would like to decide based on who is logging in what page to serve next.

Rather let's say you always go to the same page next - but from there you can then redirect the user somewhere else.

For example, say from the login you go to a netWebPage "AfterLogin". From _there_ you can then do a simple redirect to the URL you want them to go to.

p_web.Redirect('WhateverProcedure')

Cheers
Bruce