Patch #6414 ยป Redmine.pm_AllowAlternateAuth.diff
| redmine-1.0.1/extra/svn/Redmine.pm 2010-09-16 11:54:10.000000000 +0200 | ||
|---|---|---|
|
# RedmineCacheCredsMax 50
|
||
|
</Location>
|
||
|
If you want to be able to use additional authentication methods (i.e.
|
||
|
to have read-only users that are not on LDAP or on the Redmine
|
||
|
database) you can do it setting RedmineAllowAlternateAuth to on (with
|
||
|
this setting the module returns DECLINE and apache moves to the next
|
||
|
authentication module). As an example, if you want to use the Redmine
|
||
|
users and the /etc/apache2/htpasswd file to validate the subversion
|
||
|
users you can use a configuration like the following:
|
||
|
PerlLoadModule Apache::Authn::Redmine
|
||
|
<Location /svn>
|
||
|
DAV svn
|
||
|
SVNParentPath "/var/svn"
|
||
|
AuthType Basic
|
||
|
AuthName redmine
|
||
|
Require valid-user
|
||
|
PerlAccessHandler Apache::Authn::Redmine::access_handler
|
||
|
PerlAuthenHandler Apache::Authn::Redmine::authen_handler
|
||
|
RedmineAllowAlternateAuth on
|
||
|
RedmineDSN "DBI:Pg:database=databasename;host=my.db.server"
|
||
|
RedmineDbUser "redmine"
|
||
|
RedmineDbPass "password"
|
||
|
AuthBasicProvider file
|
||
|
AuthUserFile "/etc/apache2/htpasswd"
|
||
|
</Location>
|
||
|
To be able to browse repository inside redmine, you must add something
|
||
|
like that :
|
||
| ... | ... | |
|
args_how => TAKE1,
|
||
|
errmsg => 'RedmineCacheCredsMax must be decimal number',
|
||
|
},
|
||
|
{
|
||
|
name => 'RedmineAllowAlternateAuth',
|
||
|
req_override => OR_AUTHCFG,
|
||
|
args_how => FLAG,
|
||
|
},
|
||
|
);
|
||
|
sub RedmineDSN {
|
||
| ... | ... | |
|
$self->{RedmineCacheCredsMax} = $arg;
|
||
|
}
|
||
|
}
|
||
|
sub RedmineAllowAlternateAuth { set_val('RedmineAllowAlternateAuth', @_); }
|
||
|
sub trim {
|
||
|
my $string = shift;
|
||
| ... | ... | |
|
return OK;
|
||
|
} else {
|
||
|
$r->note_auth_failure();
|
||
|
my $cfg = Apache2::Module::get_config(__PACKAGE__, $r->server, $r->per_dir_config);
|
||
|
if ( $cfg->{RedmineAllowAlternateAuth} ) {
|
||
|
return DECLINED;
|
||
|
}
|
||
|
return AUTH_REQUIRED;
|
||
|
}
|
||
|
}
|
||