Changeset 5017 for trunk/gsdl/src/recpt/receptionist.cpp
- Timestamp:
- 2003-07-24T04:04:00+12:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/recpt/receptionist.cpp
r4974 r5017 208 208 // it contains. The configuration should take place after everything 209 209 // has been added but before the initialisation. 210 210 211 void receptionist::configure (const text_t &key, const text_tarray &cfgline) { 211 212 // configure the receptionist 212 213 214 215 213 216 if (cfgline.size() >= 1) { 214 217 cgiarginfo *info = NULL; … … 272 275 } 273 276 277 // Read in the value for the site_auth directive either true or false 278 else if (key == "site_auth") configinfo.site_auth = (cfgline[0] == "true"); 279 280 else if (key == "site_group") 281 joinchar(cfgline,',',configinfo.site_group); 282 274 283 else if (key == "SiteFormat") { 275 284 if (cfgline[0] == "HomePageType") { … … 1080 1089 1081 1090 bool receptionist::check_mainargs (cgiargsclass &args, ostream &logout) { 1082 // if this receptionist is running in collection dependant mode 1083 // then it should always set the collection argument to the 1084 // collection 1085 if (!configinfo.collection.empty()) args["c"] = configinfo.collection; 1086 1087 // if current collection uses ccscols make sure 1088 // "ccs" argument is set and make "cc" default to 1089 // all collections in "ccs" 1090 if (args["a"] != "config" && !args["c"].empty()) { 1091 1092 text_t &arg_c = args["c"]; 1093 recptproto *collectproto = protocols.getrecptproto (arg_c, logout); 1094 if (collectproto == NULL) { 1095 // oops, this collection isn't valid 1096 outconvertclass text_t2ascii; 1097 logout << text_t2ascii << "ERROR: Invalid collection: " << arg_c << "\n"; 1098 args["c"].clear(); 1099 1100 } else { 1101 1102 ColInfoResponse_t *cinfo = get_collectinfo_ptr (collectproto, arg_c, logout); 1103 1104 if(cinfo->auth_collection == "collection") 1105 { 1106 args["uan"] = "1"; 1107 args["ug"] = cinfo->auth_group; 1108 } 1109 1110 1091 1092 if(configinfo.site_auth) 1093 { 1094 args["uan"] = "1"; 1095 args["ug"] = configinfo.site_group; 1096 } 1097 1098 1099 // if this receptionist is running in collection dependant mode 1100 // then it should always set the collection argument to the 1101 // collection 1102 if (!configinfo.collection.empty()) args["c"] = configinfo.collection; 1103 1104 // if current collection uses ccscols make sure 1105 // "ccs" argument is set and make "cc" default to 1106 // all collections in "ccs" 1107 if (args["a"] != "config" && !args["c"].empty()) { 1108 1109 text_t &arg_c = args["c"]; 1110 recptproto *collectproto = protocols.getrecptproto (arg_c, logout); 1111 if (collectproto == NULL) { 1112 // oops, this collection isn't valid 1113 outconvertclass text_t2ascii; 1114 logout << text_t2ascii << "ERROR: Invalid collection: " << arg_c << "\n"; 1115 args["c"].clear(); 1116 1117 } else { 1118 1119 ColInfoResponse_t *cinfo = get_collectinfo_ptr (collectproto, arg_c, logout); 1120 1121 if(cinfo->auth_collection == "collection") 1122 { 1123 args["uan"] = "1"; 1124 args["ug"] = cinfo->auth_group; 1125 } 1126 1127 1111 1128 if (cinfo != NULL) { 1112 if (!cinfo->ccsCols.empty()) {1113 args["ccs"] = 1;1114 if (args["cc"].empty()) {1115 text_tarray::const_iterator col_here = cinfo->ccsCols.begin();1116 text_tarray::const_iterator col_end = cinfo->ccsCols.end();1117 bool first = true;1118 while (col_here != col_end) {1119 1120 1121 if (!first) args["cc"].push_back (',');1122 args["cc"] += *col_here;1123 first = false;1124 1129 if (!cinfo->ccsCols.empty()) { 1130 args["ccs"] = 1; 1131 if (args["cc"].empty()) { 1132 text_tarray::const_iterator col_here = cinfo->ccsCols.begin(); 1133 text_tarray::const_iterator col_end = cinfo->ccsCols.end(); 1134 bool first = true; 1135 while (col_here != col_end) { 1136 // make sure it's a valid collection 1137 if (protocols.getrecptproto (*col_here, logout) != NULL) { 1138 if (!first) args["cc"].push_back (','); 1139 args["cc"] += *col_here; 1140 first = false; 1141 } 1125 1142 col_here ++; 1126 1143 }
Note:
See TracChangeset
for help on using the changeset viewer.