Put back in leading spaces to keep code blocks contiguous
hkclark [Tue, 30 Aug 2011 02:35:15 +0000 (22:35 -0400)]
Some pod tools/viewers do goofy things if the indent isn't maintained
throughout the entire code block.

lib/Catalyst/Manual/Tutorial/05_Authentication.pod

index 1ac2c84..b01f446 100644 (file)
@@ -223,11 +223,11 @@ C<StackTrace> is new):
         -Debug
         ConfigLoader
         Static::Simple
-
+    
         StackTrace
-
+    
         Authentication
-
+    
         Session
         Session::Store::File
         Session::State::Cookie
@@ -344,18 +344,18 @@ the helpers when we created the Login controller above, and update the
 definition of C<sub index> to match:
 
     =head2 index
-
+    
     Login logic
-
+    
     =cut
-
+    
     sub index :Path :Args(0) {
         my ($self, $c) = @_;
-
+    
         # Get the username and password from form
         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
@@ -374,7 +374,7 @@ definition of C<sub index> to match:
             $c->stash(error_msg => "Empty username or password.")
                 unless ($c->user_exists);
         }
-
+    
         # If either of above don't work out, send to the login page
         $c->stash(template => 'login.tt2');
     }
@@ -410,17 +410,17 @@ Next, update the corresponding method in
 C<lib/MyApp/Controller/Logout.pm> to match:
 
     =head2 index
-
+    
     Logout logic
-
+    
     =cut
-
+    
     sub index :Path :Args(0) {
         my ($self, $c) = @_;
-
+    
         # Clear the user's state
         $c->logout;
-
+    
         # Send the user to the starting point
         $c->response->redirect($c->uri_for('/'));
     }
@@ -435,7 +435,7 @@ line of the C<sub index>.
 Create a login form by opening C<root/src/login.tt2> and inserting:
 
     [% META title = 'Login' %]
-
+    
     <!-- Login form -->
     <form method="post" action="[% c.uri_for('/login') %]">
       <table>
@@ -466,17 +466,17 @@ Edit the existing C<lib/MyApp/Controller/Root.pm> class file and insert
 the following method:
 
     =head2 auto
-
+    
     Check if there is a user and, if not, forward to login page
-
+    
     =cut
-
+    
     # Note that 'auto' runs after 'begin' but before your actions and that
     # 'auto's "chain" (all from application path to most specific class are run)
     # See the 'Actions' section of 'Catalyst::Manual::Intro' for more info.
     sub auto :Private {
         my ($self, $c) = @_;
-
+    
         # Allow unauthenticated users to reach the login page.  This
         # allows unauthenticated users to reach any action in the Login
         # controller.  To lock it down to a single action, we could use:
@@ -486,7 +486,7 @@ the following method:
         if ($c->controller eq $c->controller('Login')) {
             return 1;
         }
-
+    
         # If a user doesn't exist, force login
         if (!$c->user_exists) {
             # Dump a log message to the development server debug output
@@ -496,7 +496,7 @@ the following method:
             # Return 0 to cancel 'post-auto' processing and prevent use of application
             return 0;
         }
-
+    
         # User found, so return 1 to continue with processing after this 'auto'
         return 1;
     }
@@ -677,16 +677,16 @@ file C<set_hashed_passwords.pl> in your editor and enter the following
 text:
 
     #!/usr/bin/perl
-
+    
     use strict;
     use warnings;
-
+    
     use MyApp::Schema;
-
+    
     my $schema = MyApp::Schema->connect('dbi:SQLite:myapp.db');
-
+    
     my @users = $schema->resultset('User')->all;
-
+    
     foreach my $user (@users) {
         $user->password('mypass');
         $user->update;
@@ -777,21 +777,21 @@ match the following (everything after the model search line of code has
 changed):
 
     =head2 delete
-
+    
     Delete a book
-
+    
     =cut
-
+    
     sub delete :Chained('object') :PathPart('delete') :Args(0) {
         my ($self, $c) = @_;
-
+    
         # Use the book object saved by 'object' and delete it along
         # with related 'book_authors' entries
         $c->stash->{object}->delete;
-
+    
         # Use 'flash' to save information across requests until it's read
         $c->flash->{status_msg} = "Book deleted";
-
+    
         # Redirect the user back to the list page
         $c->response->redirect($c->uri_for($self->action_for('list')));
     }