[otrs-cvs] CVS: otrs/Kernel/System/Auth LDAP.pm, 1.31, 1.32 Radius.pm, 1.5, 1.6

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/Auth
In directory lancelot:/tmp/cvs-serv24920/Kernel/System/Auth

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/Auth/LDAP.pm,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -r1.31 -r1.32
*** LDAP.pm	14 Dec 2006 11:45:53 -0000	1.31
--- LDAP.pm	4 Jan 2007 12:14:47 -0000	1.32
***************
*** 1,5 ****
  # --
  # Kernel/System/Auth/LDAP.pm - provides the ldap authentification
! # Copyright (C) 2001-2006 OTRS GmbH, http://otrs.org/
  # --
  # $Id$
--- 1,5 ----
  # --
  # Kernel/System/Auth/LDAP.pm - provides the ldap authentification
! # Copyright (C) 2001-2007 OTRS GmbH, http://otrs.org/
  # --
  # $Id$
***************
*** 41,44 ****
--- 41,45 ----
      # get ldap preferences
      $Self->{Count} = $Param{Count} || '';
+     $Self->{Die} = $Self->{ConfigObject}->Get('AuthModule::LDAP::Die'.$Param{Count});
      $Self->{Host} = $Self->{ConfigObject}->Get('AuthModule::LDAP::Host'.$Param{Count})
          || die "Need AuthModule::LDAP::Host$Param{Count} in Kernel/Config.pm";
***************
*** 129,133 ****
  
      # 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}) {
--- 130,146 ----
  
      # 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/Auth/Radius.pm,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** Radius.pm	14 Dec 2006 11:45:53 -0000	1.5
--- Radius.pm	4 Jan 2007 12:14:47 -0000	1.6
***************
*** 35,39 ****
      # Debug 0=off 1=on
      $Self->{Debug} = 0;
! 
      # get user table
      $Self->{RadiusHost} = $Self->{ConfigObject}->Get('AuthModule::Radius::Host'.$Param{Count})
--- 35,40 ----
      # Debug 0=off 1=on
      $Self->{Debug} = 0;
!     # get config
!     $Self->{Die} = $Self->{ConfigObject}->Get('AuthModule::Radius::Die'.$Param{Count});
      # get user table
      $Self->{RadiusHost} = $Self->{ConfigObject}->Get('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);
  
--- 101,117 ----
      }
      # 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