X-Git-Url: http://lists.indexdata.com/cgi-bin?a=blobdiff_plain;f=src%2Ffilter_auth_simple.cpp;h=f48dd157606a8a8eef6f07858d67c46474e2a783;hb=47f540947520045b8d72cd8b4d7543a48093cc37;hp=7b0cba80384af7c950c1f556746c02dbe0cf9d43;hpb=79100c2ae2dac4bdde4f4d46b69e147562b4ec6c;p=metaproxy-moved-to-github.git diff --git a/src/filter_auth_simple.cpp b/src/filter_auth_simple.cpp index 7b0cba8..f48dd15 100644 --- a/src/filter_auth_simple.cpp +++ b/src/filter_auth_simple.cpp @@ -1,7 +1,22 @@ -/* $Id: filter_auth_simple.cpp,v 1.18 2006-03-16 10:40:59 adam Exp $ - Copyright (c) 2005-2006, Index Data. +/* $Id: filter_auth_simple.cpp,v 1.24 2007-05-23 14:24:10 adam Exp $ + Copyright (c) 2005-2007, Index Data. -%LICENSE% +This file is part of Metaproxy. + +Metaproxy is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +Metaproxy is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Metaproxy; see the file LICENSE. If not, write to the +Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ #include "config.hpp" @@ -242,9 +257,10 @@ void yf::AuthSimple::process_init(mp::Package &package) const static bool contains(std::list list, std::string thing) { std::list::const_iterator i; for (i = list.begin(); i != list.end(); i++) - if (*i == thing) + if (mp::util::database_name_normalize(*i) == + mp::util::database_name_normalize(thing)) return true; - + return false; } @@ -341,8 +357,8 @@ void yf::AuthSimple::check_targets(mp::Package & package) const std::list authorisedTargets = m_p->targetsByUser[user]; std::list targets; - Z_OtherInformation *otherInfo = initReq->otherInfo; - mp::util::get_vhost_otherinfo(&otherInfo, 1, targets); + Z_OtherInformation **otherInfo = &initReq->otherInfo; + mp::util::remove_vhost_otherinfo(otherInfo, targets); // Check each of the targets specified in the otherInfo package std::list::iterator i; @@ -365,9 +381,8 @@ void yf::AuthSimple::check_targets(mp::Package & package) const YAZ_BIB1_ACCESS_TO_SPECIFIED_DATABASE_DENIED, // ### It would be better to use the Z-db name "all databases"); - mp::odr odr; - mp::util::set_vhost_otherinfo(&otherInfo, odr, targets); + mp::util::set_vhost_otherinfo(otherInfo, odr, targets); package.move(); }