[otrs-cvs] CVS: otrs/Kernel/System/CustomerAuth LDAP.pm, 1.18, 1.19 Radius.pm,1.4,1.5

cvs-log at otrs.org cvs-log at otrs.org
Thu Jan 4 13:14:49 CET 2007


Update of /home/cvs/otrs/Kernel/System/CustomerAuth
In directory lancelot:/tmp/cvs-serv24920/Kernel/System/CustomerAuth

Modified Files:
	LDAP.pm Radius.pm 
Log Message:
added config option for die or log is ldap/radius auth server is not available

Index: LDAP.pm
===================================================================
RCS file: /home/cvs/otrs/Kernel/System/CustomerAuth/LDAP.pm,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -r1.18 -r1.19
*** LDAP.pm	14 Dec 2006 13:30:45 -0000	1.18
--- LDAP.pm	4 Jan 2007 12:14:47 -0000	1.19
***************
*** 1,5 ****
  # --
  # Kernel/System/CustomerAuth/LDAP.pm - provides the ldap authentification
! # Copyright (C) 2001-2006 OTRS GmbH, http://otrs.org/
  # --
  # $Id$
--- 1,5 ----
  # --
  # Kernel/System/CustomerAuth/LDAP.pm - provides the ldap authentification
! # Copyright (C) 2001-2007 OTRS GmbH, http://otrs.org/
  # --
  # $Id$
***************
*** 40,43 ****
--- 40,44 ----
  
      # get ldap preferences
+     $Self->{Die} = $Self->{ConfigObject}->Get('Customer::AuthModule::LDAP::Die'.$Param{Count});
      $Self->{Host} = $Self->{ConfigObject}->Get('Customer::AuthModule::LDAP::Host'.$Param{Count})
          || die "Need Customer::AuthModule::LDAPHost in Kernel/Config.pm";
***************
*** 120,124 ****
      }
      # ldap connect and bind (maybe with SearchUserDN and SearchUserPw)
!     my $LDAP = Net::LDAP->new($Self->{Host}, %{$Self->{Params}}) or die "$@";
      my $Result = '';
      if ($Self->{SearchUserDN} && $Self->{SearchUserPw}) {
--- 121,137 ----
      }
      # ldap connect and bind (maybe with SearchUserDN and SearchUserPw)
!     my $LDAP = Net::LDAP->new($Self->{Host}, %{$Self->{Params}});
!     if (!$LDAP) {
!         if ($Self->{Die}) {
!             die "Can't connect to $Self->{Host}: $@";
!         }
!         else {
!             $Self->{LogObject}->Log(
!                 Priority => 'error',
!                 Message => "Can't connect to $Self->{Host}: $@",
!             );
!             return;
!         }
!     }
      my $Result = '';
      if ($Self->{SearchUserDN} && $Self->{SearchUserPw}) {

Index: Radius.pm
===================================================================
RCS file: /home/cvs/otrs/Kernel/System/CustomerAuth/Radius.pm,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** Radius.pm	14 Dec 2006 11:59:25 -0000	1.4
--- Radius.pm	4 Jan 2007 12:14:47 -0000	1.5
***************
*** 36,39 ****
--- 36,41 ----
      $Self->{Debug} = 0;
  
+     # get config
+     $Self->{Die} = $Self->{ConfigObject}->Get('Customer::AuthModule::Radius::Die'.$Param{Count});
      # get user table
      $Self->{RadiusHost} = $Self->{ConfigObject}->Get('Customer::AuthModule::Radius::Host'.$Param{Count})
***************
*** 100,104 ****
      }
      # Create a radius object
!     my $Radius = new Authen::Radius (Host => $Self->{RadiusHost}, Secret => $Self->{RadiusSecret});
      my $AuthResult = $Radius->check_pwd ($User, $Pw);
  
--- 102,118 ----
      }
      # Create a radius object
!     my $Radius = Authen::Radius->new(Host => $Self->{RadiusHost}, Secret => $Self->{RadiusSecret});
!     if (!$Radius) {
!         if ($Self->{Die}) {
!             die "Can't connect to $Self->{RadiusHost}: $@";
!         }
!         else {
!             $Self->{LogObject}->Log(
!                 Priority => 'error',
!                 Message => "Can't connect to $Self->{RadiusHost}: $@",
!             );
!             return;
!         }
!     }
      my $AuthResult = $Radius->check_pwd ($User, $Pw);
  



More information about the cvs-log mailing list