steveosoule
11/5/2015 - 8:25 PM

Miva - Force Customer Login

Miva - Force Customer Login

<!DOCTYPE html>
<html lang="en" class="no-js" xmlns:fb="http://ogp.me/ns/fb#">

<mvt:if expr="NOT g.Basket:cust_id">
	<mvt:if expr="NOT(l.settings:page:code CIN 'LOGN,LOGOUT,GFTL,ORDL,WLGN') AND g.Action NE 'CSTR'">
		<mvt:assign name="l.header" value="miva_output_header( 'Status', '302 Found' )" />
		<mvt:if expr="g.Secure">
			<mvt:assign name="g.protocol" value="'https:'" />
		<mvt:else>
			<mvt:assign name="g.protocol" value="'http:'" />
		</mvt:if>
		<mvt:assign name="g.current_url" value="g.protocol $ '//' $ g.domain:name $ s.request_uri" />
		<mvt:assign name="l.header" value="miva_output_header( 'Location', l.settings:urls:logn:secure_sep $ 'redirect_to=' $ encodeentities( g.current_url )  )" />
	</mvt:if>
	<mvt:exit/>
</mvt:if>

<mvt:if expr="g.Basket:cust_id AND g.Action EQ 'CPWD' AND NOT (l.settings:messages:error_message_count GT 0)">
	<mvt:item name="customfields" param="Write_Customer_ID(g.Basket:cust_id, 'password_has_reset', 'Yes')" />
	<mvt:assign name="l.header" value="miva_output_header( 'Status', '302 Found' )" />
	<mvt:assign name="l.header" value="miva_output_header( 'Location', l.settings:urls:sfnt:auto )" />
</mvt:if>

<mvt:if expr="l.settings:page:code NE 'CPWD'">
	<mvt:item name="customfields" param="Read_Customer_ID(g.Basket:cust_id, 'password_has_reset', l.settings:customer:cf:password_has_reset)" />
	<mvt:if expr="ISNULL l.settings:customer:cf:password_has_reset OR l.settings:customer:cf:password_has_reset EQ 'No' OR NOT l.settings:customer:cf:password_has_reset">
		<mvt:assign name="l.header" value="miva_output_header( 'Status', '302 Found' )" />
		<mvt:assign name="l.header" value="miva_output_header( 'Location', l.settings:urls:CPWD:auto )" />
	</mvt:if>
</mvt:if>

<mvt:if expr="g.Basket:cust_id AND g.Action EQ 'LOGN' AND l.settings:customer:cf:password_has_reset">
	<mvt:assign name="l.header" value="miva_output_header( 'Status', '302 Found' )" />
	<mvt:if expr="g.redirect_to">
		<mvt:assign name="l.header" value="miva_output_header( 'Location', g.redirect_to )" />
	<mvt:else>
		<mvt:assign name="l.header" value="miva_output_header( 'Location', l.settings:urls:sfnt:auto )" />
	</mvt:if>
</mvt:if>