Index: trunk/phase3/includes/User.php |
— | — | @@ -2753,6 +2753,14 @@ |
2754 | 2754 | |
2755 | 2755 | $this->load(); |
2756 | 2756 | if ( 0 == $this->mId ) return; |
| 2757 | + if ( !$this->mToken ) { |
| 2758 | + // When token is empty or NULL generate a new one and then save it to the database |
| 2759 | + // This allows a wiki to re-secure itself after a leak of it's user table or $wgSecretKey |
| 2760 | + // Simply by setting every cell in the user_token column to NULL and letting them be |
| 2761 | + // regenerated as users log back into the wiki. |
| 2762 | + $this->setToken(); |
| 2763 | + $this->saveSettings(); |
| 2764 | + } |
2757 | 2765 | $session = array( |
2758 | 2766 | 'wsUserID' => $this->mId, |
2759 | 2767 | 'wsToken' => $this->mToken, |