function weakCheckId($subState) { $uf = new UserFilter(new PFC_And(new PFC_Not(new UFC_Dead()), new UFC_Promo('=', $subState->s('edu_type'), $subState->s('yearpromo')), new PFC_Not(new UFC_Registered(true)))); if ($it = $uf->iterProfiles()) { while ($profile = $it->next()) { if ($profile->compareNames($subState->s('firstname'), $subState->s('lastname'))) { $subState->set('lastname', $profile->lastName()); $subState->set('firstname', $profile->firstName()); $subState->set('uid', $profile->owner()->id()); $subState->set('watch', $profile->owner()->watch); $subState->set('comment', $profile->owner()->comment); $subState->set('birthdateRef', $profile->__get('birthdate_ref')); $subState->set('xorgid', $profile->__get('xorg_id')); return true; } } } $uf = new UserFilter(new PFC_And(new PFC_Not(new UFC_Dead()), new UFC_Promo('=', $subState->s('edu_type'), $subState->s('yearpromo')), new UFC_Registered(true))); if ($it = $uf->iterProfiles()) { while ($profile = $it->next()) { if ($profile->compareNames($subState->s('firstname'), $subState->s('lastname'))) { $subState->set('uid', $profile->owner()->id()); $subState->set('watch', $profile->owner()->watch); $subState->set('comment', $profile->owner()->comment); $subState->set('birthdateRef', $profile->__get('birthdate_ref')); $subState->set('xorgid', $profile->__get('xorg_id')); return 'Tu es vraisemblablement déjà inscrit !'; } } } return 'Nous n\'avons pas les mêmes informations (promo, accents…) que toi ! Tu peux vérifier en cherchant ta fiche sur l\'annuaire public, si ça ne fonctionne toujours pas tu peux nous envoyer un email à support@polytechnique.org'; }
function handler_ical(PlPage $page, PlUser $user) { require_once 'ical.inc.php'; $page->changeTpl('carnet/calendar.tpl', NO_SKIN); $page->register_function('display_ical', 'display_ical'); $filter = new UserFilter(new UFC_Contact($user)); $profiles = $filter->iterProfiles(); $page->assign('events', PlIteratorUtils::map($profiles, array($this, 'buildBirthRef'))); pl_cached_content_headers('text/calendar', 1); }