Improvement of the IMAP configuration:
[platal.git] / modules / register.php
index 69a8ae5..6d1da67 100644 (file)
@@ -148,8 +148,10 @@ class RegisterModule extends PLModule
                         $err[] = "La 'Date de naissance' n'est pas correcte.";
                     } else {
                         $birth = explode('/', $birth, 3);
-                        $year  = intval($birth[2]);
-                        if ($year < 100) $year += 1900;
+                        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.";
@@ -466,6 +468,11 @@ class RegisterModule extends PLModule
                 $client->subscribe($sub);
             }
         }
+        if (Post::v('imap')) {
+            require_once 'emails.inc.php';
+            $storage = new MailStorageIMAP(S::v('uid'));
+            $storage->enable();
+        }
 
         pl_redirect('profile/edit');
     }