update for short url validation
authorSteve Sutton <steve@gaslightmedia.com>
Wed, 10 Feb 2010 21:51:31 +0000 (21:51 +0000)
committerSteve Sutton <steve@gaslightmedia.com>
Wed, 10 Feb 2010 21:51:31 +0000 (21:51 +0000)
admin/Toolbox/ShortUrlCheck.php [new file with mode: 0644]
admin/Toolbox/edit_bus_category.phtml

diff --git a/admin/Toolbox/ShortUrlCheck.php b/admin/Toolbox/ShortUrlCheck.php
new file mode 100644 (file)
index 0000000..bc6158e
--- /dev/null
@@ -0,0 +1,17 @@
+<?php
+if ($_GET['url']) {
+    $dont_include_functions = true;
+    require_once '../../setup.phtml';
+    $shortUrl = new Toolkit_ShortURL(
+        Toolkit_Database::getInstance());
+    try {
+        if ($shortUrl->isValidUrlName($_GET['url'])) {
+            echo 'true';
+        } else {
+            echo 'false';
+        }
+    } catch(Exception $e) {
+        die($e->getMessage);
+    }
+}
+?>
index a1566af..e7908ea 100755 (executable)
@@ -79,6 +79,7 @@ if (defined("MEMBERS_DB") && MEMBERS_DB == 1) {
     }
 }
 echo '<script type="text/javascript" src="'.GLM_APP_BASE_URL.'ckeditor/current/ckeditor.js"></script>';
+echo '<script type="text/javascript" src="'.GLM_APP_BASE_URL.'shortUrl/ShortUrlValidator.js"></script>';
 echo '<form id="myForm" action="update_bus_category.phtml" method="POST" enctype="multipart/form-data">';
 echo '<table id="admin-edit-table">';
 if (defined("MEMBERS_DB") && MEMBERS_DB == 1) {