[Catalyst-commits] r12712 - in Catalyst-Plugin-Authentication/0.10000/trunk/lib/Catalyst: Authentication/Store Plugin

rafl at dev.catalyst.perl.org rafl at dev.catalyst.perl.org
Fri Jan 22 21:44:55 GMT 2010


Author: rafl
Date: 2010-01-22 21:44:55 +0000 (Fri, 22 Jan 2010)
New Revision: 12712

Modified:
   Catalyst-Plugin-Authentication/0.10000/trunk/lib/Catalyst/Authentication/Store/Minimal.pm
   Catalyst-Plugin-Authentication/0.10000/trunk/lib/Catalyst/Plugin/Authentication.pm
Log:
Clean up some more tabs and whitespaces.

Modified: Catalyst-Plugin-Authentication/0.10000/trunk/lib/Catalyst/Authentication/Store/Minimal.pm
===================================================================
--- Catalyst-Plugin-Authentication/0.10000/trunk/lib/Catalyst/Authentication/Store/Minimal.pm	2010-01-22 21:34:14 UTC (rev 12711)
+++ Catalyst-Plugin-Authentication/0.10000/trunk/lib/Catalyst/Authentication/Store/Minimal.pm	2010-01-22 21:44:55 UTC (rev 12712)
@@ -104,7 +104,7 @@
                                 },
                                 store => {
                                     class => 'Minimal',
-                               	    users => {
+                                    users => {
                                         bob => {
                                             password => "s00p3r",
                                             editor => 'yes',

Modified: Catalyst-Plugin-Authentication/0.10000/trunk/lib/Catalyst/Plugin/Authentication.pm
===================================================================
--- Catalyst-Plugin-Authentication/0.10000/trunk/lib/Catalyst/Plugin/Authentication.pm	2010-01-22 21:34:14 UTC (rev 12711)
+++ Catalyst-Plugin-Authentication/0.10000/trunk/lib/Catalyst/Plugin/Authentication.pm	2010-01-22 21:44:55 UTC (rev 12712)
@@ -53,8 +53,8 @@
 # change this to allow specification of a realm - to verify the user is part of that realm
 # in addition to verifying that they exist.
 sub user_exists {
-	my $c = shift;
-	return defined($c->_user) || defined($c->find_realm_for_persisted_user);
+    my $c = shift;
+    return defined($c->_user) || defined($c->find_realm_for_persisted_user);
 }
 
 # works like user_exists - except only returns true if user
@@ -227,7 +227,7 @@
     $app->mk_classdata( '_auth_realm_restore_order' => []);
 
     my $cfg = $app->config->{'Plugin::Authentication'};
-	my $realmshash;
+    my $realmshash;
     if (!defined($cfg)) {
         if (exists($app->config->{'authentication'})) {
             $cfg = $app->config->{'authentication'};
@@ -236,16 +236,16 @@
             $cfg = {};
         }
     } else {
-		# the realmshash contains the various configured realms.  By default this is
-		# the main $app->config->{'Plugin::Authentication'} hash - but if that is
-		# not defined, or there is a subkey {'realms'} then we use that.
-		$realmshash = $cfg;
-	}
+        # the realmshash contains the various configured realms.  By default this is
+        # the main $app->config->{'Plugin::Authentication'} hash - but if that is
+        # not defined, or there is a subkey {'realms'} then we use that.
+        $realmshash = $cfg;
+    }
 
-	## If we have a sub-key of {'realms'} then we use that for realm configuration
-	if (exists($cfg->{'realms'})) {
-		$realmshash = $cfg->{'realms'};
-	}
+    ## If we have a sub-key of {'realms'} then we use that for realm configuration
+    if (exists($cfg->{'realms'})) {
+        $realmshash = $cfg->{'realms'};
+    }
 
     # old default was to force use_session on.  This must remain for that
     # reason - but if use_session is already in the config, we respect its setting.
@@ -262,16 +262,16 @@
 
         foreach my $realm (sort keys %{$realmshash}) {
             if (ref($realmshash->{$realm}) eq 'HASH' &&
-				(exists($realmshash->{$realm}{credential}) || exists($realmshash->{$realm}{class}))) {
+                (exists($realmshash->{$realm}{credential}) || exists($realmshash->{$realm}{class}))) {
 
-	            $app->setup_auth_realm($realm, $realmshash->{$realm});
+                $app->setup_auth_realm($realm, $realmshash->{$realm});
 
-	            if (exists($realmshash->{$realm}{'user_restore_priority'})) {
-	                $auth_restore_order{$realm} = $realmshash->{$realm}{'user_restore_priority'};
-	            } else {
-	                $auth_restore_order{$realm} = $authcount++;
-	            }
-			}
+                if (exists($realmshash->{$realm}{'user_restore_priority'})) {
+                    $auth_restore_order{$realm} = $realmshash->{$realm}{'user_restore_priority'};
+                } else {
+                    $auth_restore_order{$realm} = $authcount++;
+                }
+            }
         }
 
         # if we have a 'default_realm' in the config hash and we don't already
@@ -634,19 +634,19 @@
                         },
                         store => {
                             class => 'Minimal',
-        	                users => {
-        	                    bob => {
-        	                        password => "s00p3r",                	
-        	                        editor => 'yes',
-        	                        roles => [qw/edit delete/],
-        	                    },
-        	                    william => {
-        	                        password => "s3cr3t",
-        	                        roles => [qw/comment/],
-        	                    }
-        	                }	
-        	            }
-        	        }
+                            users => {
+                                bob => {
+                                    password => "s00p3r",
+                                    editor => 'yes',
+                                    roles => [qw/edit delete/],
+                                },
+                                william => {
+                                    password => "s3cr3t",
+                                    roles => [qw/comment/],
+                                }
+                            }
+                        }
+                    }
                 }
     );
 
@@ -755,10 +755,10 @@
                             },
                             store => {
                                 class => 'DBIx::Class',
-        	                    user_model => 'MyApp::Users',
-        	                    role_column => 'roles',
-        	                }
-            	        }
+                                user_model => 'MyApp::Users',
+                                role_column => 'roles',
+                            }
+                        }
                     }
     );
 
@@ -781,21 +781,21 @@
                         },
                         store => {
                             class => 'DBIx::Class',
-    	                    user_model => 'MyApp::Users',
-    	                    role_column => 'roles',
-    	                }
-        	        },
-        	        admins => {
-        	            credential => {
-        	                class => 'Password',
-        	                password_field => 'password',
+                            user_model => 'MyApp::Users',
+                            role_column => 'roles',
+                        }
+                    },
+                    admins => {
+                        credential => {
+                            class => 'Password',
+                            password_field => 'password',
                             password_type => 'clear'
-        	            },
-        	            store => {
-        	                class => '+MyApp::Authentication::Store::NetAuth',
-        	                authserver => '192.168.10.17'
-        	            }
-        	        }
+                        },
+                        store => {
+                            class => '+MyApp::Authentication::Store::NetAuth',
+                            authserver => '192.168.10.17'
+                        }
+                    }
                 }
     );
 
@@ -1077,7 +1077,7 @@
 or by using a Store plugin:
 
     # load the Minimal authentication store.
-	use Catalyst qw/Authentication Authentication::Store::Minimal/;
+    use Catalyst qw/Authentication Authentication::Store::Minimal/;
 
 Sets the default store to
 L<Catalyst::Plugin::Authentication::Store::Minimal>.




More information about the Catalyst-commits mailing list