-
1. Re: content on login for the forum
mattdwm Jun 18, 2012 11:46 AM (in response to kenneth_rapp)Did you ever figure this out? I need to do something similar.
-
2. Re: content on login for the forum
kenneth_rapp Jun 18, 2012 8:27 PM (in response to mattdwm)Yes actually, I just figured it out yesterday. The only answer I could find was the one I wanted to avoid, though.
The basic process is to pull the forum page in with an ajax call with jQuery. There's a layer in the forum document with the id 'user' which has different properties whether someone is currently logged in or not. If they're logged in, it will contain a link to logout, and if they're not, it won't. So I used this as a test. Here is the function I made, I left out and commented the parts to add your own code for if logged in and if logged off:
function GetForumLoginState(){ forumget = $.ajax({ url: '/ForumRetrieve.aspx', dataType:'html', async:false, data: { 'ForumID':12345 } }); forumget.done(function(data){ loginstatus = $(data).find('li.user:has(a[href="/LogOutProcess.aspx"])').html(); if(loginstatus == null){ // they're logged out } else{ // they're logged in } }); }... replacing it with your own forum id too. Running this somewhere will show you whether someone is currently logged in or not.
-
3. Re: content on login for the forum
tmikaeld Aug 15, 2012 6:24 AM (in response to kenneth_rapp)Why not use the module that shows if you are logged in or not?
{module_isloggedin}
It will show 1 if logged in 0 if not.
-
4. Re: content on login for the forum
jymcconn Oct 30, 2012 9:22 AM (in response to tmikaeld)I have used the module_isLoggedIn, but find that is shows 1 if I am logged in to any area. Do you know of a way to ask if user is logged into a specific zone? Thanks for any insight.
Janice
-
5. Re: content on login for the forum
Mihai_Tica Oct 31, 2012 12:19 AM (in response to jymcconn)I am afraid at the moment there is no way to "tell" which secure zone a CRM contact is logged into out of the box, as you notived the module_isLoggedin can only be used to determine whether the current user is logged in or not.
This is what I was thinking though, imagine this setup:
-2 login forms for 2 different secure zones
-the secure zones have 2 blank landing pages that will act as proxies (let's call them proxyA.html and proxyB.html), will detail this further below
-on either page put a javascript snippet that redirects the site visitor to the page you need them to be redirected after logging in (let's call it pageA.html) and adds a query parameter in the URL
-on pageA.html you will need to have a javascript snippet that reads the parameter in the URL and does something based on its value. Basically at this point based on the parameter in the URL you can tell which secure zone form the site visitor used to login
In this setup you basically use the proxy pages to "mark" the URL with a parameter you can later use to link that site visitor to the secure zone form he used to login.
What do you think, would this type of setup be useful?
-
6. Re: content on login for the forum
jymcconn Oct 31, 2012 10:23 AM (in response to Mihai_Tica)Yes, it helped. I'm submitting a booking form with an associated web app item form using ajax. I needed to differentiate between member logged in and anonymous logged in so I could test and not log out a member. Thanks to another thread, I saw that if the web app is in the secure member zone, then a member doesn't need the anonymous log in.
I have had some intermittent problems with the web app item not submitting - can't find a pattern to pin down the cause. On Monday, 2 of 7 bookings didn't have the associated web app item created. Thanks for the help.


