Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Move the in-line javascript associated with the user capability editing into a separate script file. |
|---|---|
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA3-256: |
ef63351dbadad31e8317ffaebd37cfb8 |
| User & Date: | drh 2017-12-06 10:28:00.163 |
Context
|
2017-12-06
| ||
| 11:14 | Move all inline javascript associated with the login screen into a separate script file. check-in: c6785fabf9 user: drh tags: trunk | |
| 10:28 | Move the in-line javascript associated with the user capability editing into a separate script file. check-in: ef63351dba user: drh tags: trunk | |
| 10:01 | Perform table sorting using a separate javascript file rather than using in-line javascript. check-in: 6b645d631d user: drh tags: trunk | |
Changes
Changes to src/main.mk.
| ︙ | ︙ | |||
199 200 201 202 203 204 205 206 207 208 209 210 211 212 | $(SRCDIR)/graph.js \ $(SRCDIR)/href.js \ $(SRCDIR)/markdown.md \ $(SRCDIR)/menu.js \ $(SRCDIR)/sbsdiff.js \ $(SRCDIR)/sorttable.js \ $(SRCDIR)/tree.js \ $(SRCDIR)/wiki.wiki TRANS_SRC = \ $(OBJDIR)/add_.c \ $(OBJDIR)/allrepo_.c \ $(OBJDIR)/attach_.c \ $(OBJDIR)/bag_.c \ | > | 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 | $(SRCDIR)/graph.js \ $(SRCDIR)/href.js \ $(SRCDIR)/markdown.md \ $(SRCDIR)/menu.js \ $(SRCDIR)/sbsdiff.js \ $(SRCDIR)/sorttable.js \ $(SRCDIR)/tree.js \ $(SRCDIR)/useredit.js \ $(SRCDIR)/wiki.wiki TRANS_SRC = \ $(OBJDIR)/add_.c \ $(OBJDIR)/allrepo_.c \ $(OBJDIR)/attach_.c \ $(OBJDIR)/bag_.c \ |
| ︙ | ︙ |
Changes to src/setup.c.
| ︙ | ︙ | |||
614 615 616 617 618 619 620 |
login_insert_csrf_secret();
if( login_is_special(zLogin) ){
@ <input type="hidden" name="login" value="%s(zLogin)">
@ <input type="hidden" name="info" value="">
@ <input type="hidden" name="pw" value="*">
}
@ <input type="hidden" name="referer" value="%h(cgi_referer("setup_ulist"))">
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 614 615 616 617 618 619 620 621 622 623 624 625 626 627 |
login_insert_csrf_secret();
if( login_is_special(zLogin) ){
@ <input type="hidden" name="login" value="%s(zLogin)">
@ <input type="hidden" name="info" value="">
@ <input type="hidden" name="pw" value="*">
}
@ <input type="hidden" name="referer" value="%h(cgi_referer("setup_ulist"))">
@ <table>
@ <tr>
@ <td class="usetupEditLabel">User ID:</td>
if( uid ){
@ <td>%d(uid) <input type="hidden" name="id" value="%d(uid)" /></td>
}else{
@ <td>(new user)<input type="hidden" name="id" value="0" /></td>
|
| ︙ | ︙ | |||
678 679 680 681 682 683 684 |
@ </tr>
@ <tr>
@ <td class="usetupEditLabel">Capabilities:</td>
@ <td>
#define B(x) inherit[x]
@ <table border=0><tr><td valign="top">
if( g.perm.Setup ){
| | < | < | < | < | < | < | < | < | < | < | < | < | < | < | < | < | < | < | < | < | < | < | < | < | < | < | 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 |
@ </tr>
@ <tr>
@ <td class="usetupEditLabel">Capabilities:</td>
@ <td>
#define B(x) inherit[x]
@ <table border=0><tr><td valign="top">
if( g.perm.Setup ){
@ <label><input type="checkbox" name="as"%s(oa['s']) />
@ Setup%s(B('s'))</label><br />
}
@ <label><input type="checkbox" name="aa"%s(oa['a']) />
@ Admin%s(B('a'))</label><br />
@ <label><input type="checkbox" name="ad"%s(oa['d']) />
@ Delete%s(B('d'))</label><br />
@ <label><input type="checkbox" name="ae"%s(oa['e']) />
@ Email%s(B('e'))</label><br />
@ <label><input type="checkbox" name="ap"%s(oa['p']) />
@ Password%s(B('p'))</label><br />
@ <label><input type="checkbox" name="ai"%s(oa['i']) />
@ Check-In%s(B('i'))</label><br />
@ <label><input type="checkbox" name="ao"%s(oa['o']) />
@ Check-Out%s(B('o'))</label><br />
@ <label><input type="checkbox" name="ah"%s(oa['h']) />
@ Hyperlinks%s(B('h'))</label><br />
@ <label><input type="checkbox" name="ab"%s(oa['b']) />
@ Attachments%s(B('b'))</label><br />
@ </td><td><td width="40"></td><td valign="top">
@ <label><input type="checkbox" name="au"%s(oa['u']) />
@ Reader%s(B('u'))</label><br />
@ <label><input type="checkbox" name="av"%s(oa['v']) />
@ Developer%s(B('v'))</label><br />
@ <label><input type="checkbox" name="ag"%s(oa['g']) />
@ Clone%s(B('g'))</label><br />
@ <label><input type="checkbox" name="aj"%s(oa['j']) />
@ Read Wiki%s(B('j'))</label><br />
@ <label><input type="checkbox" name="af"%s(oa['f']) />
@ New Wiki%s(B('f'))</label><br />
@ <label><input type="checkbox" name="am"%s(oa['m']) />
@ Append Wiki%s(B('m'))</label><br />
@ <label><input type="checkbox" name="ak"%s(oa['k']) />
@ Write Wiki%s(B('k'))</label><br />
@ <label><input type="checkbox" name="al"%s(oa['l']) />
@ Moderate Wiki%s(B('l'))</label><br />
@ </td><td><td width="40"></td><td valign="top">
@ <label><input type="checkbox" name="ar"%s(oa['r']) />
@ Read Ticket%s(B('r'))</label><br />
@ <label><input type="checkbox" name="an"%s(oa['n']) />
@ New Tickets%s(B('n'))</label><br />
@ <label><input type="checkbox" name="ac"%s(oa['c']) />
@ Append To Ticket%s(B('c'))</label><br />
@ <label><input type="checkbox" name="aw"%s(oa['w']) />
@ Write Tickets%s(B('w'))</label><br />
@ <label><input type="checkbox" name="aq"%s(oa['q']) />
@ Moderate Tickets%s(B('q'))</label><br />
@ <label><input type="checkbox" name="at"%s(oa['t']) />
@ Ticket Report%s(B('t'))</label><br />
@ <label><input type="checkbox" name="ax"%s(oa['x']) />
@ Private%s(B('x'))</label><br />
@ <label><input type="checkbox" name="ay"%s(oa['y']) />
@ Write Unversioned%s(B('y'))</label><br />
@ <label><input type="checkbox" name="az"%s(oa['z']) />
@ Download Zip%s(B('z'))</label>
@ </td></tr>
@ </table>
@ </td>
@ </tr>
@ <tr>
@ <td class="usetupEditLabel">Selected Cap.:</td>
|
| ︙ | ︙ | |||
801 802 803 804 805 806 807 |
@ <td> </td>
@ <td><input type="submit" name="submit" value="Apply Changes" /></td>
@ </tr>
}
@ </table>
@ </div></form>
@ </div>
| | | 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 |
@ <td> </td>
@ <td><input type="submit" name="submit" value="Apply Changes" /></td>
@ </tr>
}
@ </table>
@ </div></form>
@ </div>
style_load_one_js_file("useredit.js");
@ <h2>Privileges And Capabilities:</h2>
@ <ul>
if( higherUser ){
@ <li><p class="missingPriv">
@ User %h(zLogin) has Setup privileges and you only have Admin privileges
@ so you are not permitted to make changes to %h(zLogin).
@ </p></li>
|
| ︙ | ︙ |
Added src/useredit.js.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
/* This script accompanies the /setup_uedit web page. It's job is to keep
** the check-boxes with user capabilities up-to-date with the capability
** string.
**
** The capability string is stored in #usetupEditCapability
*/
function updateCapabilityString(){
try {
var inputs = document.getElementsByTagName('input');
if( inputs && inputs.length ){
var output = document.getElementById('usetupEditCapability');
if( output ){
var permsIds = [], x = 0;
for(var i = 0; i < inputs.length; i++){
var e = inputs[i];
if( !e.name || !e.type ) continue;
if( e.type.toLowerCase()!=='checkbox' ) continue;
if( e.name.length===2 && e.name[0]==='a' ){
// looks like a capability checkbox
e.onchange = updateCapabilityString;
if( e.checked ){
// grab the second character of the element
// name, which is the textual flag for this
// capability, and then add it to the result
// array.
permsIds[x++] = e.name[1];
}
}
}
permsIds.sort();
output.innerHTML = permsIds.join('');
}
}
} catch (e) {
/* ignore errors */
}
}
updateCapabilityString();
|
Changes to win/Makefile.mingw.
| ︙ | ︙ | |||
608 609 610 611 612 613 614 615 616 617 618 619 620 621 | $(SRCDIR)/graph.js \ $(SRCDIR)/href.js \ $(SRCDIR)/markdown.md \ $(SRCDIR)/menu.js \ $(SRCDIR)/sbsdiff.js \ $(SRCDIR)/sorttable.js \ $(SRCDIR)/tree.js \ $(SRCDIR)/wiki.wiki TRANS_SRC = \ $(OBJDIR)/add_.c \ $(OBJDIR)/allrepo_.c \ $(OBJDIR)/attach_.c \ $(OBJDIR)/bag_.c \ | > | 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 | $(SRCDIR)/graph.js \ $(SRCDIR)/href.js \ $(SRCDIR)/markdown.md \ $(SRCDIR)/menu.js \ $(SRCDIR)/sbsdiff.js \ $(SRCDIR)/sorttable.js \ $(SRCDIR)/tree.js \ $(SRCDIR)/useredit.js \ $(SRCDIR)/wiki.wiki TRANS_SRC = \ $(OBJDIR)/add_.c \ $(OBJDIR)/allrepo_.c \ $(OBJDIR)/attach_.c \ $(OBJDIR)/bag_.c \ |
| ︙ | ︙ |
Changes to win/Makefile.msc.
| ︙ | ︙ | |||
534 535 536 537 538 539 540 541 542 543 544 545 546 547 |
$(SRCDIR)\graph.js \
$(SRCDIR)\href.js \
$(SRCDIR)\markdown.md \
$(SRCDIR)\menu.js \
$(SRCDIR)\sbsdiff.js \
$(SRCDIR)\sorttable.js \
$(SRCDIR)\tree.js \
$(SRCDIR)\wiki.wiki
OBJ = $(OX)\add$O \
$(OX)\allrepo$O \
$(OX)\attach$O \
$(OX)\bag$O \
$(OX)\bisect$O \
| > | 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 |
$(SRCDIR)\graph.js \
$(SRCDIR)\href.js \
$(SRCDIR)\markdown.md \
$(SRCDIR)\menu.js \
$(SRCDIR)\sbsdiff.js \
$(SRCDIR)\sorttable.js \
$(SRCDIR)\tree.js \
$(SRCDIR)\useredit.js \
$(SRCDIR)\wiki.wiki
OBJ = $(OX)\add$O \
$(OX)\allrepo$O \
$(OX)\attach$O \
$(OX)\bag$O \
$(OX)\bisect$O \
|
| ︙ | ︙ |