]> gitweb.fluxo.info Git - semanticscuttle.git/commitdiff
respect $shorturl configuration setting
authorcweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>
Sat, 16 Jan 2010 08:11:39 +0000 (08:11 +0000)
committercweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>
Sat, 16 Jan 2010 08:11:39 +0000 (08:11 +0000)
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@577 b3834d28-1941-0410-a4f8-b48e95affb8f

data/config.default.php
www/go.php

index acbb13964556c916ded8a8be4d874b62b31c409e..69d2c25836fb7d9211b941df40610f5c7fb9b60f 100644 (file)
@@ -394,6 +394,14 @@ $useredir = false;
  */
 $url_redir = 'http://www.google.com/url?sa=D&q=';
 
+/**
+ * Enable short URL service.
+ * Can be used to visit urls using http://example.org/go/shortname
+ *
+ * @var boolean
+ */
+$shorturl = true;
+
 /**
  * Array of bookmark extensions that Scuttle should add system tags for.
  * When adding an URL with one of the given extensions, a system
index d306be0d5121e63ce19b6e63c537f910a4792e5e..9d1a44f3c43d27ed1f0b3719900d79e9e703eb05 100644 (file)
  */
 require_once '../src/SemanticScuttle/header.php';
 
+if (!$GLOBALS['shorturl']) {
+    header('HTTP/1.0 500 Internal Server Error');
+    header('Content-Type: text/plain');
+    echo 'Short URL service deactivated';
+    exit();
+}
+
 if (!isset($_SERVER['PATH_INFO'])) {
     header('HTTP/1.0 400 Bad Request');
     header('Content-Type: text/plain');