[Bps-public-commit] r16709 - in RT-Authen-ExternalAuth/trunk/lib/RT: Authen Authen/ExternalAuth

zordrak at bestpractical.com zordrak at bestpractical.com
Thu Nov 6 11:24:21 EST 2008


Author: zordrak
Date: Thu Nov  6 11:24:20 2008
New Revision: 16709

Modified:
   RT-Authen-ExternalAuth/trunk/lib/RT/Authen/ExternalAuth.pm
   RT-Authen-ExternalAuth/trunk/lib/RT/Authen/ExternalAuth/LDAP.pm
   RT-Authen-ExternalAuth/trunk/lib/RT/User_Vendor.pm

Log:
zordrak | 2008-11-06 11:15:00 +0000
 * 0.07_01-prealpha
 * Major method calling issues sorted

Modified: RT-Authen-ExternalAuth/trunk/lib/RT/Authen/ExternalAuth.pm
==============================================================================
--- RT-Authen-ExternalAuth/trunk/lib/RT/Authen/ExternalAuth.pm	(original)
+++ RT-Authen-ExternalAuth/trunk/lib/RT/Authen/ExternalAuth.pm	Thu Nov  6 11:24:20 2008
@@ -37,7 +37,7 @@
     my $updated         = 0;
     my $msg             = "User NOT updated";
 
-    my $user_disabled 	= RT::Authen::ExternalAuth->UserDisabled($username);
+    my $user_disabled 	= RT::Authen::ExternalAuth::UserDisabled($username);
 
     my $UserObj = RT::User->new($RT::SystemUser);
     $UserObj->Load($username);        
@@ -110,20 +110,19 @@
 
 sub UserExists {
 
-    my $self = shift;
     my $username = shift;
     my $user_exists_externally = 0;   
 
     my @auth_services = @$RT::ExternalAuthPriority;
-$RT::Logger->debug("auth_services:",Dumper(@auth_services));
+
     foreach my $service (@auth_services) {
         my $config = $RT::ExternalSettings->{$service};
-$RT::Logger->debug("config:",Dumper($config));
+
         if ($config->{'type'} eq 'db') {    
-            $user_exists_externally = RT::Authen::ExternalAuth::DBI->UserExists($service,$username);
+            $user_exists_externally = RT::Authen::ExternalAuth::DBI::UserExists($service,$username);
             last if $user_exists_externally;
         } elsif ($config->{'type'} eq 'ldap') {
-            $user_exists_externally = RT::Authen::ExternalAuth::LDAP->UserExists($service,$username);
+            $user_exists_externally = RT::Authen::ExternalAuth::LDAP::UserExists($service,$username);
             last if $user_exists_externally;
         } else {
             $RT::Logger->error("Invalid type specification (",
@@ -154,12 +153,12 @@
         # And then act accordingly depending on what type of service it is.
         # Right now, there is only code for DBI and LDAP services
         if ($config->{'type'} eq 'db') {    
-            my $success = RT::Authen::ExternalAuth::DBI->GetAuth($service,$username,$password);
+            my $success = RT::Authen::ExternalAuth::DBI::GetAuth($service,$username,$password);
             return 1 if $success;
             next;
             
         } elsif ($config->{'type'} eq 'ldap') {
-            my $success = RT::Authen::ExternalAuth::LDAP->GetAuth($service,$username,$password);
+            my $success = RT::Authen::ExternalAuth::LDAP::GetAuth($service,$username,$password);
             return 1 if $success;
             next;
                     
@@ -203,7 +202,7 @@
         # If it's a DBI config:
         if ($config->{'type'} eq 'db') {
             
-            unless(RT::Authen::ExternalAuth::DBI->UserExists($username,$service)) {
+            unless(RT::Authen::ExternalAuth::DBI::UserExists($username,$service)) {
                 $RT::Logger->debug("User (",
                                     $username,
                                     ") doesn't exist in service (",
@@ -211,11 +210,11 @@
                                     ") - Cannot update information - Skipping...");
                 next;
             }
-            $user_disabled = RT::Authen::ExternalAuth::DBI->UserDisabled($username,$service);
+            $user_disabled = RT::Authen::ExternalAuth::DBI::UserDisabled($username,$service);
             
         } elsif ($config->{'type'} eq 'ldap') {
             
-            unless(RT::Authen::ExternalAuth::LDAP->UserExists($username,$service)) {
+            unless(RT::Authen::ExternalAuth::LDAP::UserExists($username,$service)) {
                 $RT::Logger->debug("User (",
                                     $username,
                                     ") doesn't exist in service (",
@@ -223,7 +222,7 @@
                                     ") - Cannot update information - Skipping...");
                 next;
             }
-            $user_disabled = RT::Authen::ExternalAuth::LDAP->UserDisabled($username,$service);
+            $user_disabled = RT::Authen::ExternalAuth::LDAP::UserDisabled($username,$service);
             
         } else {
             # The type of external service doesn't currently have any methods associated with it. Or it's a typo.
@@ -307,9 +306,9 @@
             # the service requested.
             
             if($config->{'type'} eq 'ldap'){    
-                ($found, %params) = RT::Authen::ExternalAuth::LDAP->CanonicalizeUserInfo($service,$key,$value);
+                ($found, %params) = RT::Authen::ExternalAuth::LDAP::CanonicalizeUserInfo($service,$key,$value);
             } elsif ($config->{'type'} eq 'db') {
-                ($found, %params) = RT::Authen::ExternalAuth::DBI->CanonicalizeUserInfo($service,$key,$value);
+                ($found, %params) = RT::Authen::ExternalAuth::DBI::CanonicalizeUserInfo($service,$key,$value);
             } else {
                 $RT::Logger->debug( (caller(0))[3],
                                     "does not consider",

Modified: RT-Authen-ExternalAuth/trunk/lib/RT/Authen/ExternalAuth/LDAP.pm
==============================================================================
--- RT-Authen-ExternalAuth/trunk/lib/RT/Authen/ExternalAuth/LDAP.pm	(original)
+++ RT-Authen-ExternalAuth/trunk/lib/RT/Authen/ExternalAuth/LDAP.pm	Thu Nov  6 11:24:20 2008
@@ -62,7 +62,7 @@
     unless ($ldap_msg->count == 1) {
         $RT::Logger->info(  $service,
                             "AUTH FAILED:", 
-                            $self->Name,
+                            $username,
                             "User not found or more than one user found");
         # We got no user, or too many users.. jump straight to the next external auth service
         return 0;

Modified: RT-Authen-ExternalAuth/trunk/lib/RT/User_Vendor.pm
==============================================================================
--- RT-Authen-ExternalAuth/trunk/lib/RT/User_Vendor.pm	(original)
+++ RT-Authen-ExternalAuth/trunk/lib/RT/User_Vendor.pm	Thu Nov  6 11:24:20 2008
@@ -22,7 +22,7 @@
     }
 
 
-    if(RT::Authen::ExternalAuth->GetAuth($self->Name,$value)) {
+    if(RT::Authen::ExternalAuth::GetAuth($self->Name,$value)) {
         $RT::Logger->debug( (caller(0))[3], 
                             "EXTERNAL AUTH OKAY");
         return(1);
@@ -84,7 +84,7 @@
 sub CanonicalizeUserInfo {
     my $self = shift;
     my $args = shift;
-    return($RT::Authen::ExternalAuth->CanonicalizeUserInfo($self,$args));
+    return($RT::Authen::ExternalAuth::CanonicalizeUserInfo($self,$args));
 }
 # }}}
 



More information about the Bps-public-commit mailing list