Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
O
OHR Support
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
97
Issues
97
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
OHR Support
Commits
c2edd624
Commit
c2edd624
authored
Nov 28, 2011
by
Holger Just
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix trailing whitespace
parent
5e171001
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
18 deletions
+18
-18
Redmine.pm
extra/svn/Redmine.pm
+18
-18
No files found.
extra/svn/Redmine.pm
View file @
c2edd624
...
...
@@ -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
});
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment