Author: ygrego Date: 2015-05-18 14:34:52 +0000 (Mon, 18 May 2015) New Revision: 1376 Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1376 Log: Modification of method "setParentalControlPIN" Modified: oipf/js/impl/ParentalControlManagerObject.js Modified: oipf/js/impl/ParentalControlManagerObject.js =================================================================== --- oipf/js/impl/ParentalControlManagerObject.js 2015-05-18 14:25:36 UTC (rev 1375) +++ oipf/js/impl/ParentalControlManagerObject.js 2015-05-18 14:34:52 UTC (rev 1376) @@ -144,23 +144,20 @@ * Return: Integer */ setParentalControlPIN: function(oldPcPIN, newPcPIN) { - if (this._currentInvalidPINAttempts < this._invalidPINAttemptsMax) { + + if (this._currentPIN == oldPcPIN) { + this._currentPIN = newPcPIN; + return this._PIN_CORRECT; + } + this._currentInvalidPINAttempts++; - if (this._currentPIN == oldPcPIN) { - - this._currentPIN = newPcPIN; - return this._PIN_CORRECT; - - } else { - - this._currentInvalidPINAttempts++; - return this._PIN_INCORRECT; - } + if (this._currentInvalidPINAttempts > this._invalidPINAttemptsMax) { + this._lockPINEntry(); + return this._PIN_LOCKED; } + + return this._PIN_INCORRECT; - this._lockPINEntry(); - - return this._PIN_LOCKED; }, verifyParentalControlPIN: function(pcPIN) {