Ignore:
Timestamp:
2010-12-14T14:35:39+13:00 (13 years ago)
Author:
davidb
Message:

"un" cgi argument is now compulsory if authentication is on, and made options when not.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/cgiactions/baseaction.pm

    r23439 r23477  
    7070        $err_mess .= "  $a:\n";
    7171        $err_mess .= "    Compulsory args: ";
    72         $err_mess .= join(", ", ("c", "un"),
    73                   @{$action_table->{$a}->{'compulsory-args'}});
     72        my @comp_args = ("c");
     73        push(@comp_args,"un") if ($authenication_enabled);
     74        push(@comp_args,@{$action_table->{$a}->{'compulsory-args'}});
     75        $err_mess .= join(", ", @comp_args);
     76
    7477        $err_mess .= "\n";
    7578
    76         if (scalar(@{$action_table->{$a}->{'optional-args'}})>0) {
     79        my @opt_args = ();
     80        push(@opt_args,"un") if (!$authenication_enabled);
     81        push(@opt_args,@{$action_table->{$a}->{'optional-args'}});
     82
     83        if (scalar(@opt_args)>0) {
    7784
    7885        $err_mess .= "    Optional args  : ";
    79         $err_mess .= join(", ", @{$action_table->{$a}->{'optional-args'}});
     86        $err_mess .= join(", ", @opt_args);
    8087        $err_mess .= "\n";
    8188        }
     
    165172    }
    166173
    167 
    168     # Retrieve infodb-type
    169     if (defined $collect) {
    170         my $inexport = newCGI inexport("metadata-server",$collect);
    171         my ($config_filename,$collect_cfg) = $inexport->read_collection_cfg($collect);   
    172         $self->{'infodbtype'} = $collect_cfg->{'infodbtype'};
    173     }
    174    
     174    # Retrieve infodb-type
     175    if (defined $collect) {
     176    my $inexport = newCGI inexport(ref $self,$collect);
     177    my ($config_filename,$collect_cfg) = $inexport->read_collection_cfg($collect);   
     178    $self->{'infodbtype'} = $collect_cfg->{'infodbtype'};
     179    }
     180   
    175181    return $self;
    176182}
Note: See TracChangeset for help on using the changeset viewer.