From 311ad398e06cd2eba270ea70ca5a326d03b490f9 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 27 Nov 2014 03:09:22 +0100 Subject: linkshorter now works with 2 domains --- linkshorter/index.php | 10 +++++----- linkshorter/robots.txt | 2 ++ linkshorter/view/templ-head.php | 1 + linkshorter/view/templ-index.php | 2 +- linkshorter/view/templ-password.php | 2 +- tools/config.php | 3 +++ tools/navbar.php | 9 +++++---- 7 files changed, 18 insertions(+), 11 deletions(-) create mode 100644 linkshorter/robots.txt create mode 100644 tools/config.php diff --git a/linkshorter/index.php b/linkshorter/index.php index c60bc82..cca4f20 100644 --- a/linkshorter/index.php +++ b/linkshorter/index.php @@ -45,7 +45,7 @@ if ( ! isset($_REQUEST['checkpassword']) || $_REQUEST['checkpassword'] != 1 ) $options["ttl"] = ""; else { if ( ! preg_match( "/^[0-9]+$/", trim($_REQUEST["ttl"]) ) ){ - _do_output("Failure", "Your Lifetime doesn't look like a valid number."); + _do_output("Failure!", "Your Lifetime doesn't look like a valid number."); } $options["ttl"] = $_REQUEST["ttl"]; } @@ -58,20 +58,20 @@ if ( ! isset($_REQUEST['checkpassword']) || $_REQUEST['checkpassword'] != 1 ) $db = new Database(REDIS_CONNECT, REDIS_SELECT); if ( $options["short"] != "" && $db->exists($options["short"]) ) - _do_output("Failure", "Query string '".htmlentities($options["short"])."' already taken. Please choose a different one."); + _do_output("Failure!", "Query string '".htmlentities($options["short"])."' already taken. Please choose a different one."); if ( $options["short"] == "" ) $options["short"] = getToken(); if ( $options["ttl"] != "" ){ if ( ! $db->set($options["short"], json_encode($options), $options["ttl"]) ){ - _do_output("Failure", "Database went away. :("); + _do_output("Failure!", "Database went away. :("); } } else { if ( ! $db->set($options["short"], json_encode($options)) ){ - _do_output("Failure", "Database went away. :("); + _do_output("Failure!", "Database went away. :("); } } - _do_output("Success!", "Your shortlink is " . SHORTDOMAIN . htmlentities($options["short"]) . "."); + _do_output("Success!", "Your short link is " . SHORTDOMAIN . htmlentities($options["short"]) . "."); } diff --git a/linkshorter/robots.txt b/linkshorter/robots.txt new file mode 100644 index 0000000..1f53798 --- /dev/null +++ b/linkshorter/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: / diff --git a/linkshorter/view/templ-head.php b/linkshorter/view/templ-head.php index abc29bf..2eee43c 100644 --- a/linkshorter/view/templ-head.php +++ b/linkshorter/view/templ-head.php @@ -4,6 +4,7 @@