<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Q &#187; Miva</title>
	<atom:link href="http://www.mc2design.com/blog/category/miva/feed" rel="self" type="application/rss+xml" />
	<link>http://www.mc2design.com/blog</link>
	<description>Web development and marketing from the squares at MC² Design Group</description>
	<lastBuildDate>Tue, 16 Feb 2010 22:53:36 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Detecting if user is logged in with Miva Store&#160;Morph</title>
		<link>http://www.mc2design.com/blog/detecting-if-user-is-logged-in-with-miva-store-morph</link>
		<comments>http://www.mc2design.com/blog/detecting-if-user-is-logged-in-with-miva-store-morph#comments</comments>
		<pubDate>Wed, 30 Apr 2008 23:31:33 +0000</pubDate>
		<dc:creator>Luke Visinoni</dc:creator>
				<category><![CDATA[Miva]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.mc2design.com/blog/?p=133</guid>
		<description><![CDATA[As I was working on a Miva Merchant store today, I needed to show the user a link, but only if they were currently logged in. I know I have done this before, but I couldn&#8217;t find the code for the life of me. So I went to trusty ol&#8217; Google and typed in &#8220;Miva [...]]]></description>
			<content:encoded><![CDATA[<p>As I was working on a Miva Merchant store today, I needed to show the user a link, but only if they were currently logged in. I know I have done this before, but I couldn&#8217;t find the code for the life of me. So I went to trusty ol&#8217; Google and typed in &#8220;Miva Merchant detect if user logged in&#8221; and several other terms only to come up with nothing. So I dug through several other Merchant sites to find the code. I finally found it and have decided to post it here in case somebody else has the same&nbsp;problem.</p>
<p class="update">UPDATE: Apparently you need to check that g.Basket:CUST_ID is not equal to zero. At first my solution only checked that it wasn&#8217;t null which was flawed.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mvt:if</span> <span style="color: #000066;">expr</span>=<span style="color: #ff0000;">&quot;NOT ISNULL g.Basket:CUST_ID AND g.Basket:CUST_ID NE 0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    Welcome back, <span style="color: #ddbb00;">&amp;mvte:global:customer:login;</span>!
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mvt:else<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    Hello anonymous user!
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/mvt:if<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.mc2design.com/blog/detecting-if-user-is-logged-in-with-miva-store-morph/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Back to the Future &#8211; Miva Merchant Conference&#160;2008</title>
		<link>http://www.mc2design.com/blog/back-future-miva-conference-2008</link>
		<comments>http://www.mc2design.com/blog/back-future-miva-conference-2008#comments</comments>
		<pubDate>Thu, 06 Mar 2008 05:53:07 +0000</pubDate>
		<dc:creator>Luke Visinoni</dc:creator>
				<category><![CDATA[Client News]]></category>
		<category><![CDATA[Miva]]></category>

		<guid isPermaLink="false">http://www.mc2design.com/blog/back-future-miva-conference-2008</guid>
		<description><![CDATA[The theme of this year&#8217;s Miva Merchant conference, while somewhat cheesy, couldn&#8217;t have been more appropriate. Less than six months ago, we were seriously considering finding another e-commerce platform. Just to give you an idea of how big of a deal that is, MC2 has been working with Miva Merchant since 1998. For those of [...]]]></description>
			<content:encoded><![CDATA[<p>The theme of <a href="http://smallbusiness.miva.com/conference_2008/">this year&#8217;s Miva Merchant conference</a>, while somewhat cheesy, couldn&#8217;t have been more appropriate. Less than six months ago, we were seriously considering finding another e-commerce platform. Just to give you an idea of how big of a deal that is, MC2 has been working with Miva Merchant since 1998. For those of you who are mathematically challenged, that&#8217;s ten years! In computer years, that is a&nbsp;lifetime.</p>
<p><a href="http://www.mc2design.com/blog/wp-content/uploads/2008/03/digitalcameraphotos-archive.jpg" title="Conference Room" class="thickbox"><img src="http://www.mc2design.com/blog/wp-content/uploads/2008/03/room.jpg" alt="Conference Room Thumbnail" class="bordered" align="right"&nbsp;/></a></p>
<h3>Back&#8230;</h3>
<p>To explain why &#8220;Back to the Future&#8221; was such an appropriate theme for the conference, let me give you some background. For those of you who aren&#8217;t aware, FindWhat.com, a search-marketing focused company, purchased Miva Merchant in 2004. They made a few good moves at first, acquiring MVCool and re-branding it as <a href="http://www.mivacentral.com">MivaCentral</a> as well as releasing Miva Merchant 5, but for the next few years they seemed to basically run Merchant into the ground. They alienated module developers, outsourced support, and almost destroyed the community that made it such a success in the first&nbsp;place.</p>
<h3>&#8230;to the&nbsp;Future</h3>
<p>In August of 2007, it was announced that <a href="http://www.mivamerchant.com/company/press/release.mv?Release_ID=95">Miva Merchant had been purchased</a> from FindWhat.com (now <a href="http://www.miva.com">Miva, Inc</a>) by several of the management team who had worked so hard to make the product a success in the past. Within a month, the new team managed to <a href="http://www.mivamerchant.com/company/press/release.mv?Release_ID=96">bring tech support back in-house</a> and drop-kicked the <a href="http://extranet.miva.com/forums/showthread.php?t=8369" showthread.php?t="8369"">ridiculous outsourced design services</a> that had pissed off the community so&nbsp;much.</p>
<h3>The conference? I&#8217;m getting to&nbsp;it!</h3>
<p>My cohort and I arrived in San Diego Thursday night after a whopping hour on a Southwest flight from Sacramento. After getting our rental car and checking in to the hotel, we headed down to the beach and hung out just long enough for me decide we need to open an <em>MC2 Design, San Diego division</em> and then were off to Thursday night&#8217;s mixer where we were given not only a whole <a href="http://www.websyourway.com/memories/mixer0208/DSC_0164">bag of schwag</a>, but also free beer and a chance to meet the infamous <a href="http://www.websyourway.com/memories/mixer0208/DSC_0210">Baron&nbsp;Bob</a>.</p>
<p><span&nbsp;id="more-109"></span></p>
<p>Basically everything I went to the conference to hear was revealed in Rick Wilson&#8217;s keynote on Friday morning. During the keynote, Rick revealed Merchant 5.5 and I think you&#8217;d be hard pressed to find anybody who attended who wasn&#8217;t completely blown away. I&#8217;d just like to go over a few of the features that were revealed in&nbsp;5.5.</p>
<ul>
<li><strong>Skins</strong> &#8211; Easily one of the coolest new features in 5.5 is the skins system. What it does is allow you to completely change the look and feel of your Merchant store with the click of a button. If you are familiar with Wordpress, Miva&#8217;s skin system is similar. We will be making heavy use of this feature.</li>
<li><strong>Dreamweaver integration</strong> &#8211; Dreamweaver integration was promised years ago, but it looks like they finally pulled it off. The way this works, is you export the pages you&#8217;d like to edit and simply open them up in Dreamweaver. From here you can edit Merchant&#8217;s templates as if they were simply html documents. In order for this to work you will need to download a free Dreamweaver extension that will be made available via Merchant&#8217;s website.</li>
<li><strong>Completely re-designed interface</strong> &#8211; The new interface is wonderful. The first impression I had of Miva Merchant was not good and I have to say one of the main reasons was the interface looked like it came from 1992.</li>
<li><strong>Built-in SEO features</strong> &#8211; In the past it has only been possible to customize Merchant&#8217;s URLs by manually creating a mod_rewrite file. The new version has this built right into the admin interface</li>
<li><strong>No more black boxes</strong> &#8211; Every piece of html / smt template code in Merchant 5.5 is editable through the interface.</li>
<li><strong>Full CSS support</strong> &#8211; The new version comes with a completely css-based skin and the layout is based on divs instead of tables.</li>
<li><strong>Simple administration mode has been removed</strong> &#8211; Simple administration mode was the stupidest feature available and it was on by default. In fact, advanced administration mode is a lot simpler than simple administration mode. It has been completely removed from Merchant 5.5.</li>
<li><strong>One-page checkout</strong> &#8211; That&#8217;s right. One page checkout is built-in in Merchant 5.5. It is not manditory, but it&#8217;s available. I can&#8217;t recall if this is a &#8220;coming soon&#8221; feature or if it is already implemented</li>
<li><strong>Configurable error pages</strong> &#8211; All error pages in Merchant 5.5 are completely customizeable</li>
<li><strong>Unnecessary whitespace removed</strong> &#8211; If you have worked with Merchant before, I&#8217;m sure you are aware of the fifteen or twenty blank lines that are output before any html on every page. While this doesn&#8217;t actually make any difference, it is an annoyance I&#8217;m happy that I no longer have to deal with.</li>
</ul>
<p>What is really impressive about all these features is that they were able to pull them off without breaking a single thing. Merchant will be a streamed update and it will not have any effect (other than the updates) on your extisting&nbsp;store(s).</p>
<p><a href="http://www.mc2design.com/blog/wp-content/uploads/2008/03/digitalcameraphotos-archive030608-302.jpg" title="Michael with Rick Wilson"><img src="http://www.mc2design.com/blog/wp-content/uploads/2008/03/michael-and-rick-thumb.jpg" alt="Michael with Rick Wilson" class="bordered" align="right"&nbsp;/></a></p>
<p>Just to be honest, once I was told they&#8217;d be <a href="http://smallbusiness.miva.com/conference_2008/presentations.html">posting slides online</a>, I stopped taking notes. I know there are other features, but I can&#8217;t be sure if they&#8217;re on the way or if they are included in 5.5. I&#8217;ve told you the best of it anyway. I&#8217;ll post links to the slides when they are available. Also, as soon as Michael gets me the photos took of us at the conference, I&#8217;ll post those as&nbsp;well.</p>
<p>I&#8217;d go into detail about the conference sessions, but honestly they were a little lacking. Fortunately the news of Merchant 5.5 as well as the extremely positive experience I had with the new owners were enough to make up for it. The photo to the right is new Executive Vice President, Rick Wilson with Michael. I missed out on getting my photo taken with them because I was discussing code with the dotComHost guys. There is photo of us with those guys on the&nbsp;way.</p>
<p>One small disappointment is that Merchant 5.5 was not released on the day of the conference as was expected, but this is actually a good thing. The new owners decided they weren&#8217;t going to release the new version until it has been thoroughly beta tested and documented. These are two things past versions really could have done a better job of, so it&#8217;s good to see them learning from their&nbsp;mistakes.</p>
<p>Leslie Nord of <a href="http://www.emediasales.com/" rel="external">eMediaSales</a> has posted tons of <a href="http://www.websyourway.com/memories/MM08">photos of the event</a>, so go check &#8216;em&nbsp;out!</p>
<p>UPDATE: Pamela Hazelton of <a href="http://www.designextend.com">Design Extend</a> has written an article along the same theme as this one, only better. <img src='http://www.mc2design.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  <a href="http://www.practicalecommerce.com/blogs/mistakes-that-kill/archives/42">Check it&nbsp;out.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mc2design.com/blog/back-future-miva-conference-2008/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>MC2 Development Team Attends MIVA Conference&#160;2008</title>
		<link>http://www.mc2design.com/blog/mc2-development-team-attends-miva-conference-2008</link>
		<comments>http://www.mc2design.com/blog/mc2-development-team-attends-miva-conference-2008#comments</comments>
		<pubDate>Sun, 02 Mar 2008 18:49:45 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Industry News]]></category>
		<category><![CDATA[Miva]]></category>
		<category><![CDATA[Press]]></category>

		<guid isPermaLink="false">http://www.mc2design.com/blog/mc2-development-team-attends-miva-conference-2008</guid>
		<description><![CDATA[MC2 Design&#8217;s development team attended the MIVA Merchant 2008 Conference in San Diego, California, held at the Marina Village Conference Centers on Feb 28,29 and March 1st. MIVA Merchant announced exciting new features with its pending release of version 5.5, which released in Beta March 2nd and is slated for streamed release as an upgrade [...]]]></description>
			<content:encoded><![CDATA[<p>MC2 Design&#8217;s development team attended the MIVA Merchant 2008 Conference in San Diego, California, held at the Marina Village Conference Centers on Feb 28,29 and March 1st. MIVA Merchant announced exciting new features with its pending release of version 5.5, which released in Beta March 2nd and is slated for streamed release as an upgrade from 5.0, early to mid April 2008. MC2 came away from the event very encouraged about the vision and future of Miva Merchant as an enterprise level application. The management team of MIVA Merchant provided a very informative, approachable experience, letting merchants, developers, and designers know that they are here to stay.  For additional information on this conference and version 5.5 see <a href="http://www.mc2design.com/blog/back-future-miva-conference-2008">this&nbsp;article</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mc2design.com/blog/mc2-development-team-attends-miva-conference-2008/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating &#8220;zebra-striping&#8221; with Miva&#8217;s &#8220;Store-morph&#8221; template&#160;system</title>
		<link>http://www.mc2design.com/blog/zebra-striping-miva-smt-templates</link>
		<comments>http://www.mc2design.com/blog/zebra-striping-miva-smt-templates#comments</comments>
		<pubDate>Tue, 18 Sep 2007 17:37:27 +0000</pubDate>
		<dc:creator>Luke Visinoni</dc:creator>
				<category><![CDATA[Miva]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.mc2design.com/blog/zebra-striping-miva-smt-templates</guid>
		<description><![CDATA[The technique of &#8220;zebra-striping&#8221; tables and other data-centric html elements has been around for a long time. It is an easy way to make mundane, hard-to-read elements pretty and readable. You can see an example of this technique below. Notice how each row is a difference color? This is what is referred to as &#8220;zebra-striping&#8221;.

There [...]]]></description>
			<content:encoded><![CDATA[<p>The technique of &#8220;zebra-striping&#8221; tables and other data-centric html elements has been around for a long time. It is an easy way to make mundane, hard-to-read elements pretty and readable. You can see an example of this technique below. Notice how each row is a difference color? This is what is referred to as &#8220;zebra-striping&#8221;.<br />
<img src='http://www.mc2design.com/blog/wp-content/uploads/2007/09/zebra-striping-table.gif' alt='Zebra-Striping' align="right" class="bordered" /><br />
There has been many times I&#8217;ve wished to get this effect within <a href="http://smallbusiness.miva.com">Miva Merchant 5</a>. Luckily, Merchant&#8217;s SMT template system or &#8220;store-morph&#8221; technology allows for this. In fact, it&#8217;s pretty simple. </p>
<p>&nbsp;</p>
<p><span id="more-71"></span><br />
According to <a href="http://docs.smallbusiness.miva.com/en-US/merchant/5/webhelp/Store_Morph_Technology_(SMT)_-_Working_with_Page_Templates.htm">Miva&#8217;s &#8220;store-morph&#8221; documentation</a>:</p>
<blockquote cite="http://docs.smallbusiness.miva.com/en-US/merchant/5/webhelp/Store_Morph_Technology_(SMT)_-_Working_with_Page_Templates.htm"><p>When stepping through an array, in a foreach loop, the current position in the array is given by the pos1&nbsp;variable.</p></blockquote>
<p>With this information, we simply use the <a href="http://en.wikipedia.org/wiki/Modulo_operation">modulo operator</a> while we&#8217;re stepping through an array to decide whether or not we&#8217;re on an even&nbsp;row.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;table</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;basket&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mvt:foreach</span> <span style="color: #000066;">iterator</span>=<span style="color: #ff0000;">&quot;item&quot;</span> <span style="color: #000066;">array</span>=<span style="color: #ff0000;">&quot;basket:items&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
   <span style="color: #808080; font-style: italic;">&lt;!-- if pos1 MOD 2 = 0, then this is an even row because pos1 is divisable by two with no remainder --&gt;</span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mvt:if</span> <span style="color: #000066;">expr</span>=<span style="color: #ff0000;">&quot;(pos1 MOD 2 ) EQ 0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;tr</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;even&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mvt:else<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #808080; font-style: italic;">&lt;!-- otherwise it's an odd row --&gt;</span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;tr</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;odd&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/mvt:if<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;td<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><span style="color: #ddbb00;">&amp;mvt:item:name;</span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/td<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;td<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><span style="color: #ddbb00;">&amp;mvt:item:price;</span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/td<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/tr<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/mvt:foreach<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Now all that&#8217;s left to do is style the rows with&nbsp;css:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#basket</span> tr<span style="color: #6666ff;">.even</span> <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#eee</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#basket</span> tr<span style="color: #6666ff;">.odd</span> <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#ddd</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Any&nbsp;questions?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mc2design.com/blog/zebra-striping-miva-smt-templates/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Miva Small Business Solutions has been bought&#160;out</title>
		<link>http://www.mc2design.com/blog/miva-small-business-solutions-has-been-acquired</link>
		<comments>http://www.mc2design.com/blog/miva-small-business-solutions-has-been-acquired#comments</comments>
		<pubDate>Wed, 08 Aug 2007 00:11:42 +0000</pubDate>
		<dc:creator>Luke Visinoni</dc:creator>
				<category><![CDATA[Industry News]]></category>
		<category><![CDATA[Miva]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.mc2design.com/blog/miva-small-business-solutions-has-been-acquired</guid>
		<description><![CDATA[Miva Small Business Solutions, creator of Miva Merchant announced on Monday that they have been purchased by a former Miva Small Business management team led by Russell Carroll.

To quote the press release:
Miva Small Business Solutions has been purchased from Miva, Inc. by a management team lead by Russell Carroll, who will serve as new CEO [...]]]></description>
			<content:encoded><![CDATA[<p>Miva Small Business Solutions, creator of Miva Merchant announced on Monday that they have been purchased by a former Miva Small Business management team led by Russell Carroll.<br />
<span id="more-57"></span><br />
To quote the press release:</p>
<blockquote><p>Miva Small Business Solutions has been purchased from Miva, Inc. by a management team lead by Russell Carroll, who will serve as new CEO for the enterprise, and former Miva executive Rick Wilson, its new Executive Vice President. Rounding out the team are Mark Johnson, VP of Development, and David Roquemore, VP of&nbsp;Technology.</p>
<p>Russ Carroll stated “Our entire focus will be on improving our customers’ experience by concentrating on our core products, enhancing our hosting partner relationships, and supporting our&nbsp;developers.”</p>
<p>Executive VP Rick Wilson added, “As an example of our customer-centered focus, we will be transferring support in-house as quickly as possible. This will dramatically improve service levels as well as strengthen the feedback mechanism from our client&nbsp;base.”</p></blockquote>
<p>This is excellent news for the Miva community. There has been a lot of speculation lately about the possibility of the company going under or being bought out. The fact that it was bought out by a team that knows the product and the company is an excellent sign and shows that they see value in the product and the&nbsp;userbase.</p>
<p>Right away we&#8217;re seeing big changes, as today they announced they are bringing their customer support back in-house after outsourcing it to who-knows-where for the past year or&nbsp;so.</p>
<p>According to support manager, Wayne&nbsp;Smith:</p>
<blockquote><p>Building our customers trust in the quality of our product support is my single objective here at Miva Small Business. We&#8217;re focused not just on providing support but providing the most competent support for our products possible. Please bear with us as we complete building the team back home in San Diego. While we might have to schedule callbacks with our customers during peak hours, the tradeoff for excellent support is an easy&nbsp;choice.</p></blockquote>
<p>Read the entire <a href="http://smallbusiness.miva.com/company/press/release.mv?Release_ID=95">press&nbsp;release</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mc2design.com/blog/miva-small-business-solutions-has-been-acquired/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A little advice for Miva Merchant module&#160;developers</title>
		<link>http://www.mc2design.com/blog/a-little-advice-for-miva-merchand-module-developers</link>
		<comments>http://www.mc2design.com/blog/a-little-advice-for-miva-merchand-module-developers#comments</comments>
		<pubDate>Thu, 02 Aug 2007 00:08:48 +0000</pubDate>
		<dc:creator>Luke Visinoni</dc:creator>
				<category><![CDATA[Miva]]></category>
		<category><![CDATA[Rants, Raves & Crazy Things]]></category>

		<guid isPermaLink="false">http://www.mc2design.com/blog/a-little-advice-for-miva-merchand-module-developers</guid>
		<description><![CDATA[I would just like to take a moment to point out a few of the things that drive me insane about Miva Merchant modules. If you are a Miva developer, please take&#160;note.

Let me write my own&#160;HTML
It&#8217;s bad enough the Miva Merchant itself doesn&#8217;t allow me 100% control over my HTML without module developers doing the [...]]]></description>
			<content:encoded><![CDATA[<p>I would just like to take a moment to point out a few of the things that drive me insane about <a href="http://smallbusiness.miva.com" rel="nofollow">Miva Merchant</a> modules. If you are a Miva developer, please take&nbsp;note.</p>
<p><span&nbsp;id="more-41"></span></p>
<h3>Let me write my own&nbsp;HTML</h3>
<p>It&#8217;s bad enough the Miva Merchant itself doesn&#8217;t allow me 100% control over my HTML without module developers doing the same thing to me. Miva and its third party module developers have proven time and time again that they are completely incapable of writing HTML from this decade. I am thoroughly sick of seeing tag soup like the following when I render a Miva module&nbsp;component.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;BR&gt;&lt;TABLE border=0 cellspacing=0 cellpadding=0 nowrap&gt;
&lt;TR&gt;
&lt;FORM METHOD=POST ACTION=&quot;http://www.example.com/shop&quot; name=&quot;ch&quot;&gt;
&lt;input type=&quot;hidden&quot; name=&quot;Screen&quot; value=&quot;OINF&quot;&gt;
&lt;input type=&quot;hidden&quot; name=&quot;Store_Code&quot; value=&quot;EX&quot;&gt;
&lt;TD&gt;
&lt;INPUT CLASS=&quot;ch_text&quot; TYPE=&quot;submit&quot; value=&quot;Checkout&quot;&gt;
&lt;/TD&gt;
&lt;/FORM&gt;
&lt;/TR&gt;
&nbsp;
&lt;/TABLE&gt;
&lt;BR&gt;&lt;BR&gt;
&lt;TABLE border=0 cellspacing=0 cellpadding=0&gt;
&lt;TR&gt;
&lt;FORM METHOD=POST ACTION=&quot;http://www.example.com/shop&quot; name=&quot;cs&quot;&gt;
&lt;input type=&quot;hidden&quot; name=&quot;Screen&quot; value=&quot;PROD&quot;&gt;
&lt;input type=&quot;hidden&quot; name=&quot;Store_Code&quot; value=&quot;EX&quot;&gt;
&lt;input type=&quot;hidden&quot; name=&quot;Product_Code&quot; value=&quot;1501T&quot;&gt;
&lt;input type=&quot;hidden&quot; name=&quot;Category_Code&quot; value=&quot;women&quot;&gt;
&lt;input type=&quot;hidden&quot; name=&quot;Search&quot; value=&quot;&quot;&gt;
&lt;input type=&quot;hidden&quot; name=&quot;Offset&quot; value=&quot;0&quot;&gt;
&lt;TD&gt;
&lt;INPUT CLASS=&quot;cs_text&quot; TYPE=&quot;submit&quot; value=&quot;Continue Shopping&quot;&gt;
&lt;/TD&gt;
&lt;/FORM&gt;
&lt;/TR&gt;
&nbsp;
&lt;/TABLE&gt;</pre></div></div>

<p>Not only does code like this make it impossible for me to have a w3c-compliant website, it also limits me in many ways. What if I don&#8217;t want to post to the page you have so boldly assumed I wanted to post to? Now I have to get another third party module just to fix the mess you made for me. What if I don&#8217;t want some of the input elements you have forced me to use? In this case, I&#8217;m just plain screwed. If your module needs to render HTML code, let the developer have access to this&nbsp;code.</p>
<h3>When developing modules for version 5 or higher, use the template system that is already in&nbsp;place</h3>
<p>Don&#8217;t provide me with some archaic, proprietary &#8220;token&#8221; system. There is a half-way decent template system in place in Merchant version 5 (or higher) for you to use, so why reinvent the wheel with your own, less flexible system? I realize that some of this is just left over from version 4 modules, but if you&#8217;re going to develop modules, there&#8217;s no reason you can&#8217;t update the template system, which brings me to my next&nbsp;point.</p>
<h3>Update your&nbsp;modules!!</h3>
<p>There are so many module developers out there who create a module and never address it again. There are several modules that were created for version 4 of Merchant that still (it&#8217;s been about 2 years) have not made the port to version 5 (attribute upload anyone?). Why is this? It can&#8217;t be that difficult to update your&nbsp;modules.</p>
<h3>Don&#8217;t require javascript for your module to work&nbsp;properly</h3>
<p>There is absolutely no reason for you to require that javascript be enabled for me to use your backend module. Now, I can understand the requirement of javascript in the case of something built for the front end, but even in this case, the javascript should be loosely coupled enough that it isn&#8217;t really required. Take for instance the <a href="http://jquery.com/demo/thickbox/">thickbox</a> component we use on several of our ecommerce sites. If javascript is enabled, it allows for a very nice modal-like experience when you want to see an enlarged photo of a product, otherwise, it just takes you to the larger image via http (view in&nbsp;browser).</p>
<h3>Gee, your module is very useful, but the interface looks like&nbsp;hell</h3>
<p>This is the most common thing I see in not only modules, but Merchant itself. Merchant&#8217;s backend is hideous, and to go along with it, so are just about all module interfaces. Is it a requirement to create ugly interfaces in the Miva community?&nbsp;</p>
<p>Well, that&#8217;s my list. What irritates you most about Miva&nbsp;modules?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mc2design.com/blog/a-little-advice-for-miva-merchand-module-developers/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Cross-site scripting precautions within Miva SMT&#160;templates</title>
		<link>http://www.mc2design.com/blog/cross-site-scripting-precautions-within-miva-smt-templates</link>
		<comments>http://www.mc2design.com/blog/cross-site-scripting-precautions-within-miva-smt-templates#comments</comments>
		<pubDate>Thu, 14 Jun 2007 21:00:18 +0000</pubDate>
		<dc:creator>Luke Visinoni</dc:creator>
				<category><![CDATA[Miva]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.mc2design.com/blog/how-to-prevent-xss-attacks-within-miva-smt-templates</guid>
		<description><![CDATA[As I&#8217;ve grown familiar with Miva Merchant, I&#8217;ve become very wary of Miva SMT entities. SMT entities are basically to Miva Merchant what variables are to any other language. If you have developed anything in PHP, you are likely aware of the security implications of having register_globals turned on. In Miva Merchant, the same sort [...]]]></description>
			<content:encoded><![CDATA[<p>As I&#8217;ve grown familiar with <a href="http://www.smallbusiness.miva.com">Miva Merchant</a>, I&#8217;ve become very wary of Miva <abbr title="store morph technology">SMT</abbr> entities. <abbr title="store morph technology">SMT</abbr> entities are basically to Miva Merchant what variables are to any other language. If you have developed anything in <abbr title="PHP: Hypertext Preprocessor">PHP</abbr>, you are likely aware of the <a href="http://www.php.net/register_globals">security implications of having register_globals turned on</a>. In Miva Merchant, the same sort of implications exist because Miva Merchant converts all CGI environment variables into <abbr title="store morph technology">SMT</abbr> entities (variables) upon startup.<br />
<span id="more-10"></span></p>
<blockquote cite="http://smallbusiness.miva.com/support/docs/ScriptGuide_html/ScriptGuide.html#495336"><p>All available CGI environment variables are automatically converted into static MIVA Script system variables upon start-up. All HTTP headers are saved in environment variables and therefore are also converted to MIVA Script static&nbsp;variables.</p></blockquote>
<h3>So why is that&nbsp;bad?</h3>
<p>The problem is that many of the CGI environment variables come directly from the user, meaning if you use them incorrectly or carelessly, you open yourself up to all kinds of malicious attacks. One such attack is called a <a href="http://en.wikipedia.org/wiki/Cross-site_scripting" class="popup">cross site scripting</a> or <abbr title="Cross site scripting">XSS</abbr> attack (a form of script/code injection). This type of attack is very common, and you would be surprised just how many sites leave themselves vulnerable to&nbsp;it.</p>
<p>A website is vulnerable to <abbr title="Cross site scripting">XSS</abbr> attacks if it accepts input from the user (this can be through the url, through a form, etc.) and then outputs it unchecked and unmodified. For example, on a search form, generally a web developer will repopulate the search textbox with the term the user searched for. Something like the&nbsp;following:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"> <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mvt:if</span> <span style="color: #000066;">expr</span>=<span style="color: #ff0000;">&quot;NOT ISNULL g.search&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h1<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Product Search<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/h1<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;form</span> <span style="color: #000066;">method</span>=<span style="color: #ff0000;">&quot;get&quot;</span> <span style="color: #000066;">action</span>=<span style="color: #ff0000;">&quot;&amp;mvt:global:sessionurl;&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span> 
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;label<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
     Search For The Following Word(s):
     <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;input</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;search&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;&amp;mvt:global:search;&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/label<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;input</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;Go&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;submit&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/form<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/mvt:if<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>With that code, user input is outputted to the html page, completely unchecked and unmodified. This means that a malicious user (let&#8217;s call her Mallory) could inject html code into your script (since she is allowed to enter characters such as &lt; and &gt;). If Mallory can inject html code into your script, I wonder what else she could inject in there. What if she entered something like the&nbsp;following?</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">&quot; /&gt;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;script<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>alert('Insert Malicious Javascript Here');<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/script<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;input</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;hidden&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;irrelevant&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;</span></span></pre></div></div>

<p>With our existing template code, that would result in the following <abbr title="hypertext markup language">html</abbr> being output to the&nbsp;browser:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h1<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Product Search<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/h1<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;form</span> <span style="color: #000066;">method</span>=<span style="color: #ff0000;">&quot;get&quot;</span> <span style="color: #000066;">action</span>=<span style="color: #ff0000;">&quot;http://www.example.com&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span> 
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;label<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
     Search For The Following Word(s):
     <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;input</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;search&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;script<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>alert('Insert Malicious Javascript Here');<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/script<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;input</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;hidden&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;irrelevant&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/label<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;input</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;Go&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;submit&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/form<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Now, because Miva Merchant converts all environment variables to <abbr title="store morph technology">SMT</abbr> entities, whether they came from a form via <a href="http://en.wikipedia.org/wiki/Http#Request_methods">POST</a> or from the url (via <a href="http://en.wikipedia.org/wiki/Http#Request_methods">GET</a>), Mallory can attach her malicious javascript code to the end of a URL and trick some unsuspecting victim (we&#8217;ll call him Adam) into clicking on it (perhaps through an email forged to look like it came from your website). Adam clicks on the link, and logs in, and now Mallory&#8217;s malicious script has access to Adam&#8217;s session and therefor, Adam&#8217;s account&nbsp;information.</p>
<h3>Preventing cross-site&nbsp;scripting</h3>
<p>In many languages, to prevent this sort of attack, you simply escape user-submitted content before outputting it again. This is generally done with some sort of function. For example, in <abbr title="PHP: Hypertext Preprocessor">PHP</abbr> you would use a function such as <a href="http://www.php.net/htmlspecialchars" class="popup">htmlspecialchars</a> or <a href="http://www.php.net/htmlentities" class="popup">htmlentities</a>. This is not necessary in <abbr title="store morph technology">SMT</abbr> templates, because Miva has taken the liberty of providing 3 versions of every one of these variables for&nbsp;you.</p>
<p><strong>From Miva&#8217;s&nbsp;documentation:</strong></p>
<blockquote cite="http://docs.smallbusiness.miva.com/en-US/merchant/5/webhelp/store_morph_technology_%28smt%29_-_working_with_page_templates.htm"><p>Entities start with &#038;mvt, and can have an optional additional character, either an e, or a, for entity encoding or attribute encoding,&nbsp;respectively.</p>
<p>Entities beginning with &#038;mvt are replaced directly in the HTML code with the information they represent. So in bgcolor=&#8221;&#038;mvt:colors:lhdr_bg;&#8221;, the entity would be replaced with the actual list header color number in hex, giving&nbsp;bgcolor=&#8221;#000080&#8243;.</p>
<p>Entities beginning with &#038;mvte are &#8220;entity encoded&#8221;. Their values will be formatted to appear on the screen, with any special characters being displayed verbatim (&#8220;as is&#8221;), rather than being interpreted according to their special meaning. If the entity you want to display includes the &#8220;&lt;&#8221; character (&#8220;less-than&#8221; sign), entity encoding will cause that character to appear, unchanged, on the screen, rather than being interpreted as the beginning of an HTML&nbsp;tag.</p></blockquote>
<p>So, to sum up the documentation, if you are going to be outputting any kind of variable to the screen, you would use the &#038;mvte prefix. This way, special characters such as &lt; and &gt; would be escaped, so the user cannot inject scripts into your code. So now, let&#8217;s adjust our code from up above so that it is no longer an <abbr title="cross-site scripting">XSS</abbr> vulnerability. To do that, we simply change the entity prefix from &#038;mvt to &#038;mvte. Pretty&nbsp;painless!</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"> <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mvt:if</span> <span style="color: #000066;">expr</span>=<span style="color: #ff0000;">&quot;NOT ISNULL g.search&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h1<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Product Search<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/h1<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
   <span style="color: #808080; font-style: italic;">&lt;!-- this variable does not need to be escaped --&gt;</span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;form</span> <span style="color: #000066;">method</span>=<span style="color: #ff0000;">&quot;get&quot;</span> <span style="color: #000066;">action</span>=<span style="color: #ff0000;">&quot;&amp;mvt:global:sessionurl;&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span> 
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;label<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
     Search For The Following Word(s):
     <span style="color: #808080; font-style: italic;">&lt;!-- this user-supplied variable does --&gt;</span>
     <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;input</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;search&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;&amp;mvte:global:search;&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/label<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;input</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;Go&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;submit&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/form<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/mvt:if<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>With this modification, if Mallory were to try the same attack, it would result in the following (completely harmless) <abbr title="hypertext markup language">html</abbr> being output to the&nbsp;browser.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h1<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Product Search<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/h1<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;form</span> <span style="color: #000066;">method</span>=<span style="color: #ff0000;">&quot;get&quot;</span> <span style="color: #000066;">action</span>=<span style="color: #ff0000;">&quot;http://www.example.com&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span> 
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;label<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
     Search For The Following Word(s):
     <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;input</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;search&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;&amp;amp;quot; /scriptalert&amp;amp;#40;'Inse&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/label<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;input</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;Go&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;submit&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/form<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Miva also supplies a third version of every <abbr title="store morph technology">SMT</abbr> variable for use in a&nbsp;URL.</p>
<blockquote cite="http://docs.smallbusiness.miva.com/en-US/merchant/5/webhelp/store_morph_technology_%28smt%29_-_working_with_page_templates.htm"><p>Entities beginning with &#038;mvta, are &#8220;attribute encoded&#8221;. That is, their values will be formatted so they can be included in a URL, with any special characters being transformed into characters that can be understood by a web browser. For instance, you have probably seen attribute-encoded characters in URLs, such as space characters that are represented as %20. When a category name, for instance, is to be included in a URL, and may contain characters that would require this special formatting, use&nbsp;&#038;mvta.</p></blockquote>
<h3>Places where you may not suspect you need to use escaped&nbsp;entities</h3>
<p>There are several Miva Merchant modules out there that allow you to assign your own variables within the template. For example, <a href="http://www.emporiumplus.com">Emporium Plus</a>&#8217;s (exremely useful) <a href="http://www.emporiumplus.com/merchant2/merchant.mvc?Screen=PROD<br />
&#038;Store_Code=wcw&#038;Product_Code=1AA00223&#038;Category_Code=">toolkit module</a>. Let&#8217;s say you want some promotional text to be available on several of your miva templates. With the toolkit module, you simply create a variable within your global head tag with the following template item:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mvt:item</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;toolkit&quot;</span> <span style="color: #000066;">param</span>=<span style="color: #ff0000;">&quot;sassign|promotext|One day only! 15 foobars for $1&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></div></div>

<p>Now, you put the &#038;mvt:global:promotext; in your global header, and only the pages with the toolkit item assigned to them will now render this text, right? <strong>WRONG!</strong> Because Miva Merchant converts <i>all</i> environment variables into global <abbr title="Store morph technology">SMT</abbr> entities, your script is now open to <abbr title="Cross-site scripting">XSS</abbr> attacks again. Mallory simply has to craft a link like the following and get Adam to click on&nbsp;it.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">Hello Adam, <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;a</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;http://www.example.com/mm5/merchant.mvc?Screen=ACNT&amp;Store_Code=YOURSTORE&amp;</span>
<span style="color: #009900;">promotext=%3Cscript%3Ealert('malicious%20code');%3C/script%3E&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Log in to your account<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/a<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>?</pre></div></div>

<p>Since you didn&#8217;t assign the toolkit module to the ACNT screen, and you outputted the value of the promotext variable without escaping, your site once again has an XSS&nbsp;vulnerability.</p>
<h3>So, what have we&nbsp;learned?</h3>
<p>First of all, <u>never</u> trust user-submitted data. Secondly, you need to be paranoid about outputting any kind of data, unescaped to the browser. Even if it seems as though it couldn&#8217;t have been tainted by the user, think of it from all&nbsp;angles.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mc2design.com/blog/cross-site-scripting-precautions-within-miva-smt-templates/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
