Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch json-meta-data Excluding Merge-Ins
This is equivalent to a diff from 8dcee00837 to d433272527
|
2022-11-18
| ||
| 19:28 | Add the ability to specify a description for each ticket report format. The user and reportfmt tables are updated with a new jx column containing JSON that describes the new features. (The user.jx table is currently not used but it was convenient to add it at the same time.) check-in: fcf17b28a9 user: drh tags: trunk | |
| 19:23 | Make sure the reportfmt table contains the jx column before trying to use that column. Leaf check-in: d433272527 user: drh tags: json-meta-data | |
| 19:20 | Use the "name" query parameter to select a report number. The legacy "rn" query parameter still works, but generated hyperlinks now use the new format. check-in: 3048c04b2a user: drh tags: json-meta-data | |
|
2022-11-17
| ||
| 23:38 | Add the "jx" column to the "user" and "reportfmt" tables, with the intent of using the column for JSON metadata. Currently unused. Make arrangements to sync the "jx" column (using the "fossil config" command) in a way that is backwards compatible with older versions that do not have the "jx" column. check-in: b7ac178c4f user: drh tags: json-meta-data | |
| 07:45 | Increase the version number to 2.21 to start the next development cycle. check-in: 8dcee00837 user: danield tags: trunk | |
|
2022-11-16
| ||
| 20:59 | Merge in setupuser-retain-pw branch (HTML change only, no code). check-in: 88f9da9880 user: stephan tags: trunk | |
Changes to src/configure.c.
| ︙ | |||
355 356 357 358 359 360 361 | 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 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 | - + - - - - - + + + + + - + | ** In overview, we have: ** ** NAME CONTENT ** ------- ----------------------------------------------------------- ** /config $MTIME $NAME value $VALUE ** /user $MTIME $LOGIN pw $VALUE cap $VALUE info $VALUE photo $VALUE ** /shun $MTIME $UUID scom $VALUE |
| ︙ | |||
443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 | 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 | + + + + + + + + + |
}
blob_append_sql(&sql,") VALUES(%s,%s",
azToken[1] /*safe-for-%s*/, azToken[0]/*safe-for-%s*/);
for(jj=2; jj<nToken; jj+=2){
blob_append_sql(&sql, ",%s", azToken[jj+1] /*safe-for-%s*/);
}
db_protect_only(PROTECT_SENSITIVE);
/* Make sure tables have the "jx" column */
if( strcmp(&zName[1],"user")==0 ){
user_update_user_table();
}else if( strcmp(&zName[1],"reportfmt")==0 ){
report_update_reportfmt_table();
}
db_multi_exec("%s)", blob_sql_text(&sql));
if( db_changes()==0 ){
blob_reset(&sql);
blob_append_sql(&sql, "UPDATE \"%w\" SET mtime=%s",
&zName[1], azToken[0]/*safe-for-%s*/);
for(jj=2; jj<nToken; jj+=2){
blob_append_sql(&sql, ", \"%w\"=%s",
azToken[jj], azToken[jj+1]/*safe-for-%s*/);
|
| ︙ | |||
530 531 532 533 534 535 536 | 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 | + - - - + + + + + + + + - - - - - - - + + + + + + + + + + + - + + - - - + + + + + + + + - - - - - - + + + + + + + + + - + |
blob_size(&rec), blob_str(&rec));
nCard++;
blob_reset(&rec);
}
db_finalize(&q);
}
if( groupMask & CONFIGSET_USER ){
if( db_table_has_column("repository","user","jx") ){
|
| ︙ |
Changes to src/event.c.
| ︙ | |||
550 551 552 553 554 555 556 | 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 | - + |
@ <td valign="top">
@ <input type="text" name="g" size="40" value="%h(zTags)" />
@ </td></tr>
@ <tr><th align="right" valign="top">\
@ %z(href("%R/markup_help"))Markup Style</a>:</th>
@ <td valign="top">
|
| ︙ |
Changes to src/forum.c.
| ︙ | |||
1057 1058 1059 1060 1061 1062 1063 | 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 | - + |
const char *zContent
){
if( zTitle ){
@ Title: <input type="input" name="title" value="%h(zTitle)" size="50"
@ maxlength="125"><br>
}
@ %z(href("%R/markup_help"))Markup style</a>:
|
| ︙ |
Changes to src/report.c.
| ︙ | |||
73 74 75 76 77 78 79 | 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | - + - + - + - + |
}
rn = db_column_int(&q, 0);
cnt++;
blob_appendf(&ril, "<li>");
if( zTitle[0] == '_' ){
blob_appendf(&ril, "%s", zTitle);
} else {
|
| ︙ | |||
251 252 253 254 255 256 257 258 259 260 261 262 263 264 | 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 | + + + + + + + + + + + + + + |
*(char**)pError = mprintf("only SELECT statements are allowed");
rc = SQLITE_DENY;
break;
}
}
return rc;
}
/*
** Make sure the reportfmt table is up-to-date. It should contain
** the "jx" column (as of version 2.21). If it does not, add it.
**
** The "jx" column is intended to hold a JSON object containing optional
** key-value pairs.
*/
void report_update_reportfmt_table(void){
if( db_table_has_column("repository","reportfmt","jx")==0 ){
db_multi_exec("ALTER TABLE repository.reportfmt"
" ADD COLUMN jx TEXT DEFAULT '{}';");
}
}
/*
** Activate the ticket report query authorizer. Must be followed by an
** eventual call to report_unrestrict_sql().
*/
void report_restrict_sql(char **pzErr){
db_set_authorizer(report_query_authorizer,(void*)pzErr,"Ticket-Report");
|
| ︙ | |||
319 320 321 322 323 324 325 326 327 328 | 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 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 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - + + - + |
}
if( pStmt ){
sqlite3_finalize(pStmt);
}
report_unrestrict_sql();
return zErr;
}
/*
** Get a report number from query parameters. This can be done in various
** ways:
**
** (1) (legacy) rn=NNN where NNN is the reportfmt.rn integer primary key.
**
** (2) name=NNN where NNN is the rn.
**
** (3) name=TAG where TAG matches reportfmt.jx->>tag
**
** Regardless of how the report is specified, return the primary key, rn.
** Return 0 if not found.
*/
static int report_number(void){
int rn;
const char *zName;
char *zEnd;
/* Case (1) */
rn = atoi(PD("rn","0"));
if( rn>0 ) return rn;
zName = P("name");
if( zName==0 || zName[0]==0 ) return 0;
if( fossil_isdigit(zName[0])
&& (rn = strtol(zName, &zEnd, 10))>0
&& zEnd[0]==0
){
/* Case 2 */
return rn;
}
rn = db_int(0, "SELECT rn FROM reportfmt WHERE jx->>'tag'==%Q", zName);
return rn;
}
/*
** WEBPAGE: rptsql
|
| ︙ | |||
380 381 382 383 384 385 386 | 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 | + - + + + + + - + - - - - + + + + + + + - + + + + + | /* ** WEBPAGE: rptnew ** WEBPAGE: rptedit ** ** Create (/rptnew) or edit (/rptedit) a ticket report format. ** Query parameters: ** ** name=N Ticket report number or tag. |
| ︙ | |||
454 455 456 457 458 459 460 461 | 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 | + + + + - - - + + + + + + - - - + + + + - + + + + + - + + + + + + + + + + + + - + + + + + + + + + + + + + + + |
&& db_exists("SELECT 1 FROM reportfmt WHERE title=%Q and rn<>%d",
zTitle, rn)
){
zErr = mprintf("There is already another report named \"%h\"", zTitle);
}
if( zErr==0 ){
login_verify_csrf_secret();
if( zTag && zTag[0]==0 ) zTag = 0;
if( zDesc && zDesc[0]==0 ){ zDesc = 0; zMimetype = 0; }
if( zMimetype && zMimetype[0]==0 ){ zDesc = 0; zMimetype = 0; }
if( rn>0 ){
db_multi_exec(
|
| ︙ | |||
751 752 753 754 755 756 757 | 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 | - + - + |
pState->wikiFlags = WIKI_NOBADLINKS;
pState->zWikiStart = "";
pState->zWikiEnd = "";
if( P("plaintext") ){
pState->wikiFlags |= WIKI_LINKSONLY;
pState->zWikiStart = "<pre class='verbatim'>";
pState->zWikiEnd = "</pre>";
|
| ︙ | |||
1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 | 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 | + + - + + + - + - + - + + + + |
){
int count = 0;
int rn, rc;
char *zSql;
char *zTitle;
char *zOwner;
char *zClrKey;
char *zDesc;
char *zMimetype;
int tabs;
Stmt q;
char *zErr1 = 0;
char *zErr2 = 0;
|
| ︙ | |||
1092 1093 1094 1095 1096 1097 1098 | 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 | - + - + + + + + + + + |
style_submenu_element("Reports","%R/reportlist?%s",zQS);
} else {
style_submenu_element("Raw","%R/%s?tablist=1",g.zPath);
style_submenu_element("Reports","%R/reportlist");
}
if( g.perm.Admin
|| (g.perm.TktFmt && g.zLogin && fossil_strcmp(g.zLogin,zOwner)==0) ){
|
| ︙ |
Changes to src/schema.c.
| ︙ | |||
124 125 126 127 128 129 130 | 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 | - + + | @ pw TEXT, -- password @ cap TEXT, -- Capabilities of this user @ cookie TEXT, -- WWW login cookie @ ipaddr TEXT, -- IP address for which cookie is valid @ cexpire DATETIME, -- Time when cookie expires @ info TEXT, -- contact information @ mtime DATE, -- last change. seconds since 1970 |
| ︙ | |||
174 175 176 177 178 179 180 | 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 | - + + | @ -- @ CREATE TABLE reportfmt( @ rn INTEGER PRIMARY KEY, -- Report number @ owner TEXT, -- Owner of this report format (not used) @ title TEXT UNIQUE, -- Title of this report @ mtime DATE, -- Last modified. seconds since 1970 @ cols TEXT, -- A color-key specification |
| ︙ |
Changes to src/user.c.
| ︙ | |||
571 572 573 574 575 576 577 578 579 580 581 582 583 584 | 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 | + + + + + + + + + + + + + + |
url_parse(0, URL_USE_CONFIG);
fossil_print("URL user: %s\n", g.url.user);
user_select();
fossil_print("Final g.zLogin: %s\n", g.zLogin);
fossil_print("Final g.userUid: %d\n", g.userUid);
}
/*
** Make sure the USER table is up-to-date. It should contain
** the "JX" column (as of version 2.21). If it does not, add it.
**
** The "JX" column is intended to hold a JSON object containing optional
** key-value pairs.
*/
void user_update_user_table(void){
if( db_table_has_column("repository","user","jx")==0 ){
db_multi_exec("ALTER TABLE repository.user"
" ADD COLUMN jx TEXT DEFAULT '{}';");
}
}
/*
** COMMAND: test-hash-passwords
**
** Usage: %fossil test-hash-passwords REPOSITORY
**
** Convert all local password storage to use a SHA1 hash of the password
|
| ︙ |
Changes to src/wiki.c.
| ︙ | |||
644 645 646 647 648 649 650 | 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 | - + + + + - + - + |
alert_user_contact(login_name());
}
return nrid;
}
/*
** Output a selection box from which the user can select the
|
| ︙ | |||
1332 1333 1334 1335 1336 1337 1338 | 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 | - + |
"data-tab-label='Editor' "
"class='hidden'"
">");
CX("<div class='"
"wikiedit-options flex-container flex-row child-gap-small'>");
CX("<div class='input-with-label'>"
"<label>Mime type</label>");
|
| ︙ | |||
1533 1534 1535 1536 1537 1538 1539 | 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 | - + |
wiki_standard_submenu(W_ALL_BUT(W_NEW));
@ <p>Rules for wiki page names:</p>
well_formed_wiki_name_rules();
form_begin(0, "%R/wikinew");
@ <p>Name of new wiki page:
@ <input style="width: 35;" type="text" name="name" value="%h(zName)" /><br />
@ %z(href("%R/markup_help"))Markup style</a>:
|
| ︙ |