summaryrefslogtreecommitdiff
path: root/includes/controller/user_driver_licenses_controller.php
diff options
context:
space:
mode:
authormsquare <msquare@notrademark.de>2016-11-17 14:40:21 +0100
committermsquare <msquare@notrademark.de>2016-11-17 14:40:21 +0100
commit7b8d1918087b1d16519037afe61fd6ff09c68f94 (patch)
treeab450f444fc6fcc8bd39583d834e3cc005a2a92d /includes/controller/user_driver_licenses_controller.php
parent9c4636f5c4dd5d3b7ff12effb553172f8235cfe6 (diff)
reduce complexity of user driver license
Diffstat (limited to 'includes/controller/user_driver_licenses_controller.php')
-rw-r--r--includes/controller/user_driver_licenses_controller.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/includes/controller/user_driver_licenses_controller.php b/includes/controller/user_driver_licenses_controller.php
index 818ff86b..8e90e39e 100644
--- a/includes/controller/user_driver_licenses_controller.php
+++ b/includes/controller/user_driver_licenses_controller.php
@@ -88,7 +88,7 @@ function user_driver_license_edit_controller() {
$user_driver_license = UserDriverLicense($user_source['UID']);
if ($user_driver_license == null) {
$wants_to_drive = false;
- $user_driver_license = UserDriverLicense_new($user_source);
+ $user_driver_license = UserDriverLicense_new();
} else {
$wants_to_drive = true;
}
@@ -105,8 +105,8 @@ function user_driver_license_edit_controller() {
$user_driver_license['has_license_forklift'] = isset($_REQUEST['has_license_forklift']);
if (UserDriverLicense_valid($user_driver_license)) {
- if ($user_driver_license == null) {
- UserDriverLicenses_create($user_driver_license);
+ if ($user_driver_license['user_id'] == null) {
+ $user_driver_license = UserDriverLicenses_create($user_driver_license, $user);
} else {
UserDriverLicenses_update($user_driver_license);
}