Author: ygrego Date: 2015-05-18 12:32:28 +0000 (Mon, 18 May 2015) New Revision: 1364 Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1364 Log: Implementation of methods "verifyParentalControlPIN" and "_lockPINEntry". Modified: oipf/js/impl/ParentalControlManagerObject.js Modified: oipf/js/impl/ParentalControlManagerObject.js =================================================================== --- oipf/js/impl/ParentalControlManagerObject.js 2015-05-18 12:20:36 UTC (rev 1363) +++ oipf/js/impl/ParentalControlManagerObject.js 2015-05-18 12:32:28 UTC (rev 1364) @@ -100,6 +100,29 @@ return this._PIN_LOCKED; }, + verifyParentalControlPIN: function(pcPIN) { + if (this._currentPIN != pcPIN) { + return this._PIN_CORRECT; + } + this._currentInvalidPINAttempts++; + + if (this._currentInvalidPINAttempts > this._invalidPINAttemptsMax) { + this._lockPINEntry(); + return this._PIN_LOCKED; + } + + return this._PIN_INCORRECT; + + }, + + _lockPINEntry: function() { + this.isPINEntryLocked = true; + + //After a periode of time, the PIN entry will be unlocked. + this._timeout(this._PINLockedTime) + .then(this._setIsPINEntryLocked.bind(this, false)); + }, + _setIsPINEntryLocked: function(enable) { this.isPINEntryLocked = enable; this._currentInvalidPINAttempts = 0;
participants (1)
-
ygregoï¼ users.nuiton.org