@@ -227,9 +227,38 sub authen_handler { | |||
|
227 | 227 | } |
|
228 | 228 | } |
|
229 | 229 | |
|
230 | # check if authentication is forced | |
|
231 | sub is_authentication_forced { | |
|
232 | my $r = shift; | |
|
233 | ||
|
234 | my $dbh = connect_database($r); | |
|
235 | my $sth = $dbh->prepare( | |
|
236 | "SELECT value FROM settings where settings.name = 'login_required';" | |
|
237 | ); | |
|
238 | ||
|
239 | $sth->execute(); | |
|
240 | my $ret = 0; | |
|
241 | if (my @row = $sth->fetchrow_array) { | |
|
242 | if ($row[0] eq "1" || $row[0] eq "t") { | |
|
243 | $ret = 1; | |
|
244 | } | |
|
245 | } | |
|
246 | $sth->finish(); | |
|
247 | undef $sth; | |
|
248 | ||
|
249 | $dbh->disconnect(); | |
|
250 | undef $dbh; | |
|
251 | ||
|
252 | $ret; | |
|
253 | } | |
|
254 | ||
|
230 | 255 | sub is_public_project { |
|
231 | 256 | my $project_id = shift; |
|
232 | 257 | my $r = shift; |
|
258 | ||
|
259 | if (is_authentication_forced($r)) { | |
|
260 | return 0; | |
|
261 | } | |
|
233 | 262 | |
|
234 | 263 | my $dbh = connect_database($r); |
|
235 | 264 | my $sth = $dbh->prepare( |
General Comments 0
You need to be logged in to leave comments.
Login now