diff -ur mediawiki-1.10.0/includes/SpecialPreferences.php mediawiki-1.10.0-patched/includes/SpecialPreferences.php --- mediawiki-1.10.0/includes/SpecialPreferences.php 2007-04-08 11:30:06.000000000 +0200 +++ mediawiki-1.10.0-patched/includes/SpecialPreferences.php 2007-07-23 15:32:32.000000000 +0200 @@ -45,6 +45,7 @@ $this->mMath = $request->getVal( 'wpMath' ); $this->mDate = $request->getVal( 'wpDate' ); $this->mUserEmail = $request->getVal( 'wpUserEmail' ); + $this->mUserJid = $request->getVal( 'wpUserJid' ); $this->mRealName = $wgAllowRealName ? $request->getVal( 'wpRealName' ) : ''; $this->mEmailFlag = $request->getCheck( 'wpEmailFlag' ) ? 0 : 1; $this->mNick = $request->getVal( 'wpNick' ); @@ -323,6 +324,13 @@ } } + global $wgEnableJid; + if ( $wgEnableJid ) { + $wgUser->setJid( $this->mUserJid ); + $wgUser->setCookies(); + $wgUser->saveSettings(); + } + if( $needRedirect && $error === false ) { $title =& SpecialPage::getTitleFor( "Preferences" ); $wgOut->redirect($title->getFullURL('success')); @@ -341,6 +349,7 @@ $this->mOldpass = $this->mNewpass = $this->mRetypePass = ''; $this->mUserEmail = $wgUser->getEmail(); + $this->mUserJid = $wgUser->getJid(); $this->mUserEmailAuthenticationtimestamp = $wgUser->getEmailAuthenticationtimestamp(); $this->mRealName = ($wgAllowRealName) ? $wgUser->getRealName() : ''; @@ -563,6 +572,18 @@ ); } + global $wgEnableJid; + if ($wgEnableJid) { + $wgOut->addHTML( + $this->addRow( + '', + "mUserJid}\" size='25' />" + ) + ); + } + + + global $wgParser; if( !empty( $this->mToggles['fancysig'] ) && false === $wgParser->validateSig( $rawNick ) ) { diff -ur mediawiki-1.10.0/includes/User.php mediawiki-1.10.0-patched/includes/User.php --- mediawiki-1.10.0/includes/User.php 2007-04-27 15:03:42.000000000 +0200 +++ mediawiki-1.10.0-patched/includes/User.php 2007-07-23 15:34:50.000000000 +0200 @@ -102,6 +102,8 @@ 'mEmailTokenExpires', 'mRegistration', 'mEditCount', + # user_jid table + 'mJid', # user_group table 'mGroups', ); @@ -643,6 +645,7 @@ $this->mPassword = $this->mNewpassword = ''; $this->mNewpassTime = null; $this->mEmail = ''; + $this->mJid = ''; $this->mOptions = null; # Defer init if ( isset( $_COOKIE[$wgCookiePrefix.'LoggedOut'] ) ) { @@ -769,6 +772,22 @@ $this->mEditCount = $s->user_editcount; $this->getEditCount(); // revalidation for nulls + # Load jid data + $s = $dbr->selectRow( 'user_jid', 'user_jid', array( 'uj_user' => $this->mId ), __METHOD__ ); + if ( $s->user_jid ) { + $this->mJid = $s->user_jid; + } else { + $this->mJid = ""; + if (gettype($s->user_jid)=="NULL"){ + $dbr->insert( 'user_jid', + array( + 'uj_user' => $this->mId, + 'user_jid' => $this->mJid + ), __METHOD__ + ); + } + } + # Load group data $res = $dbr->select( 'user_groups', array( 'ug_group' ), @@ -1496,6 +1515,24 @@ $this->mEmail = $str; } + function getJid() { + $this->load(); + return $this->mJid; + } + + function setJid( $str ) { + $this->load(); + $this->mJid = $str; + } + + function getJabberStatus() { + global $wgJidPresenceUrl; + if ($this->getJid() != "") { + return ' Statut Jabber'; + } + else return; + } + function getRealName() { $this->load(); return $this->mRealName; @@ -1975,6 +2012,15 @@ 'user_id' => $this->mId ), __METHOD__ ); + + $dbw->update( 'user_jid', + array( /* SET */ + 'user_jid' => $this->mJid + ), array( /* WHERE */ + 'uj_user' => $this->mId + ), __METHOD__ + ); + $this->clearSharedCache(); } @@ -2042,6 +2088,14 @@ } else { $newUser = null; } + + $dbw->insert( 'user_jid', + array( + 'uj_user' => $this->mId, + 'user_jid' => $this->mJid + ), __METHOD__, array( 'IGNORE') + ); + return $newUser; } @@ -2070,6 +2124,13 @@ ); $this->mId = $dbw->insertId(); + $dbw->insert( 'user_jid', + array( + 'uj_user' => $this->mId, + 'user_jid' => $this->mJid + ), __METHOD__ + ); + # Clear instance cache other than user table data, which is already accurate $this->clearInstanceCache(); } Seulement dans mediawiki-1.10.0-patched/includes: .User.php.swp diff -ur mediawiki-1.10.0/languages/messages/MessagesFr.php mediawiki-1.10.0-patched/languages/messages/MessagesFr.php --- mediawiki-1.10.0/languages/messages/MessagesFr.php 2007-05-02 20:50:59.000000000 +0200 +++ mediawiki-1.10.0-patched/languages/messages/MessagesFr.php 2007-07-08 21:55:45.000000000 +0200 @@ -404,6 +404,7 @@ 'badretype' => 'Les mots de passe que vous avez saisis ne sont pas identiques.', 'userexists' => 'Le nom d’utilisateur que vous avez saisi est déjà utilisé. Veuillez en choisir un autre.', 'youremail' => 'Adresse de courriel* :', +'yourjid' => 'Adresse Jabber :', 'username' => 'Nom d’utilisateur :', 'uid' => 'Numéro d’utilisateur :', 'yourrealname' => 'Nom réel*',