]> git.mjollnir.org Git - moodle.git/commitdiff
Minor change to make user searches a bit better
authormoodler <moodler>
Wed, 27 Aug 2003 13:36:22 +0000 (13:36 +0000)
committermoodler <moodler>
Wed, 27 Aug 2003 13:36:22 +0000 (13:36 +0000)
Next time I'll put proper paging in

lib/datalib.php

index a1ae05a36ab71e9804cd8b4a984940e0155f2020..67a509cf03bd3996ba4bc8787eedd8e8c705b8a0 100644 (file)
@@ -1012,9 +1012,7 @@ function get_users($get=true, $search="", $confirmed=false, $exceptions="", $sor
 /// $sort is a sorting criteria to use
 
     if ($search) {
-        $search = " AND (firstname LIKE '%$search%'
-                     OR lastname LIKE '%$search%'
-                     OR email LIKE '%$search%') ";
+        $search = " AND (CONCAT(firstname,\" \",lastname) LIKE '%$search%' OR email LIKE '%$search%') ";
     }
 
     if ($confirmed) {
@@ -1054,9 +1052,7 @@ function get_users_listing($sort, $dir="ASC", $page=1, $recordsperpage=20, $sear
     }
 
     if ($search) {
-        $search = " AND (firstname LIKE '%$search%'
-                     OR lastname LIKE '%$search%'
-                     OR email LIKE '%$search%') ";
+        $search = " AND (CONCAT(firstname,\" \",lastname) LIKE '%$search%' OR email LIKE '%$search%') ";
     }
 
     return get_records_sql("SELECT id, username, email, firstname, lastname, city, country, lastaccess