Creating a redirect for users without a login name, but user.login has a mystery default value
I'm trying to create a redirect on the page initialization page, which will run of the user does not have a login name. Our community is private, and to view it at all you have to be logged in via SSO. However, we don't force users to choose a login name until they click an action, such as "Reply".
For users who have not chosen a login name, the user.login value is not not null or blank, but instead it is defaulting to SunsetRunner, which is the value we've input in the Admin settings field Users > Profile defaults > For deleted member accounts, display this username (screenshot included below).
The code below shows my intent. It currently works but is not solid, because I do not know how the value "SunsetRunner" is getting pulled in. If the user's login is SunsetRunner, we know they have not chosen a username/login yet (or have a deleted account), so we can redirect them to the registration page.
How do I figure out if the user has chosen a username/login name yet? Can I do it by comparing the user.login value to something that's not a static string?
<#-- Profile page redirect --> <#if (page.name?lower_case == "viewprofilepage") > <#if user.login == ‘SunsetRunner’ > <#assign currUrl = http.request.url /> ${http.response.setRedirectUrl("/t5/user/ssoregistrationpage?dest_url=" + currUrl)} </#if> </#if>
hi iftomkins
you can try the following to target partially registered users:
<#if user.anonymous == false && user.registration.complete == false > ... </#if>