X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FManual%2FTutorial%2F05_Authentication.pod;h=87ab43522ef13139d54ce424847c2c140618cfac;hb=5efd5cc6c1a720e102acd63b08f65a4de2a0f4b5;hp=4a5c05e9be1587a1390cce8872b4af982e45c9d3;hpb=f9ce297698249b24617c5a60e7c625f2005be144;p=catagits%2FCatalyst-Manual.git diff --git a/lib/Catalyst/Manual/Tutorial/05_Authentication.pod b/lib/Catalyst/Manual/Tutorial/05_Authentication.pod index 4a5c05e..87ab435 100644 --- a/lib/Catalyst/Manual/Tutorial/05_Authentication.pod +++ b/lib/Catalyst/Manual/Tutorial/05_Authentication.pod @@ -85,22 +85,22 @@ opening F 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: B Here is a short script that will dump the contents of -Cconfig> to L format in F: +C<< MyApp->config >> to L format in F: $ 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 and inserting:
- - - - - - - - - - - - -
Username:
Password:
+ + + + + + + + + + + + +
Username:
Password:
@@ -515,8 +515,8 @@ 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 + # 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. %]

@@ -575,8 +575,8 @@ bottom (below the closing tag): ...

- Login - Create + Login + Create

Reload your browser and you should now see a "Login" and "Create" links @@ -606,7 +606,7 @@ We are just avoiding the I 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 and L. +L and L. =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 query parameter: ... Although the sample above only shows the C 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" in the C<< >> line.