more wikis
 
[Dantman]

Dantman 2,347 edits since August 19, 2006

2,347

User:Dantman/GE Extended/Custom Extensions/RightsControl/RightsControl.php

Wikia - creating communities

<?php

/**
 * The RightsControl Extension's task's are:
 * - Managements of UserRights in a manor similar to Special:Userrights but safe like
 *   	Special:Makesysop, Special:Makebot, and Special:Desysop. 
 *
 * @package GENetwork Extensions
 * @subpackage RightsControl 
 * @author Daniel Friesen (http://www.wikia.com/wiki/User:Dantman) (dan_the_man@telus.net)
 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public Licence 2.0 or later
 */

if( !defined( 'MEDIAWIKI' ) ) die( "This is an extension to the MediaWiki package and cannot be run standalone." );

$wgExtensionFunctions[] = 'efRightsControlSetup';

require_once( "$IP/extensions/RightsControl/SpecialRightsControl.php" );

$wgExtensionCredits['specialpage'][] = array(
			'name' => 'RightsControl',
			'author' => 'Daniel Friesen(aka: Dantman)',
			'url' => 'http://www.wikia.com/wiki/User:Dantman/GE_Extended/Custom_Extensions/RightsControl'
	);

function efRightsControlSetup() {
	global $wgMessageCache, $wgUser, $wgRequest, $wgOut;
	
	$rc = new SpecialRightsControl();
	SpecialPage::addPage( $rc );
	if( !$rc->userCanExecute( $wgUser ) &&
		$wgRequest->getBool( 'rightsControlMainpageFallback', false ) )
			$wgOut->redirect( Title::newMainPage()->getFullURL() );
	
	$wgMessageCache->addMessages(
		array(
			'rightscontrol'              => "User Rights Control",
			'userrights-error'           => "Error",
			'userrights-confirm'         => "Confirmation",
			'useringroups'               => "This user is part of the groups:",
			'userremovefrom'             => "Remove from",
			'useraddto'                  => "Add to",
			'userrights-limitedhelp'     => "You may not see some of the flags listed on the left in the boxes on the right. This is because only the flags you are allowed to edit will be listed on the right.",
			'userrights-noneselected'    => "You did not select any groups to add or remove.",
			'userrights-alreadyhas'      => "You can't add the group '$1' because this user already is part of that group.",
			'userrights-isnotgroup'      => "You can't remove the group '$1' because this user is not part of that group.",
			'userrights-addgroup'        => "You are going to grant this user the permissions of the group '$1'.",
			'userrights-removegroup'     => "You are going to revoke the permissions for the group '$1' from this user.",
			'userrights-oneway-noremove' => "This is a one way action, you will not be able to remove '$1' from this user if you grant them these permissions.",
			'userrights-oneway-nogrant'  => "This is a one way action, you will not be able to grant the permissions for '$1' to this user if you revoke these permissions.",
			'userrights-sure'            => "Are you sure you wish to make these actions.",
			'userrights-yes'             => "Yes",
			'userrights-no'              => "No",
			'badaccess-addgroup'         => "You are not allowed to add a user to the '$1' group.",
			'badaccess-removegroup'      => "You are not allowed to remove a user from the '$1' group."
		)
	);
}

?>