Merge remote branch 'origin/platal-1.0.1'
[platal.git] / modules / register.php
index 9c90e09..44c1866 100644 (file)
@@ -56,7 +56,7 @@ class RegisterModule extends PLModule
                                  FROM  register_marketing AS m
                            INNER JOIN  accounts           AS a   ON (m.uid = a.uid)
                            INNER JOIN  account_profiles   AS ap  ON (a.uid = ap.uid AND FIND_IN_SET('owner', ap.perms))
-                           INNER JOIN  profiles           AS p   ON (p.pid = ap.uid)
+                           INNER JOIN  profiles           AS p   ON (p.pid = ap.pid)
                            INNER JOIN  profile_display    AS pd  ON (p.pid = pd.pid)
                            INNER JOIN  profile_name       AS pnl ON (p.pid = pnl.pid AND pnl.typeid = {?})
                            INNER JOIN  profile_name       AS pnf ON (p.pid = pnf.pid AND pnf.typeid = {?})
@@ -179,7 +179,7 @@ class RegisterModule extends PLModule
                     $subState->set('services', $services);
 
                     // Validate the password.
-                    if (!Post::v('response2', false)) {
+                    if (!Post::v('pwhash', false)) {
                         $error[] = "Le mot de passe n'est pas valide.";
                     }
 
@@ -211,7 +211,7 @@ class RegisterModule extends PLModule
                         $subState->set('birthdate', sprintf("%04d-%02d-%02d",
                                                             intval($birth[2]), intval($birth[1]), intval($birth[0])));
                         $subState->set('email', Post::t('email'));
-                        $subState->set('password', Post::t('response2'));
+                        $subState->set('password', Post::t('pwhash'));
 
                         // Update the current alert if the birthdate is incorrect,
                         // or if the IP address of the user has been banned.
@@ -248,7 +248,7 @@ class RegisterModule extends PLModule
         }
 
         $page->changeTpl('register/step' . $subState->i('step') . '.tpl');
-        $page->addJsLink('motdepasse.js');
+        $page->addJsLink('password.js');
         if (isset($error)) {
             $page->trigError($error);
         }
@@ -280,7 +280,7 @@ class RegisterModule extends PLModule
                              FROM  register_pending AS r
                        INNER JOIN  accounts         AS a   ON (r.uid = a.uid)
                        INNER JOIN  account_profiles AS ap  ON (a.uid = ap.uid AND FIND_IN_SET('owner', ap.perms))
-                       INNER JOIN  profiles         AS p   ON (p.pid = ap.uid)
+                       INNER JOIN  profiles         AS p   ON (p.pid = ap.pid)
                        INNER JOIN  profile_name     AS pnl ON (p.pid = pnl.pid AND pnl.typeid = {?})
                        INNER JOIN  profile_name     AS pnf ON (p.pid = pnf.pid AND pnf.typeid = {?})
                        INNER JOIN  profile_display  AS pd  ON (p.pid = pd.pid)
@@ -329,7 +329,7 @@ class RegisterModule extends PLModule
         //
         XDB::execute("UPDATE  accounts
                          SET  password = {?}, state = 'active',
-                              registration_date = NOW()
+                              registration_date = NOW(), email = NULL
                        WHERE  uid = {?}", $password, $uid);
         XDB::execute("UPDATE  profiles
                          SET  birthdate = {?}, last_change = NOW()
@@ -395,7 +395,7 @@ class RegisterModule extends PLModule
         $mymail->send();
 
         // Index the user, to allow her to appear in searches.
-        Profile::rebuildSearchTokens($uid);
+        Profile::rebuildSearchTokens($pid);
 
         // Notify other users which were watching for her arrival.
         XDB::execute('REPLACE INTO  contacts (uid, contact)