350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
|
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
|
-
+
-
-
-
-
+
+
+
+
+
|
**
** Generate a ZIP archive for the baseline.
** Return that ZIP archive as the HTTP reply content.
*/
void baseline_zip_page(void){
int rid;
char *zName;
int i;
int nName;
Blob zip;
login_check_credentials();
if( !g.okRead || !g.okHistory ){ login_needed(); return; }
zName = mprintf("%s", PD("name",""));
i = strlen(zName);
for(i=strlen(zName)-1; i>5; i--){
if( zName[i]=='.' ){
zName[i] = 0;
nName = strlen(zName);
for(nName=strlen(zName)-1; nName>5; nName--){
if( zName[nName]=='.' ){
zName[nName] = 0;
break;
}
}
rid = name_to_rid(zName);
if( rid==0 ){
@ Not found
return;
}
if( nName>10 ) zName[10] = 0;
zip_of_baseline(rid, &zip, zName);
cgi_set_content(&zip);
cgi_set_content_type("application/zip");
cgi_reply();
}
|