Registration check case sensitive - how to change?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Registration check case sensitive - how to change?

Coleen_Astalos
We modified my validate registration form macro to check to see if the person registering was in the "members" group.  It appears that this check is case sensitive and I'm having a problem with that as members don't remember when they subscribed to my service whether they had any uppercase letters in their email address.  

This is how the macro checks membership - is there a way to change it so it's not case sensitive?

<n.users_in_group. group="Members">  
        <n.set_var. name="in_members">  
            <n.loop.>              
                <n.if.equal value1="[n.email_field.value/]" value2="[n.current_user.user_email/]">  
                    <then>true<n.break/></then>  
                </n.if.equal>              
            </n.loop.>  
        </n.set_var.>  
        <n.if.is_empty.remove_spaces.var name="in_members">  
            <then.throw_template_exception name="user_is_not_member" />  
        </n.if.is_empty.remove_spaces.var>  
    </n.users_in_group.>  

Thanks,
Coleen
Reply | Threaded
Open this post in threaded view
|

Re: Registration check case sensitive - how to change?

Pedro
Please, try to use "to_lower_case":
<n.if.equal value1="[n.to_lower_case.email_field.value/]" value2="[n.to_lower_case.current_user.user_email/]">
My test forum.
Reply | Threaded
Open this post in threaded view
|

Re: Registration check case sensitive - how to change?

Coleen_Astalos
That works.
Thanks,
Coleen