From a20ffeb3c24888068f45b68bdf9f9454b5f43cda Mon Sep 17 00:00:00 2001
From: erth9960 <thuning@dsv.su.se>
Date: Wed, 8 Sep 2021 11:03:46 +0200
Subject: [PATCH] Testing a modified match function

---
 include/User.php | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/User.php b/include/User.php
index aee33f5..18a619d 100644
--- a/include/User.php
+++ b/include/User.php
@@ -47,7 +47,7 @@ class User extends Entity {
         return true;
     }
 
-    public function matches($terms) {
+    public function matches($terms, $matchAll=false) {
         $terms = $this->specify_search($terms, array('name',
                                                      'email',
                                                      'notes'));
@@ -75,6 +75,9 @@ class User extends Entity {
                     break;
             }
         }
+        if($matchAll && array_diff_assoc($terms, $matches)) {
+            return array();
+        }
         return $matches;
     }