|
|
|
@ -6,6 +6,7 @@ function validate_data($users) { |
|
|
|
|
global $defined_auth_sources; |
|
|
|
|
$errors = array (); |
|
|
|
|
$usernames = array (); |
|
|
|
|
if(is_array($users)) { |
|
|
|
|
foreach ($users as $index => $user) { |
|
|
|
|
// 1. Check whether mandatory fields have been set. |
|
|
|
|
$mandatory_fields = array ('LastName', 'FirstName'); |
|
|
|
@ -57,6 +58,7 @@ function validate_data($users) { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return $errors; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -88,6 +90,7 @@ function complete_missing_data($user) { |
|
|
|
|
*/ |
|
|
|
|
function save_data($users) { |
|
|
|
|
$user_table = Database :: get_main_table(TABLE_MAIN_USER); |
|
|
|
|
if(is_array($users)) { |
|
|
|
|
foreach ($users as $index => $user) { |
|
|
|
|
$user = complete_missing_data($user); |
|
|
|
|
|
|
|
|
@ -126,6 +129,7 @@ function save_data($users) { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Reads the CSV-file. |
|
|
|
|