52 #define DEFAULT_ADMINISTRATOR "cedar_db@hao.ucar.edu"
53 #define INCORRECT_REQUEST (BES_NOT_FOUND_ERROR + 1)
54 #define INCORRECT_REQUEST_MSG "undefined request"
89 int status = BESCmdInterface::execute_request(
"cedar" ) ;
109 string s_cookie = cookie ;
110 string var =
"OpenDAP.remoteuser=" ;
111 int user_var = s_cookie.find( var ) ;
114 string s_user_var = s_cookie.substr( user_var + var.length(),
115 s_cookie.length() ) ;
116 int semi = s_user_var.find(
";" ) ;
123 user = s_user_var.substr( 0, semi ) ;
153 std::string::size_type http = https.find(
"HTTP");
154 if( http == string::npos )
160 _dhi.transmit_protocol =
"HTTP" ;
166 string user =
"undef" ;
192 BESDEBUG(
"apache",
"BESApacheInterface dhi = " << _dhi << endl )
194 BESCmdInterface::initialize() ;
272 bool ishttp = false ;
273 if( _dhi.transmit_protocol ==
"HTTP" )
288 return BESCmdInterface::exception_manager( e ) ;
292 return BESCmdInterface::exception_manager( e ) ;
296 BESApacheInterface::welcome_browser()
301 (*
BESLog::TheLog()) <<
"Incoming request from " << who.c_str() <<
" using " << agent.c_str() << endl;
304 int mo=agent.find(
"Mozilla");
305 int ho=agent.find(
"HotJava");
310 string administrator =
312 if(administrator==
"")
313 cout <<
"BES: internal server error please contact"
315 <<
"with the following message:\n" ;
317 cout <<
"BES: internal server error please contact"
318 << administrator.c_str()
319 <<
"with the following message:\n" ;
320 cout <<
"BES: cannot interact with browser" << agent.c_str() << endl ;
327 if( (method!=
"GET") && (method!=
"POST") )
331 string administrator =
333 if(administrator==
"")
334 cout <<
"BES: internal server error please contact"
335 << DEFAULT_ADMINISTRATOR
336 <<
"with the following message:\n" ;
338 cout <<
"BES: internal server error please contact"
339 << administrator.c_str()
340 <<
"with the following message:\n" ;
341 cout <<
"BES: fatal, cannot get/understand the key BES.DefaultResponseMethod"
346 cout <<
"HTTP/1.0 200 OK\n" ;
347 cout <<
"Content-type: text/html\n\n" ;
352 cout <<
"<TITLE> Request to the BES server</TITLE>\n" ;
355 cout <<
"<form action=\"http://" << _dri->
server_name
357 <<
"\" method=get>\n" ;
358 else if (method==
"POST")
359 cout <<
"<form action=\"http://" << _dri->
server_name
361 <<
"\" method=post>\n" ;
363 cout <<
"<p>Request: <br><textarea name=\"request\" cols=85 rows=11 size=40,4 wrap=\"virtual\" ></textarea></p>\n" ;
364 cout <<
"<input type=\"submit\" value=\"Submit to BES\">\n" ;
365 cout <<
"<input type=\"reset\" value=\"Clean Text Field\">\n" ;
366 cout <<
"</form>\n" ;
367 cout <<
"</body>\n" ;
368 cout <<
"</html>\n" ;