Too much for a novice like me to grasp and run with it alone...
If I understand correctly, your proposed method would create an option in
the $userclass and set it to the employee's ID. I would then need to create
a statement to check if that value exists for any other $user prior to new
user creation. Sounds good. I just don't have the peices. Would I then also
have to modify Specials:Renameuser to replace the $user(uniqueSSOID)optional
value during rename?
While scavaging in user.php, I found a query snippet that checks if a user
with the given name exists, then returns the ID.
function idForName() {
$fname = 'User::idForName';
$gotid = 0;
$s = trim( $this->getName() );
if ( 0 == strcmp( '', $s ) ) return 0;
$dbr =& wfGetDB( DB_SLAVE );
$id = $dbr->selectField( 'user', 'user_id', array(
'user_name' => $s ),
$fname );
if ( $id === false ) {
$id = 0;
}
return $id;
}
How could the above be copied/modified to return the
full username ($username) that contains the string ($UniqueSSOid) of the
about-to-be created user?
I''m not a developer, but if I get help with the above, I can figure out
how to alter the Autologin script to:
1) halt auto new user creation and display a html informative message/page
to the browser.
2) send wgEmergencyContact email with existing and proposed usernames.
As for actually renaming the user:
If I get this far, I would be very happy to perform the
Special:Renameuser process manually... ... Until I learn more php
Thx again,
Brian
This thread is also related to:
http://mail.wikipedia.org/pipermail/mediawiki-l/2006-May/011779.html
On 5/4/06, Lane, Ryan <laner(a)navo.navy.mil> wrote:
Now if I can just create a method to determin if
the user exists prior
to
You could add the user's ID as a user option on user creation:
$user->setOption('uniqueSSOID',$yourUniqueSSOID);
in function initUser() in the authentication plugin you are using. If you
do
that, you can search the database based upon the ID.
I'm not sure if the core code currently has any hooks that would allow you
to rename the user when the user logs in, without reporting errors...
I'm glad you brought this up, because I really didn't think about this,
and
this is definitely something I'll run into in the future. I'll have to
look
into adding support for this in my plugin.
V/r,
Ryan Lane <Lane(a)Wikimedia.org>