3,002
edits
(Start off script\) |
m (Removed protection from "User:Joepayne/grantBureaucrat.js": Unnecessary) |
||
(3 intermediate revisions by one other user not shown) | |||
Line 15: | Line 15: | ||
).done( function ( data ) { | ).done( function ( data ) { | ||
try { | try { | ||
if(data.query.users[0].groups.indexOf(' | if(data.query.users[0].groups.indexOf('bureaucrat') >= 0) {/* Do nothing */} | ||
else { | else { | ||
var link = mw.util.addPortletLink( | var link = mw.util.addPortletLink( | ||
Line 21: | Line 21: | ||
'#', | '#', | ||
'Give bureaucrat', | 'Give bureaucrat', | ||
'pt- | 'pt-givebureaucratlink', | ||
'Add bureaucrat rights to this user' | 'Add bureaucrat rights to this user' | ||
); | ); | ||
Line 52: | Line 52: | ||
).done( function ( data ) { | ).done( function ( data ) { | ||
try { | try { | ||
if(data.query.users[0].groups.indexOf(' | if(data.query.users[0].groups.indexOf('bureaucrat') >= 0) {/* Do nothing */} | ||
else { | else { | ||
check = confirm("Do you want to give " + username + " bureaucrat rights on this wiki?"); | check = confirm("Do you want to give " + username + " bureaucrat rights on this wiki?"); | ||
Line 124: | Line 124: | ||
summary: 'Rights notification', | summary: 'Rights notification', | ||
nocreate: 1, | nocreate: 1, | ||
appendtext: '\n\n{{subst:' + ' | appendtext: '\n\n{{subst:' + 'Bureaucrat granted}}', | ||
token: mw.user.tokens.get( 'csrfToken' ) | token: mw.user.tokens.get( 'csrfToken' ) | ||
} | } | ||
Line 145: | Line 145: | ||
summary: 'Rights notification', | summary: 'Rights notification', | ||
createonly: 1, | createonly: 1, | ||
text: '\n\n{{subst:' + ' | text: '\n\n{{subst:' + 'Bureaucrat granted}}', | ||
token: mw.user.tokens.get( 'csrfToken' ) | token: mw.user.tokens.get( 'csrfToken' ) | ||
} | } |