Reindent everything
[apache2-authzcaps.git] / lib / Apache2 / AuthzCaps.pm
index 426b6081278e5597c4b3ef0aa4edfca03a17d31a..281d3d6f6e3b63eaa9874172ea00f5030901bbc5 100644 (file)
@@ -21,45 +21,45 @@ our @EXPORT_OK = qw/setcap hascaps/;
 our $rootdir;
 
 sub setcap{
-  my ($user, $cap, $value) = @_;
-  my $config = eval { LoadFile "$rootdir/$user.yml" } // {};
-  $config->{caps}//={};
-  my $caps=$config->{caps};
-
-  delete $caps->{$cap} unless $value;
-  $caps->{$cap} = 1 if $value;
-  DumpFile "$rootdir/$user.yml", $config
+       my ($user, $cap, $value) = @_;
+       my $config = eval { LoadFile "$rootdir/$user.yml" } // {};
+       $config->{caps}//={};
+       my $caps=$config->{caps};
+
+       delete $caps->{$cap} unless $value;
+       $caps->{$cap} = 1 if $value;
+       DumpFile "$rootdir/$user.yml", $config
 }
 
 sub hascaps{
-  my ($user, @caps) = @_;
-  my $config = LoadFile "$rootdir/$user.yml";
-  my $caps = $config->{caps};
-  for (@caps) {
-       return 0 unless $caps->{$_}
-  }
-  1
+       my ($user, @caps) = @_;
+       my $config = LoadFile "$rootdir/$user.yml";
+       my $caps = $config->{caps};
+       for (@caps) {
+               return 0 unless $caps->{$_}
+       }
+       1
 }
 
 sub handler{
-  my $r=shift;
-  my $user = $r->user;
-  local $rootdir = $r->dir_config('AuthzCapsRootdir');
+       my $r=shift;
+       my $user = $r->user;
+       local $rootdir = $r->dir_config('AuthzCapsRootdir');
 
-  if ($user) {
-  LOOP: for my $requirement (map { $_->{requirement} } @{$r->requires}) {
-         my ($command, @args) = split ' ', $requirement;
+       if ($user) {
+         LOOP: for my $requirement (map { $_->{requirement} } @{$r->requires}) {
+                       my ($command, @args) = split ' ', $requirement;
 
-         given ($command){
-               when('cap'){
-                 return OK if hascaps $user, @args
-               }
+                       given ($command){
+                               when('cap'){
+                                       return OK if hascaps $user, @args
+                               }
 
-         }
+                       }
+               }
        }
-  }
 
-  DECLINED
+       DECLINED
 }
 
 1;
This page took 0.01186 seconds and 4 git commands to generate.