Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save steveosoule/073840e9ee7492252ec41b8a7d8bde88 to your computer and use it in GitHub Desktop.
Save steveosoule/073840e9ee7492252ec41b8a7d8bde88 to your computer and use it in GitHub Desktop.
Miva - Failed ICSQ Redirect to HTTP Referer
<mvt:if expr="g.Session:cache:last_ui_exception EQ 'customer_invalid_addinfo' AND NOT ISNULL s.http_referer">
<mvt:do file="g.Module_Feature_URI_UT" name="l.http_referer_uri" value="URL_To_URI( s.http_referer )" />
<mvt:do file="g.Module_Feature_URI_DB" name="l.uri_found" value="URI_Load_URI( l.http_referer_uri, l.uri )" />
<mvt:if expr="l.uri_found">
<mvt:assign name="l.flags:sep" value="1" />
<mvt:if expr="l.uri:product_id">
<mvt:do file="g.Module_Library_DB" name="l.success" value="Product_Load_ID_Cached( l.uri:product_id, l.product )" />
<mvt:do file="g.Module_Feature_URI_UT" name="l.referer_url" value="Store_Product_URL( l.product, l.flags )" />
<mvt:elseif expr="l.uri:cat_id">
<mvt:do file="g.Module_Library_DB" name="l.success" value="Category_Load_ID_Cached( l.uri:cat_id, l.category )" />
<mvt:do file="g.Module_Feature_URI_UT" name="l.referer_url" value="Store_Category_URL( l.category, l.flags )" />
<mvt:else>
<mvt:do file="g.Module_Feature_URI_UT" name="l.referer_url" value="Store_Page_Code_URL( l.uri:page_code, l.flags )" />
</mvt:if>
<mvt:assign name="l.uri:referer" value="l.referer_url" />
<mvt:if expr="NOT ISNULL l.referer_url">
<mvt:if expr="g.Customer_Login_InUse">
<mvt:assign name="l.customer_invalid_addinfo" value="'Customer_Login_InUse'" />
<mvt:elseif expr="g.Customer_LoginEmail_InUse">
<mvt:assign name="l.customer_invalid_addinfo" value="'Customer_LoginEmail_InUse'" />
<mvt:elseif expr="g.Customer_Password_Invalid">
<mvt:assign name="l.customer_invalid_addinfo" value="'Customer_Password_Invalid&Validation_Message=' $ g.Validation_Message" />
<mvt:elseif expr="g.Customer_VerifyPassword_Invalid">
<mvt:assign name="l.customer_invalid_addinfo" value="'Customer_VerifyPassword_Invalid'" />
</mvt:if>
<mvt:assign name="l.referer_url" value="l.referer_url $ 'customer_invalid_addinfo=' $ l.customer_invalid_addinfo" />
<mvt:do file="g.Module_Feature_TUI_MGR" name="l.success" value="TemplateManager_Output_Header( 'Status', '302 Found' )" />
<mvt:do file="g.Module_Feature_TUI_MGR" name="l.success" value="TemplateManager_Output_Header( 'Location', l.referer_url )" />
</mvt:if>
</mvt:if>
</mvt:if>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment