|
|
|
@ -1,4 +1,6 @@ |
|
|
|
<?php |
|
|
|
<?php |
|
|
|
|
|
|
|
/* For licensing terms, see /license.txt*/ |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Validates imported data. |
|
|
|
* Validates imported data. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@ -87,6 +89,8 @@ function complete_missing_data($user) |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Save the imported data. |
|
|
|
* Save the imported data. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param array |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
function save_data($users) |
|
|
|
function save_data($users) |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -107,15 +111,18 @@ function save_data($users) |
|
|
|
'', |
|
|
|
'', |
|
|
|
$user['AuthSource'] |
|
|
|
$user['AuthSource'] |
|
|
|
); |
|
|
|
); |
|
|
|
foreach ($user['Courses'] as $index => $course) { |
|
|
|
|
|
|
|
|
|
|
|
if (!empty($user['Courses'])) { |
|
|
|
|
|
|
|
foreach ($user['Courses'] as $course) { |
|
|
|
if (CourseManager::course_exists($course)) { |
|
|
|
if (CourseManager::course_exists($course)) { |
|
|
|
CourseManager:: subscribe_user( |
|
|
|
CourseManager::subscribeUser( |
|
|
|
$user_id, |
|
|
|
$user_id, |
|
|
|
$course, |
|
|
|
$course, |
|
|
|
$user['Status'] |
|
|
|
$user['Status'] |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// TODO: Hard-coded French texts. |
|
|
|
// TODO: Hard-coded French texts. |
|
|
|
|
|
|
|
|
|
|
|
|