From d64f96b6a1823dedb8b9b30d1b3682b4537f3103 Mon Sep 17 00:00:00 2001 From: msquare Date: Thu, 17 Nov 2016 13:11:44 +0100 Subject: reduce complexity of angeltype controller --- includes/model/User_model.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'includes/model/User_model.php') diff --git a/includes/model/User_model.php b/includes/model/User_model.php index f58c5d18..c1376abd 100644 --- a/includes/model/User_model.php +++ b/includes/model/User_model.php @@ -133,7 +133,7 @@ function Users_by_angeltype_inverted($angeltype) { * @param Angeltype $angeltype */ function Users_by_angeltype($angeltype) { - return sql_select(" + $result = sql_select(" SELECT `User`.*, `UserAngelTypes`.`id` as `user_angeltype_id`, @@ -145,6 +145,10 @@ function Users_by_angeltype($angeltype) { LEFT JOIN `UserDriverLicenses` ON `User`.`UID`=`UserDriverLicenses`.`user_id` WHERE `UserAngelTypes`.`angeltype_id`='" . sql_escape($angeltype['id']) . "' ORDER BY `Nick`"); + if ($result === false) { + engelsystem_error("Unable to load members."); + } + return $result; } /** -- cgit v1.2.3-70-g09d2