X-Git-Url: http://git.cyclocoop.org/%28?a=blobdiff_plain;f=includes%2FUser.php;h=4a21d66aa7a06267ebd4d585e161636ee67b6bd4;hb=f88c771756c580442fe7ca2f84bcbb8067b77f57;hp=6475a2f03e425cb49a561a438b445c54ebea65a1;hpb=50d9a5ec18cd1e952433b9ee1f22bf04916d1537;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/User.php b/includes/User.php index 6475a2f03e..4a21d66aa7 100644 --- a/includes/User.php +++ b/includes/User.php @@ -269,7 +269,7 @@ class User { * @static */ static function newFromConfirmationCode( $code ) { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $id = $dbr->selectField( 'user', 'user_id', array( 'user_email_token' => md5( $code ), 'user_email_token_expires > ' . $dbr->addQuotes( $dbr->timestamp() ), @@ -301,7 +301,7 @@ class User { * @static */ static function whoIs( $id ) { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); return $dbr->selectField( 'user', 'user_name', array( 'user_id' => $id ), 'User::whoIs' ); } @@ -312,7 +312,7 @@ class User { * @static */ static function whoIsReal( $id ) { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); return $dbr->selectField( 'user', 'user_real_name', array( 'user_id' => $id ), 'User::whoIsReal' ); } @@ -328,7 +328,7 @@ class User { # Illegal name return null; } - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $s = $dbr->selectRow( 'user', array( 'user_id' ), array( 'user_name' => $nt->getText() ), __METHOD__ ); if ( $s === false ) { @@ -546,7 +546,7 @@ class User { */ static function edits( $uid ) { wfProfileIn( __METHOD__ ); - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); // check if the user_editcount field has been initialized $field = $dbr->selectField( @@ -556,7 +556,7 @@ class User { ); if( $field === null ) { // it has not been initialized. do so. - $dbw =& wfGetDb( DB_MASTER ); + $dbw = wfGetDb( DB_MASTER ); $count = $dbr->selectField( 'revision', 'count(*)', array( 'rev_user' => $uid ), @@ -720,7 +720,7 @@ class User { return false; } - $dbr =& wfGetDB( DB_MASTER ); + $dbr = wfGetDB( DB_MASTER ); $s = $dbr->selectRow( 'user', '*', array( 'user_id' => $this->mId ), __METHOD__ ); if ( $s !== false ) { @@ -1183,7 +1183,7 @@ class User { * @private */ function checkNewtalk( $field, $id ) { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $ok = $dbr->selectField( 'user_newtalk', $field, array( $field => $id ), __METHOD__ ); return $ok !== false; @@ -1200,7 +1200,7 @@ class User { wfDebug( __METHOD__." already set ($field, $id), ignoring\n" ); return false; } - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $dbw->insert( 'user_newtalk', array( $field => $id ), __METHOD__, @@ -1220,7 +1220,7 @@ class User { wfDebug( __METHOD__.": already gone ($field, $id), ignoring\n" ); return false; } - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $dbw->delete( 'user_newtalk', array( $field => $id ), __METHOD__ ); @@ -1305,7 +1305,7 @@ class User { if( $this->mId ) { $this->mTouched = self::newTouchedTimestamp(); - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $dbw->update( 'user', array( 'user_touched' => $dbw->timestamp( $this->mTouched ) ), array( 'user_id' => $this->mId ), @@ -1597,7 +1597,7 @@ class User { */ function addGroup( $group ) { $this->load(); - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); if( $this->getId() ) { $dbw->insert( 'user_groups', array( @@ -1621,7 +1621,7 @@ class User { */ function removeGroup( $group ) { $this->load(); - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $dbw->delete( 'user_groups', array( 'ug_user' => $this->getID(), @@ -1773,7 +1773,7 @@ class User { // If the page is watched by the user (or may be watched), update the timestamp on any // any matching rows if ( $watched ) { - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $dbw->update( 'watchlist', array( /* SET */ 'wl_notificationtimestamp' => NULL @@ -1804,7 +1804,7 @@ class User { } if( $currentUser != 0 ) { - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $dbw->update( 'watchlist', array( /* SET */ 'wl_notificationtimestamp' => NULL @@ -1897,7 +1897,7 @@ class User { $this->mTouched = self::newTouchedTimestamp(); - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $dbw->update( 'user', array( /* SET */ 'user_name' => $this->mName, @@ -1925,7 +1925,7 @@ class User { $s = trim( $this->getName() ); if ( 0 == strcmp( '', $s ) ) return 0; - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $id = $dbr->selectField( 'user', 'user_id', array( 'user_name' => $s ), __METHOD__ ); if ( $id === false ) { $id = 0; @@ -1956,7 +1956,7 @@ class User { $user->mOptions = $params['options'] + $user->mOptions; unset( $params['options'] ); } - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $seqVal = $dbw->nextSequenceValue( 'user_user_id_seq' ); $fields = array( 'user_id' => $seqVal, @@ -1989,7 +1989,7 @@ class User { */ function addToDatabase() { $this->load(); - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $seqVal = $dbw->nextSequenceValue( 'user_user_id_seq' ); $dbw->insert( 'user', array( @@ -2119,7 +2119,7 @@ class User { if ( isset( $res ) ) return $res; else { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); return $res = $dbr->selectField( 'user', 'max(user_id)', false, 'User::getMaxID' ); } } @@ -2295,7 +2295,7 @@ class User { $token = $this->generateToken( $this->mId . $this->mEmail . $expires ); $hash = md5( $token ); - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $dbw->update( 'user', array( 'user_email_token' => $hash, 'user_email_token_expires' => $dbw->timestamp( $expires ) ),