// If more than one group applies, use the group with the highest limit
foreach ( $this->getGroups() as $group ) {
if ( isset( $limits[$group] ) ) {
- if ( $userLimit === false || $limits[$group] > $userLimit ) {
+ if ( $userLimit === false
+ || $limits[$group][0] / $limits[$group][1] > $userLimit[0] / $userLimit[1]
+ ) {
$userLimit = $limits[$group];
}
}
$this->setToken();
$passwordFactory = self::getPasswordFactory();
- if ( $str === null ) {
- $this->mPassword = $passwordFactory->newFromCiphertext( null );
- } else {
- $this->mPassword = $passwordFactory->newFromPlaintext( $str );
- }
+ $this->mPassword = $passwordFactory->newFromPlaintext( $str );
$this->mNewpassword = $passwordFactory->newFromCiphertext( null );
$this->mNewpassTime = null;
public function setNewpassword( $str, $throttle = true ) {
$this->loadPasswords();
+ $this->mNewpassword = self::getPasswordFactory()->newFromPlaintext( $str );
if ( $str === null ) {
- $this->mNewpassword = '';
$this->mNewpassTime = null;
- } else {
- $this->mNewpassword = self::getPasswordFactory()->newFromPlaintext( $str );
- if ( $throttle ) {
- $this->mNewpassTime = wfTimestampNow();
- }
+ } elseif ( $throttle ) {
+ $this->mNewpassTime = wfTimestampNow();
}
}