[freeside-commits] freeside/fs_selfservice/FS-SelfService/cgi selfservice.cgi, 1.29, 1.30 login.html, 1.4, 1.5
Ivan,,,
ivan at wavetail.420.am
Sat Nov 29 13:54:37 PST 2008
Update of /home/cvs/cvsroot/freeside/fs_selfservice/FS-SelfService/cgi
In directory wavetail.420.am:/tmp/cvs-serv1306/fs_selfservice/FS-SelfService/cgi
Modified Files:
selfservice.cgi login.html
Log Message:
add selfservice_server-single_domain config, and login_info self-service method to give the login page a bit more configurability
Index: selfservice.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/fs_selfservice/FS-SelfService/cgi/selfservice.cgi,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- selfservice.cgi 30 Sep 2008 20:17:43 -0000 1.29
+++ selfservice.cgi 29 Nov 2008 21:54:35 -0000 1.30
@@ -9,7 +9,7 @@
use HTML::Entities;
use Date::Format;
use Number::Format 1.50;
-use FS::SelfService qw( login customer_info edit_info invoice
+use FS::SelfService qw( login_info login customer_info edit_info invoice
payment_info process_payment
process_prepay
list_pkgs order_pkg signup_info order_recharge
@@ -28,7 +28,9 @@
$cgi = new CGI;
unless ( defined $cgi->param('session') ) {
- do_template('login',{});
+ my $login_info = login_info();
+
+ do_template('login', $login_info );
exit;
}
@@ -52,10 +54,12 @@
'password' => $password,
);
if ( $rv->{error} ) {
+ my $login_info = login_info();
do_template('login', {
'error' => $rv->{error},
'username' => $username,
'domain' => $domain,
+ %$login_info,
} );
exit;
} else {
@@ -81,7 +85,10 @@
if ( $result->{error} eq "Can't resume session"
|| $result->{error} eq "Expired session" ) { #ick
- do_template('login',{});
+ my $login_info = login_info();
+ use Data::Dumper;
+ warn Dumper($login_info);
+ do_template('login', $login_info);
exit;
}
@@ -620,12 +627,16 @@
$fill_in->{'selfurl'} = $cgi->self_url;
$fill_in->{'cgi'} = \$cgi;
- my $template = new Text::Template( TYPE => 'FILE',
- SOURCE => "$template_dir/$name.html",
+ my $source = "$template_dir/$name.html";
+ #warn "creating template for $source\n";
+ my $template = new Text::Template( TYPE => 'FILE',
+ SOURCE => $source,
DELIMITERS => [ '<%=', '%>' ],
- UNTAINT => 1, )
+ UNTAINT => 1,
+ )
or die $Text::Template::ERROR;
+ #warn "filling in $template with $fill_in\n";
print $cgi->header( '-expires' => 'now' ),
$template->fill_in( PACKAGE => 'FS::SelfService::_selfservicecgi',
HASH => $fill_in
Index: login.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/fs_selfservice/FS-SelfService/cgi/login.html,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- login.html 2 Oct 2003 11:23:04 -0000 1.4
+++ login.html 29 Nov 2008 21:54:35 -0000 1.5
@@ -1,29 +1,85 @@
<HTML><HEAD><TITLE>Login</TITLE></HEAD>
<BODY BGCOLOR="#e8e8e8"><FONT SIZE=5>Login</FONT><BR><BR>
<FONT SIZE="+1" COLOR="#ff0000"><%= $error %></FONT>
+
<FORM ACTION="<%= $self_url %>" METHOD=POST>
<INPUT TYPE="hidden" NAME="session" VALUE="login">
+
<TABLE BGCOLOR="#c0c0c0" BORDER=0 CELLSPACING=2 CELLPADDING=0>
+
<TR>
<TH ALIGN="right">Username </TH>
<TD>
- <INPUT TYPE="text" NAME="username" VALUE="<%= $username %>">
- </TD>
-</TR>
-<TR>
- <TH ALIGN="right">Domain </TH>
- <TD>
- <INPUT TYPE="text" NAME="domain" VALUE="<%= $domain %>">
+ <INPUT TYPE="text" NAME="username" VALUE="<%= $username %>"><%= $single_domain ? '@'.$single_domain : '' %>
</TD>
</TR>
-<!--<INPUT TYPE="hidden" NAME="domain" VALUE="myisp.com">-->
+
+<%=
+if ( $single_domain ) {
+
+ $OUT .= qq(<INPUT TYPE="hidden" NAME="domain" VALUE="$single_domain">);
+
+} else {
+
+ $OUT .= qq(
+ <TR>
+ <TH ALIGN="right">Domain </TH>
+ <TD>
+ <INPUT TYPE="text" NAME="domain" VALUE="$domain">
+ </TD>
+ </TR>
+ );
+
+}
+
+%>
+
<TR>
<TH ALIGN="right">Password </TH>
<TD>
<INPUT TYPE="password" NAME="password">
</TD>
</TR>
+<TR>
+ <TD COLSPAN=2 ALIGN="center"><INPUT TYPE="submit" VALUE="Login"></TD>
+</TR>
</TABLE>
-<BR><BR><INPUT TYPE="submit" VALUE="Login">
-</FORM></BODY></HTML>
+</FORM>
+
+<%=
+
+if ( $phone_login ) {
+
+ $OUT .= qq(
+
+ <B>OR</B><BR><BR>
+
+ <FORM ACTION="$self_url" METHOD=POST>
+ <INPUT TYPE="hidden" NAME="session" VALUE="login">
+ <TABLE BGCOLOR="#c0c0c0" BORDER=0 CELLSPACING=2 CELLPADDING=0>
+ <TR>
+ <TH ALIGN="right">Phone number </TH>
+ <TD>
+ <INPUT TYPE="text" NAME="username" VALUE="$username">
+ </TD>
+ </TR>
+ <INPUT TYPE="hidden" NAME="domain" VALUE="svc_phone">
+ <TR>
+ <TH ALIGN="right">PIN </TH>
+ <TD>
+ <INPUT TYPE="password" NAME="password">
+ </TD>
+ </TR>
+ <TR>
+ <TD COLSPAN=2 ALIGN="center"><INPUT TYPE="submit" VALUE="Login"></TD>
+ </TR>
+ </TABLE>
+ </FORM>
+ );
+
+}
+
+%>
+
+</BODY></HTML>
More information about the freeside-commits
mailing list