Release commit for 5.9013
[catagits/Catalyst-Manual.git] / lib / Catalyst / Manual / Tutorial / 05_Authentication.pod
index 4a5c05e..f5f4964 100644 (file)
@@ -85,22 +85,22 @@ opening F<myapp02.sql> in your editor and insert:
     --
     PRAGMA foreign_keys = ON;
     CREATE TABLE users (
-            id            INTEGER PRIMARY KEY,
-            username      TEXT,
-            password      TEXT,
-            email_address TEXT,
-            first_name    TEXT,
-            last_name     TEXT,
-            active        INTEGER
+        id            INTEGER PRIMARY KEY,
+        username      TEXT,
+        password      TEXT,
+        email_address TEXT,
+        first_name    TEXT,
+        last_name     TEXT,
+        active        INTEGER
     );
     CREATE TABLE role (
-            id   INTEGER PRIMARY KEY,
-            role TEXT
+        id   INTEGER PRIMARY KEY,
+        role TEXT
     );
     CREATE TABLE user_role (
-            user_id INTEGER REFERENCES users(id) ON DELETE CASCADE ON UPDATE CASCADE,
-            role_id INTEGER REFERENCES role(id) ON DELETE CASCADE ON UPDATE CASCADE,
-            PRIMARY KEY (user_id, role_id)
+        user_id INTEGER REFERENCES users(id) ON DELETE CASCADE ON UPDATE CASCADE,
+        role_id INTEGER REFERENCES role(id) ON DELETE CASCADE ON UPDATE CASCADE,
+        PRIMARY KEY (user_id, role_id)
     );
     --
     -- Load up some initial test data
@@ -312,7 +312,7 @@ following code:
     </Plugin::Authentication>
 
 B<TIP:> Here is a short script that will dump the contents of
-C<MyApp->config> to L<Config::General> format in F<myapp.conf>:
+C<< MyApp->config >> to L<Config::General> format in F<myapp.conf>:
 
     $ CATALYST_DEBUG=0 perl -Ilib -e 'use MyApp; use Config::General;
         Config::General->new->save_file("myapp.conf", MyApp->config);'
@@ -433,19 +433,19 @@ Create a login form by opening F<root/src/login.tt2> and inserting:
 
     <!-- Login form -->
     <form method="post" action="[% c.uri_for('/login') %]">
-      <table>
-        <tr>
-          <td>Username:</td>
-          <td><input type="text" name="username" size="40" /></td>
-        </tr>
-        <tr>
-          <td>Password:</td>
-          <td><input type="password" name="password" size="40" /></td>
-        </tr>
-        <tr>
-          <td colspan="2"><input type="submit" name="submit" value="Submit" /></td>
-        </tr>
-      </table>
+        <table>
+            <tr>
+                <td>Username:</td>
+                <td><input type="text" name="username" size="40" /></td>
+            </tr>
+            <tr>
+                <td>Password:</td>
+                <td><input type="password" name="password" size="40" /></td>
+            </tr>
+            <tr>
+                <td colspan="2"><input type="submit" name="submit" value="Submit" /></td>
+            </tr>
+        </table>
     </form>
 
 
@@ -515,8 +515,8 @@ lines to the bottom of the file:
     ...
     <p>
     [%
-       # This code illustrates how certain parts of the TT
-       # template will only be shown to users who have logged in
+        # This code illustrates how certain parts of the TT
+        # template will only be shown to users who have logged in
     %]
     [% IF c.user_exists %]
         Please Note: You are already logged in as '[% c.user.username %]'.
@@ -525,11 +525,11 @@ lines to the bottom of the file:
         You need to log in to use this application.
     [% END %]
     [%#
-       Note that this whole block is a comment because the "#" appears
-       immediate after the "[%" (with no spaces in between).  Although it
-       can be a handy way to temporarily "comment out" a whole block of
-       TT code, it's probably a little too subtle for use in "normal"
-       comments.
+        Note that this whole block is a comment because the "#" appears
+        immediate after the "[%" (with no spaces in between).  Although it
+        can be a handy way to temporarily "comment out" a whole block of
+        TT code, it's probably a little too subtle for use in "normal"
+        comments.
     %]
     </p>
 
@@ -575,8 +575,8 @@ bottom (below the closing </table> tag):
 
     ...
     <p>
-      <a href="[% c.uri_for('/login') %]">Login</a>
-      <a href="[% c.uri_for(c.controller.action_for('form_create')) %]">Create</a>
+        <a href="[% c.uri_for('/login') %]">Login</a>
+        <a href="[% c.uri_for(c.controller.action_for('form_create')) %]">Create</a>
     </p>
 
 Reload your browser and you should now see a "Login" and "Create" links
@@ -606,7 +606,7 @@ We are just avoiding the I<storage> of cleartext passwords in the
 database by using a salted SHA-1 hash. If you are concerned about
 cleartext passwords between the browser and your application, consider
 using SSL/TLS, made easy with modules such as
-L<Catalyst::Plugin:RequireSSL> and L<Catalyst::ActionRole::RequireSSL>.
+L<Catalyst::Plugin::RequireSSL> and L<Catalyst::ActionRole::RequireSSL>.
 
 
 =head2 Re-Run the DBIC::Schema Model Helper to Include DBIx::Class::PassphraseColumn
@@ -684,9 +684,9 @@ text:
         $user->update;
     }
 
-PassphraseColumn lets us simply call C<$user->check_password($password)>
+PassphraseColumn lets us simply call C<< $user->check_password($password) >>
 to see if the user has supplied the correct password, or, as we show
-above, call C<$user->update($new_password)> to update the hashed
+above, call C<< $user->update($new_password) >> to update the hashed
 password stored for this user.
 
 Then run the following command:
@@ -802,8 +802,8 @@ flash vs. the C<status_msg> query parameter:
     ...
 
 Although the sample above only shows the C<content> div, leave the rest
-of the file intact -- the only change we made to replace "||
-c.request.params.status_msg" with "c.flash.status_msg" in the
+of the file intact -- the only change we made to replace "C<||
+c.request.params.status_msg>" with "C<c.flash.status_msg>" in the
 C<< <span class="message"> >> line.
 
 
@@ -963,4 +963,4 @@ L<https://rt.cpan.org/Public/Dist/Display.html?Name=Catalyst-Manual>.
 
 Copyright 2006-2011, Kennedy Clark, under the
 Creative Commons Attribution Share-Alike License Version 3.0
-(L<http://creativecommons.org/licenses/by-sa/3.0/us/>).
+(L<https://creativecommons.org/licenses/by-sa/3.0/us/>).