Jump to content

User Specific Redirects from Stand Alone Login Screens


Recommended Posts

I've been hacking at this for days and still can't figure it out.

Would it be possible to show how to redirect based on the authentication table in Daniel's tutorial?

In the tutorial the options of Admin or Active are yes/no

I don't know how to translate that to: if("[@authfield:Position]" == "Manager"){

My attempts end up with the screen freezing at ?appSession=

Link to comment
Share on other sites

Hello KTMedia,

In the video you mentioned the DataType of the field is a checkbox, but here the field in a table ,"Position", is a text DataType and the value could be "Manager", "Employee", "Admin" and so on. so the JavaScript is checking for the value of "Position" field here a text and not a checkbox and redirect users based on his/her role.

let me know if I answered your question. :mrgreen:

Link to comment
Share on other sites

I appreciate your reply.

I do understand the difference.

What I don't understand is how to adapt the script. How to translate the conditional from labels to a yes/no flag.

I was hoping for an example script to go along with the video tutorial.

The documentation and video tutorials are very useful.

It would be great if they reinforced each other using common examples.

I also wish creating a stand alone HTML login page didn't eat up one of my 25 datapages, but that's my problem . :)

Link to comment
Share on other sites

okay, I'm getting close to getting this working.

Here is my script so far:

if ("[@authfield:USERS_Admin]" == "Yes"){

window.location = "http://www.ktecmedia.com/admin_status_full.shtml";

}

else if ("[@authfield:USERS_Admin]" == "No"){

window.location = "http://www.ktecmedia.com/agent.shtml";

}

This works.

Admin users authenticate and are sent to the correct page.

Agents (users marked as active but not admin) are not authenticating. "Authentication Failed"

Sounds like my problem has shifted from a standalone redirect issue to an authentication issue. :) That's a topic for a different thread.

Link to comment
Share on other sites

If you have two different user groups, admin and agents, and each group has different access level to different DataPages I recommend creating two folders each having its own authentication view rather than using redirect Java Script. However if you want to use the Java Script then both admin and agents must have access to log in and then be redirected based on the criteria of your script. In this case you should allow both user groups to login and that means your authentication data source should be a View which filters the table by Admin=Yes and Agents=Yes.

Hope this helps.

Best,

Bahar M.

Link to comment
Share on other sites

Thank you. You're right.

I've come to the conclusion that I'm making this process way too complicated.

I've created two login pages.

Anyone authenticating as an admin on the admin login page can pop over and view the agent page without having to login again (they're both admin and agent)

Problem solved.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...