OpenPKG CVS Repository
http://cvs.openpkg.org/
____________________________________________________________________________
Server: cvs.openpkg.org Name: Thomas Lotterer
Root: /v/openpkg/cvs Email: [EMAIL PROTECTED]
Module: openpkg-registry Date: 27-Nov-2005 00:40:13
Branch: HEAD Handle: 2005112623401300
Modified files:
openpkg-registry registry-ui.pl
Log:
pretty authentication info printing in html head
Summary:
Revision Changes Path
1.34 +32 -9 openpkg-registry/registry-ui.pl
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-registry/registry-ui.pl
============================================================================
$ cvs diff -u -r1.33 -r1.34 registry-ui.pl
--- openpkg-registry/registry-ui.pl 26 Nov 2005 23:39:33 -0000 1.33
+++ openpkg-registry/registry-ui.pl 26 Nov 2005 23:40:13 -0000 1.34
@@ -360,7 +360,8 @@
sub viewhtmlhead (;$)
{
my ($menu) = @_;
- my $head = "";
+ my $head;
+ $head = "";
$head .= "<html>\n";
$head .= " <head>\n";
$head .= " <link rel=\"stylesheet\" type=\"text/css\"
href=\"$myurl?page=css\"/>\n";
@@ -381,14 +382,7 @@
$head .= " </tr>\n";
$head .= " <tr>\n";
$head .= " <td colspan=\"" . $td . "\">\n";
- my $username;
- $username = &identifyusername();
- if ($username ne "") {
- $head .= "authenticated as <b>" . $username . "</b>";
- }
- else {
- $head .= "you are <b>not logged in</b>\n";
- }
+ $head .= &prettyauthinfo;
$head .= " </td>\n";
$head .= " </tr>\n";
$head .= " </table>\n";
@@ -399,6 +393,35 @@
return $head;
}
+sub prettyauthinfo ()
+{
+ my ($html, $username);
+ $html = "";
+ $username = &identifyusername();
+ if ($username ne "") {
+ $html .= "authenticated as <b>" . $username . "</b> ";
+ }
+ else {
+ $html .= "you are <b>not authenticated</b>\n";
+ }
+ if ($cfg->{identification}->{mode} eq "ase") {
+ $html .= " via ase login";
+ }
+ elsif ($cfg->{identification}->{mode} eq "basicauth") {
+ $html .= " via basic authentication";
+ }
+ elsif ($cfg->{identification}->{mode} eq "naive") {
+ $html .= " via naive input";
+ }
+ elsif ($cfg->{identification}->{mode} eq "constant") {
+ $html .= " via constant setting";
+ }
+ else {
+ $html .= " through magic";
+ }
+ return $html;
+}
+
sub viewhtmltail ()
{
my ($html);
@@ .
______________________________________________________________________
The OpenPKG Project www.openpkg.org
CVS Repository Commit List [email protected]