Fossil SCM

Experimental changes to permit easier debugging of the moderation subsystem.

mistachkin 2014-09-18 22:02 UTC please-review
Commit bcb444360ae6ee6ad0fa567881f5f3bbc2230514
+2 -2
--- src/attach.c
+++ src/attach.c
@@ -288,12 +288,12 @@
288288
if( pManifest ){
289289
blob_compress(&content, &content);
290290
addCompress = 1;
291291
}
292292
needModerator =
293
- (zTkt!=0 && g.perm.ModTkt==0 && db_get_boolean("modreq-tkt",0)==1) ||
294
- (zPage!=0 && g.perm.ModWiki==0 && db_get_boolean("modreq-wiki",0)==1);
293
+ (zTkt!=0 && ticket_need_moderation(0)) ||
294
+ (zPage!=0 && wiki_need_moderation(0));
295295
rid = content_put_ex(&content, 0, 0, 0, needModerator);
296296
zUUID = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
297297
blob_zero(&manifest);
298298
for(i=n=0; zName[i]; i++){
299299
if( zName[i]=='/' || zName[i]=='\\' ) n = i;
300300
--- src/attach.c
+++ src/attach.c
@@ -288,12 +288,12 @@
288 if( pManifest ){
289 blob_compress(&content, &content);
290 addCompress = 1;
291 }
292 needModerator =
293 (zTkt!=0 && g.perm.ModTkt==0 && db_get_boolean("modreq-tkt",0)==1) ||
294 (zPage!=0 && g.perm.ModWiki==0 && db_get_boolean("modreq-wiki",0)==1);
295 rid = content_put_ex(&content, 0, 0, 0, needModerator);
296 zUUID = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
297 blob_zero(&manifest);
298 for(i=n=0; zName[i]; i++){
299 if( zName[i]=='/' || zName[i]=='\\' ) n = i;
300
--- src/attach.c
+++ src/attach.c
@@ -288,12 +288,12 @@
288 if( pManifest ){
289 blob_compress(&content, &content);
290 addCompress = 1;
291 }
292 needModerator =
293 (zTkt!=0 && ticket_need_moderation(0)) ||
294 (zPage!=0 && wiki_need_moderation(0));
295 rid = content_put_ex(&content, 0, 0, 0, needModerator);
296 zUUID = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
297 blob_zero(&manifest);
298 for(i=n=0; zName[i]; i++){
299 if( zName[i]=='/' || zName[i]=='\\' ) n = i;
300
+1 -1
--- src/json_wiki.c
+++ src/json_wiki.c
@@ -375,11 +375,11 @@
375375
blob_append(&content, cson_string_cstr(jstr),contentLen);
376376
}
377377
378378
zMimeType = json_find_option_cstr("mimetype","mimetype","M");
379379
380
- wiki_cmd_commit(zPageName, 0==rid, &content, zMimeType);
380
+ wiki_cmd_commit(zPageName, 0==rid, &content, zMimeType, 0);
381381
blob_reset(&content);
382382
/*
383383
Our return value here has a race condition: if this operation
384384
is called concurrently for the same wiki page via two requests,
385385
payV could reflect the results of the other save operation.
386386
--- src/json_wiki.c
+++ src/json_wiki.c
@@ -375,11 +375,11 @@
375 blob_append(&content, cson_string_cstr(jstr),contentLen);
376 }
377
378 zMimeType = json_find_option_cstr("mimetype","mimetype","M");
379
380 wiki_cmd_commit(zPageName, 0==rid, &content, zMimeType);
381 blob_reset(&content);
382 /*
383 Our return value here has a race condition: if this operation
384 is called concurrently for the same wiki page via two requests,
385 payV could reflect the results of the other save operation.
386
--- src/json_wiki.c
+++ src/json_wiki.c
@@ -375,11 +375,11 @@
375 blob_append(&content, cson_string_cstr(jstr),contentLen);
376 }
377
378 zMimeType = json_find_option_cstr("mimetype","mimetype","M");
379
380 wiki_cmd_commit(zPageName, 0==rid, &content, zMimeType, 0);
381 blob_reset(&content);
382 /*
383 Our return value here has a race condition: if this operation
384 is called concurrently for the same wiki page via two requests,
385 payV could reflect the results of the other save operation.
386
+22 -3
--- src/tkt.c
+++ src/tkt.c
@@ -273,10 +273,26 @@
273273
blob_reset(&sql2);
274274
blob_reset(&sql3);
275275
fossil_free(aUsed);
276276
return tktid;
277277
}
278
+
279
+/*
280
+** Returns non-zero if moderation is required for ticket changes and ticket
281
+** attachments.
282
+*/
283
+int ticket_need_moderation(
284
+ int localUser /* Are we being called for a local interactive user? */
285
+){
286
+ if( fossil_getenv("FOSSIL_FORCE_TICKET_MODERATION")!=0 ){
287
+ return 1;
288
+ }
289
+ if( localUser ){
290
+ return 0;
291
+ }
292
+ return g.perm.ModTkt==0 && db_get_boolean("modreq-tkt",0)==1;
293
+}
278294
279295
/*
280296
** Rebuild an entire entry in the TICKET table
281297
*/
282298
void ticket_rebuild_entry(const char *zTktUuid){
@@ -567,10 +583,11 @@
567583
char *zDate;
568584
const char *zUuid;
569585
int i;
570586
int nJ = 0;
571587
Blob tktchng, cksum;
588
+ int needMod;
572589
573590
login_verify_csrf_secret();
574591
if( !captcha_is_correct() ){
575592
@ <p class="generalError">Error: Incorrect security code.</p>
576593
return TH_OK;
@@ -622,25 +639,27 @@
622639
blob_appendf(&tktchng, "Z %b\n", &cksum);
623640
if( nJ==0 ){
624641
blob_reset(&tktchng);
625642
return TH_OK;
626643
}
644
+ needMod = ticket_need_moderation(0);
627645
if( g.zPath[0]=='d' ){
646
+ const char *zNeedMod = needMod ? "required" : "skipped";
628647
/* If called from /debug_tktnew or /debug_tktedit... */
629648
@ <font color="blue">
630649
@ <p>Ticket artifact that would have been submitted:</p>
631650
@ <blockquote><pre>%h(blob_str(&tktchng))</pre></blockquote>
651
+ @ <blockquote><pre>Moderation would be %h(zNeedMod).</pre></blockquote>
632652
@ <hr /></font>
633653
return TH_OK;
634654
}else{
635655
if( g.thTrace ){
636656
Th_Trace("submit_ticket {\n<blockquote><pre>\n%h\n</pre></blockquote>\n"
637657
"}<br />\n",
638658
blob_str(&tktchng));
639659
}
640
- ticket_put(&tktchng, zUuid,
641
- (g.perm.ModTkt==0 && db_get_boolean("modreq-tkt",0)==1));
660
+ ticket_put(&tktchng, zUuid, needMod);
642661
}
643662
return ticket_change(zUuid);
644663
}
645664
646665
@@ -1347,14 +1366,14 @@
13471366
}
13481367
blob_appendf(&tktchng, "K %s\n", zTktUuid);
13491368
blob_appendf(&tktchng, "U %F\n", zUser);
13501369
md5sum_blob(&tktchng, &cksum);
13511370
blob_appendf(&tktchng, "Z %b\n", &cksum);
1352
- if( ticket_put(&tktchng, zTktUuid, 0) ){
1371
+ if( ticket_put(&tktchng, zTktUuid, ticket_need_moderation(1)) ){
13531372
fossil_fatal("%s\n", g.zErrMsg);
13541373
}else{
13551374
fossil_print("ticket %s succeeded for %s\n",
13561375
(eCmd==set?"set":"add"),zTktUuid);
13571376
}
13581377
}
13591378
}
13601379
}
13611380
--- src/tkt.c
+++ src/tkt.c
@@ -273,10 +273,26 @@
273 blob_reset(&sql2);
274 blob_reset(&sql3);
275 fossil_free(aUsed);
276 return tktid;
277 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
278
279 /*
280 ** Rebuild an entire entry in the TICKET table
281 */
282 void ticket_rebuild_entry(const char *zTktUuid){
@@ -567,10 +583,11 @@
567 char *zDate;
568 const char *zUuid;
569 int i;
570 int nJ = 0;
571 Blob tktchng, cksum;
 
572
573 login_verify_csrf_secret();
574 if( !captcha_is_correct() ){
575 @ <p class="generalError">Error: Incorrect security code.</p>
576 return TH_OK;
@@ -622,25 +639,27 @@
622 blob_appendf(&tktchng, "Z %b\n", &cksum);
623 if( nJ==0 ){
624 blob_reset(&tktchng);
625 return TH_OK;
626 }
 
627 if( g.zPath[0]=='d' ){
 
628 /* If called from /debug_tktnew or /debug_tktedit... */
629 @ <font color="blue">
630 @ <p>Ticket artifact that would have been submitted:</p>
631 @ <blockquote><pre>%h(blob_str(&tktchng))</pre></blockquote>
 
632 @ <hr /></font>
633 return TH_OK;
634 }else{
635 if( g.thTrace ){
636 Th_Trace("submit_ticket {\n<blockquote><pre>\n%h\n</pre></blockquote>\n"
637 "}<br />\n",
638 blob_str(&tktchng));
639 }
640 ticket_put(&tktchng, zUuid,
641 (g.perm.ModTkt==0 && db_get_boolean("modreq-tkt",0)==1));
642 }
643 return ticket_change(zUuid);
644 }
645
646
@@ -1347,14 +1366,14 @@
1347 }
1348 blob_appendf(&tktchng, "K %s\n", zTktUuid);
1349 blob_appendf(&tktchng, "U %F\n", zUser);
1350 md5sum_blob(&tktchng, &cksum);
1351 blob_appendf(&tktchng, "Z %b\n", &cksum);
1352 if( ticket_put(&tktchng, zTktUuid, 0) ){
1353 fossil_fatal("%s\n", g.zErrMsg);
1354 }else{
1355 fossil_print("ticket %s succeeded for %s\n",
1356 (eCmd==set?"set":"add"),zTktUuid);
1357 }
1358 }
1359 }
1360 }
1361
--- src/tkt.c
+++ src/tkt.c
@@ -273,10 +273,26 @@
273 blob_reset(&sql2);
274 blob_reset(&sql3);
275 fossil_free(aUsed);
276 return tktid;
277 }
278
279 /*
280 ** Returns non-zero if moderation is required for ticket changes and ticket
281 ** attachments.
282 */
283 int ticket_need_moderation(
284 int localUser /* Are we being called for a local interactive user? */
285 ){
286 if( fossil_getenv("FOSSIL_FORCE_TICKET_MODERATION")!=0 ){
287 return 1;
288 }
289 if( localUser ){
290 return 0;
291 }
292 return g.perm.ModTkt==0 && db_get_boolean("modreq-tkt",0)==1;
293 }
294
295 /*
296 ** Rebuild an entire entry in the TICKET table
297 */
298 void ticket_rebuild_entry(const char *zTktUuid){
@@ -567,10 +583,11 @@
583 char *zDate;
584 const char *zUuid;
585 int i;
586 int nJ = 0;
587 Blob tktchng, cksum;
588 int needMod;
589
590 login_verify_csrf_secret();
591 if( !captcha_is_correct() ){
592 @ <p class="generalError">Error: Incorrect security code.</p>
593 return TH_OK;
@@ -622,25 +639,27 @@
639 blob_appendf(&tktchng, "Z %b\n", &cksum);
640 if( nJ==0 ){
641 blob_reset(&tktchng);
642 return TH_OK;
643 }
644 needMod = ticket_need_moderation(0);
645 if( g.zPath[0]=='d' ){
646 const char *zNeedMod = needMod ? "required" : "skipped";
647 /* If called from /debug_tktnew or /debug_tktedit... */
648 @ <font color="blue">
649 @ <p>Ticket artifact that would have been submitted:</p>
650 @ <blockquote><pre>%h(blob_str(&tktchng))</pre></blockquote>
651 @ <blockquote><pre>Moderation would be %h(zNeedMod).</pre></blockquote>
652 @ <hr /></font>
653 return TH_OK;
654 }else{
655 if( g.thTrace ){
656 Th_Trace("submit_ticket {\n<blockquote><pre>\n%h\n</pre></blockquote>\n"
657 "}<br />\n",
658 blob_str(&tktchng));
659 }
660 ticket_put(&tktchng, zUuid, needMod);
 
661 }
662 return ticket_change(zUuid);
663 }
664
665
@@ -1347,14 +1366,14 @@
1366 }
1367 blob_appendf(&tktchng, "K %s\n", zTktUuid);
1368 blob_appendf(&tktchng, "U %F\n", zUser);
1369 md5sum_blob(&tktchng, &cksum);
1370 blob_appendf(&tktchng, "Z %b\n", &cksum);
1371 if( ticket_put(&tktchng, zTktUuid, ticket_need_moderation(1)) ){
1372 fossil_fatal("%s\n", g.zErrMsg);
1373 }else{
1374 fossil_print("ticket %s succeeded for %s\n",
1375 (eCmd==set?"set":"add"),zTktUuid);
1376 }
1377 }
1378 }
1379 }
1380
+23 -8
--- src/wiki.c
+++ src/wiki.c
@@ -156,10 +156,25 @@
156156
@ %h(blob_str(pWiki))
157157
@ </pre>
158158
}
159159
}
160160
161
+/*
162
+** Returns non-zero if moderation is required for wiki changes and wiki
163
+** attachments.
164
+*/
165
+int wiki_need_moderation(
166
+ int localUser /* Are we being called for a local interactive user? */
167
+){
168
+ if( fossil_getenv("FOSSIL_FORCE_WIKI_MODERATION")!=0 ){
169
+ return 1;
170
+ }
171
+ if( localUser ){
172
+ return 0;
173
+ }
174
+ return g.perm.ModWiki==0 && db_get_boolean("modreq-wiki",0)==1;
175
+}
161176
162177
/*
163178
** WEBPAGE: wiki
164179
** URL: /wiki?name=PAGENAME
165180
*/
@@ -282,13 +297,13 @@
282297
}
283298
284299
/*
285300
** Write a wiki artifact into the repository
286301
*/
287
-static void wiki_put(Blob *pWiki, int parent){
302
+static void wiki_put(Blob *pWiki, int parent, int needMod){
288303
int nrid;
289
- if( g.perm.ModWiki || db_get_boolean("modreq-wiki",0)==0 ){
304
+ if( !needMod ){
290305
nrid = content_put_ex(pWiki, 0, 0, 0, 0);
291306
if( parent) content_deltify(parent, nrid, 0);
292307
}else{
293308
nrid = content_put_ex(pWiki, 0, 0, 0, 1);
294309
moderation_table_create();
@@ -427,11 +442,11 @@
427442
}
428443
blob_appendf(&wiki, "W %d\n%s\n", strlen(zBody), zBody);
429444
md5sum_blob(&wiki, &cksum);
430445
blob_appendf(&wiki, "Z %b\n", &cksum);
431446
blob_reset(&cksum);
432
- wiki_put(&wiki, 0);
447
+ wiki_put(&wiki, 0, wiki_need_moderation(0));
433448
}
434449
db_end_transaction(0);
435450
cgi_redirectf("wiki?name=%T", zPageName);
436451
}
437452
if( P("cancel")!=0 ){
@@ -658,11 +673,11 @@
658673
appendRemark(&body, zMimetype);
659674
blob_appendf(&wiki, "W %d\n%s\n", blob_size(&body), blob_str(&body));
660675
md5sum_blob(&wiki, &cksum);
661676
blob_appendf(&wiki, "Z %b\n", &cksum);
662677
blob_reset(&cksum);
663
- wiki_put(&wiki, rid);
678
+ wiki_put(&wiki, rid, wiki_need_moderation(0));
664679
db_end_transaction(0);
665680
}
666681
cgi_redirectf("wiki?name=%T", zPageName);
667682
}
668683
if( P("cancel")!=0 ){
@@ -961,11 +976,11 @@
961976
** zMimeType specifies the N-card for the wiki page. If it is 0,
962977
** empty, or "text/x-fossil-wiki" (the default format) then it is
963978
** ignored.
964979
*/
965980
int wiki_cmd_commit(const char *zPageName, int isNew, Blob *pContent,
966
- const char *zMimeType){
981
+ const char *zMimeType, int localUser){
967982
Blob wiki; /* Wiki page content */
968983
Blob cksum; /* wiki checksum */
969984
int rid; /* artifact ID of parent page */
970985
char *zDate; /* timestamp */
971986
char *zUuid; /* uuid for rid */
@@ -1011,11 +1026,11 @@
10111026
blob_str(pContent) );
10121027
md5sum_blob(&wiki, &cksum);
10131028
blob_appendf(&wiki, "Z %b\n", &cksum);
10141029
blob_reset(&cksum);
10151030
db_begin_transaction();
1016
- wiki_put(&wiki, 0);
1031
+ wiki_put(&wiki, 0, wiki_need_moderation(localUser));
10171032
db_end_transaction(0);
10181033
return 1;
10191034
}
10201035
10211036
/*
@@ -1119,14 +1134,14 @@
11191134
&& (pWiki->zMimetype && *pWiki->zMimetype)){
11201135
zMimeType = pWiki->zMimetype;
11211136
}
11221137
}
11231138
if( g.argv[2][1]=='r' ){
1124
- wiki_cmd_commit(zPageName, 1, &content, zMimeType);
1139
+ wiki_cmd_commit(zPageName, 1, &content, zMimeType, 1);
11251140
fossil_print("Created new wiki page %s.\n", zPageName);
11261141
}else{
1127
- wiki_cmd_commit(zPageName, 0, &content, zMimeType);
1142
+ wiki_cmd_commit(zPageName, 0, &content, zMimeType, 1);
11281143
fossil_print("Updated wiki page %s.\n", zPageName);
11291144
}
11301145
manifest_destroy(pWiki);
11311146
blob_reset(&content);
11321147
}else if( strncmp(g.argv[2],"delete",n)==0 ){
11331148
--- src/wiki.c
+++ src/wiki.c
@@ -156,10 +156,25 @@
156 @ %h(blob_str(pWiki))
157 @ </pre>
158 }
159 }
160
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
161
162 /*
163 ** WEBPAGE: wiki
164 ** URL: /wiki?name=PAGENAME
165 */
@@ -282,13 +297,13 @@
282 }
283
284 /*
285 ** Write a wiki artifact into the repository
286 */
287 static void wiki_put(Blob *pWiki, int parent){
288 int nrid;
289 if( g.perm.ModWiki || db_get_boolean("modreq-wiki",0)==0 ){
290 nrid = content_put_ex(pWiki, 0, 0, 0, 0);
291 if( parent) content_deltify(parent, nrid, 0);
292 }else{
293 nrid = content_put_ex(pWiki, 0, 0, 0, 1);
294 moderation_table_create();
@@ -427,11 +442,11 @@
427 }
428 blob_appendf(&wiki, "W %d\n%s\n", strlen(zBody), zBody);
429 md5sum_blob(&wiki, &cksum);
430 blob_appendf(&wiki, "Z %b\n", &cksum);
431 blob_reset(&cksum);
432 wiki_put(&wiki, 0);
433 }
434 db_end_transaction(0);
435 cgi_redirectf("wiki?name=%T", zPageName);
436 }
437 if( P("cancel")!=0 ){
@@ -658,11 +673,11 @@
658 appendRemark(&body, zMimetype);
659 blob_appendf(&wiki, "W %d\n%s\n", blob_size(&body), blob_str(&body));
660 md5sum_blob(&wiki, &cksum);
661 blob_appendf(&wiki, "Z %b\n", &cksum);
662 blob_reset(&cksum);
663 wiki_put(&wiki, rid);
664 db_end_transaction(0);
665 }
666 cgi_redirectf("wiki?name=%T", zPageName);
667 }
668 if( P("cancel")!=0 ){
@@ -961,11 +976,11 @@
961 ** zMimeType specifies the N-card for the wiki page. If it is 0,
962 ** empty, or "text/x-fossil-wiki" (the default format) then it is
963 ** ignored.
964 */
965 int wiki_cmd_commit(const char *zPageName, int isNew, Blob *pContent,
966 const char *zMimeType){
967 Blob wiki; /* Wiki page content */
968 Blob cksum; /* wiki checksum */
969 int rid; /* artifact ID of parent page */
970 char *zDate; /* timestamp */
971 char *zUuid; /* uuid for rid */
@@ -1011,11 +1026,11 @@
1011 blob_str(pContent) );
1012 md5sum_blob(&wiki, &cksum);
1013 blob_appendf(&wiki, "Z %b\n", &cksum);
1014 blob_reset(&cksum);
1015 db_begin_transaction();
1016 wiki_put(&wiki, 0);
1017 db_end_transaction(0);
1018 return 1;
1019 }
1020
1021 /*
@@ -1119,14 +1134,14 @@
1119 && (pWiki->zMimetype && *pWiki->zMimetype)){
1120 zMimeType = pWiki->zMimetype;
1121 }
1122 }
1123 if( g.argv[2][1]=='r' ){
1124 wiki_cmd_commit(zPageName, 1, &content, zMimeType);
1125 fossil_print("Created new wiki page %s.\n", zPageName);
1126 }else{
1127 wiki_cmd_commit(zPageName, 0, &content, zMimeType);
1128 fossil_print("Updated wiki page %s.\n", zPageName);
1129 }
1130 manifest_destroy(pWiki);
1131 blob_reset(&content);
1132 }else if( strncmp(g.argv[2],"delete",n)==0 ){
1133
--- src/wiki.c
+++ src/wiki.c
@@ -156,10 +156,25 @@
156 @ %h(blob_str(pWiki))
157 @ </pre>
158 }
159 }
160
161 /*
162 ** Returns non-zero if moderation is required for wiki changes and wiki
163 ** attachments.
164 */
165 int wiki_need_moderation(
166 int localUser /* Are we being called for a local interactive user? */
167 ){
168 if( fossil_getenv("FOSSIL_FORCE_WIKI_MODERATION")!=0 ){
169 return 1;
170 }
171 if( localUser ){
172 return 0;
173 }
174 return g.perm.ModWiki==0 && db_get_boolean("modreq-wiki",0)==1;
175 }
176
177 /*
178 ** WEBPAGE: wiki
179 ** URL: /wiki?name=PAGENAME
180 */
@@ -282,13 +297,13 @@
297 }
298
299 /*
300 ** Write a wiki artifact into the repository
301 */
302 static void wiki_put(Blob *pWiki, int parent, int needMod){
303 int nrid;
304 if( !needMod ){
305 nrid = content_put_ex(pWiki, 0, 0, 0, 0);
306 if( parent) content_deltify(parent, nrid, 0);
307 }else{
308 nrid = content_put_ex(pWiki, 0, 0, 0, 1);
309 moderation_table_create();
@@ -427,11 +442,11 @@
442 }
443 blob_appendf(&wiki, "W %d\n%s\n", strlen(zBody), zBody);
444 md5sum_blob(&wiki, &cksum);
445 blob_appendf(&wiki, "Z %b\n", &cksum);
446 blob_reset(&cksum);
447 wiki_put(&wiki, 0, wiki_need_moderation(0));
448 }
449 db_end_transaction(0);
450 cgi_redirectf("wiki?name=%T", zPageName);
451 }
452 if( P("cancel")!=0 ){
@@ -658,11 +673,11 @@
673 appendRemark(&body, zMimetype);
674 blob_appendf(&wiki, "W %d\n%s\n", blob_size(&body), blob_str(&body));
675 md5sum_blob(&wiki, &cksum);
676 blob_appendf(&wiki, "Z %b\n", &cksum);
677 blob_reset(&cksum);
678 wiki_put(&wiki, rid, wiki_need_moderation(0));
679 db_end_transaction(0);
680 }
681 cgi_redirectf("wiki?name=%T", zPageName);
682 }
683 if( P("cancel")!=0 ){
@@ -961,11 +976,11 @@
976 ** zMimeType specifies the N-card for the wiki page. If it is 0,
977 ** empty, or "text/x-fossil-wiki" (the default format) then it is
978 ** ignored.
979 */
980 int wiki_cmd_commit(const char *zPageName, int isNew, Blob *pContent,
981 const char *zMimeType, int localUser){
982 Blob wiki; /* Wiki page content */
983 Blob cksum; /* wiki checksum */
984 int rid; /* artifact ID of parent page */
985 char *zDate; /* timestamp */
986 char *zUuid; /* uuid for rid */
@@ -1011,11 +1026,11 @@
1026 blob_str(pContent) );
1027 md5sum_blob(&wiki, &cksum);
1028 blob_appendf(&wiki, "Z %b\n", &cksum);
1029 blob_reset(&cksum);
1030 db_begin_transaction();
1031 wiki_put(&wiki, 0, wiki_need_moderation(localUser));
1032 db_end_transaction(0);
1033 return 1;
1034 }
1035
1036 /*
@@ -1119,14 +1134,14 @@
1134 && (pWiki->zMimetype && *pWiki->zMimetype)){
1135 zMimeType = pWiki->zMimetype;
1136 }
1137 }
1138 if( g.argv[2][1]=='r' ){
1139 wiki_cmd_commit(zPageName, 1, &content, zMimeType, 1);
1140 fossil_print("Created new wiki page %s.\n", zPageName);
1141 }else{
1142 wiki_cmd_commit(zPageName, 0, &content, zMimeType, 1);
1143 fossil_print("Updated wiki page %s.\n", zPageName);
1144 }
1145 manifest_destroy(pWiki);
1146 blob_reset(&content);
1147 }else if( strncmp(g.argv[2],"delete",n)==0 ){
1148

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button