rework makefile
[platal.git] / modules / register.php
index 95aeff8..a8ee89d 100644 (file)
@@ -26,6 +26,7 @@ class RegisterModule extends PLModule
         return array(
             'register'         => $this->make_hook('register', AUTH_PUBLIC),
             'register/end'     => $this->make_hook('end',      AUTH_PUBLIC),
+            'register/end.php' => $this->make_hook('end_old',  AUTH_PUBLIC),
             'register/success' => $this->make_hook('success',  AUTH_MDP),
         );
     }
@@ -42,6 +43,11 @@ class RegisterModule extends PLModule
             $sub_state['step'] = max(0,Get::getInt('back'));
         }
 
+        // Compatibility with old sources, keep it atm
+        if (!$hash && Env::has('hash')) {
+            $hash = Env::get('hash');
+        }
+
         if ($hash) {
             $res = $globals->xdb->query(
                     "SELECT  m.uid, u.promo, u.nom, u.prenom, u.matricule
@@ -147,8 +153,11 @@ class RegisterModule extends PLModule
         if (isset($err)) {
             $page->trig($err);
         }
+    }
 
-        return PL_OK;
+    function handler_end_old(&$page)
+    {
+        return $this->handler_end($page, Env::get('hash'));
     }
 
     function handler_end(&$page, $hash = null)
@@ -264,8 +273,6 @@ class RegisterModule extends PLModule
 
         redirect($globals->baseurl.'/register/success');
         $page->assign('uid', $uid);
-
-        return PL_OK;
     }
 
     function handler_success(&$page)
@@ -293,8 +300,6 @@ class RegisterModule extends PLModule
         }
 
         $page->addJsLink('javascript/motdepasse.js');
-
-        return PL_OK;
     }
 }