PacketFence - BTS - PacketFence
View Issue Details
0000876PacketFencecorepublic2009-12-10 17:212012-08-29 15:28
obilodeau 
obilodeau 
highfeaturehave not tried
closedfixed 
 
3.0.0 
0000876: simplify registration / login process
Most of the users only want ONE page with info and login / password fields for registration or login.

Right now that's not easy to do. It should become the default and keep the multiple pages registration pages in optional config.

Right now the way to do it is:

Basically, check in lib/pf/web.pm, there are two subs:

generate_registration_page
generate_login_page

and these are called from cgi-bin/register.cgi.

Now, your goal is to skip generate_registration_page.

Add the following line to html/user/content/templates/login.html anywhere between <form..>...</form> 
tags:
<input type="hidden" name="mode" value="register">

and patch cgi-bin/register.cgi with:
--- pf/cgi-bin/register.cgi    9ad54d294120b0f8e3e63c6e6f36109679e9f41d
+++ pf/cgi-bin/register.cgi    18c03de41b3c6625fc52baf268de167585375c02
@@ -145,5 +145,5 @@ if (defined($params{'mode'})) {
     generate_error_page($cgi, $session, "error: incorrect mode");
   }
 } else {
-  generate_registration_page($cgi, $session, $destination_url, $mac,1);
+  generate_login_page($cgi, $session, $ENV{REQUEST_URI}, $destination_url, $err);
 }

This should do the trick but note that I have not tested it and something might be missing. 

excerpt from an email I sent on the mailing list today
No tags attached.
Issue History
2009-12-10 17:21obilodeauNew Issue
2009-12-10 17:21obilodeauStatusnew => assigned
2009-12-10 17:21obilodeauAssigned To => obilodeau
2011-01-18 12:02obilodeauTarget Version => 2.1.0
2011-03-03 15:15obilodeauTarget Version2.1.0 => +1
2011-03-03 15:18obilodeauTarget Version+1 => +2
2012-02-29 10:58obilodeauCategoryfuture => core
2012-08-29 15:28obilodeauNote Added: 0002988
2012-08-29 15:28obilodeauStatusassigned => resolved
2012-08-29 15:28obilodeauFixed in Version => 3.0.0
2012-08-29 15:28obilodeauResolutionopen => fixed
2012-08-29 15:28obilodeauTarget Version+2 =>
2012-08-29 15:28obilodeauStatusresolved => closed

Notes
(0002988)
obilodeau   
2012-08-29 15:28   
Fixed a long time ago when we revamped the templates. One template is the default behavior since then.