Sfoglia il codice sorgente

fix compile errors

George Baugh 2 anni fa
parent
commit
13d1f3d20e
1 ha cambiato i file con 4 aggiunte e 18 eliminazioni
  1. 4 18
      lib/Trog/Auth.pm

+ 4 - 18
lib/Trog/Auth.pm

@@ -6,6 +6,8 @@ use warnings;
 no warnings 'experimental';
 use feature qw{signatures state};
 
+use FindBin::libs;
+
 use UUID::Tiny ':std';
 use Digest::SHA 'sha256';
 use Authen::TOTP;
@@ -67,23 +69,6 @@ sub user_exists ($user) {
     return 1;
 }
 
-=head2 killsession
-
-Whack the active session for a user.
-Useful for password resets and so forth.
-
-=cut
-
-sub killsession ($user) {
-    my $dbh  = _dbh();
-    my $rows = $dbh->do( "DELETE FROM sess_user WHERE name=?", undef, $user );
-    if ($dbh->errstr()) {
-        WARN("Could not killsession: ".$dbh->errstr());
-        return 0;
-    }
-    return 1;
-}
-
 =head2 acls4user(STRING username) = ARRAYREF
 
 Return the list of ACLs belonging to the user.
@@ -293,6 +278,7 @@ sub useradd ( $user, $pass, $acls ) {
 }
 
 sub add_change_request ( %args ) {
+    my $dbh  = _dbh();
     my $res  = $dbh->do( "INSERT INTO change_request (username,token,type,secret) VALUES (?,?,?,?)", undef, $args{user}, $args{token}, $args{type}, $args{secret} );
     return !!$res;
 }
@@ -321,7 +307,7 @@ sub process_change_request ( $token ) {
             return "TOTP auth turned off for $user";
         },
     );
-    return $dispatch->{$type}->($user, $secret);
+    return $dispatch{$type}->($user, $secret);
 }
 
 # Ensure the db schema is OK, and give us a handle