<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -5,18 +5,22 @@
 
 $urls = array(
     'css'           =&gt; Snap_Request::makeURL(array(
+        'key'   =&gt; SNAP_WI_KEY,
         'mode'  =&gt; 'resource',
         'file'  =&gt; 'css',
         )),
     'css-ie6'       =&gt; Snap_Request::makeURL(array(
+        'key'   =&gt; SNAP_WI_KEY,
         'mode'  =&gt; 'resource',
         'file'  =&gt; 'css-ie6',
         )),
     'css-ie7'       =&gt; Snap_Request::makeURL(array(
+        'key'   =&gt; SNAP_WI_KEY,
         'mode'  =&gt; 'resource',
         'file'  =&gt; 'css-ie7',
         )),
     'js'            =&gt; Snap_Request::makeURL(array(
+        'key'   =&gt; SNAP_WI_KEY,
         'mode'  =&gt; 'resource',
         'file'  =&gt; 'js',
         )),</diff>
      <filename>core/util/webfiles/index.php</filename>
    </modified>
    <modified>
      <diff>@@ -50,16 +50,43 @@ $content_types = array(
 
 $replacements = array(
     'css'       =&gt; array(
-        '{IMG}' =&gt; SNAP_WI_URL_PATH.'?mode=resource&amp;file=',
-        '../../../../assets/skins/sam/sprite.png' =&gt; SNAP_WI_URL_PATH.'?mode=resource&amp;file=sam-assets.png'
+        '{IMG}' =&gt; Snap_Request::makeURL(array(
+            'key'   =&gt; SNAP_WI_KEY,
+            'mode'  =&gt; 'resource',
+            'file'  =&gt; null,
+        )),
+
+        '../../../../assets/skins/sam/sprite.png' =&gt; Snap_Request::makeURL(array(
+            'key'   =&gt; SNAP_WI_KEY,
+            'mode'  =&gt; 'resource',
+            'file'  =&gt; 'sam-assets.png',
+        )),
     ),
     'css-ie6'   =&gt; array(
-        '{IMG}' =&gt; SNAP_WI_URL_PATH.'?mode=resource&amp;file=',
-        '../../../../assets/skins/sam/sprite.png' =&gt; SNAP_WI_URL_PATH.'?mode=resource&amp;file=sam-assets.png'
+        '{IMG}' =&gt; Snap_Request::makeURL(array(
+            'key'   =&gt; SNAP_WI_KEY,
+            'mode'  =&gt; 'resource',
+            'file'  =&gt; null,
+        )),
+
+        '../../../../assets/skins/sam/sprite.png' =&gt; Snap_Request::makeURL(array(
+            'key'   =&gt; SNAP_WI_KEY,
+            'mode'  =&gt; 'resource',
+            'file'  =&gt; 'sam-assets.png',
+        )),
     ),
     'css-ie7'   =&gt; array(
-        '{IMG}' =&gt; SNAP_WI_URL_PATH.'?mode=resource&amp;file=',
-        '../../../../assets/skins/sam/sprite.png' =&gt; SNAP_WI_URL_PATH.'?mode=resource&amp;file=sam-assets.png'
+        '{IMG}' =&gt; Snap_Request::makeURL(array(
+            'key'   =&gt; SNAP_WI_KEY,
+            'mode'  =&gt; 'resource',
+            'file'  =&gt; null,
+        )),
+
+        '../../../../assets/skins/sam/sprite.png' =&gt; Snap_Request::makeURL(array(
+            'key'   =&gt; SNAP_WI_KEY,
+            'mode'  =&gt; 'resource',
+            'file'  =&gt; 'sam-assets.png',
+        )),
     ),
 );
 </diff>
      <filename>core/util/webfiles/resource.php</filename>
    </modified>
    <modified>
      <diff>@@ -14,10 +14,18 @@ define('SNAP_WI_TEST_PATH', '/path/to/my/tests/');
 // once more without weird script url hackery
 define('SNAP_WI_URL_PATH', 'http://www.example.com/path/to/snaptest_web.dist.php');
 
-// STEP 4: set the matching path Files matching this pattern will be testable
+// STEP 4: Set a key. You only need this if you are putting your
+// tests on a publicly accessible server. This also offers very minimal
+// protection. If you're actually going this far in the protecting bit,
+// it is probably time to read up on .htaccess and possibly write your own
+// web stub to do security.
+// A blank string means no key will be used.
+define('SNAP_WI_KEY', '');
+
+// STEP 5: set the matching path Files matching this pattern will be testable
 define('SNAP_WI_TEST_MATCH', '^.*\.stest\.php$');
 
-// STEP 5: Relax, you're done.
+// STEP 6: Relax, you're done.
 // Go to http://www.example.com/path/to/snaptest_web.dist.php
 
 // --------------------------------------------------------------------------</diff>
      <filename>snaptest_web.dist.php</filename>
    </modified>
    <modified>
      <diff>@@ -15,8 +15,17 @@ require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'constants.php';
 
 $options = Snap_Request::getLongOptions(array(
     'mode'      =&gt; 'index',
+    'key'       =&gt; '',
 ));
 
+if (SNAP_WI_KEY) {
+    if ($options['key'] != SNAP_WI_KEY) {
+        echo &quot;\n&quot;;
+        echo &quot;SnapTest Web Interface: Key Mismatch\n&quot;;
+        exit;
+    }
+}
+
 Snap_Request::setURLBase(SNAP_WI_URL_PATH);
 
 switch ($options['mode']) {</diff>
      <filename>snaptest_webcore.php</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>ebac5f4f75c7ae9660f71f19ad05fbc9b72666d4</id>
    </parent>
  </parents>
  <author>
    <name>Jakob Heuser</name>
    <email>jakob@felocity.org</email>
  </author>
  <url>http://github.com/Jakobo/snaptest/commit/61c9c7c209baf8622266e618755d6c755faf9ddd</url>
  <id>61c9c7c209baf8622266e618755d6c755faf9ddd</id>
  <committed-date>2008-06-09T23:05:29-07:00</committed-date>
  <authored-date>2008-06-09T23:05:29-07:00</authored-date>
  <message>added key support for web interface

Signed-off-by: Jakob Heuser &lt;jakob@felocity.org&gt;</message>
  <tree>a966fe7ed2ca628d965c874ec143252e2f0f364b</tree>
  <committer>
    <name>Jakob Heuser</name>
    <email>jakob@felocity.org</email>
  </committer>
</commit>
