[greenstone-users] authorised users for protected collections

From deepak kumar
Date30 May 2003 04:55:41 -0000
Subject [greenstone-users] authorised users for protected collections
I am looking for some idea to make a collection accessible to
a paticular group of users. In the greenstone archive section, i
found this trick, which won't work actually. Do anyone suggest me
how to make a collection restricted with password.

I compliede the source code for greenstone after putting few line
of code in the suggested file as instructed below. but it's not

I like to mention here the environment that i am using
OS-window98, Greenstone2.39[web installation], apache1.3.

line of code that i put in the src/recpt/receptionist.cpp

if (args["c"] == "imtcol") {
args['uan'] = 1;
args['ug'] = "imtgroup";

I made sure that i have users added in a new group "imtgroup" and
a collection named "imtcol". Do i need some thing else to

Best regards


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
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
belonging to the "mygroup" group will be able to access the

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
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


Impress your clients! Send mail from me @ mycompany.com .
Just Rs.1499/year.
Click http://www.rediffmailpro.com to know more.