summaryrefslogtreecommitdiff
path: root/includes/model
diff options
context:
space:
mode:
Diffstat (limited to 'includes/model')
-rw-r--r--includes/model/Shifts_model.php4
-rw-r--r--includes/model/User_model.php2
2 files changed, 4 insertions, 2 deletions
diff --git a/includes/model/Shifts_model.php b/includes/model/Shifts_model.php
index 2db0a3d3..67580eee 100644
--- a/includes/model/Shifts_model.php
+++ b/includes/model/Shifts_model.php
@@ -263,7 +263,9 @@ function Shift_create($shift) {
*/
function Shifts_by_user($user) {
$result = sql_select("
- SELECT `ShiftTypes`.`id` as `shifttype_id`, `ShiftTypes`.`name`, `ShiftEntry`.*, `Shifts`.*, `Room`.*
+ SELECT `ShiftTypes`.`id` as `shifttype_id`, `ShiftTypes`.`name`,
+ `ShiftEntry`.`id`, `ShiftEntry`.`SID`, `ShiftEntry`.`TID`, `ShiftEntry`.`UID`, `ShiftEntry`.`freeloaded`, `ShiftEntry`.`Comment`,
+ `Shifts`.*, `Room`.*
FROM `ShiftEntry`
JOIN `Shifts` ON (`ShiftEntry`.`SID` = `Shifts`.`SID`)
JOIN `ShiftTypes` ON (`ShiftTypes`.`id` = `Shifts`.`shifttype_id`)
diff --git a/includes/model/User_model.php b/includes/model/User_model.php
index 344a3886..3ebd3bf9 100644
--- a/includes/model/User_model.php
+++ b/includes/model/User_model.php
@@ -284,7 +284,7 @@ function User($user_id) {
function User_by_api_key($api_key) {
$user = sql_select("SELECT * FROM `User` WHERE `api_key`='" . sql_escape($api_key) . "' LIMIT 1");
if ($user === false) {
- return false;
+ engelsystem_error("Unable to find user by api key.");
}
if (count($user) == 0) {
return null;