summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Davis <edavis@littlestreamsoftware.com>2010-07-08 03:48:35 +0000
committerEric Davis <edavis@littlestreamsoftware.com>2010-07-08 03:48:35 +0000
commitf3b9c0027f02503cdafc524f282397b5a3259885 (patch)
treeaa900e4dc8b370f3c806fb398cad9dcdd7926fbb
parenta146c2d03ffa452426516387028ebe608d9d710c (diff)
downloadredmine-f3b9c0027f02503cdafc524f282397b5a3259885.tar.gz
redmine-f3b9c0027f02503cdafc524f282397b5a3259885.zip
Merged r3831 from trunk.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/0.9-stable@3833 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--extra/svn/Redmine.pm29
1 files changed, 29 insertions, 0 deletions
diff --git a/extra/svn/Redmine.pm b/extra/svn/Redmine.pm
index 1b3b0910f..f608ee124 100644
--- a/extra/svn/Redmine.pm
+++ b/extra/svn/Redmine.pm
@@ -227,9 +227,38 @@ sub authen_handler {
}
}
+# check if authentication is forced
+sub is_authentication_forced {
+ my $r = shift;
+
+ my $dbh = connect_database($r);
+ my $sth = $dbh->prepare(
+ "SELECT value FROM settings where settings.name = 'login_required';"
+ );
+
+ $sth->execute();
+ my $ret = 0;
+ if (my @row = $sth->fetchrow_array) {
+ if ($row[0] eq "1" || $row[0] eq "t") {
+ $ret = 1;
+ }
+ }
+ $sth->finish();
+ undef $sth;
+
+ $dbh->disconnect();
+ undef $dbh;
+
+ $ret;
+}
+
sub is_public_project {
my $project_id = shift;
my $r = shift;
+
+ if (is_authentication_forced($r)) {
+ return 0;
+ }
my $dbh = connect_database($r);
my $sth = $dbh->prepare(