]> Frank Brehm's Git Trees - books.git/commitdiff
Benutzeranmeldung eingeführt
authorFrank Brehm <frank@brehm-online.com>
Thu, 18 Dec 2008 15:55:21 +0000 (15:55 +0000)
committerFrank Brehm <frank@brehm-online.com>
Thu, 18 Dec 2008 15:55:21 +0000 (15:55 +0000)
20 files changed:
lib/FrBr/Books.pm
lib/FrBr/Books/Controller/Autor.pm
lib/FrBr/Books/Controller/Books.pm
lib/FrBr/Books/Controller/Kategorie.pm
lib/FrBr/Books/Controller/Login.pm
lib/FrBr/Books/Controller/Logout.pm [new file with mode: 0644]
lib/FrBr/Books/Controller/Ort.pm
lib/FrBr/Books/Controller/Serie.pm
lib/FrBr/Books/Controller/Verlag.pm
root/src/autor/index.tt2
root/src/autor/list.tt2
root/src/books/index.tt2
root/src/books/list.tt2
root/src/category/index.tt2
root/src/login.css [new file with mode: 0644]
root/src/login.tt2 [new file with mode: 0644]
root/src/not_allowed.tt2 [new file with mode: 0644]
root/src/ort/index.tt2
root/src/serie/index.tt2
root/src/verlag/index.tt2

index bc518e466817547eedf2ed223551b8ce0cce0731..a251562cd3a7a297ff2d289117ae5c319bea8c86 100644 (file)
@@ -31,13 +31,15 @@ use Catalyst qw/
 
     StackTrace
 
+    Authentication
+
     Session
     Session::Store::DBIC
     Session::State::Cookie
 
 /;
 
-our $VERSION = '0.01';
+our $VERSION = '0.02';
 
 my %LangsToUse = (
     'de' => 'deutsch',
@@ -59,6 +61,24 @@ my %LangsToUseInDates = (
 # local deployment.
 
 __PACKAGE__->config(
+    'authentication' => {
+        'default_realm' => 'users',
+        'realms'        => {
+            'users' => {
+                'credential' => {
+                    'class'             => 'Password',
+                    'password_field'    => 'password',
+                    'password_type'     => 'salted_hash',
+                    'password_salt_len' => 8,
+                },
+                'store' => {
+                    'class'         => 'DBIx::Class',
+                    'user_class'    => 'Users',
+                    'id_field'      => 'user_id',
+                },
+            },
+        },
+    },
     'name' => 'FrBr::Books',
     'session' => {
         'dbic_class' => 'Schema::Session',
@@ -150,8 +170,48 @@ sub auto : Private {
     #$c->stash->{'lang_to_use'} = $lang;
     #$c->log->debug( $K . "Neue Sprache: '" . $lang . "' (" . $LangsToUseInDates{$lang} . ")." ) if $c->stash->{'debug_level'} >= 2;
 
+    # Login-abhaengige Dinge
+
     $c->stash->{'login_action'} = 'login';
 
+    if ( ( $c->controller eq $c->controller('Login') ) or ( $c->controller eq $c->controller('Logout') ) ) {
+        $c->stash->{'login_action'} = 'none';
+    }
+    elsif ( $c->user_exists ) {
+
+        my $user_info = $c->user();
+        #$c->log->debug( get_output_string( $K, "Aktueller Nutzer: ", $user_info ) ) if $c->config->{'debug_level'} >= 4;
+        my $uid       = $user_info->user_id;
+        my $user_name = $user_info->login;
+        if ( $user_info->nachname ) {
+            $user_name = $user_info->nachname;
+            $user_name = $user_info->vorname . " " . $user_name if $user_info->vorname;
+        }
+        $c->stash->{'current_user'}                     = $user_name;
+        $c->stash->{'current_user_id'}                  = $user_info->user_id;
+        $c->stash->{'login_action'}                     = 'logout';
+        $c->stash->{'current_user_is_manager'}          = 0;
+        $c->stash->{'current_user_is_human_resources'} = 0;
+        $c->stash->{'current_user_deps'}                = {};
+        $c->session->{'current_user_name'}              = $user_name;
+        $c->session->{'last_login_name'}                = $user_info->login();
+
+        #set_last_activity_time($c);
+
+        if ( $c->stash->{'debug_level'} >= 2 ) {
+            $c->log->debug( $K
+                    . "Aktuelle Nutzerinformationen:\n"
+                    . "  Name:          '" . $c->stash->{'current_user'} . "'\n"
+                    . "  Nutzer-Id:      " . $c->stash->{'current_user_id'} . "\n"
+                    . "  Ist Manager:    " . ( $c->stash->{'current_user_is_manager'} ? 'Ja' : 'Nein' ) . "\n"
+                    . "  Ist Personaler: " . ( $c->stash->{'current_user_is_human_resources'} ? 'Ja' : 'Nein' ) . "\n"
+                    . "  Abteilungen:    " . get_output_string( $c->stash->{'current_user_deps'} ) );
+        } ## end if ( $c->stash->{'debug_level'} >= 2 )
+
+    } ## end elsif ( $c->user_exists )
+
+    $c->stash->{'last_login_name'} = $c->session->{'last_login_name'};
+
     $c->log->debug( $K . "Aktuelle Script-URL: '" . $c->stash->{'self_url'} . "'." ) if $c->stash->{'debug_level'} >= 2;
 
     # Listenlaenge festlegen
@@ -162,6 +222,16 @@ sub auto : Private {
 
 } ## end sub auto :
 
+#-------------------------------------------------------
+
+sub not_allowed : Local {
+
+    my ( $self, $c ) = @_;
+    my $K = ( caller(0) )[3] . "(): ";
+
+    $c->stash->{'template'} = 'not_allowed.tt2';
+
+}
 
 =head1 NAME
 
index 1bd214bb3c8c098d67a98588efab8f2cb7768b1d..0c23d311b3a303a98c8f3cae8050ef6d21857658 100644 (file)
@@ -123,6 +123,11 @@ sub form_new : Path('new') {
 
     $c->log->debug( $K . "aufgerufen." ) if $c->stash->{'debug_level'} > 2;
 
+    unless ( $c->user_exists() ) {
+        $c->detach('/not_allowed');
+        return;
+    }
+
     $c->stash->{'menu_path'} = [] unless $c->stash->{'menu_path'};
     push @{ $c->stash->{'menu_path'} }, {
         'path' => $c->web_path("/autor/new"),
index cb320290b1997b87b95dd256b6d408f72a6c5eec..319473382ec165ee6b44b3b9f1103695ffd85f43 100644 (file)
@@ -191,6 +191,11 @@ sub form_new : Path('new') {
 
     $c->log->debug( $K . "aufgerufen." ) if $c->stash->{'debug_level'} > 2;
 
+    unless ( $c->user_exists() ) {
+        $c->detach('/not_allowed');
+        return;
+    }
+
     $c->stash->{'menu_path'} = [] unless $c->stash->{'menu_path'};
     $self->add_booklist_menu($c) if $c->session->{'from_book_list'};
     push @{ $c->stash->{'menu_path'} }, {
@@ -295,6 +300,11 @@ sub delete_buch : Path('delete') {
 
     $c->log->debug( $K . "aufgerufen." ) if $c->stash->{'debug_level'} > 2;
 
+    unless ( $c->user_exists() ) {
+        $c->detach('/not_allowed');
+        return;
+    }
+
     $c->stash->{'menu_path'} = [] unless $c->stash->{'menu_path'};
     $self->add_booklist_menu($c) if $c->session->{'from_book_list'};
     push @{ $c->stash->{'menu_path'} }, {
@@ -360,6 +370,11 @@ sub form_edit : Path('edit') {
 
     $c->log->debug( $K . "aufgerufen." ) if $c->stash->{'debug_level'} > 2;
 
+    unless ( $c->user_exists() ) {
+        $c->detach('/not_allowed');
+        return;
+    }
+
     $c->stash->{'menu_path'} = [] unless $c->stash->{'menu_path'};
     $self->add_booklist_menu($c) if $c->session->{'from_book_list'};
     push @{ $c->stash->{'menu_path'} }, {
index aaea194e66413ef12d9ba9f50d30379ffdbd71de..a4972565c1aafd1c1e8161745f3fa880525b2915 100644 (file)
@@ -96,6 +96,11 @@ sub form_new : Path('new') {
 
     $c->log->debug( $K . "aufgerufen." ) if $c->stash->{'debug_level'} > 2;
 
+    unless ( $c->user_exists() ) {
+        $c->detach('/not_allowed');
+        return;
+    }
+
     $c->stash->{'menu_path'} = [] unless $c->stash->{'menu_path'};
     push @{ $c->stash->{'menu_path'} }, {
         'path' => $c->web_path("/kategorie/new"),
index d1d8c5d96c6c1a16b140dfd9e80ecfec763d5d46..45f66ecae5c00619cead63315c039c921dd41319 100644 (file)
@@ -26,15 +26,40 @@ Catalyst Controller.
 =cut
 
 sub index : Private {
-    my ( $self, $c ) = @_;
 
-    $c->stash->{'template'}   = 'not_implemented.tt2';
+    my ( $self, $c ) = @_;
 
     push @{ $c->stash->{'menu_path'} }, {
         'path' => $c->web_path("/login"),
         'name' => "Anmeldung"
     };
 
+    $c->stash->{'site_title'} = "Anmeldung an Franks Büchersammlung";
+
+    $c->stash->{'cssfiles'} = [] unless $c->stash->{'cssfiles'};
+    push @{ $c->stash->{'cssfiles'} }, 'login.css';
+
+    my $username = $c->request->params->{'username'};
+    my $password = $c->request->params->{'password'};
+
+    # If the username and password values were found in form
+    if ( $username && $password ) {
+
+        # Attempt to log the user in
+        my $rs = $c->model('Schema::Users')->search({ 'login' => $username, 'deleted' => 'n', 'enabled' => 'y' });
+        if ($c->authenticate({ 'password' => $password, 'dbix_class' => {  resultset => $rs } })) {
+            $c->response->redirect( $c->web_path('/') );
+            return 1;
+        } ## end if ( $c->login( $username, $password ) )
+        else {
+            # Set an error message
+            $c->stash->{'error_msg'} = "Falscher Nutzername oder Paßwort.";
+        }
+    } ## end if ( $username && $password )
+
+    # If either of above don't work out, send to the login page
+    $c->stash->{'template'} = 'login.tt2';
+
 }
 
 
diff --git a/lib/FrBr/Books/Controller/Logout.pm b/lib/FrBr/Books/Controller/Logout.pm
new file mode 100644 (file)
index 0000000..404dbaa
--- /dev/null
@@ -0,0 +1,72 @@
+package FrBr::Books::Controller::Logout;
+
+# $Id$
+# $URL$
+
+use strict;
+use warnings;
+use base 'Catalyst::Controller';
+use FrBr::Common;
+
+=head1 NAME
+
+FrBr::Books::Controller::Logout - Catalyst Controller zum Abmelden
+
+=head1 DESCRIPTION
+
+Catalyst Controller.
+
+=head1 METHODS
+
+=cut
+
+
+=head2 index 
+
+=cut
+
+sub index : Private {
+
+    my ( $self, $c ) = @_;
+    my $K = ( caller(0) )[3] . "(): ";
+
+    if ( $c->user_exists ) {
+        # Clear the user's state
+        $c->logout;
+    }
+
+    # Ueberfluessige Sitzungsdaten weg ...
+    my @Keys = qw(
+        list_length
+    );
+    for my $key (@Keys) {
+        delete $c->session->{$key} if $c->session->{$key};
+    }
+
+    $c->stash->{'login_action'} = 'none';
+
+    # Send the user to the starting point
+    $c->response->redirect( $c->web_path('/') );
+
+    #$c->stash->{'site_title'} = $c->localize("Logout");
+    $c->stash->{'site_title'} = "Abmelden";
+
+}
+
+
+=head1 AUTHOR
+
+Frank Brehm
+
+=head1 LICENSE
+
+This library is free software, you can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut
+
+1;
+
+__END__
+
+# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
index e77245d10045c4ddc0398b19b18971a9d5759020..5cc30d7dd5b2462352baadee8fa6a2656fd6a5f9 100644 (file)
@@ -96,6 +96,11 @@ sub form_new : Path('new') {
 
     $c->log->debug( $K . "aufgerufen." ) if $c->stash->{'debug_level'} > 2;
 
+    unless ( $c->user_exists() ) {
+        $c->detach('/not_allowed');
+        return;
+    }
+
     $c->stash->{'menu_path'} = [] unless $c->stash->{'menu_path'};
     push @{ $c->stash->{'menu_path'} }, {
         'path' => $c->web_path("/ort/new"),
index 4d2859e3786e49855412bed1788c643d3ccc5da3..2ca87bc420c4f62ed95921a40eb192defd89e462 100644 (file)
@@ -96,6 +96,11 @@ sub form_new : Path('new') {
 
     $c->log->debug( $K . "aufgerufen." ) if $c->stash->{'debug_level'} > 2;
 
+    unless ( $c->user_exists() ) {
+        $c->detach('/not_allowed');
+        return;
+    }
+
     $c->stash->{'menu_path'} = [] unless $c->stash->{'menu_path'};
     push @{ $c->stash->{'menu_path'} }, {
         'path' => $c->web_path("/serie/new"),
index 83fcf1403f2175b46bce9efd253c4a65e19b9a31..0eba0837f490d243782c99d6134d3ab768c020df 100644 (file)
@@ -95,6 +95,11 @@ sub form_new : Path('new') {
 
     $c->log->debug( $K . "aufgerufen." ) if $c->stash->{'debug_level'} > 2;
 
+    unless ( $c->user_exists() ) {
+        $c->detach('/not_allowed');
+        return;
+    }
+
     $c->stash->{'menu_path'} = [] unless $c->stash->{'menu_path'};
     push @{ $c->stash->{'menu_path'} }, {
         'path' => $c->web_path("/verlag/new"),
index 8298d566673107f5910d1ef2abd0f5b8361b35fa..404f02fee7f6db11918b462c532adff9f8702b20 100644 (file)
@@ -27,7 +27,7 @@
     <td colspan="2" class="empty">
       &nbsp;</td>
   </tr>
-  <tr>
+  [% IF Catalyst.user_exists %]<tr>
     <td class="button">
       &nbsp;</td>
     <td class="item">
@@ -36,7 +36,7 @@
   <tr>
     <td colspan="2" class="empty">
       &nbsp;</td>
-  </tr>
+  </tr>[% END %]
   <tr>
     <td class="button">
       &nbsp;</td>
index b74cd32d3f50b96d36020c80230becc40fcb8828..3ea09992609e4f8a7f8154ba4fac0c6772e9407e 100644 (file)
@@ -1,4 +1,4 @@
-[%#
+<!-- [%#
   ** Template fuer Autorenliste
   **
   ** vim: noai : ts=4 fenc=utf-8 filetype=html expandtab :
@@ -7,21 +7,25 @@
   ** $URL$
   ** -%]
 
+  Autorenliste
+
+-->
+
 [% META title = 'Autorenliste' -%]
 
 <div class="center">
 
 <table class="wrapper" cellspacing="0">
 <tr><th>Liste der Bücher</th> </tr>
-<tr><td class="action"><a href="[% path('/autor/new') %]">Neuer Autor ...</a></td></tr>
+[% IF Catalyst.user_exists %]<tr><td class="action"><a href="[% path('/autor/new') %]">Neuer Autor ...</a></td></tr>[% END %]
 <tr><td><table class="autorliste">
   <tr>
     <th>Name des Autors</th>
     <th>zusätzliche Angaben</th>
     <th>Bücher</th>
     <th></th>
-    <th></th>
-    <th></th>
+    [% IF Catalyst.user_exists %]<th></th>
+    <th></th>[% END %]
   </tr>
 [% rowstyle = 'even' %][%- FOREACH author IN authors -%][% author_id = author.id %]
   <tr>
@@ -32,8 +36,8 @@
             <li>[% book.title %][% IF book.untertitel %] ([% book.untertitel %])[% END %]</li>[% END %][% ELSE %]<li><i>keine</i></li>[% END %]
         </ul></td>
     <td class="button [% rowstyle %]"><a href="[% path('/autor/view') %]?view_autor_id=[% author.id %]">Ansehen</a></td>
-    <td class="button [% rowstyle %]"><a href="[% path('/autor/edit') %]?edit_autor_id=[% author.id %]">Ändern</a></td>
-    <td class="button [% rowstyle %]">[% IF author.books and author.books.size > 0 %]Löschen[% ELSE %]<a href="[% path('/autor/delete') %]?delete_autor_id=[% author.id %]">Löschen</a>[% END %]</td>
+    [% IF Catalyst.user_exists %]<td class="button [% rowstyle %]"><a href="[% path('/autor/edit') %]?edit_autor_id=[% author.id %]">Ändern</a></td>
+    <td class="button [% rowstyle %]">[% IF author.books and author.books.size > 0 %]Löschen[% ELSE %]<a href="[% path('/autor/delete') %]?delete_autor_id=[% author.id %]">Löschen</a>[% END %]</td>[% END %]
   </tr>
 [% IF rowstyle == 'even' %][% rowstyle = 'odd'%][% ELSE %][% rowstyle = 'even' %][% END %][% END -%]
 </table></td></tr></table>
index 8f80c4eb77b99a2a4aada652343897b41eaf4208..7ea1d27398de3a8c1c2e9f8d21db3beb0b8a741d 100644 (file)
@@ -1,6 +1,6 @@
-[%#
+<!-- [%#
 
-    message.tt2 - Universal-Template
+    books/index.tt2.tt2 - Template für Bücher-Menü
 
     vim: noai : ts=4 fenc=utf-8 filetype=html expandtab :
 
@@ -8,6 +8,10 @@
     $URL$
 
 -%]
+
+  Bücher-Menü
+
+-->
 <div style="text-align: center">
 <table class="menu" cellspacing="0">
   <tr>
   </tr><tr>
     <td colspan="2" class="empty">
       &nbsp;</td>
-  </tr><tr>
+  [% IF Catalyst.user_exists %]</tr><tr>
     <td class="button">
       &nbsp;</td>
     <td class="item">
       <a href="[% path('/books/new') %]">Neues Buch</a></td>
   </tr><tr>
     <td colspan="2" class="empty">
-      &nbsp;</td>
+      &nbsp;</td>[% END %]
   </tr><tr>
     <td class="button">
       &nbsp;</td>
index 84a1cca0684674b67b28651b1de0033ca9ba6868..543d3aa81166bced3758d54c0f55906a843f6c6c 100644 (file)
@@ -1,4 +1,4 @@
-[%#
+<!-- [%#
   ** Template fuer Buecherliste
   **
   ** vim: noai : ts=4 fenc=utf-8 filetype=html expandtab :
@@ -7,11 +7,15 @@
   ** $URL$
   ** -%]
 
-[% META title = 'Bücherliste' -%]
+  Bücherliste
+
+-->
+
+[% tab_colspan = 6 %][% IF Catalyst.user_exists %][% tab_colspan = 8 %][% END %][% META title = 'Bücherliste' -%]
 
 [% BLOCK navrow %]
   <tr>
-    <td class="nav" colspan="8"><table cellspacing="0" class="nav" width="100%">
+    <td class="nav" colspan="[% tab_colspan %]"><table cellspacing="0" class="nav" width="100%">
           <tr>
               <td width="33%" style="text-align: left;"><b>[% IF book_liste_page.cur != 1 %]<a href="[% self_url %]?page=1" title="Erste Seite">&lt;&lt;</a>[% ELSE %]&lt;&lt;[% END %]&nbsp;&nbsp;[% IF book_liste_page.cur != book_liste_page.prev %]<a href="[% self_url %]?page=[% book_liste_page.prev %]" title="Vorherige Seite">&lt;</a>[% ELSE %]&lt;[% END %]</b></td>
               <td width="33%" style="text-align: center;">Buch [% book_liste_page.book_from %] bis [% book_liste_page.book_to %] von [% book_liste_page.books %]</td>
@@ -25,7 +29,7 @@
 
 <table class="wrapper" cellspacing="0">
 <tr><th>Liste der Bücher</th> </tr>
-<tr><td class="action"><a href="[% path('/books/new') %]">Neues Buch ...</a></td></tr>
+[% IF Catalyst.user_exists %]<tr><td class="action"><a href="[% path('/books/new') %]">Neues Buch ...</a></td></tr>[% END %]
 <tr><td><table class="buchliste" cellspacing="0">
   <tr>
     <th>Autor (-en)</th>
@@ -34,8 +38,8 @@
     <th>Verlag</th>
     <th>Aufbewahrungsort</th>
     <th></th>
-    <th></th>
-    <th></th>
+    [% IF Catalyst.user_exists %]<th></th>
+    <th></th>[% END %]
   </tr>[% PROCESS navrow %]
 [% rowstyle = 'even' %][%- FOREACH book IN books -%][% buch_id = book.id %]
   <tr>
@@ -45,8 +49,8 @@
     <td class="[% rowstyle %]">[% book.verlagsname_short %]</td>
     <td class="[% rowstyle %]">[% IF book.orts_id %][% book.ortsname %][% ELSE %]unbekannt[% END %]</td>
     <td class="[% rowstyle %] button"><a href="[% path('/books/view') %]?view_book_id=[% book.id %]">Ansehen</a></td>
-    <td class="[% rowstyle %] button"><a href="[% path('/books/edit') %]?edit_book_id=[% book.id %]">Ändern</a></td>
-    <td class="[% rowstyle %] button"><a href="[% path('/books/delete') %]?delete_book_id=[% book.id %]">Löschen</a></td>
+    [% IF Catalyst.user_exists %]<td class="[% rowstyle %] button"><a href="[% path('/books/edit') %]?edit_book_id=[% book.id %]">Ändern</a></td>
+    <td class="[% rowstyle %] button"><a href="[% path('/books/delete') %]?delete_book_id=[% book.id %]">Löschen</a></td>[% END %]
   </tr>
 [% IF rowstyle == 'even' %][% rowstyle = 'odd'%][% ELSE %][% rowstyle = 'even' %][% END %][% END -%]
 [% PROCESS navrow %]</table></td></tr></table>
index faa75d41fefb952aea5bf9216c109e296777097e..c9e577bf4447760e67eb7a45f4d02f2d4ebc9e70 100644 (file)
@@ -27,7 +27,7 @@
     <td colspan="2" class="empty">
       &nbsp;</td>
   </tr>
-  <tr>
+  [% IF Catalyst.user_exists %]<tr>
     <td class="button">
       &nbsp;</td>
     <td class="item">
@@ -36,7 +36,7 @@
   <tr>
     <td colspan="2" class="empty">
       &nbsp;</td>
-  </tr>
+  </tr>[% END %]
   <tr>
     <td class="button">
       &nbsp;</td>
diff --git a/root/src/login.css b/root/src/login.css
new file mode 100644 (file)
index 0000000..6d87d3d
--- /dev/null
@@ -0,0 +1,93 @@
+/* [%#
+   # Template fuer Stylesheets Login-Formular
+   #
+   # $Id$
+   # $URL$
+   #
+-%]
+
+Stylesheets Autoren */
+
+DIV.center {
+  margin:               auto;
+  text-align:           center;
+  width:                auto;
+}
+
+TABLE.wrapper {
+  border-spacing:       0;
+  margin:               auto;
+}
+
+TABLE.wrapper TH {
+  text-align:           center;
+  font-size:            1.2em;
+}
+
+TABLE.wrapper TD {
+  text-align:           left;
+}
+
+TABLE.wrapper TD.action {
+  font-weight:          bolder;
+  padding-top:          1em;
+  padding-bottom:       1em;
+}
+
+TABLE.login {
+  border-width:                2px;
+  border-style:                solid;
+  border-top-color:     [% site.col.tab_rahmen_hell %];
+  border-left-color:    [% site.col.tab_rahmen_hell %];
+  border-right-color:  [% site.col.tab_rahmen_dkl %];
+  border-bottom-color:  [% site.col.tab_rahmen_dkl %];  
+  border-collapse:     separate;
+  border-spacing:      0;
+  margin:              auto;
+}
+
+TABLE.login TH {
+  vertical-align:      top;
+  text-align:          left; 
+  font-size:            1em;
+  padding:             2px;
+  border-width:                1px;
+  border-style:                solid;
+  border-top-color:     [% site.col.tab_rahmen_dkl %];
+  border-left-color:    [% site.col.tab_rahmen_dkl %];
+  border-right-color:  [% site.col.tab_rahmen_hell %];
+  border-bottom-color:  [% site.col.tab_rahmen_hell %];  
+  background-color:    [% site.col.list_head %];
+}
+
+TABLE.login TD {
+  vertical-align:      top;
+  font-size:            1em;
+  padding:             2px;
+  border-width:                1px;
+  border-style:                solid;
+  border-top-color:     [% site.col.tab_rahmen_dkl %];
+  border-left-color:    [% site.col.tab_rahmen_dkl %];
+  border-right-color:  [% site.col.tab_rahmen_hell %];
+  border-bottom-color:  [% site.col.tab_rahmen_hell %];  
+  background-color:    [% site.col.list_row_bold %];
+}
+
+TABLE.login TD.empty {
+  height:              3px;
+}
+
+TABLE.login TH.button {
+  font-weight:          bolder;
+  text-align:           center;
+  padding-left:         1em;
+  padding-right:        1em;
+}
+
+TABLE.login TH.button INPUT {
+  font-weight:          bolder;
+  font-size:           1.2em;
+  padding-left:         2em;
+  padding-right:        2em;
+}
+
diff --git a/root/src/login.tt2 b/root/src/login.tt2
new file mode 100644 (file)
index 0000000..c19da76
--- /dev/null
@@ -0,0 +1,44 @@
+<!-- [%#
+    Template zur Darstellung des Login-Formulars
+
+    vim: noai : ts=4 fenc=utf-8 filetype=html expandtab :
+
+    $Id$
+    $URL$
+
+-%]
+
+Login form -->
+
+[%- META title = 'Anmeldung an Franks Büchersammlung' -%]
+<div class="center">
+
+<form method="post" action="[% path('/login') %]">
+  <table class="login" cellspacing="0">
+    <tr>
+      <th colspan="2" class="title">Anmeldung am System</th>
+    </tr><tr>
+      <td colspan="2" class="empty"></td>
+    </tr><tr>
+      <th>Nutzername:</th>
+      <td><input type="text" name="username" size="40" [% IF last_login_name %]value="[% last_login_name %]" [% END %]/></td>
+    </tr><tr>
+      <th>Paßwort:</th>
+      <td><input type="password" name="password" size="40" /></td>
+    </tr><tr>
+      <td colspan="2" class="empty"></td>
+    </tr><tr>
+      <th colspan="2" class="button"><input type="submit" name="submit" value="Anmelden" /></th>
+    </tr>
+  </table>
+</form>
+[%- IF error_msg %]
+<div class="error">
+<span class="bold">Fehler:</span>&nbsp;[% error_msg %]
+</div>
+[% END %]
+<div class="back">
+<h2><a href="[% path('/') %]">Zurück</a></h2>
+</div>
+
+</div>
diff --git a/root/src/not_allowed.tt2 b/root/src/not_allowed.tt2
new file mode 100644 (file)
index 0000000..c53c25e
--- /dev/null
@@ -0,0 +1,21 @@
+<!-- [%#
+
+    Template zur Darstellung einer nicht erlaubten Aktion
+
+    vim: noai : ts=4 fenc=utf-8 filetype=html expandtab :
+
+    $Id$
+    $URL$
+
+%]
+
+Das ist hier nicht erlaubt!!!
+
+-->
+
+<h2>Sie sind nicht angemeldet.</h2>
+<h3>Das gewünschte Feature ist Ihnen deshalb nicht zugänglich.</h3>
+<br />
+<br />
+<h1 style="text-align: center;"><a href="[% path('/') %]">OK</a></h1>
+
index 8be4883f1ea7b826e1ff8ab40c9f92f8cf262212..c1255ecb3c225015dd629facf1785f5616ddaa70 100644 (file)
@@ -27,7 +27,7 @@
     <td colspan="2" class="empty">
       &nbsp;</td>
   </tr>
-  <tr>
+  [% IF Catalyst.user_exists %]<tr>
     <td class="button">
       &nbsp;</td>
     <td class="item">
@@ -36,7 +36,7 @@
   <tr>
     <td colspan="2" class="empty">
       &nbsp;</td>
-  </tr>
+  </tr>[% END %]
   <tr>
     <td class="button">
       &nbsp;</td>
index be4375f2e620bc8de14386949efb94d583c5924e..c6ba3475756ba176405b54d976dce35f5a715ba9 100644 (file)
@@ -27,7 +27,7 @@
     <td colspan="2" class="empty">
       &nbsp;</td>
   </tr>
-  <tr>
+  [% IF Catalyst.user_exists %]<tr>
     <td class="button">
       &nbsp;</td>
     <td class="item">
@@ -36,7 +36,7 @@
   <tr>
     <td colspan="2" class="empty">
       &nbsp;</td>
-  </tr>
+  </tr>[% END %]
   <tr>
     <td class="button">
       &nbsp;</td>
index 24faddf807fbfa24ba25be5c61574d8017d0c538..a72dc7c1345e01cd5a66501f812bbe6bc772c111 100644 (file)
@@ -27,7 +27,7 @@
     <td colspan="2" class="empty">
       &nbsp;</td>
   </tr>
-  <tr>
+  [% IF Catalyst.user_exists %]<tr>
     <td class="button">
       &nbsp;</td>
     <td class="item">
@@ -36,7 +36,7 @@
   <tr>
     <td colspan="2" class="empty">
       &nbsp;</td>
-  </tr>
+  </tr>[% END %]
   <tr>
     <td class="button">
       &nbsp;</td>