}
// Loads the user identity using the environment.
+ $user = null;
if ($login) {
$user = User::get($login);
} else if (Env::has('user_id')) {
$page->assign('bans', $bans);
}
- function getHruid($line, $key)
+ function getHruid($line, $key, $relation)
{
- var_dump($line);
- if (!isset($line['nom']) || !isset($line['prenom']) || !isset($line['promo'])) {
- return null;
+ $prenom = CSVImporter::getValue($line, 'prenom', $relation['prenom']);
+ $nom = CSVImporter::getValue($line, 'nom', $relation['nom']);
+ $promo = CSVImporter::getValue($line, 'promo', $relation['promo']);
+
+ if ($prenom != 'NULL' && $nom != 'NULL' && $promo != 'NULL') {
+ return make_forlife($prenom, $nom, $promo);
}
- return make_forlife($line['prenom'], $line['nom'], $line['promo']);
+ return null;
}
- function getMatricule($line, $key)
+ function getMatricule($line, $key, $relation)
{
$mat = $line['matricule'];
$year = intval(substr($mat, 0, 3));
$importer->apply($page, "admin/axletter", array('user_id', 'email', 'prenom', 'nom', 'promo', 'flag', 'hash'));
}
- function idFromMail($line, $key)
+ function idFromMail($line, $key, $relation = null)
{
static $field;
global $globals;
return $id ? $id : '0';
}
- function createHash($line, $key)
+ function createHash($line, $key, $relation)
{
$hash = implode(time(), $line) . rand();
$hash = md5($hash);