According to the author of my AutoLogin script, "Several routines from AuthPlugin must be overridden for correct operation to occur.... ...*userExists()* must return *true* always. The method is misleading. It's only called by MediaWiki in determining whether the user exists in the security context, not whether the user is in the MediaWiki database. " cite http://meta.wikimedia.org/wiki/User:Otheus/Auto_Login_via_REMOTE_USER
Am I missing something, or is these statements conflicting?
Should I place the test for 'does string exist in any username' in userExists() to prevent a new username initialization/creation?
Thx Brian
It looks like you'll need to change the hook for this plugin. You'll probably want to modify it after the block that begins with:
if ($u->getId() != 0) {
You may want to see if the author of the plugin will do it for you since you aren't a coder. Especially since authentication probably isn't a spot you want to get wrong.
V/r,
Ryan Lane
Thanks Ryan, Just to prove I'm not a developer, here is my hack to detect if a username ends with a known string. Once detected, it simply halts php, sends me an email and directs the browser to an html page for explanation. Sure its ugly.
The code below was inserted into the code found at http://meta.wikimedia.org/wiki/User:Otheus/Auto_Login_via_REMOTE_USER/code immediately before(above) the lines: // Ok, now we create a user. include 'includes/SpecialUserlogin.php';
inserted the following:
# before creating a new user, check to see if an existing username ends # with the same SSOID. If so, halt new user creation, alert browser and # send email to Wiki Admin. $dbr =& wfGetDB( DB_SLAVE ); $s = $dbr->selectField( 'user', 'user_name', "`user_name` LIKE CONVERT( _utf8 '% $uid'USING latin1)", "Auth_remoteuser.php"); if ( $s === false ) { # do nothing, placeholder for debug } else { error_log( (date(DATE_ATOM)).",Existing user,-".$s."-ending same attempting user-".$username."-and should be renamed.\n",1,' WikiAdmin@Company.com'); header("Location: http://intranetsite.com/namechange.htm"); exit(); }
My quest now is to convert the code for special page Special:Renameuser
http://meta.wikimedia.org/wiki/Special_Renameuser into an extension to be called from within the code above inplace of the header command. Any suggestions?
Thanks
Brian On 5/8/06, Lane, Ryan laner@navo.navy.mil wrote:
According to the author of my AutoLogin script, "Several routines from AuthPlugin must be overridden for correct
operation
to occur.... ...*userExists()* must return *true* always. The method
is
misleading. It's only called by MediaWiki in determining whether the
user
exists in the security context, not whether the user is in the MediaWiki database. " cite
http://meta.wikimedia.org/wiki/User:Otheus/Auto_Login_via_REMOTE_USER
Am I missing something, or is these statements conflicting?
Should I place the test for 'does string exist in any username' in userExists() to prevent a new username initialization/creation?
Thx Brian
It looks like you'll need to change the hook for this plugin. You'll probably want to modify it after the block that begins with:
if ($u->getId() != 0) {
You may want to see if the author of the plugin will do it for you since you aren't a coder. Especially since authentication probably isn't a spot you want to get wrong.
V/r,
Ryan Lane _______________________________________________ MediaWiki-l mailing list MediaWiki-l@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
mediawiki-l@lists.wikimedia.org