Ignore:
Timestamp:
2003-07-18T10:02:55+12:00 (21 years ago)
Author:
sjboddie
Message:

Added the following options to the collect.cfg file:

=> auth_collection: This has two values document or collection, provides

authentication at the collection level or document level.

=> auth_groups: This allows user groups to access collections or documents.

=> allow_acls: When used in conjunction with authcollection = document to

activate the following two options, must be either true or false.

=> allowallexcept: This option requires a list of space separated document OID's

which means all documents can be viewed and the ones listed cannot
without authentication.

=> denyallexcept: This option requires a list of space separated document OID's

whereby all documents require authentication except those listed
by document OID's.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/recpt/documentaction.cpp

    r4972 r4974  
    166166
    167167bool documentaction::check_cgiargs (cgiargsinfoclass &argsinfo, cgiargsclass &args,
    168                     recptprotolistclass * /*protos*/, ostream &logout) {
    169 
    170   // check gc argument
    171   int arg_gc = args.getintarg("gc");
     168                    recptprotolistclass *protos, ostream &logout) {
     169
     170   if(!args["d"].empty())
     171      {
     172     recptproto* collectproto = protos->getrecptproto (args["c"], logout);
     173     if (collectproto != NULL)
     174        {
     175           ColInfoResponse_t *cinfo = recpt->get_collectinfo_ptr (collectproto, args["c"], logout);
     176           
     177           if(cinfo->auth_collection == "document" && cinfo->allow_acls)
     178          {
     179             // both are either commented out or uncomment and are empty
     180             if (cinfo->allowallexcept.empty() && cinfo->denyallexcept.empty())
     181            {
     182               //deny everything
     183               args["uan"] = "1";
     184               args["ug"] = cinfo->auth_group;
     185            }
     186
     187             // both allowallexcept and denyallexcept are turned on !
     188             else if (!cinfo->allowallexcept.empty() && !cinfo->denyallexcept.empty())
     189            {
     190               //deny everything
     191               args["uan"] = "1";
     192               args["ug"] = cinfo->auth_group;
     193            }
     194             
     195             // only allowallexcept is set, so ask to authenticate for that article/doc
     196             else if (cinfo->allowallexcept.find(args["d"]) != cinfo->allowallexcept.end() )
     197            {
     198               
     199               args["uan"] = "1";
     200               args["ug"] = cinfo->auth_group;
     201            }
     202             
     203             // only denyallexcept is set, so ask to authenticate for that article/doc
     204             else if (cinfo->denyallexcept.find(args["d"]) == cinfo->denyallexcept.end() )
     205            {
     206               args["uan"] = "1";
     207               args["ug"] = cinfo->auth_group;
     208            }
     209             
     210          }
     211        }
     212      }
     213   // check gc argument
     214   int arg_gc = args.getintarg("gc");
    172215  if (arg_gc < 0 || arg_gc > 2) {
    173216    logout << "Warning: \"gc\" argument out of range (" << arg_gc << ")\n";
Note: See TracChangeset for help on using the changeset viewer.