Removing invalid and confusing references to id_field
[catagits/Catalyst-Manual.git] / lib / Catalyst / Manual / Tutorial / Authentication.pod
index e66fee8..d7c0851 100644 (file)
@@ -205,7 +205,7 @@ classes created in Part 3.
 
 Note that we do not need to make any change to the
 C<lib/MyApp/Schema.pm> schema file.  It simply tells DBIC to
-load all of the result source files it finds in below the
+load all of the result class files it finds in below the
 C<lib/MyApp/Schema> directory, so it will automatically pick
 up our new table information.
 
@@ -238,7 +238,7 @@ Look for the three new model objects in the startup debug output:
     '-------------------------------------------------------------------+----------'
     ...
 
-Again, notice that your "result source" classes have been "re-loaded"
+Again, notice that your "result class" classes have been "re-loaded"
 by Catalyst under C<MyApp::Model>.
 
 
@@ -293,10 +293,11 @@ L<ConfigLoader|Catalyst::Plugin::ConfigLoader> plugin.
 
 First, as noted in Part 3 of the tutorial, Catalyst has recently
 switched from a default config file format of YAML to
-C<Config::General> (an apache-like format).  In case you are using
-a version of Catalyst earlier than v5.7014, delete the C<myapp.yml>
-file and simply follow the directions below to create a new
-C<myapp.conf> file.
+C<Config::General> (an apache-like format).  In case you are using a
+version of Catalyst earlier than v5.7014, delete the C<myapp.yml>, or
+convert it to .conf format using the TIP in
+L<Catalyst::Manual::MoreCatalystBasics>; then simply follow the
+directions below to create a new C<myapp.conf> file.
 
 Here, we need to load several parameters that tell
 L<Catalyst::Plugin::Authentication|Catalyst::Plugin::Authentication>
@@ -331,9 +332,6 @@ C<myapp.conf> file and update it to match:
                     # NOTE: Omit 'MyApp::Model' here just as you would when using
                     # '$c->model("DB::Users)'
                     user_class DB::Users
-                    # This is the name of the field in your 'users' table that
-                    # contains the user's name
-                    id_field username
                 </store>
             </dbic>
         </realms>
@@ -384,7 +382,7 @@ Then update it to match:
         if ($username && $password) {
             # Attempt to log the user in
             if ($c->authenticate({ username => $username,
-                                   password => $password} )) {
+                                   password => $password  } )) {
                 # If successful, then let them use the application
                 $c->response->redirect($c->uri_for('/books/list'));
                 return;
@@ -453,7 +451,7 @@ Create a login form by opening C<root/src/login.tt2> and inserting:
     [% META title = 'Login' %]
 
     <!-- Login form -->
-    <form method="post" action="[% Catalyst.uri_for('/login') %]">
+    <form method="post" action="[% c.uri_for('/login') %]">
       <table>
         <tr>
           <td>Username:</td>
@@ -589,9 +587,9 @@ lines to the bottom of the file:
        # This code illustrates how certain parts of the TT
        # template will only be shown to users who have logged in
     %]
-    [% IF Catalyst.user_exists %]
-        Please Note: You are already logged in as '[% Catalyst.user.username %]'.
-        You can <a href="[% Catalyst.uri_for('/logout') %]">logout</a> here.
+    [% IF c.user_exists %]
+        Please Note: You are already logged in as '[% c.user.username %]'.
+        You can <a href="[% c.uri_for('/logout') %]">logout</a> here.
     [% ELSE %]
         You need to log in to use this application.
     [% END %]
@@ -638,8 +636,8 @@ Open C<root/src/books/list.tt2> and add the following lines to the
 bottom (below the closing </table> tag):
 
     <p>
-      <a href="[% Catalyst.uri_for('/login') %]">Login</a>
-      <a href="[% Catalyst.uri_for('form_create') %]">Create</a>
+      <a href="[% c.uri_for('/login') %]">Login</a>
+      <a href="[% c.uri_for('form_create') %]">Create</a>
     </p>
 
 Reload your browser and you should now see a "Login" and "Create" links
@@ -751,9 +749,6 @@ C<password_hash_type> are new, everything else is the same):
                     # NOTE: Omit 'MyApp::Model' here just as you would when using
                     # '$c->model("DB::Users)'
                     user_class DB::Users
-                    # This is the name of the field in your 'users' table that
-                    # contains the user's name
-                    id_field username
                 </store>
             </dbic>
         </realms>
@@ -813,7 +808,7 @@ flash vs. the C<status_msg> query parameter:
     <div id="header">[% PROCESS site/header %]</div>
 
     <div id="content">
-    <span class="message">[% status_msg || Catalyst.flash.status_msg %]</span>
+    <span class="message">[% status_msg || c.flash.status_msg %]</span>
     <span class="error">[% error_msg %]</span>
     [% content %]
     </div>
@@ -841,7 +836,7 @@ information.
 
 Although the a use of flash above is certainly an improvement over the
 C<status_msg> we employed in Part 4 of the tutorial, the C<status_msg
-|| Catalyst.flash.status_msg> statement is a little ugly. A nice
+|| c.flash.status_msg> statement is a little ugly. A nice
 alternative is to use the C<flash_to_stash> feature that automatically
 copies the content of flash to stash.  This makes your code controller
 and template code work regardless of where it was directly access, a
@@ -873,7 +868,7 @@ Restart the development server and go to
 L<http://localhost:3000/books/list> in your browser.  Delete another
 of the "Test" books you added in the previous step.  Flash should still
 maintain the status message across the redirect even though you are no
-longer explicitly accessing C<Catalyst.flash>.
+longer explicitly accessing C<c.flash>.
 
 
 =head1 AUTHOR