X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Manual.git;a=blobdiff_plain;f=lib%2FCatalyst%2FManual%2FTutorial%2FAuthentication.pod;h=b670e67d083d02d34c0e1c0f2f99bf2f4769db96;hp=e66fee8ecc3b570aa7960b98d3cc8f368b1038e6;hb=c89d3e0c4c78f73590171d23236e3dc8557514f5;hpb=905a3a26761669e7c4fd80daa50034eaa3375b50 diff --git a/lib/Catalyst/Manual/Tutorial/Authentication.pod b/lib/Catalyst/Manual/Tutorial/Authentication.pod index e66fee8..b670e67 100644 --- a/lib/Catalyst/Manual/Tutorial/Authentication.pod +++ b/lib/Catalyst/Manual/Tutorial/Authentication.pod @@ -205,7 +205,7 @@ classes created in Part 3. Note that we do not need to make any change to the C 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 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. @@ -293,10 +293,11 @@ L plugin. First, as noted in Part 3 of the tutorial, Catalyst has recently switched from a default config file format of YAML to -C (an apache-like format). In case you are using -a version of Catalyst earlier than v5.7014, delete the C -file and simply follow the directions below to create a new -C file. +C (an apache-like format). In case you are using a +version of Catalyst earlier than v5.7014, delete the C, or +convert it to .conf format using the TIP in +L; then simply follow the +directions below to create a new C file. Here, we need to load several parameters that tell L @@ -331,9 +332,6 @@ C 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 @@ -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 and inserting: [% META title = 'Login' %] -
+ @@ -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 logout here. + [% IF c.user_exists %] + Please Note: You are already logged in as '[% c.user.username %]'. + You can logout here. [% ELSE %] You need to log in to use this application. [% END %] @@ -638,8 +636,8 @@ Open C and add the following lines to the bottom (below the closing
Username:
tag):

- Login - Create + Login + Create

Reload your browser and you should now see a "Login" and "Create" links @@ -751,9 +749,6 @@ C 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 @@ -813,7 +808,7 @@ flash vs. the C query parameter:
- [% status_msg || Catalyst.flash.status_msg %] + [% status_msg || c.flash.status_msg %] [% error_msg %] [% content %]
@@ -841,7 +836,7 @@ information. Although the a use of flash above is certainly an improvement over the C we employed in Part 4 of the tutorial, the C statement is a little ugly. A nice +|| c.flash.status_msg> statement is a little ugly. A nice alternative is to use the C 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 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. +longer explicitly accessing C. =head1 AUTHOR @@ -885,4 +880,4 @@ most recent version of the Catalyst Tutorial can be found at L. Copyright 2006-2008, Kennedy Clark, under Creative Commons License -(L). +(L).