Tweaks to check for localhost machine, a=chris

Chris Pollett [2015-01-17 20:Jan:th]
Tweaks to check for localhost machine, a=chris
Filename
controllers/admin_controller.php
controllers/search_controller.php
models/crawl_model.php
models/model.php
diff --git a/controllers/admin_controller.php b/controllers/admin_controller.php
index 4584dfd50..ed51e2403 100755
--- a/controllers/admin_controller.php
+++ b/controllers/admin_controller.php
@@ -383,7 +383,6 @@ class AdminController extends Controller implements CrawlConstants
         $machine_urls = $this->model("machine")->getQueueServerUrls();
         list($stalled, $status, $data['RECENT_CRAWLS']) =
             $crawl_model->combinedCrawlInfo($machine_urls);
-
         if($stalled) {
             $crawl_model->sendStopCrawlMessage($machine_urls);
         }
diff --git a/controllers/search_controller.php b/controllers/search_controller.php
index ac2f45672..1c6af50c4 100755
--- a/controllers/search_controller.php
+++ b/controllers/search_controller.php
@@ -121,6 +121,7 @@ class SearchController extends Controller implements CrawlConstants
         }
         $data['ELAPSED_TIME'] = changeInMicrotime($start_time);
         if ($view == "serial" || $view == "json") {
+            $data['BASE_URL'] = BASE_URL;
             if(isset($data["PAGES"])) {
                 $count = count($data["PAGES"]);
                 for($i = 0; $i < $count; $i++) {
diff --git a/models/crawl_model.php b/models/crawl_model.php
index 569812cd1..e89ef7686 100755
--- a/models/crawl_model.php
+++ b/models/crawl_model.php
@@ -1355,7 +1355,6 @@ EOT;
                 2);
             return $combined;
         }
-
         $combined = array();
         $combined[] = $this->crawlStalled();
         $combined[] = $this->crawlStatus();
diff --git a/models/model.php b/models/model.php
index aa290f8e7..cb8919abd 100755
--- a/models/model.php
+++ b/models/model.php
@@ -370,7 +370,9 @@ class Model implements CrawlConstants
             }
         }
         return count($machine_urls) <= 1 &&
-                    UrlParser::isLocalhostUrl($machine_urls[0]);
+                    UrlParser::isLocalhostUrl($machine_urls[0]) &&
+                    UrlParser::getPath(NAME_SERVER) ==
+                    UrlParser::getPath($machine_urls[0]);
     }
     /**
      * Used to get the translation of a string_id stored in the database to
ViewGit