Re: how to create authorised users for protected collections

From Stefan Boddie
DateTue, 5 Mar 2002 14:43:57 +1300
Subject Re: how to create authorised users for protected collections
In-Reply-To (3C81168B-FE3CC5E7-t-online-de)
> Hi,
> in the users guide, chapter "user management" is written that it is
> possible to protect collections for special users, authenticating with
> "user" and "password". How i can combine a special user with a special
> collection, and does this mechanism work also for an exported collection
> on CD.
> Best regards A. Dobreff


Unfortunately you've found a bit of a half-truth in the users guide. That
is, while Greenstone does have user authentication built in (as used by the
collector and administrative functions) there's currently no easy way to
protect specific collections with it.

Having said that, if you're not afraid to get your hands dirty the following
hack should work.

In the parse_cgi_args() function of src/recpt/receptionist.cpp you could add
the following block of (completely untested) code sometime before the call
to check_external_cgiargs().

if (args["c"] == "mycol") {
args['uan'] = 1;
args['ug'] = "mygroup";

By adding this and recompiling the code you should find that only users
belonging to the "mygroup" group will be able to access the "mycol"

This change will also work for collections exported to CD-ROM (as long as
the server.exe file in bin/windows has the changes compiled in).

I hope this helps. If you don't feel comfortable altering the code and
recompiling yourself let me know and I'll have a go at it when I get the
time (or maybe someone could implement this functionality properly?).