From: Laszlo Papp <[email protected]>

    Add 'Maintainer' element into search/info type object handling
    too for the unity, it will be handled so not just in msearch
    case separately.

Signed-off-by: Laszlo Papp <[email protected]>
---
 web/lib/aurjson.class.php |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/web/lib/aurjson.class.php b/web/lib/aurjson.class.php
index 5794ebc..f8f011b 100644
--- a/web/lib/aurjson.class.php
+++ b/web/lib/aurjson.class.php
@@ -94,9 +94,8 @@ class AurJSON {
         }

         $keyword_string = mysql_real_escape_string($keyword_string, 
$this->dbh);
-
-        $query = "SELECT " . implode(',', $this->fields) .
-            " FROM Packages WHERE DummyPkg=0 AND " .
+        $base_query = "SELECT Users.Username as Maintainer, " . 
implode(',',$this->fields) .
+            " FROM Packages, Users WHERE Users.ID=Packages.MaintainerUID AND 
DummyPkg=0 AND " .
             "  ( Name LIKE '%{$keyword_string}%' OR " .
             "    Description LIKE '%{$keyword_string}%' )";
         $result = db_query($query, $this->dbh);
@@ -121,8 +120,8 @@ class AurJSON {
      * @return mixed Returns an array of value data containing the package data
      **/
     private function info($pqdata) {
-        $base_query = "SELECT " . implode(',', $this->fields) .
-            " FROM Packages WHERE DummyPkg=0 AND ";
+        $base_query = "SELECT Users.Username as Maintainer, " . 
implode(',',$this->fields) .
+            " FROM Packages, Users WHERE Users.ID=Packages.MaintainerUID AND 
DummyPkg=0 AND ";

         if ( is_numeric($pqdata) ) {
             // just using sprintf to coerce the pqd to an int
--
1.6.4.4

Reply via email to