MediaWiki:Gadget-user-tools.js

/* */ // add links "User rights", "User settings" and "Patrol rights" to toolbox menu // only for head editors and administrators on user pages and discussion pages if (wgUserGroups) { userrights = wgUserGroups.toString; ur_sysop = userrights.search("sysop"); ur_patrol = userrights.search("patrol"); ur_byro = userrights.search("bureaucrat"); } else { ur_sysop = -1; ur_patrol = -1; ur_byro = -1; } if((wgNamespaceNumber == 2 || wgNamespaceNumber == 3)) { addOnloadHook(   function {      wgTitleAa = new Array;      wgTitleAa = wgTitle.split('/');      urPath = wgServer + wgScript + '/';      if(ur_byro != -1) {        addPortletLink('p-tb', urPath + "Special:Userrights/" + wgTitleAa[0], 'User rights', 't-userrights', 'Set user rights for this user');      } /* no EditUser Extension      if(ur_byro != -1) {        addPortletLink('p-tb', urPath + "Special:EditUser/" + wgTitleAa[0], 'User settings', 't-usersettings', 'This user\'s settings');      }      if(ur_sysop != -1) {        addPortletLink('p-tb', urPath + "Special:Makepatrol/" + wgTitleAa[0], 'Patrol rights', 't-makepatrol', 'Set patrol rights to this user');      }      if(ur_byro != -1) {        addPortletLink('p-tb', urPath + "Special:CheckUser", 'Check IP address', 't-ipcheckuser', 'Check IP address of this user (need to set IP manually)');      }    }  ); } /* */