migrate referent + profile edition
[platal.git] / include / register.inc.php
index aa5e0d6..47cae63 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2004 Polytechnique.org                              *
+ *  Copyright (C) 2003-2006 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -252,9 +252,10 @@ function finish_ins($sub_state)
 {
     global $globals;
     extract($sub_state);
+    require_once('secure_hash.inc.php');
 
     $pass     = rand_pass();
-    $pass_md5 = md5($pass_clair);
+    $pass_encrypted = hash_encrypt($pass_clair);
     $hash     = rand_url_id(12);
   
     $globals->xdb->execute('UPDATE auth_user_md5 SET last_known_email={?} WHERE matricule = {?}', $email, $mat);
@@ -262,10 +263,10 @@ function finish_ins($sub_state)
     $globals->xdb->execute(
             "REPLACE INTO  register_pending (uid, forlife, bestalias, mailorg2, password, email, date, relance, naissance, hash)
                    VALUES  ({?}, {?}, {?}, {?}, {?}, {?}, NOW(), 0, {?}, {?})",
-            $uid, $forlife, $bestalias, $mailorg2, $pass_md5, $email, $naissance, $hash);
+            $uid, $forlife, $bestalias, $mailorg2, $pass_encrypted, $email, $naissance, $hash);
 
     require_once('xorg.mailer.inc.php');
-    $mymail = new XOrgMailer('inscrire.mail.tpl');
+    $mymail = new XOrgMailer('register/inscrire.mail.tpl');
     $mymail->assign('mailorg', $bestalias);
     $mymail->assign('lemail',  $email);
     $mymail->assign('pass',    $pass);