| | @@ -520,10 +520,23 @@ |
| 520 | 520 | db_end_transaction(0); |
| 521 | 521 | }else{ |
| 522 | 522 | usage("add|cat|edit|export|list|revert|remove|sync|touch"); |
| 523 | 523 | } |
| 524 | 524 | } |
| 525 | + |
| 526 | +/* |
| 527 | +** Emit an HTML form for uploading a new unversioned file if |
| 528 | +** the current user has WrUnver permissions, else this is |
| 529 | +** a no-op. |
| 530 | +*/ |
| 531 | +static void uv_form_upload(void){ |
| 532 | + if( !g.perm.WrUnver ) return; |
| 533 | + CX("<form class='uvupload' method='POST'>"); |
| 534 | + CX("<label for='uvupload'>Select file to upload:</label>"); |
| 535 | + CX("<input type='file' id='uvupload' name='uvupload'/>"); |
| 536 | + CX("</form>"); |
| 537 | +} |
| 525 | 538 | |
| 526 | 539 | /* |
| 527 | 540 | ** WEBPAGE: uvlist |
| 528 | 541 | ** |
| 529 | 542 | ** Display a list of all unversioned files in the repository. |
| | @@ -547,10 +560,11 @@ |
| 547 | 560 | cgi_check_for_malice(); |
| 548 | 561 | etag_check(ETAG_DATA,0); |
| 549 | 562 | style_header("Unversioned Files"); |
| 550 | 563 | if( !db_table_exists("repository","unversioned") ){ |
| 551 | 564 | @ No unversioned files on this server |
| 565 | + uv_form_upload(); |
| 552 | 566 | style_finish_page(); |
| 553 | 567 | return; |
| 554 | 568 | } |
| 555 | 569 | if( PB("byage") ) zOrderBy = "mtime DESC"; |
| 556 | 570 | if( PB("showdel") ) showDel = 1; |
| | @@ -639,10 +653,11 @@ |
| 639 | 653 | @ </tfoot> |
| 640 | 654 | @ </table></div> |
| 641 | 655 | }else{ |
| 642 | 656 | @ No unversioned files on this server. |
| 643 | 657 | } |
| 658 | + uv_form_upload(); |
| 644 | 659 | style_finish_page(); |
| 645 | 660 | } |
| 646 | 661 | |
| 647 | 662 | /* |
| 648 | 663 | ** WEBPAGE: juvlist |
| 649 | 664 | |