Fossil SCM
Add the 'test-prompt-user' command.
Commit
8817b0ed6eb2a9583f79478dfdb7b3381e696cf4
Parent
7c7597220a9f15b…
1 file changed
+15
+15
| --- src/user.c | ||
| +++ src/user.c | ||
| @@ -553,10 +553,25 @@ | ||
| 553 | 553 | db_multi_exec( |
| 554 | 554 | "UPDATE user SET pw=shared_secret(pw,login), mtime=now()" |
| 555 | 555 | " WHERE length(pw)>0 AND length(pw)!=40" |
| 556 | 556 | ); |
| 557 | 557 | } |
| 558 | + | |
| 559 | +/* | |
| 560 | +** COMMAND: test-prompt-user | |
| 561 | +** | |
| 562 | +** Usage: %fossil test-prompt-user PROMPT | |
| 563 | +** | |
| 564 | +** Prompts the user for input and then prints it verbatim (i.e. without | |
| 565 | +** a trailing line terminator). | |
| 566 | +*/ | |
| 567 | +void test_prompt_user_cmd(void){ | |
| 568 | + Blob answer; | |
| 569 | + if( g.argc!=3 ) usage("PROMPT"); | |
| 570 | + prompt_user(g.argv[2], &answer); | |
| 571 | + fossil_print("%s", blob_str(&answer)); | |
| 572 | +} | |
| 558 | 573 | |
| 559 | 574 | /* |
| 560 | 575 | ** WEBPAGE: access_log |
| 561 | 576 | ** |
| 562 | 577 | ** Show login attempts, including timestamp and IP address. |
| 563 | 578 |
| --- src/user.c | |
| +++ src/user.c | |
| @@ -553,10 +553,25 @@ | |
| 553 | db_multi_exec( |
| 554 | "UPDATE user SET pw=shared_secret(pw,login), mtime=now()" |
| 555 | " WHERE length(pw)>0 AND length(pw)!=40" |
| 556 | ); |
| 557 | } |
| 558 | |
| 559 | /* |
| 560 | ** WEBPAGE: access_log |
| 561 | ** |
| 562 | ** Show login attempts, including timestamp and IP address. |
| 563 |
| --- src/user.c | |
| +++ src/user.c | |
| @@ -553,10 +553,25 @@ | |
| 553 | db_multi_exec( |
| 554 | "UPDATE user SET pw=shared_secret(pw,login), mtime=now()" |
| 555 | " WHERE length(pw)>0 AND length(pw)!=40" |
| 556 | ); |
| 557 | } |
| 558 | |
| 559 | /* |
| 560 | ** COMMAND: test-prompt-user |
| 561 | ** |
| 562 | ** Usage: %fossil test-prompt-user PROMPT |
| 563 | ** |
| 564 | ** Prompts the user for input and then prints it verbatim (i.e. without |
| 565 | ** a trailing line terminator). |
| 566 | */ |
| 567 | void test_prompt_user_cmd(void){ |
| 568 | Blob answer; |
| 569 | if( g.argc!=3 ) usage("PROMPT"); |
| 570 | prompt_user(g.argv[2], &answer); |
| 571 | fossil_print("%s", blob_str(&answer)); |
| 572 | } |
| 573 | |
| 574 | /* |
| 575 | ** WEBPAGE: access_log |
| 576 | ** |
| 577 | ** Show login attempts, including timestamp and IP address. |
| 578 |