aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgoodale <goodale@1faa4e14-9dd3-4be0-9f0e-ffe519881164>2000-09-20 10:27:42 +0000
committergoodale <goodale@1faa4e14-9dd3-4be0-9f0e-ffe519881164>2000-09-20 10:27:42 +0000
commit98b7f416ef5f730b16f9bfdbe142c22f14f7839f (patch)
tree0ed05beeb98d5f9c5ebe953923fa027f4faba524
parentc9c7ff278d952939638e89df5db78293f22bddac (diff)
Reversiing commit about auth of controlling, as realised it wa already done.
My memory must be going ! Corrected URI in Location: header from run control setting page. Tom git-svn-id: http://svn.cactuscode.org/arrangements/CactusConnect/HTTPD/trunk@62 1faa4e14-9dd3-4be0-9f0e-ffe519881164
-rw-r--r--src/Content.c71
1 files changed, 22 insertions, 49 deletions
diff --git a/src/Content.c b/src/Content.c
index eca4853..8ee3a8a 100644
--- a/src/Content.c
+++ b/src/Content.c
@@ -1170,64 +1170,37 @@ static int ControlSet(cGH *cctkGH, httpRequest *request)
char message[4098];
const char *runstate;
- int notauthorised;
- char thisuser[USER_LENGTH+1];
+ runstate = HTTP_ArgumentValue(request,"runstate");
- notauthorised = HTTP_AuthenticateBasic(request, "user", thisuser, USER_LENGTH);
-
- if(!notauthorised)
+ switch(*runstate)
{
- runstate = HTTP_ArgumentValue(request,"runstate");
-
- switch(*runstate)
- {
- case 'T' : HTTP_SteerQueue(CCTK_THORNSTRING, "terminate", "yes");
- ControlTerminationPage(cctkGH, request);
- break;
- case 'P' : HTTP_SteerQueue(CCTK_THORNSTRING, "pause", "yes");
- break;
- case 'R' : HTTP_SteerQueue(CCTK_THORNSTRING, "pause", "no");
- break;
- default :
- fprintf(stderr, "Unknown runstate '%s'\n", runstate);
- }
+ case 'T' : HTTP_SteerQueue(CCTK_THORNSTRING, "terminate", "yes");
+ ControlTerminationPage(cctkGH, request);
+ break;
+ case 'P' : HTTP_SteerQueue(CCTK_THORNSTRING, "pause", "yes");
+ break;
+ case 'R' : HTTP_SteerQueue(CCTK_THORNSTRING, "pause", "no");
+ break;
+ default :
+ fprintf(stderr, "Unknown runstate '%s'\n", runstate);
+ }
- /* Now redirect the browser to the normal page */
+ /* Now redirect the browser to the normal page */
/* Status message */
- if(request->http_major_version < 1 ||
- (request->http_major_version == 1 && request->http_minor_version < 1))
- {
- /* Older browsers don't understand 303 */
- strcpy(message,"HTTP/1.0 302 Found\r\n");
- }
- else
- {
- strcpy(message,"HTTP/1.0 303 See Other\r\n");
- }
-
- sprintf(message, "%sLocation: /control.html/\r\n\r\n", message);
-
- HTTP_Write(request, message, strlen(message));
+ if(request->http_major_version < 1 ||
+ (request->http_major_version == 1 && request->http_minor_version < 1))
+ {
+ /* Older browsers don't understand 303 */
+ strcpy(message,"HTTP/1.0 302 Found\r\n");
}
else
{
- /* Not authorised */
- strcpy(message,"HTTP/1.0 401 Unauthorized\r\n");
+ strcpy(message,"HTTP/1.0 303 See Other\r\n");
+ }
- HTTP_Write(request, message, strlen(message));
-
- strcpy(message,"WWW-Authenticate: Basic realm=\"Cactus Control\"\r\n");
+ sprintf(message, "%sLocation: /control.html\r\n\r\n", message);
- HTTP_Write(request, message, strlen(message));
-
- HTTP_CookieCancel(request,"user", "/");
-
- strcpy(message,"Content-Type: text/html\r\n\r\n");
-
- HTTP_Write(request, message, strlen(message));
-
- HTTP_Write(request, notauthorized_page, strlen(notauthorized_page));
- }
+ HTTP_Write(request, message, strlen(message));
return 0;
}