Author: ygrego Date: 2015-05-18 13:45:14 +0000 (Mon, 18 May 2015) New Revision: 1372 Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1372 Log: Addition of the method "setBlockUnrated". Modified: oipf/js/impl/ParentalControlManagerObject.js Modified: oipf/js/impl/ParentalControlManagerObject.js =================================================================== --- oipf/js/impl/ParentalControlManagerObject.js 2015-05-18 13:33:41 UTC (rev 1371) +++ oipf/js/impl/ParentalControlManagerObject.js 2015-05-18 13:45:14 UTC (rev 1372) @@ -111,6 +111,50 @@ }, + /* + * Description: + * Set whether programmes for which no parental rating has been retrieved + * from the metadata client nor defined by the service provider should be + * blocked automatically by the terminal. + * + * This operation SHALL be protected + * by the parental control PIN (if PIN entry is enabled).The return value + * indicates the success of the operation, and SHALL take one of + * the following values: + * ------------------------------------------------------------------------ + * Value | Description + * ------ ----------------------------------------------------------------- + * 0 | The PIN is correct. + * ------ ----------------------------------------------------------------- + * 1 | The PIN is incorrect. + * ------ ----------------------------------------------------------------- + * 2 | PIN entry is locked because an invalid PIN has been entered too + * | many times. The number of invalid PIN attempts before PIN entry + * | is locked is outside the scope of this specification. + * ------ ----------------------------------------------------------------- + * + * Arguments: + * - pcPIN: The parental control PIN. + * + * - block: Flag indicating whether programmes SHALL be blocked. + * + */ + setBlockUnrated: function(pcPIN, block) { + if (this._currentPIN == pcPIN) { + this._blockUnrated = block; + 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;