View | Details | Raw Unified | Return to bug 21395
Collapse All | Expand All

(-)a/C4/InstallAuth.pm (-14 / +7 lines)
Lines 31-36 use C4::Koha; Link Here
31
31
32
use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
32
use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
33
33
34
@ISA    = qw(Exporter);
35
@EXPORT = qw(
36
  &checkauth
37
  &get_template_and_user
38
);
34
39
35
=head1 NAME
40
=head1 NAME
36
41
Lines 68-84 InstallAuth - Authenticates Koha users for Install process Link Here
68
73
69
=head1 FUNCTIONS
74
=head1 FUNCTIONS
70
75
71
=over 2
76
=head2 get_template_and_user
72
73
=cut
74
75
@ISA    = qw(Exporter);
76
@EXPORT = qw(
77
  &checkauth
78
  &get_template_and_user
79
);
80
81
=item get_template_and_user
82
77
83
    my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
78
    my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
84
        {   template_name   => "opac-main.tt",
79
        {   template_name   => "opac-main.tt",
Lines 168-174 sub _get_template_language { Link Here
168
    -d $path ? $opaclang : 'en';
163
    -d $path ? $opaclang : 'en';
169
}
164
}
170
165
171
=item checkauth
166
=head2 checkauth
172
167
173
  ($userid, $cookie, $sessionID) = &checkauth($query, $noauth, $flagsrequired, $type);
168
  ($userid, $cookie, $sessionID) = &checkauth($query, $noauth, $flagsrequired, $type);
174
169
Lines 428-435 END { } # module clean-up code here (global destructor) Link Here
428
1;
423
1;
429
__END__
424
__END__
430
425
431
=back
432
433
=head1 SEE ALSO
426
=head1 SEE ALSO
434
427
435
CGI(3)
428
CGI(3)
(-)a/docs/CAS/CASProxy/examples/koha_webservice.pl (+4 lines)
Lines 26-34 Link Here
26
26
27
=head1 CGI PARAMETERS
27
=head1 CGI PARAMETERS
28
28
29
=over
30
29
=item PT
31
=item PT
30
The Proxy Ticket, needed for check_api_auth, that will try to make the CAS Server validate it.
32
The Proxy Ticket, needed for check_api_auth, that will try to make the CAS Server validate it.
31
33
34
=back
35
32
=cut 
36
=cut 
33
37
34
use utf8;
38
use utf8;
(-)a/misc/migration_tools/bulkmarcimport.pl (-2 / +2 lines)
Lines 442-452 RECORD: while ( ) { Link Here
442
			 	if ($sourcetag < "010"){
442
			 	if ($sourcetag < "010"){
443
					if ($record->field($sourcetag)){
443
					if ($record->field($sourcetag)){
444
					  my $source = $record->field($sourcetag)->data();
444
					  my $source = $record->field($sourcetag)->data();
445
					  printf($idmapfh "%s|%s\n",$source,$biblionumber);
445
                      printf($idmapfh "%s|%s\n",$source,$biblionumber);
446
					}
446
					}
447
			    } else {
447
			    } else {
448
					my $source=$record->subfield($sourcetag,$sourcesubfield);
448
					my $source=$record->subfield($sourcetag,$sourcesubfield);
449
					printf($idmapfh "%s|%s\n",$source,$biblionumber);
449
                    printf($idmapfh "%s|%s\n",$source,$biblionumber);
450
			  }
450
			  }
451
			}
451
			}
452
					# create biblio, unless we already have it ( either match or isbn )
452
					# create biblio, unless we already have it ( either match or isbn )
(-)a/misc/translator/TmplTokenizer.pm (-16 / +16 lines)
Lines 379-391 sub parametrize { Link Here
379
		    ;
379
		    ;
380
		} elsif (defined $params[$i - 1]) {
380
		} elsif (defined $params[$i - 1]) {
381
		    my $param = $params[$i - 1];
381
		    my $param = $params[$i - 1];
382
		    warn_normal("$fmt_0: $&: Expected a TMPL_VAR, but found a "
382
            warn_normal("$fmt_0: $&: Expected a TMPL_VAR, but found a "
383
			    . $param->type->to_string . "\n", undef)
383
                . $param->type->to_string . "\n", undef)
384
			    if $param->type != C4::TmplTokenType::DIRECTIVE;
384
                if $param->type != C4::TmplTokenType::DIRECTIVE;
385
		    warn_normal("$fmt_0: $&: Unsupported "
385
            warn_normal("$fmt_0: $&: Unsupported "
386
				. "field width or precision\n", undef)
386
                . "field width or precision\n", undef)
387
			    if defined $width || defined $prec;
387
			    if defined $width || defined $prec;
388
		    warn_normal("$fmt_0: $&: Parameter $i not known", undef)
388
            warn_normal("$fmt_0: $&: Parameter $i not known", undef)
389
			    unless defined $param;
389
			    unless defined $param;
390
		    $it .= defined $f? &$f( $param ): $param->string;
390
		    $it .= defined $f? &$f( $param ): $param->string;
391
		}
391
		}
Lines 396-422 sub parametrize { Link Here
396
396
397
		my $param = $params[$i - 1];
397
		my $param = $params[$i - 1];
398
		if (!defined $param) {
398
		if (!defined $param) {
399
		    warn_normal("$fmt_0: $&: Parameter $i not known", undef);
399
            warn_normal("$fmt_0: $&: Parameter $i not known", undef);
400
		} else {
400
		} else {
401
		    if ($param->type == C4::TmplTokenType::TAG
401
		    if ($param->type == C4::TmplTokenType::TAG
402
			    && $param->string =~ /^<input\b/is) {
402
			    && $param->string =~ /^<input\b/is) {
403
			my $type = defined $param->attributes?
403
			my $type = defined $param->attributes?
404
				lc($param->attributes->{'type'}->[1]): undef;
404
				lc($param->attributes->{'type'}->[1]): undef;
405
			if ($conv eq 'S') {
405
			if ($conv eq 'S') {
406
			    warn_normal("$fmt_0: $&: Expected type=text, "
406
                warn_normal("$fmt_0: $&: Expected type=text, "
407
					. "but found type=$type", undef)
407
                    . "but found type=$type", undef)
408
				    unless $type eq 'text';
408
				    unless $type eq 'text';
409
			} elsif ($conv eq 'p') {
409
			} elsif ($conv eq 'p') {
410
			    warn_normal("$fmt_0: $&: Expected type=radio, "
410
                warn_normal("$fmt_0: $&: Expected type=radio, "
411
					. "but found type=$type", undef)
411
                    . "but found type=$type", undef)
412
				    unless $type eq 'radio';
412
				    unless $type eq 'radio';
413
			}
413
			}
414
		    } else {
414
		    } else {
415
			warn_normal("$&: Expected an INPUT, but found a "
415
                warn_normal("$&: Expected an INPUT, but found a "
416
				. $param->type->to_string . "\n", undef)
416
                    . $param->type->to_string . "\n", undef)
417
		    }
417
		    }
418
		    warn_normal("$fmt_0: $&: Unsupported "
418
            warn_normal("$fmt_0: $&: Unsupported "
419
				. "field width or precision\n", undef)
419
                . "field width or precision\n", undef)
420
			    if defined $width || defined $prec;
420
			    if defined $width || defined $prec;
421
		    $it .= defined $f? &$f( $param ): $param->string;
421
		    $it .= defined $f? &$f( $param ): $param->string;
422
		}
422
		}
Lines 439-445 sub parametrize { Link Here
439
	    my $i  = $1;
439
	    my $i  = $1;
440
	    $fmt = $';
440
	    $fmt = $';
441
	    my $anchor = $anchors[$i - 1];
441
	    my $anchor = $anchors[$i - 1];
442
	    warn_normal("$&: Anchor $1 not found for msgid \"$fmt_0\"", undef) #FIXME
442
        warn_normal("$&: Anchor $1 not found for msgid \"$fmt_0\"", undef) #FIXME
443
		    unless defined $anchor;
443
		    unless defined $anchor;
444
	    $it .= $anchor->string;
444
	    $it .= $anchor->string;
445
	} else {
445
	} else {
(-)a/misc/translator/xgettext.pl (-5 / +5 lines)
Lines 275-287 sub convert_translation_file { Link Here
275
	$translation{$msgid} = $msgstr unless $msgstr eq '*****';
275
	$translation{$msgid} = $msgstr unless $msgstr eq '*****';
276
276
277
	if ($msgid  =~ /\bcharset=(["']?)([^;\s"']+)\1/s) {
277
	if ($msgid  =~ /\bcharset=(["']?)([^;\s"']+)\1/s) {
278
	    my $candidate = TmplTokenizer::charset_canon($2);
278
        my $candidate = TmplTokenizer::charset_canon($2);
279
	    die "Conflicting charsets in msgid: $candidate vs $charset_in\n"
279
	    die "Conflicting charsets in msgid: $candidate vs $charset_in\n"
280
		    if defined $charset_in && $charset_in ne $candidate;
280
		    if defined $charset_in && $charset_in ne $candidate;
281
	    $charset_in = $candidate;
281
	    $charset_in = $candidate;
282
	}
282
	}
283
	if ($msgstr =~ /\bcharset=(["']?)([^;\s"']+)\1/s) {
283
	if ($msgstr =~ /\bcharset=(["']?)([^;\s"']+)\1/s) {
284
	    my $candidate = TmplTokenizer::charset_canon($2);
284
        my $candidate = TmplTokenizer::charset_canon($2);
285
	    die "Conflicting charsets in msgid: $candidate vs $charset_out\n"
285
	    die "Conflicting charsets in msgid: $candidate vs $charset_out\n"
286
		    if defined $charset_out && $charset_out ne $candidate;
286
		    if defined $charset_out && $charset_out ne $candidate;
287
	    $charset_out = $candidate;
287
	    $charset_out = $candidate;
Lines 289-296 sub convert_translation_file { Link Here
289
    }
289
    }
290
    # The following assumption is correct; that's what HTML::Template assumes
290
    # The following assumption is correct; that's what HTML::Template assumes
291
    if (!defined $charset_in) {
291
    if (!defined $charset_in) {
292
	$charset_in = $charset_out = TmplTokenizer::charset_canon('utf-8');
292
        $charset_in = $charset_out = TmplTokenizer::charset_canon('utf-8');
293
	warn "Warning: Can't determine original templates' charset, defaulting to $charset_in\n";
293
        warn "Warning: Can't determine original templates' charset, defaulting to $charset_in\n";
294
    }
294
    }
295
}
295
}
296
296
Lines 383-389 if (defined $files_from) { Link Here
383
	my $input = /^\//? $_: "$directory/$_";
383
	my $input = /^\//? $_: "$directory/$_";
384
	my $h = TmplTokenizer->new( $input );
384
	my $h = TmplTokenizer->new( $input );
385
	$h->set_allow_cformat( 1 );
385
	$h->set_allow_cformat( 1 );
386
	VerboseWarnings::set_input_file_name($input);
386
    VerboseWarnings::set_input_file_name($input);
387
	print STDERR "$0: Processing file \"$input\"\n" if $verbose_p;
387
	print STDERR "$0: Processing file \"$input\"\n" if $verbose_p;
388
	text_extract( $h );
388
	text_extract( $h );
389
    }
389
    }
(-)a/reports/bor_issues_top.pl (-1 / +1 lines)
Lines 242-248 sub calculate { Link Here
242
			$columns{($row[0] ||'NULL')}++;
242
			$columns{($row[0] ||'NULL')}++;
243
            push @loopcol, { coltitle => $row[0] || 'NULL' };
243
            push @loopcol, { coltitle => $row[0] || 'NULL' };
244
        }
244
        }
245
		$debug and print $debugfh "full array: ", Dumper(\%columns), "\n";
245
        $debug and print $debugfh "full array: ", Dumper(\%columns), "\n";
246
    }else{
246
    }else{
247
        $columns{''} = 1;
247
        $columns{''} = 1;
248
    }
248
    }
(-)a/t/db_dependent/LDAP/test_ldap_add.pl (-1 / +1 lines)
Lines 46-52 sub hashup { Link Here
46
}
46
}
47
47
48
sub recursive_breakdown {
48
sub recursive_breakdown {
49
	my $dse = shift or return;
49
    my $dse = shift or return;
50
	if (ref($dse) =~ /HASH/) {
50
	if (ref($dse) =~ /HASH/) {
51
		return join "\n", map {"$_\t=> " . recursive_breakdown($dse->{$_})} keys %$dse;
51
		return join "\n", map {"$_\t=> " . recursive_breakdown($dse->{$_})} keys %$dse;
52
	} elsif (ref($dse) =~ /ARRAY/) {
52
	} elsif (ref($dse) =~ /ARRAY/) {
(-)a/tools/batchMod.pl (-3 / +2 lines)
Lines 427-434 foreach my $tag (sort keys %{$tagslib}) { Link Here
427
	$subfield_data{marc_lib}   ="<span id=\"error$i\" title=\"".$tagslib->{$tag}->{$subfield}->{lib}."\">".$tagslib->{$tag}->{$subfield}->{lib}."</span>";
427
	$subfield_data{marc_lib}   ="<span id=\"error$i\" title=\"".$tagslib->{$tag}->{$subfield}->{lib}."\">".$tagslib->{$tag}->{$subfield}->{lib}."</span>";
428
	$subfield_data{mandatory}  = $tagslib->{$tag}->{$subfield}->{mandatory};
428
	$subfield_data{mandatory}  = $tagslib->{$tag}->{$subfield}->{mandatory};
429
	$subfield_data{repeatable} = $tagslib->{$tag}->{$subfield}->{repeatable};
429
	$subfield_data{repeatable} = $tagslib->{$tag}->{$subfield}->{repeatable};
430
	my $value;
430
    my $value;
431
   if ( $use_default_values) {
431
    if ( $use_default_values) {
432
	    $value = $tagslib->{$tag}->{$subfield}->{defaultvalue};
432
	    $value = $tagslib->{$tag}->{$subfield}->{defaultvalue};
433
	    # get today date & replace YYYY, MM, DD if provided in the default value
433
	    # get today date & replace YYYY, MM, DD if provided in the default value
434
            my $today = dt_from_string;
434
            my $today = dt_from_string;
435
- 

Return to bug 21395