[Koha-cvs] CVS: koha/C4 Auth.pm,1.23,1.24 Context.pm,1.11,1.12

Ambrose Li acli at users.sourceforge.net
Thu Feb 6 07:35:28 CET 2003


Update of /cvsroot/koha/koha/C4
In directory sc8-pr-cvs1:/tmp/cvs-serv25478/C4

Modified Files:
	Auth.pm Context.pm 
Log Message:
Use the new C4::Boolean module and the new C4::Auth::boolean_parameter
function to test for boolean values in parameters


Index: Auth.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Auth.pm,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -r1.23 -r1.24
*** Auth.pm	6 Feb 2003 06:13:59 -0000	1.23
--- Auth.pm	6 Feb 2003 06:35:26 -0000	1.24
***************
*** 302,308 ****
  	}
      }
!     my $insecure = C4::Context->preference("insecure");
      # finished authentification, now respond
!     if ($loggedin || $authnotrequired ||(defined($insecure) && $insecure eq "yes")) {
  	# successful login
  	unless ($cookie) {
--- 302,308 ----
  	}
      }
!     my $insecure = C4::Context->boolean_preference('insecure');
      # finished authentification, now respond
!     if ($loggedin || $authnotrequired || (defined($insecure) && $insecure)) {
  	# successful login
  	unless ($cookie) {

Index: Context.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Context.pm,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** Context.pm	20 Jan 2003 07:35:31 -0000	1.11
--- Context.pm	6 Feb 2003 06:35:26 -0000	1.12
***************
*** 21,24 ****
--- 21,25 ----
  use strict;
  use DBI;
+ use C4::Boolean;
  
  use vars qw($VERSION $AUTOLOAD),
***************
*** 324,327 ****
--- 325,335 ----
  EOT
  	return $retval;
+ }
+ 
+ sub boolean_preference ($) {
+ 	my $self = shift;
+ 	my $var = shift;		# The system preference to return
+ 	my $it = preference($var);
+ 	return defined($it)? C4::Boolean::is_true($it): undef;
  }
  





More information about the Koha-cvs mailing list