KTMedia Posted August 18, 2011 Report Share Posted August 18, 2011 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= Quote Link to comment Share on other sites More sharing options...
londoncity Posted August 18, 2011 Report Share Posted August 18, 2011 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: Quote Link to comment Share on other sites More sharing options...
KTMedia Posted August 19, 2011 Author Report Share Posted August 19, 2011 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 . Quote Link to comment Share on other sites More sharing options...
KTMedia Posted August 19, 2011 Author Report Share Posted August 19, 2011 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. Quote Link to comment Share on other sites More sharing options...
bahar_vm Posted August 23, 2011 Report Share Posted August 23, 2011 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. Quote Link to comment Share on other sites More sharing options...
KTMedia Posted August 26, 2011 Author Report Share Posted August 26, 2011 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.