From: Sebastian Hammer Date: Wed, 11 Apr 2007 16:48:09 +0000 (+0000) Subject: Moved the check for PZ_ALLOW X-Git-Tag: PAZPAR2.1.0.0~322 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=7268905fa4eb3b905b9e1f3a26b84301f4ffccab;p=pazpar2-moved-to-github.git Moved the check for PZ_ALLOW --- diff --git a/src/database.c b/src/database.c index 82830a8..39514d4 100644 --- a/src/database.c +++ b/src/database.c @@ -1,4 +1,4 @@ -/* $Id: database.c,v 1.12 2007-04-11 13:05:50 quinn Exp $ +/* $Id: database.c,v 1.13 2007-04-11 16:48:09 quinn Exp $ Copyright (c) 2006-2007, Index Data. This file is part of Pazpar2. @@ -241,8 +241,6 @@ static int match_criterion(struct setting **settings, struct database_criterion int database_match_criteria(struct setting **settings, struct database_criterion *cl) { - if (settings && settings[PZ_ALLOW] && *settings[PZ_ALLOW]->value == '0') - return 0; for (; cl; cl = cl->next) if (!match_criterion(settings, cl)) break; @@ -261,11 +259,15 @@ int session_grep_databases(struct session *se, struct database_criterion *cl, int i = 0; for (p = se->databases; p; p = p->next) + { + if (p->settings && p->settings[PZ_ALLOW] && *p->settings[PZ_ALLOW]->value == '0') + continue; if (database_match_criteria(p->settings, cl)) { (*fun)(se, p); i++; } + } return i; }