Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch email-alerts Excluding Merge-Ins
This is equivalent to a diff from bb9233a61a to c256626026
|
2018-06-23
| ||
| 00:53 | Merge in support for email notifications. Munch more work is needed, but it seems ready to begin functional testing. ... (check-in: b77f1aaed0 user: drh tags: trunk) | |
| 00:49 | Fix some minor problems with email notification support ... (Closed-Leaf check-in: c256626026 user: drh tags: email-alerts) | |
|
2018-06-22
| ||
| 19:48 | Improvements to on-line subscription management. ... (check-in: e649820ba1 user: drh tags: email-alerts) | |
| 01:37 | Add the --nocompress option to the "fossil clone" command. ... (check-in: 96d0a4becf user: drh tags: trunk) | |
|
2018-06-21
| ||
| 17:07 | Merge codecheck1 enhancements from trunk. ... (check-in: 4d13d94893 user: drh tags: email-alerts) | |
| 16:40 | Strengthen the codecheck1.c utility program to help find cases where query parameters are used in unsafe ways. No unsafe usage of query parameters was detected in the current code. ... (check-in: bb9233a61a user: drh tags: trunk) | |
| 15:02 | Provide an implementation for popen() and pclose() on Windows to fix the build. ... (check-in: 565b5ff0c2 user: drh tags: trunk) | |
Changes to src/attach.c.
| ︙ | |||
375 376 377 378 379 380 381 | 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 | - + |
zTargetType = mprintf("Ticket <a href=\"%R/tktview/%s\">%S</a>",
zTkt, zTkt);
}
if( zFrom==0 ) zFrom = mprintf("%s/home", g.zTop);
if( P("cancel") ){
cgi_redirect(zFrom);
}
|
| ︙ |
Changes to src/blob.c.
| ︙ | |||
478 479 480 481 482 483 484 485 486 487 488 489 490 491 | 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 | + + + + + + + |
/*
** Rewind the cursor on a blob back to the beginning.
*/
void blob_rewind(Blob *p){
p->iCursor = 0;
}
/*
** Truncate a blob back to zero length
*/
void blob_truncate(Blob *p){
p->nUsed = 0;
}
/*
** Seek the cursor in a blob to the indicated offset.
*/
int blob_seek(Blob *p, int offset, int whence){
if( whence==BLOB_SEEK_SET ){
p->iCursor = offset;
|
| ︙ | |||
651 652 653 654 655 656 657 658 659 660 661 662 663 664 | 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 | + + + + + + + + + + |
i++;
}
if( pTo ){
blob_append(pTo, &pFrom->aData[pFrom->iCursor], i - pFrom->iCursor);
}
pFrom->iCursor = i;
}
/*
** Ensure that the text in pBlob ends with '\n'
*/
void blob_add_final_newline(Blob *pBlob){
if( pBlob->nUsed<=0 ) return;
if( pBlob->aData[pBlob->nUsed-1]!='\n' ){
blob_append(pBlob, "\n", 1);
}
}
/*
** Return true if the blob contains a valid base16 identifier artifact hash.
**
** The value returned is actually one of HNAME_SHA1 OR HNAME_K256 if the
** hash is valid. Both of these are non-zero and therefore "true".
** If the hash is not valid, then HNAME_ERROR is returned, which is zero or
|
| ︙ |
Changes to src/captcha.c.
| ︙ | |||
495 496 497 498 499 500 501 | 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 | - + - + | ** ** If no captcha is required or if the correct captcha is supplied, return ** true (non-zero). ** ** The query parameters examined are "captchaseed" for the seed value and ** "captcha" for text that the user types in response to the captcha prompt. */ |
| ︙ | |||
591 592 593 594 595 596 597 | 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 | - + |
return 0;
}
}
#endif
zCookieName = mprintf("fossil-cc-%.10s", db_get("project-code","x"));
zCookieValue = P(zCookieName);
if( zCookieValue && atoi(zCookieValue)==1 ) return 0;
|
| ︙ |
Changes to src/cgi.c.
| ︙ | |||
54 55 56 57 58 59 60 61 62 63 64 65 66 67 | 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | + + | ** does the same except "y" is returned in place of NULL if there is not match. */ #define P(x) cgi_parameter((x),0) #define PD(x,y) cgi_parameter((x),(y)) #define PT(x) cgi_parameter_trimmed((x),0) #define PDT(x,y) cgi_parameter_trimmed((x),(y)) #define PB(x) cgi_parameter_boolean(x) #define PCK(x) cgi_parameter_checked(x,1) #define PIF(x,y) cgi_parameter_checked(x,y) /* ** Destinations for output text. */ #define CGI_HEADER 0 #define CGI_BODY 1 |
| ︙ | |||
1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 | 1118 1119 1120 1121 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 | + + + + + + + + + + + + + + + + + + + + + + + |
** or "no" or "off".
*/
int cgi_parameter_boolean(const char *zName){
const char *zIn = cgi_parameter(zName, 0);
if( zIn==0 ) return 0;
return zIn[0]==0 || is_truth(zIn);
}
/*
** Return either an empty string "" or the string "checked" depending
** on whether or not parameter zName has value iValue. If parameter
** zName does not exist, that is assumed to be the same as value 0.
**
** This routine implements the PCK(x) and PIF(x,y) macros. The PIF(x,y)
** macro generateds " checked" if the value of parameter x equals integer y.
** PCK(x) is the same as PIF(x,1). These macros are used to generate
** the "checked" attribute on checkbox and radio controls of forms.
*/
const char *cgi_parameter_checked(const char *zName, int iValue){
const char *zIn = cgi_parameter(zName,0);
int x;
if( zIn==0 ){
x = 0;
}else if( !fossil_isdigit(zIn[0]) ){
x = is_truth(zIn);
}else{
x = atoi(zIn);
}
return x==iValue ? "checked" : "";
}
/*
** Return the name of the i-th CGI parameter. Return NULL if there
** are fewer than i registered CGI parameters.
*/
const char *cgi_parameter_name(int i){
if( i>=0 && i<nUsedQP ){
|
| ︙ |
Changes to src/codecheck1.c.
| ︙ | |||
329 330 331 332 333 334 335 | 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 | - + + + + + |
/*
** Return true if the input is an argument that is never safe for use
** with %s.
*/
static int never_safe(const char *z){
if( strstr(z,"/*safe-for-%s*/")!=0 ) return 0;
|
| ︙ |
Changes to src/db.c.
| ︙ | |||
308 309 310 311 312 313 314 315 316 317 318 319 320 321 | 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 | + + + + + + + + + + + + + + + + + + + + + |
pStmt->pPrev = 0;
if( db.pAllStmt ) db.pAllStmt->pPrev = pStmt;
db.pAllStmt = pStmt;
va_end(ap);
}
return rc;
}
/* Prepare a statement using text placed inside a Blob
** using blob_append_sql().
*/
int db_prepare_blob(Stmt *pStmt, Blob *pSql){
int rc;
char *zSql;
pStmt->sql = *pSql;
blob_init(pSql, 0, 0);
zSql = blob_sql_text(&pStmt->sql);
db.nPrepare++;
rc = sqlite3_prepare_v3(g.db, zSql, -1, 0, &pStmt->pStmt, 0);
if( rc!=0 ){
db_err("%s\n%s", sqlite3_errmsg(g.db), zSql);
}
pStmt->pNext = pStmt->pPrev = 0;
pStmt->nStep = 0;
pStmt->rc = rc;
return rc;
}
/*
** Return the index of a bind parameter
*/
static int paramIdx(Stmt *pStmt, const char *zParamName){
int i = sqlite3_bind_parameter_index(pStmt->pStmt, zParamName);
if( i==0 ){
|
| ︙ | |||
873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 | 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 | + + + + + + + + + + + + + + + + + + + + + + + + + |
if( g.fTimeFormat==1 ){
sqlite3_result_text(context, "0 seconds", -1, SQLITE_STATIC);
}else{
sqlite3_result_text(context, "utc", -1, SQLITE_STATIC);
}
}
/*
** If the input is a hexadecimal string, convert that string into a BLOB.
** If the input is not a hexadecimal string, return NULL.
*/
void db_hextoblob(
sqlite3_context *context,
int argc,
sqlite3_value **argv
){
const unsigned char *zIn = sqlite3_value_text(argv[0]);
int nIn = sqlite3_value_bytes(argv[0]);
unsigned char *zOut;
if( zIn==0 ) return;
if( nIn&1 ) return;
if( !validate16((const char*)zIn, nIn) ) return;
zOut = sqlite3_malloc64( nIn/2 );
if( zOut==0 ){
sqlite3_result_error_nomem(context);
return;
}
decode16(zIn, zOut, nIn);
sqlite3_result_blob(context, zOut, nIn/2, sqlite3_free);
}
/*
** Register the SQL functions that are useful both to the internal
** representation and to the "fossil sql" command.
*/
void db_add_aux_functions(sqlite3 *db){
sqlite3_create_function(db, "checkin_mtime", 2, SQLITE_UTF8, 0,
db_checkin_mtime_function, 0, 0);
sqlite3_create_function(db, "symbolic_name_to_rid", 1, SQLITE_UTF8, 0,
db_sym2rid_function, 0, 0);
sqlite3_create_function(db, "symbolic_name_to_rid", 2, SQLITE_UTF8, 0,
db_sym2rid_function, 0, 0);
sqlite3_create_function(db, "now", 0, SQLITE_UTF8, 0,
db_now_function, 0, 0);
sqlite3_create_function(db, "toLocal", 0, SQLITE_UTF8, 0,
db_tolocal_function, 0, 0);
sqlite3_create_function(db, "fromLocal", 0, SQLITE_UTF8, 0,
db_fromlocal_function, 0, 0);
sqlite3_create_function(db, "hextoblob", 1, SQLITE_UTF8, 0,
db_hextoblob, 0, 0);
}
#if USE_SEE
/*
** This is a pointer to the saved database encryption key string.
*/
static char *zSavedKey = 0;
|
| ︙ |
Changes to src/email.c.
| ︙ | |||
17 18 19 20 21 22 23 24 25 26 27 28 29 30 | 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | + + + + + | ** ** Email notification features */ #include "config.h" #include "email.h" #include <assert.h> /* ** Maximum size of the subscriberCode blob, in bytes */ #define SUBSCRIBER_CODE_SZ 32 /* ** SQL code to implement the tables needed by the email notification ** system. */ static const char zEmailInit[] = @ -- Subscribers are distinct from users. A person can have a log-in in @ -- the USER table without being a subscriber. Or a person can be a |
| ︙ | |||
40 41 42 43 44 45 46 | 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 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 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 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 279 280 281 282 283 284 285 286 287 288 289 | - - - + + + - - + - - + + + - - - + + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - - + + - - + + - - + + - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + | @ -- w - Wiki changes @ -- Probably different codes will be added in the future. In the future @ -- we might also add a separate table that allows subscribing to email @ -- notifications for specific branches or tags or tickets. @ -- @ CREATE TABLE repository.subscriber( @ subscriberId INTEGER PRIMARY KEY, -- numeric subscriber ID. Internal use |
| ︙ | |||
229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 | 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 | + + |
if( pPlain && pHtml ){
blob_appendf(&all, "MIME-Version: 1.0\r\n");
zBoundary = db_text(0, "SELECT hex(randomblob(20))");
blob_appendf(&all, "Content-Type: multipart/alternative;"
" boundary=\"%s\"\r\n", zBoundary);
}
if( pPlain ){
blob_add_final_newline(pPlain);
if( zBoundary ){
blob_appendf(&all, "\r\n--%s\r\n", zBoundary);
}
blob_appendf(&all,"Content-Type: text/plain\r\n");
blob_appendf(&all, "Content-Transfer-Encoding: base64\r\n\r\n");
append_base64(&all, pPlain);
}
if( pHtml ){
blob_add_final_newline(pHtml);
if( zBoundary ){
blob_appendf(&all, "--%s\r\n", zBoundary);
}
blob_appendf(&all,"Content-Type: text/html\r\n");
blob_appendf(&all, "Content-Transfer-Encoding: base64\r\n\r\n");
append_base64(&all, pHtml);
}
|
| ︙ | |||
279 280 281 282 283 284 285 | 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 | - + - - + + + + + + + + + + + + + + |
if( out ){
fwrite(blob_buffer(&all), 1, blob_size(&all), out);
fclose(out);
}
}
}else if( strcmp(zDest, "dir")==0 ){
const char *zDir = db_get("email-send-dir","./");
|
| ︙ | |||
324 325 326 327 328 329 330 331 332 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 | 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 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 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 | + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + + + + - + + + - + - |
** if the email-send-method is set to "db".
*/
/*
** SETTING: email-self width=40
** This is the email address for the repository. Outbound emails add
** this email address as the "From:" field.
*/
/*
** SETTING: email-receive-dir width=40
** Inbound email messages are saved as separate files in this directory,
** for debugging analysis. Disable saving of inbound emails omitting
** this setting, or making it an empty string.
*/
/*
** COMMAND: email
**
** Usage: %fossil email SUBCOMMAND ARGS...
**
** Subcommands:
**
** exec Compose and send pending email alerts.
** Some installations may want to do this via
** a cron-job to make sure alerts are sent
** in a timely manner.
** Options:
**
** --digest Send digests
**
** inbound [FILE] Receive an inbound email message. This message
** is analyzed to see if it is a bounce, and if
** necessary, subscribers may be disabled.
**
** reset Hard reset of all email notification tables
** in the repository. This erases all subscription
** information. Use with extreme care.
**
** send TO [OPTIONS] Send a single email message using whatever
** email sending mechanism is currently configured.
** Use this for testing the email configuration.
** Options:
**
** --body FILENAME
** --html
** --stdout
** --subject|-S SUBJECT
**
** settings [NAME VALUE] With no arguments, list all email settings.
** Or change the value of a single email setting.
**
** subscribers [PATTERN] List all subscribers matching PATTERN.
**
** unsubscribe EMAIL Remove a single subscriber with the given EMAIL.
*/
void email_cmd(void){
const char *zCmd;
int nCmd;
db_find_and_open_repository(0, 0);
email_schema();
zCmd = g.argc>=3 ? g.argv[2] : "x";
nCmd = (int)strlen(zCmd);
|
| ︙ | |||
400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 | 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 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 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 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 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 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 | + - - + + - + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - + + + + + + + + + + - - + + + + - + - + + + - - - + + + - - - - - - - + + + + + + - + - + - + - + - - + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + |
blob_appendf(&hdr, "Subject: %s\n", zSubject);
}
if( zSource ){
blob_read_from_file(&body, zSource, ExtFILE);
}else{
prompt_for_user_comment(&body, &prompt);
}
blob_add_final_newline(&body);
if( sendAsHtml ){
email_send(&hdr, 0, &body, zDest);
}else if( sendAsBoth ){
Blob html;
blob_init(&html, 0, 0);
blob_appendf(&html, "<pre>\n%h</pre>\n", blob_str(&body));
email_send(&hdr, &body, &html, zDest);
blob_zero(&html);
}else{
email_send(&hdr, &body, 0, zDest);
}
blob_zero(&hdr);
blob_zero(&body);
blob_zero(&prompt);
|
Changes to src/encode.c.
| ︙ | |||
632 633 634 635 636 637 638 639 640 641 642 643 644 645 | 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 | + |
/*
** Return true if the input string contains only valid base-16 digits.
** If any invalid characters appear in the string, return false.
*/
int validate16(const char *zIn, int nIn){
int i;
if( nIn<0 ) nIn = (int)strlen(zIn);
for(i=0; i<nIn; i++, zIn++){
if( zDecode[zIn[0]&0xff]>63 ){
return zIn[0]==0;
}
}
return 1;
}
|
| ︙ |
Changes to src/forum.c.
| ︙ | |||
99 100 101 102 103 104 105 | 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | - - |
" ORDER BY xdepth DESC, xtime ASC"
") SELECT * FROM post;",
itemId
);
while( db_step(&q)==SQLITE_ROW ){
int id = db_column_int(&q, 0);
const char *zUser = db_column_text(&q, 1);
|
| ︙ | |||
255 256 257 258 259 260 261 | 253 254 255 256 257 258 259 260 261 262 263 264 265 266 | - |
** p Preview changes
*/
void forum_edit_page(void){
int itemId;
int parentId;
char *zErr = 0;
login_check_credentials();
|
| ︙ |
Changes to src/login.c.
| ︙ | |||
728 729 730 731 732 733 734 735 736 737 738 739 740 741 | 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 | + + + + + |
}
@ </div>
free(zCaptcha);
}
@ </form>
}
if( g.zLogin && g.perm.Password ){
if( email_enabled() ){
@ <hr>
@ <p>Configure <a href="%R/alerts">Email Alerts</a>
@ for user <b>%h(g.zLogin)</b></p>
}
@ <hr />
@ <p>Change Password for user <b>%h(g.zLogin)</b>:</p>
form_begin(0, "%R/login");
@ <table>
@ <tr><td class="form_label">Old Password:</td>
@ <td><input type="password" name="p" size="30" /></td></tr>
@ <tr><td class="form_label">New Password:</td>
|
| ︙ | |||
1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 | 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 | + + + + + + + + + |
/*
** Return true if the user is "nobody"
*/
int login_is_nobody(void){
return g.zLogin==0 || g.zLogin[0]==0 || fossil_strcmp(g.zLogin,"nobody")==0;
}
/*
** Return true if the user is a specific individual, not "nobody" or
** "anonymous".
*/
int login_is_individual(void){
return g.zLogin!=0 && g.zLogin[0]!=0 && fossil_strcmp(g.zLogin,"nobody")!=0
&& fossil_strcmp(g.zLogin,"anonymous")!=0;
}
/*
** Return the login name. If no login name is specified, return "nobody".
*/
const char *login_name(void){
return (g.zLogin && g.zLogin[0]) ? g.zLogin : "nobody";
}
|
| ︙ |
Changes to src/rebuild.c.
| ︙ | |||
142 143 144 145 146 147 148 | 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 | - + + |
/*
** Update the repository schema for Fossil version 2.0. (2017-02-28)
** (1) Change the CHECK constraint on BLOB.UUID so that the length
** is greater than or equal to 40, not exactly equal to 40.
*/
void rebuild_schema_update_2_0(void){
|
| ︙ | |||
355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 | 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 | + - + + |
bag_init(&bagDone);
ttyOutput = doOut;
processCnt = 0;
if (ttyOutput && !g.fQuiet) {
percent_complete(0);
}
email_triggers_disable();
rebuild_update_schema();
blob_init(&sql, 0, 0);
db_prepare(&q,
"SELECT name FROM sqlite_master /*scan*/"
" WHERE type='table'"
" AND name NOT IN ('admin_log', 'blob','delta','rcvfrom','user','alias',"
"'config','shun','private','reportfmt',"
"'concealed','accesslog','modreq',"
|
| ︙ | |||
444 445 446 447 448 449 450 451 452 453 454 455 456 457 | 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 | + |
percent_complete((processCnt*1000)/totalSize);
}
if( doClustering ) create_cluster();
if( ttyOutput && !g.fQuiet && totalSize>0 ){
processCnt += incrSize;
percent_complete((processCnt*1000)/totalSize);
}
email_triggers_enable();
if(!g.fQuiet && ttyOutput ){
percent_complete(1000);
fossil_print("\n");
}
return errCnt;
}
|
| ︙ |
Changes to src/setup.c.
| ︙ | |||
1020 1021 1022 1023 1024 1025 1026 | 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 | - + - + |
login_verify_csrf_secret();
db_set(zVar, zQ, 0);
admin_log("Set entry_attribute %Q to: %.*s%s",
zVar, 20, zQ, (nZQ>20 ? "..." : ""));
zVal = zQ;
}
@ <input type="text" id="%s(zQParm)" name="%s(zQParm)" value="%h(zVal)" \
|
| ︙ |
Changes to src/timeline.c.
| ︙ | |||
2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 | 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 | + | ** Options: ** -n|--limit N If N is positive, output the first N entries. If ** N is negative, output the first -N lines. If N is ** zero, no limit. Default is -20 meaning 20 lines. ** -p|--path PATH Output items affecting PATH only. ** PATH can be a file or a sub directory. ** --offset P skip P changes ** --sql Show the SQL used to generate the timeline ** -t|--type TYPE Output items from the given types only, such as: ** ci = file commits only ** e = technical notes only ** t = tickets only ** w = wiki commits only ** -v|--verbose Output the list of files changed by each commit ** and the type of each change (edited, deleted, |
| ︙ | |||
2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 | 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 | + + |
int objid = 0;
Blob uuid;
int mode = TIMELINE_MODE_NONE;
int verboseFlag = 0 ;
int iOffset;
const char *zFilePattern = 0;
Blob treeName;
int showSql = 0;
verboseFlag = find_option("verbose","v", 0)!=0;
if( !verboseFlag){
verboseFlag = find_option("showfiles","f", 0)!=0; /* deprecated */
}
db_find_and_open_repository(0, 0);
zLimit = find_option("limit","n",1);
zWidth = find_option("width","W",1);
zType = find_option("type","t",1);
zFilePattern = find_option("path","p",1);
showSql = find_option("sql",0,0)!=0;
if( !zLimit ){
zLimit = find_option("count",0,1);
}
if( zLimit ){
n = atoi(zLimit);
}else{
|
| ︙ | |||
2518 2519 2520 2521 2522 2523 2524 | 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 | + + + - + |
}
blob_append_sql(&sql, "\nORDER BY event.mtime DESC");
if( iOffset>0 ){
/* Don't handle LIMIT here, otherwise print_timeline()
* will not determine the end-marker correctly! */
blob_append_sql(&sql, "\n LIMIT -1 OFFSET %d", iOffset);
}
if( showSql ){
fossil_print("%s\n", blob_str(&sql));
}
|
| ︙ |
Changes to src/tkt.c.
| ︙ | |||
592 593 594 595 596 597 598 | 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 | - + | const char *zUuid; int i; int nJ = 0; Blob tktchng, cksum; int needMod; login_verify_csrf_secret(); |
| ︙ |
Changes to src/wiki.c.
| ︙ | |||
532 533 534 535 536 537 538 | 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 | - + |
}
if( zBody==0 && (pWiki = manifest_get(rid, CFTYPE_WIKI, 0))!=0 ){
zBody = pWiki->zWiki;
zMimetype = pWiki->zMimetype;
}
}
if( P("submit")!=0 && zBody!=0
|
| ︙ | |||
756 757 758 759 760 761 762 | 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 | - + |
}
}
if( !g.perm.ApndWiki ){
login_needed(g.anon.ApndWiki);
return;
}
if( P("submit")!=0 && P("r")!=0 && P("u")!=0
|
| ︙ |