Changeset 5024


Ignore:
Timestamp:
2003-07-25T04:57:48+12:00 (21 years ago)
Author:
sjboddie
Message:

Changed the authentication directives to more easier to use ones.
authenticate option replaces auth_collection and takes the same options. The
options public_documents and private_documents replace the allowallexcept
and denyallexcept ACLs. The allow_acls has been removed. The auth_group remains
the same.

Location:
trunk/gsdl/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/colservr/collectserver.cpp

    r4974 r5024  
    101101
    102102    // What have we set in our collect.cfg file :  document or collection ?
    103     else if (key == "auth_collection") collectinfo.auth_collection = value;
     103    else if (key == "authenticate") collectinfo.authenticate = value;
    104104
    105105    // What have we set for our group list
     
    115115     
    116116      joinchar(cfgline,',',collectinfo.auth_group);
    117       //      outconvertclass t;
     117     
     118      //outconvertclass t;
    118119      //cerr << t << collectinfo.auth_group << "\n";
    119120       }
    120121
    121     // Have we set our security switch for use of acl to ON ?
    122 
    123     else if (key == "allow_acls")
    124        {
    125       if(value=="true")
    126          collectinfo.allow_acls = true;
    127       else
    128          collectinfo.allow_acls = false;
    129        }
    130 
    131122    // In the map the key-value pair contain the same
    132     // data
    133    
    134     // What have we set for our allowallexcept ACL
    135     else if (key == "allowallexcept")
     123    // data i.e key == data, if key is 2 then data is 2
     124   
     125    // What have we set for our public_documents ACL
     126    else if (key == "public_documents")
    136127       {
    137128      text_tarray::const_iterator begin = cfgline.begin();
     
    139130      while(begin != end)
    140131         {
    141         collectinfo.allowallexcept[*begin] = *begin;
     132        // key = data i.e if key is 2 then data is 2
     133        // collectinfo.public_documents[*begin] is the key
     134        // *begin is the data value
     135
     136        collectinfo.public_documents[*begin] = *begin;
    142137        begin++;
    143138         }
    144139       }
    145140   
    146     // What have we set for our group list
    147     else if (key == "denyallexcept")
     141    // What have we set for our private_documents ACL
     142    else if (key == "private_documents")
    148143       {
    149144      text_tarray::const_iterator begin = cfgline.begin();
     
    151146      while(begin != end)
    152147         {
    153         collectinfo.denyallexcept[*begin] = *begin;
     148        // key = data i.e if key is 2 then data is 2
     149        // collectinfo.public_documents[*begin] is the key
     150        // *begin is the data value
     151       
     152        collectinfo.private_documents[*begin] = *begin;
    154153        begin++;
    155154         }
  • trunk/gsdl/src/recpt/comtypes.cpp

    r5017 r5024  
    7171  // various parts of the code.
    7272 
    73   auth_collection.clear();         // turned off by default, individual collection authentication
     73  authenticate.clear();         // turned off by default, individual collection authentication
    7474  auth_group.clear();              // turned off by default, authentication by groups method
    75   allow_acls= false;               // turned off by default, our ACL switch either on or off in collect.cfg
    76   allowallexcept.clear();          // turned off by default, our allow-all-except <grouplist>
    77   denyallexcept.clear();           // turned off by default, out deny-all-except <grouplist>
    78  
    79  
     75  public_documents.clear();          // turned off by default, allow access to these documents <list>
     76  private_documents.clear();           // turned off by default, disallow access to these documents <list>
     77   
    8078}
    8179
  • trunk/gsdl/src/recpt/comtypes.h

    r4974 r5024  
    103103   text_t         httpprefix;
    104104   text_t         receptionist;
    105    text_t         buildType;       // 'mg' or 'mgpp'
    106    text_t         auth_collection; // 'document' or 'collection'
    107    text_t         auth_group;      // 'mygroup' 'yourgroup'
    108    bool           allow_acls;      // to make sure that the user wants to use this ACL feature
    109    text_tmap      allowallexcept;  // the acl to allow stuff or deny things
    110    text_tmap      denyallexcept;   // the opposite of the one above
     105   text_t         buildType;           // 'mg' or 'mgpp'
     106   text_t         authenticate;      // 'document' or 'collection'
     107   text_t         auth_group;          // 'mygroup' 'yourgroup'
     108   text_tmap      public_documents;    // the acl to allow access to listed documents
     109   text_tmap      private_documents;   // the acl to disallow access to listed documents
    111110   text_tarray    searchTypes; // form, plain, empty if collection uses mg, or has no searching facility
    112111};
  • trunk/gsdl/src/recpt/documentaction.cpp

    r5019 r5024  
    178178           ColInfoResponse_t *cinfo = recpt->get_collectinfo_ptr (collectproto, args["c"], logout);
    179179           
    180            if(cinfo->auth_collection == "document" && cinfo->allow_acls)
     180           if(cinfo->authenticate == "document")
    181181          {
    182182             // both are either commented out or uncomment and are empty
    183              if (cinfo->allowallexcept.empty() && cinfo->denyallexcept.empty())
     183             if (cinfo->public_documents.empty() && cinfo->private_documents.empty())
    184184            {
    185185               //deny everything
     
    188188            }
    189189
    190              // both allowallexcept and denyallexcept are turned on !
    191              else if (!cinfo->allowallexcept.empty() && !cinfo->denyallexcept.empty())
     190             // both public_documents and private_documents are turned on !
     191             else if (!cinfo->public_documents.empty() && !cinfo->private_documents.empty())
    192192            {
    193193               //deny everything
     
    196196            }
    197197             
    198              // only allowallexcept is set, so ask to authenticate for that article/doc
    199              else if (cinfo->allowallexcept.find(docTop) != cinfo->allowallexcept.end() )
     198             // only public_documents is set, so ask to authenticate for that article/doc
     199             else if (cinfo->public_documents.find(docTop) != cinfo->public_documents.end() )
    200200            {
    201201               
     
    204204            }
    205205             
    206              // only denyallexcept is set, so ask to authenticate for that article/doc
    207              else if (cinfo->denyallexcept.find(docTop) == cinfo->denyallexcept.end() )
     206             // only private_documents is set, so ask to authenticate for that article/doc
     207             else if (cinfo->private_documents.find(docTop) == cinfo->private_documents.end() )
    208208            {
    209209               args["uan"] = "1";
  • trunk/gsdl/src/recpt/receptionist.cpp

    r5020 r5024  
    11201120     ColInfoResponse_t *cinfo = get_collectinfo_ptr (collectproto, arg_c, logout);
    11211121     
    1122      if(cinfo->auth_collection == "collection")
     1122     if(cinfo->authenticate == "collection")
    11231123        {
    11241124           args["uan"] = "1";
Note: See TracChangeset for help on using the changeset viewer.