Go to the source code of this file.
Data Structures | |
| class | CSV |
Functions | |
| if(count(get_included_files())==1) | array_swap_cols_and_rows ($origMatrix, $presumedColKeyList) |
| claro_CSV_format_ok ($format, $delim, $enclosedBy) | |
| claro_check_campus_CSV_File ($uploadTempDir, $useFirstLine, $usedFormat, $fieldSeparator, $enclosedBy) | |
| claro_disp_CSV_error_backlog () | |
| check_email_synthax_userlist ($userlist) | |
| check_username_used_userlist ($userlist) | |
| check_officialcode_used_userlist ($userlist) | |
| check_password_userlist ($userlist) | |
| check_mail_used_userlist ($userlist) | |
| check_duplicate_mail_userlist ($userlist) | |
| check_duplicate_username_userlist ($userlist) | |
| check_duplicate_officialcode_userlist ($userlist) | |
| if (count(get_included_files())==1) array_swap_cols_and_rows | ( | $ | origMatrix, | |
| $ | presumedColKeyList | |||
| ) |
CLAROLINE
Library for import of csv user list
2001-2008 Universite catholique de Louvain (UCL) http://www.gnu.org/copyleft/gpl.html (GPL) GENERAL PUBLIC LICENSE
this function allows to invert cols and rows of a 2D array needed to treat the potentialy new users to add form a CSV file
| origMartix | array source array to be reverted | |
| $presumedColKeyList | array contain the minimum list of colum in the builded array |
Definition at line 34 of file import_csv.lib.php.
| check_duplicate_mail_userlist | ( | $ | userlist | ) |
Check DUPLICATE EMAIL OF ADDABLE USERS : take the 2D array in param and check if email are all different.
| $userlist | must be a 2D array with the list of potential new users : $userlist['email'][$i] for the email $userlist['username'][$i] for the username $userlist['officialCode'][$i] for the officialCod |
Definition at line 525 of file import_csv.lib.php.
| check_duplicate_officialcode_userlist | ( | $ | userlist | ) |
Check DUPLICATE OFFICIAL CODE OF ADDABLE USERS : take the 2D array in param and check if official codes are all different.
| $userlist | must be a 2D array with the list of potential new users : $userlist['email'][$i] for the email $userlist['username'][$i] for the username $userlist['officialCode'][$i] for the officialCod |
Definition at line 594 of file import_csv.lib.php.
| check_duplicate_username_userlist | ( | $ | userlist | ) |
Check DUPLICATE USERNAMES OF ADDABLE USERS : take the 2D array in param and check if username are all different.
| $userlist | must be a 2D array with the list of potential new users : $userlist['email'][$i] for the email $userlist['username'][$i] for the username $userlist['officialCode'][$i] for the officialCod |
Definition at line 563 of file import_csv.lib.php.
| check_email_synthax_userlist | ( | $ | userlist | ) |
Check EMAIL SYNTHAX : if new users in Claroline with the specified parameters contains synthax error in mail given.
| $userlist | must be a 2D array with the list of potential new users : $userlist['email'][$i] for the email |
Definition at line 309 of file import_csv.lib.php.
| check_mail_used_userlist | ( | $ | userlist | ) |
Check EMAIL NOT TAKEN YET : check if the e-mails are not already taken by someone in the plateform
| $userlist | must be a 2D array with the list of potential new users : |
$userlist['email'][$i] for the email
Definition at line 471 of file import_csv.lib.php.
| check_officialcode_used_userlist | ( | $ | userlist | ) |
Check OFFICIAL CODE NOT TAKEN YET : check if admincode (officialCode) is not already taken by someone else
| $userlist | must be a 2D array with the list of potential new users : |
$userlist['officialCode'][$i] for the officialCode
Definition at line 391 of file import_csv.lib.php.
| check_password_userlist | ( | $ | userlist | ) |
Check PASSWORD ACCEPTABLE : check if password is sufficently complex for this user
| $userlist | must be a 2D array with the list of potential new users : |
$userlist['username'][$i] for the username $userlist['password'][$i] for the password
Definition at line 443 of file import_csv.lib.php.
| check_username_used_userlist | ( | $ | userlist | ) |
Check USERNAME NOT TAKEN YET : check if usernames are not already token by someone else
| $userlist | must be a 2D array with the list of potential new users : $userlist['username'][$i] for the username |
Definition at line 337 of file import_csv.lib.php.
| claro_check_campus_CSV_File | ( | $ | uploadTempDir, | |
| $ | useFirstLine, | |||
| $ | usedFormat, | |||
| $ | fieldSeparator, | |||
| $ | enclosedBy | |||
| ) |
Check ERRORS in a CSV file uploaded of potential new user to add in Claroline
format used for line of CSV file must be stored in SESSION to use this function properly: ...
| $uploadTempDir | : place where the folder is stored | |
| $useFirstLine | : boolean true if parser should user the first line of file to know where the format is false otherwise | |
| $format | : the used format, if empty, this means that we use first line format mode |
$_SESSION['claro_csv_userlist'] for the users to add
$_SESSION['claro_mail_synthax_error'] for mail synthax error $_SESSION['claro_mail_used_error'] for mail used in campus error $_SESSION['claro_username_used_error'] for username used in campus error $_SESSION['claro_officialcode_used_error'] for official code used error $_SESSION['claro_password_error'] for password error $_SESSION['claro_mail_duplicate_error'] for mail duplicate error $_SESSION['claro_username_duplicate_error'] for username duplicate error $_SESSION['claro_officialcode_duplicate_error'] for officialcode duplicate error
Definition at line 140 of file import_csv.lib.php.
| claro_CSV_format_ok | ( | $ | format, | |
| $ | delim, | |||
| $ | enclosedBy | |||
| ) |
test if the given format is correct to be used in claroline to add user, if all the complusory fields are present.
| format | to test |
Definition at line 75 of file import_csv.lib.php.
| claro_disp_CSV_error_backlog | ( | ) |
display the errors caused by a conflict with the platform after parsing the CSV file used to add new users found in the platform. ERRORS and USERS must be saved in the session at these places :
$_SESSION['claro_csv_userlist'] for the users to add
$_SESSION['claro_mail_synthax_error'] for mail synthax error $_SESSION['claro_mail_used_error'] for mail used in campus error $_SESSION['claro_username_used_error'] for username used in campus error $_SESSION['claro_officialcode_used_error'] for official code used error $_SESSION['claro_password_error'] for password error $_SESSION['claro_mail_duplicate_error'] for mail duplicate error $_SESSION['claro_username_duplicate_error'] for username duplicate error $_SESSION['claro_officialcode_duplicate_error'] for officialcode duplicate error
Definition at line 246 of file import_csv.lib.php.
1.6.3