mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/OATHAuth
synced 2024-11-24 08:14:15 +00:00
Add method to clear all keys associated with the user
This is needed when changing modules, we need to remove all keys from the old module Change-Id: Iaada3df631260dbd612cce01f5477e93e6da4596
This commit is contained in:
parent
275a5a54cc
commit
019cf6ccdd
|
@ -110,6 +110,20 @@ class OATHUser {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes all keys associated with the user
|
||||
* Warning: This only removes the keys in memory,
|
||||
* changes need to be persisted
|
||||
*/
|
||||
public function clearAllKeys() {
|
||||
$this->keys = [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds single key to the key array
|
||||
*
|
||||
* @param IAuthKey $key
|
||||
*/
|
||||
public function addKey( IAuthKey $key ) {
|
||||
if ( !$this->keyTypeCorrect( $key ) ) {
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue