** Process CGI parameters. */
| 299 | ** Process CGI parameters. |
| 300 | */ |
| 301 | void loadForm(void) |
| 302 | { |
| 303 | int i,n; |
| 304 | char **tokens=NULL; |
| 305 | int rosa_type=0; |
| 306 | |
| 307 | for(i=0;i<mapserv->request->NumParams;i++) { /* now process the rest of the form variables */ |
| 308 | if(strlen(mapserv->request->ParamValues[i]) == 0) |
| 309 | continue; |
| 310 | |
| 311 | |
| 312 | if(strcasecmp(mapserv->request->ParamNames[i],"icon") == 0) { |
| 313 | mapserv->icon = msStrdup(mapserv->request->ParamValues[i]); |
| 314 | continue; |
| 315 | } |
| 316 | |
| 317 | if(strcasecmp(mapserv->request->ParamNames[i],"queryfile") == 0) { |
| 318 | QueryFile = msStrdup(mapserv->request->ParamValues[i]); |
| 319 | continue; |
| 320 | } |
| 321 | |
| 322 | if(strcasecmp(mapserv->request->ParamNames[i],"savequery") == 0) { |
| 323 | mapserv->savequery = MS_TRUE; |
| 324 | continue; |
| 325 | } |
| 326 | |
| 327 | /* Insecure as implemented, need to save someplace non accessible by everyone in the universe |
| 328 | if(strcasecmp(mapserv->request->ParamNames[i],"savemap") == 0) { |
| 329 | mapserv->savemap = MS_TRUE; |
| 330 | continue; |
| 331 | } |
| 332 | */ |
| 333 | |
| 334 | if(strcasecmp(mapserv->request->ParamNames[i],"zoom") == 0) { |
| 335 | mapserv->Zoom = getNumeric(mapserv->request->ParamValues[i]); |
| 336 | if((mapserv->Zoom > MAXZOOM) || (mapserv->Zoom < MINZOOM)) { |
| 337 | msSetError(MS_WEBERR, "Zoom value out of range.", "loadForm()"); |
| 338 | writeError(); |
| 339 | } |
| 340 | continue; |
| 341 | } |
| 342 | |
| 343 | if(strcasecmp(mapserv->request->ParamNames[i],"zoomdir") == 0) { |
| 344 | mapserv->ZoomDirection = (int)getNumeric(mapserv->request->ParamValues[i]); |
| 345 | if((mapserv->ZoomDirection != -1) && (mapserv->ZoomDirection != 1) && (mapserv->ZoomDirection != 0)) { |
| 346 | msSetError(MS_WEBERR, "Zoom direction must be 1, 0 or -1.", "loadForm()"); |
| 347 | writeError(); |
| 348 | } |
| 349 | continue; |
| 350 | } |
| 351 | |
| 352 | if(strcasecmp(mapserv->request->ParamNames[i],"zoomsize") == 0) { /* absolute zoom magnitude */ |
| 353 | ZoomSize = (int) getNumeric(mapserv->request->ParamValues[i]); |
| 354 | if((ZoomSize > MAXZOOM) || (ZoomSize < 1)) { |
| 355 | msSetError(MS_WEBERR, "Invalid zoom size.", "loadForm()"); |
| 356 | writeError(); |
| 357 | } |
| 358 | continue; |
no test coverage detected