Fix trailing whitespace
This commit is contained in:
parent
5e171001bc
commit
c2edd624a6
|
@ -49,7 +49,7 @@ Authen::Simple::LDAP (and IO::Socket::SSL if LDAPS is used):
|
|||
|
||||
PerlAccessHandler Apache::Authn::Redmine::access_handler
|
||||
PerlAuthenHandler Apache::Authn::Redmine::authen_handler
|
||||
|
||||
|
||||
## for mysql
|
||||
RedmineDSN "DBI:mysql:database=databasename;host=my.db.server"
|
||||
## for postgres
|
||||
|
@ -227,31 +227,31 @@ my @directives = (
|
|||
},
|
||||
);
|
||||
|
||||
sub RedmineDSN {
|
||||
sub RedmineDSN {
|
||||
my ($self, $parms, $arg) = @_;
|
||||
$self->{RedmineDSN} = $arg;
|
||||
my $query = "SELECT
|
||||
my $query = "SELECT
|
||||
hashed_password, salt, auth_source_id, permissions
|
||||
FROM members, projects, users, roles, member_roles
|
||||
WHERE
|
||||
WHERE
|
||||
projects.id=members.project_id
|
||||
AND member_roles.member_id=members.id
|
||||
AND users.id=members.user_id
|
||||
AND users.id=members.user_id
|
||||
AND roles.id=member_roles.role_id
|
||||
AND users.status=1
|
||||
AND login=?
|
||||
AND users.status=1
|
||||
AND login=?
|
||||
AND identifier=? ";
|
||||
$self->{RedmineQuery} = trim($query);
|
||||
}
|
||||
|
||||
sub RedmineDbUser { set_val('RedmineDbUser', @_); }
|
||||
sub RedmineDbPass { set_val('RedmineDbPass', @_); }
|
||||
sub RedmineDbWhereClause {
|
||||
sub RedmineDbWhereClause {
|
||||
my ($self, $parms, $arg) = @_;
|
||||
$self->{RedmineQuery} = trim($self->{RedmineQuery}.($arg ? $arg : "")." ");
|
||||
}
|
||||
|
||||
sub RedmineCacheCredsMax {
|
||||
sub RedmineCacheCredsMax {
|
||||
my ($self, $parms, $arg) = @_;
|
||||
if ($arg) {
|
||||
$self->{RedmineCachePool} = APR::Pool->new;
|
||||
|
@ -325,10 +325,10 @@ sub access_handler {
|
|||
|
||||
sub authen_handler {
|
||||
my $r = shift;
|
||||
|
||||
|
||||
my ($res, $redmine_pass) = $r->get_basic_auth_pw();
|
||||
return $res unless $res == OK;
|
||||
|
||||
|
||||
if (is_member($r->user, $redmine_pass, $r)) {
|
||||
return OK;
|
||||
} else {
|
||||
|
@ -355,7 +355,7 @@ sub is_authentication_forced {
|
|||
}
|
||||
$sth->finish();
|
||||
undef $sth;
|
||||
|
||||
|
||||
$dbh->disconnect();
|
||||
undef $dbh;
|
||||
|
||||
|
@ -365,7 +365,7 @@ sub is_authentication_forced {
|
|||
sub is_public_project {
|
||||
my $project_id = shift;
|
||||
my $r = shift;
|
||||
|
||||
|
||||
if (is_authentication_forced($r)) {
|
||||
return 0;
|
||||
}
|
||||
|
@ -392,12 +392,12 @@ sub is_public_project {
|
|||
|
||||
sub anonymous_role_allows_browse_repository {
|
||||
my $r = shift;
|
||||
|
||||
|
||||
my $dbh = connect_database($r);
|
||||
my $sth = $dbh->prepare(
|
||||
"SELECT permissions FROM roles WHERE builtin = 2;"
|
||||
);
|
||||
|
||||
|
||||
$sth->execute();
|
||||
my $ret = 0;
|
||||
if (my @row = $sth->fetchrow_array) {
|
||||
|
@ -409,7 +409,7 @@ sub anonymous_role_allows_browse_repository {
|
|||
undef $sth;
|
||||
$dbh->disconnect();
|
||||
undef $dbh;
|
||||
|
||||
|
||||
$ret;
|
||||
}
|
||||
|
||||
|
@ -504,7 +504,7 @@ sub is_member {
|
|||
|
||||
sub get_project_identifier {
|
||||
my $r = shift;
|
||||
|
||||
|
||||
my $cfg = Apache2::Module::get_config(__PACKAGE__, $r->server, $r->per_dir_config);
|
||||
my $location = $r->location;
|
||||
my ($identifier) = $r->uri =~ m{$location/*([^/]+)};
|
||||
|
@ -514,7 +514,7 @@ sub get_project_identifier {
|
|||
|
||||
sub connect_database {
|
||||
my $r = shift;
|
||||
|
||||
|
||||
my $cfg = Apache2::Module::get_config(__PACKAGE__, $r->server, $r->per_dir_config);
|
||||
return DBI->connect($cfg->{RedmineDSN}, $cfg->{RedmineDbUser}, $cfg->{RedmineDbPass});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue