Project

General

Profile

Patch #8196 » ADD_PROJECT_PARAM_TO_REDMINE_AUTH_MODULE.diff

Diego Suárez García, 2011-04-20 10:48

View differences:

Redmine.pm (working copy)
127 127
    args_how => TAKE1,
128 128
  },
129 129
  {
130
    name => 'RedmineDbProject',
131
    req_override => OR_AUTHCFG,
132
    args_how => TAKE1,
133
  },
134
  {
130 135
    name => 'RedmineDbPass',
131 136
    req_override => OR_AUTHCFG,
132 137
    args_how => TAKE1,
......
163 168

  
164 169
sub RedmineDbUser { set_val('RedmineDbUser', @_); }
165 170
sub RedmineDbPass { set_val('RedmineDbPass', @_); }
171
sub RedmineDbProject { set_val('RedmineDbProject', @_); }
166 172
sub RedmineDbWhereClause { 
167 173
  my ($self, $parms, $arg) = @_;
168 174
  $self->{RedmineQuery} = trim($self->{RedmineQuery}.($arg ? $arg : "")." ");
......
301 307
  my $r = shift;
302 308

  
303 309
  my $dbh         = connect_database($r);
304
  my $project_id  = get_project_identifier($r);
305 310

  
306 311
  my $pass_digest = Digest::SHA1::sha1_hex($redmine_pass);
307 312

  
308 313
  my $cfg = Apache2::Module::get_config(__PACKAGE__, $r->server, $r->per_dir_config);
314
  my $project_id  = get_project_identifier_from_directive($cfg, $r);
315

  
309 316
  my $usrprojpass;
310 317
  if ($cfg->{RedmineCacheCredsMax}) {
311 318
    $usrprojpass = $cfg->{RedmineCacheCreds}->get($redmine_user.":".$project_id);
......
377 384
    $identifier;
378 385
}
379 386

  
387
sub get_project_identifier_from_directive {
388
    my $cfg = shift;
389
    my $r = shift;
390
    return $cfg->{RedmineDbProject} if($cfg->{RedmineDbProject});
391
    return get_project_identifier($r);
392
}
393

  
380 394
sub connect_database {
381 395
    my $r = shift;
382 396
    
    (1-1/1)