+ } else {
+ $birth = explode('/', $birth, 3);
+ for ($i = 0; $i < 3; $i++)
+ $birth[$i] = intval($birth[$i]);
+ if ($birth[2] < 100) $birth[2] += 1900;
+ $year = $birth[2];
+ $promo = (int)$sub_state['promo'];
+ if ($year > $promo - 15 || $year < $promo - 30) {
+ $err[] = "La 'Date de naissance' n'est pas correcte.";
+ $alert = "Date de naissance incorrecte à l'inscription - ";
+ $sub_state['wrong_naissance'] = $birth;
+ }
+ }
+
+ // Register the optional services requested by the user.
+ $services = array();
+ foreach (array('ax_letter', 'imap', 'ml_promo', 'nl') as $service) {
+ if (Post::b($service)) {
+ $services[] = $service;
+ }
+ }
+ $sub_state['services'] = $services;
+
+ // Validate the password.
+ if (!Post::v('response2', false)) {
+ $err[] = "Le mot de passe n'est pas valide.";
+ }
+
+ // Check if the given email is known as dangerous.
+ $res = XDB::query("SELECT w.state, w.description
+ FROM emails_watch AS w
+ WHERE w.email = {?} AND w.state != 'safe'",
+ Post::v('email'));
+ $email_banned = false;
+ if ($res->numRows()) {
+ list($state, $description) = $res->fetchOneRow();
+ $alert .= "Email surveillé proposé à l'inscription - ";
+ $sub_state['email_desc'] = $description;
+ if ($state == 'dangerous') {
+ $email_banned = true;
+ }
+ }
+ if ($sub_state['watch']) {
+ $alert .= "Inscription d'un utilisateur surveillé - ";
+ }
+
+ if (($ip_banned = check_ip('unsafe'))) {
+ unset($err);