From bf39eb4ac8bddf84bfff2fe7ae6811a01a317748 Mon Sep 17 00:00:00 2001
From: Guillaume Rousse <guillaume.rousse@renater.fr>
Date: Tue, 31 Oct 2017 10:59:12 +0100
Subject: [PATCH] enforce strict and warnings pragmas usage

---
 bin/account-manager-client.pl                            | 1 +
 bin/account-manager-web.pl                               | 6 +++---
 bin/create-database-code.pl                              | 2 ++
 lib/IdPAccountManager/AuthenticationToken.pm             | 1 +
 lib/IdPAccountManager/DB.pm                              | 1 +
 lib/IdPAccountManager/DB/Object.pm                       | 2 ++
 lib/IdPAccountManager/Data/Authenticationtoken.pm        | 1 +
 .../Data/Authenticationtoken/Manager.pm                  | 1 +
 lib/IdPAccountManager/Data/DB/Object/AutoBase2.pm        | 9 ---------
 lib/IdPAccountManager/Data/Serviceprovider.pm            | 1 +
 lib/IdPAccountManager/Data/Serviceprovider/Manager.pm    | 1 +
 lib/IdPAccountManager/Data/Testaccount.pm                | 1 +
 lib/IdPAccountManager/Data/Testaccount/Manager.pm        | 1 +
 lib/IdPAccountManager/SAMLMetadata.pm                    | 1 +
 lib/IdPAccountManager/ServiceProvider.pm                 | 4 +++-
 lib/IdPAccountManager/TestAccount.pm                     | 1 +
 16 files changed, 21 insertions(+), 13 deletions(-)
 delete mode 100644 lib/IdPAccountManager/Data/DB/Object/AutoBase2.pm

diff --git a/bin/account-manager-client.pl b/bin/account-manager-client.pl
index c5303de..2c9173c 100755
--- a/bin/account-manager-client.pl
+++ b/bin/account-manager-client.pl
@@ -8,6 +8,7 @@
 ## Command-line client for the Test IdP Account Manager
 
 use strict;
+use warnings;
 use utf8;
 use lib qw(lib conf);
 
diff --git a/bin/account-manager-web.pl b/bin/account-manager-web.pl
index 5440184..b4af672 100755
--- a/bin/account-manager-web.pl
+++ b/bin/account-manager-web.pl
@@ -7,7 +7,8 @@
 ## 15/09/2014, Olivier Salaün
 ## Web interface for the eduGAIN Access Check Account Manager
 
-use strict vars;
+use strict;
+use warnings;
 use utf8;
 use lib qw(lib conf);
 
@@ -153,11 +154,10 @@ sub execute {
         delete $self->{'next_action'};    ## Prevent loops
 
         if (defined $actions{ $self->{'action'} }) {
-
             ## Execute the target subroutine named req_actionName
+            no strict 'refs';
             my $sub = 'req_' . $self->{'action'};
             $status = &{$sub}($self);
-
         } else {
             ## Inknown action
             push @{ $self->{'param_out'}{'errors'} }, "unknown_action";
diff --git a/bin/create-database-code.pl b/bin/create-database-code.pl
index eb5c1d0..c3c0e01 100755
--- a/bin/create-database-code.pl
+++ b/bin/create-database-code.pl
@@ -1,6 +1,8 @@
 #!/usr/bin/perl
 ## Initialize Rose::DB code given the DB structure
 
+use strict;
+use warnings;
 use lib qw(lib conf);
 
 use Rose::DB;
diff --git a/lib/IdPAccountManager/AuthenticationToken.pm b/lib/IdPAccountManager/AuthenticationToken.pm
index 240d73c..59b926b 100644
--- a/lib/IdPAccountManager/AuthenticationToken.pm
+++ b/lib/IdPAccountManager/AuthenticationToken.pm
@@ -5,6 +5,7 @@ package IdPAccountManager::AuthenticationToken;
 ## from the European Community¹s Seventh Framework Programme (FP7/2007-2013) under grant agreement nº 238875 (GÉANT).
 
 use strict;
+use warnings;
 
 use IdPAccountManager::Data::Authenticationtoken;
 use IdPAccountManager::Data::Authenticationtoken::Manager;
diff --git a/lib/IdPAccountManager/DB.pm b/lib/IdPAccountManager/DB.pm
index 1f412e4..b8206d5 100644
--- a/lib/IdPAccountManager/DB.pm
+++ b/lib/IdPAccountManager/DB.pm
@@ -1,6 +1,7 @@
 package IdPAccountManager::DB;
 
 use strict;
+use warnings;
 
 use base 'Rose::DB';
 
diff --git a/lib/IdPAccountManager/DB/Object.pm b/lib/IdPAccountManager/DB/Object.pm
index b95451c..57c3223 100644
--- a/lib/IdPAccountManager/DB/Object.pm
+++ b/lib/IdPAccountManager/DB/Object.pm
@@ -1,5 +1,7 @@
 package IdPAccountManager::DB::Object;
 
+use strict;
+use warnings;
 use base 'Rose::DB::Object';
 
 use IdPAccountManager::DB;
diff --git a/lib/IdPAccountManager/Data/Authenticationtoken.pm b/lib/IdPAccountManager/Data/Authenticationtoken.pm
index fbb7500..0efcac0 100644
--- a/lib/IdPAccountManager/Data/Authenticationtoken.pm
+++ b/lib/IdPAccountManager/Data/Authenticationtoken.pm
@@ -1,6 +1,7 @@
 package IdPAccountManager::Data::Authenticationtoken;
 
 use strict;
+use warnings;
 
 use base 'IdPAccountManager::DB::Object';
 
diff --git a/lib/IdPAccountManager/Data/Authenticationtoken/Manager.pm b/lib/IdPAccountManager/Data/Authenticationtoken/Manager.pm
index 9d71c8e..5b7563e 100644
--- a/lib/IdPAccountManager/Data/Authenticationtoken/Manager.pm
+++ b/lib/IdPAccountManager/Data/Authenticationtoken/Manager.pm
@@ -1,6 +1,7 @@
 package IdPAccountManager::Data::Authenticationtoken::Manager;
 
 use strict;
+use warnings;
 
 use base qw(Rose::DB::Object::Manager);
 
diff --git a/lib/IdPAccountManager/Data/DB/Object/AutoBase2.pm b/lib/IdPAccountManager/Data/DB/Object/AutoBase2.pm
deleted file mode 100644
index a7d9068..0000000
--- a/lib/IdPAccountManager/Data/DB/Object/AutoBase2.pm
+++ /dev/null
@@ -1,9 +0,0 @@
-package IdPAccountManager::Data::DB::Object::AutoBase2;
-
-use base 'Rose::DB::Object';
-
-use IdPAccountManager::Data::DB::AutoBase1;
-
-sub init_db { IdPAccountManager::Data::DB::AutoBase1->new }
-
-1;
diff --git a/lib/IdPAccountManager/Data/Serviceprovider.pm b/lib/IdPAccountManager/Data/Serviceprovider.pm
index dc2046f..5a1304b 100644
--- a/lib/IdPAccountManager/Data/Serviceprovider.pm
+++ b/lib/IdPAccountManager/Data/Serviceprovider.pm
@@ -1,6 +1,7 @@
 package IdPAccountManager::Data::Serviceprovider;
 
 use strict;
+use warnings;
 
 use base 'IdPAccountManager::DB::Object';
 
diff --git a/lib/IdPAccountManager/Data/Serviceprovider/Manager.pm b/lib/IdPAccountManager/Data/Serviceprovider/Manager.pm
index e23db29..63f4734 100644
--- a/lib/IdPAccountManager/Data/Serviceprovider/Manager.pm
+++ b/lib/IdPAccountManager/Data/Serviceprovider/Manager.pm
@@ -1,6 +1,7 @@
 package IdPAccountManager::Data::Serviceprovider::Manager;
 
 use strict;
+use warnings;
 
 use base qw(Rose::DB::Object::Manager);
 
diff --git a/lib/IdPAccountManager/Data/Testaccount.pm b/lib/IdPAccountManager/Data/Testaccount.pm
index ad57af7..9c8fe2e 100644
--- a/lib/IdPAccountManager/Data/Testaccount.pm
+++ b/lib/IdPAccountManager/Data/Testaccount.pm
@@ -1,6 +1,7 @@
 package IdPAccountManager::Data::Testaccount;
 
 use strict;
+use warnings;
 
 use base 'IdPAccountManager::DB::Object';
 
diff --git a/lib/IdPAccountManager/Data/Testaccount/Manager.pm b/lib/IdPAccountManager/Data/Testaccount/Manager.pm
index a2d6b36..fb4edcc 100644
--- a/lib/IdPAccountManager/Data/Testaccount/Manager.pm
+++ b/lib/IdPAccountManager/Data/Testaccount/Manager.pm
@@ -1,6 +1,7 @@
 package IdPAccountManager::Data::Testaccount::Manager;
 
 use strict;
+use warnings;
 
 use base qw(Rose::DB::Object::Manager);
 
diff --git a/lib/IdPAccountManager/SAMLMetadata.pm b/lib/IdPAccountManager/SAMLMetadata.pm
index 4b7da64..dabec01 100644
--- a/lib/IdPAccountManager/SAMLMetadata.pm
+++ b/lib/IdPAccountManager/SAMLMetadata.pm
@@ -5,6 +5,7 @@ package IdPAccountManager::SAMLMetadata;
 ## from the European Community¹s Seventh Framework Programme (FP7/2007-2013) under grant agreement nº 238875 (GÉANT).
 
 use strict;
+use warnings;
 
 use IdPAccountManager::Tools;
 use Conf;
diff --git a/lib/IdPAccountManager/ServiceProvider.pm b/lib/IdPAccountManager/ServiceProvider.pm
index a8163b8..73d9ba9 100644
--- a/lib/IdPAccountManager/ServiceProvider.pm
+++ b/lib/IdPAccountManager/ServiceProvider.pm
@@ -1,11 +1,13 @@
 package IdPAccountManager::ServiceProvider;
-use base 'IdPAccountManager::Data::Serviceprovider';
 
 ## Copyright (c) GEANT
 ## This software was developed by RENATER. The research leading to these results has received funding
 ## from the European Community¹s Seventh Framework Programme (FP7/2007-2013) under grant agreement nº 238875 (GÉANT).
 
 use strict;
+use warnings;
+
+use base 'IdPAccountManager::Data::Serviceprovider';
 
 use IdPAccountManager::Data::Serviceprovider;
 use IdPAccountManager::Data::Serviceprovider::Manager;
diff --git a/lib/IdPAccountManager/TestAccount.pm b/lib/IdPAccountManager/TestAccount.pm
index 3165d6e..05a113d 100644
--- a/lib/IdPAccountManager/TestAccount.pm
+++ b/lib/IdPAccountManager/TestAccount.pm
@@ -5,6 +5,7 @@ package IdPAccountManager::TestAccount;
 ## from the European Community¹s Seventh Framework Programme (FP7/2007-2013) under grant agreement nº 238875 (GÉANT).
 
 use strict;
+use warnings;
 
 use IdPAccountManager::Data::Testaccount;
 use IdPAccountManager::Data::Testaccount::Manager;
-- 
GitLab