Project

General

Profile

Defect #5383 » redmine.pm.patch

Yar Isakov, 2010-04-26 15:53

View differences:

Redmine.pm 2010-04-26 17:55:09.601338421 +0400
203 203
  }
204 204

  
205 205
  my $method = $r->method;
206
  return OK unless defined $read_only_methods{$method};
207

  
208 206
  my $project_id = get_project_identifier($r);
209

  
210
  $r->set_handlers(PerlAuthenHandler => [\&OK])
211
      if is_public_project($project_id, $r);
212

  
213
  return OK
207
  if (is_public_project($project_id, $r) && defined $read_only_methods{$method}) {
208
    $r->set_handlers(PerlAuthenHandler => [\&OK]);
209
  }
210
  return OK;
214 211
}
215 212

  
216 213
sub authen_handler {
......
309 306
                bindpw  =>      $rowldap[4] ? $rowldap[4] : "",
310 307
                filter  =>      "(".$rowldap[6]."=%s)"
311 308
            );
312
            $ret = 1 if ($ldap->authenticate($redmine_user, $redmine_pass));
309
            $ret = 1 if ($ldap->authenticate($redmine_user, $redmine_pass) && ((defined $read_only_methods{$method} && $permissions =~ /:browse_repository/) || $permissions =~ /:commit_access/) );
313 310
          }
314 311
          $sthldap->finish();
315 312
          undef $sthldap;
(1-1/2)