You are here Home > Know-how > MediaWiki - CMS > Authentication / Authorization > includes/AuthPlugin.php
MediaWiki - CMS
 

7.2 includes/AuthPlugin.php

15.06.2007
7.1 Block anonymous Users [  up  ] - [ A - Z ] - [ top ] 7.3 Authorization

7.1   Block anonymous Users
7.2   includes/AuthPlugin.php
7.3   Authorization
7.3.1   Restrict Access

Many organizations need the ability to limit access to certain wiki pages based on user ID / group membership.

It is also worth noting that large organisations such as Universities usually have existing users and groups systems, often published via LDAP. It is important that the ACL can integrate with the existing AuthPlugin.php to act as a client-only interface for group permissions. In these cases an existing system may exist to centrally administer group memberships, so the wiki will not require an interface to do this.

Retrieved from "meta.wikimedia.org/wiki/ACL_for_pages↑"


AuthPlugin.php

The default behavior is not to do anything, and use the local user database for all authentication. A subclass can require that all accounts authenticate externally, or use it only as a fallback; also you can transparently create internal wiki accounts the first time someone logs in who can be authenticated externally.

Functions of AuthPlugin.php
userExists( $username ) 
authenticate( $username, $password ) 
modifyUITemplate( &$template ) 
setDomain( $domain ) 
validDomain( $domain ) 
updateUser( &$user ) 
autoCreate() 
setPassword( $password ) 
updateExternalDB( $user ) 
canCreateAccounts() 
addUser( $user, $password ) 
strict() 
initUser( &$user ) 
getCanonicalName( $username ) 

An example

A username 'Reto' will be authorized with any password.

function authenticate( $username, $password ) {
	# Override this!
	if ($username == "Reto") {
		return true;
	}
	return false;
}



See also:
wikipedia.sourceforge.net/doc/MediaWiki/AuthPlugin.html


7.1 Block anonymous Users       A - Z Index       Top       Disclaimer       7.3 Authorization


$Id: includes-AuthPlugin.html,v 1.100 2007/06/15 11:49:14 webcms Exp $
copyright © 2005-2007 by reto