Example #1
0
 def keyOK(self):
     print "self[\"config\"].l.getCurrentSelection()", self[
         "config"].l.getCurrentSelection()
     if self["config"].l.getCurrentSelection() == self.editListEntry:
         self.session.open(ParentalControlEditor)
     elif self["config"].l.getCurrentSelection(
     ) == self.editBouquetListEntry:
         self.session.open(ParentalControlBouquetEditor)
     elif self["config"].l.getCurrentSelection() == self.changePin:
         if config.ParentalControl.mode.value == "complex":
             pass
         else:
             self.session.open(ParentalControlChangePin,
                               config.ParentalControl.servicepin[0],
                               _("service PIN"))
     elif self["config"].l.getCurrentSelection() == self.changeSetupPin:
         self.session.open(ParentalControlChangePin,
                           config.ParentalControl.setuppin, _("setup PIN"))
     elif self["config"].l.getCurrentSelection() == self.reloadLists:
         from Components.ParentalControl import parentalControl
         parentalControl.open()
     else:
         ConfigListScreen.keyRight(self)
         print "current selection:", self["config"].l.getCurrentSelection()
         self.createSetup()
	def downloadParentalControl(self, baseurl):
		print "[OTTClient] reading remote parental control status ..."
		
		if self.getParentalControlEnabled(baseurl):
			print "[OTTClient] parental control enabled"
			config.ParentalControl.servicepinactive.value = True
			config.ParentalControl.servicepinactive.save()
			print "[OTTClient] reding pin status ..."
			pinstatus = self.getParentalControlPinState(baseurl)
			pin = self.getParentalControlPin(baseurl)
			print "[OTTClient] pin status is setted to " + str(pinstatus)
			config.ParentalControl.servicepinactive.value = pinstatus
			config.ParentalControl.servicepinactive.save()
			config.ParentalControl.servicepin[0].value = pin
			config.ParentalControl.servicepin[0].save()
			print "[OTTClient] reading remote parental control type ..."
			stype = self.getParentalControlType(baseurl)
			print "[OTTClient] parental control type is " + stype
			config.ParentalControl.type.value = stype
			config.ParentalControl.type.save()
			print "[OTTClient] download parental control services list"
			services = self.downloadParentalControlBouquets(baseurl)
			print "[OTTClient] save parental control services list"
			parentalfile = open("/etc/enigma2/" + stype, "w")
			for service in services:
				parentalfile.write(service['reference'] + "\n")
			parentalfile.close()
			print "[OTTClient] reload parental control"
			from Components.ParentalControl import parentalControl
			parentalControl.open()
		else:
			print "[OTTClient] parental control disabled - do nothing"
Example #3
0
	def downloadParentalControl(self, baseurl):
		print("[ClientModeBox] reading remote parental control status ...")

		if self.getParentalControlEnabled(baseurl):
			print("[ClientModeBox] parental control enabled")
			config.ParentalControl.servicepinactive.value = True
			config.ParentalControl.servicepinactive.save()
			print("[ClientModeBox] reding pin status ...")
			pinstatus = self.getParentalControlPinState(baseurl)
			pin = self.getParentalControlPin(baseurl)
			print("[ClientModeBox] pin status is setted to " + str(pinstatus))
			config.ParentalControl.servicepinactive.value = pinstatus
			config.ParentalControl.servicepinactive.save()
			config.ParentalControl.servicepin[0].value = pin
			config.ParentalControl.servicepin[0].save()
			print("[ClientModeBox] reading remote parental control type ...")
			stype = self.getParentalControlType(baseurl)
			print("[ClientModeBox] parental control type is " + stype)
			config.ParentalControl.type.value = stype
			config.ParentalControl.type.save()
			print("[ClientModeBox] download parental control services list")
			services = self.downloadParentalControlBouquets(baseurl)
			print("[ClientModeBox] save parental control services list")
			parentalfile = open("/etc/enigma2/" + stype, "w")
			for service in services:
				parentalfile.write(service['reference'] + "\n")
			parentalfile.close()
			print("[ClientModeBox] reload parental control")
			from Components.ParentalControl import parentalControl
			parentalControl.open()
		else:
			print("[ClientModeBox] parental control disabled - do nothing")
Example #4
0
 def keyOK(self):
     if self["config"].l.getCurrentSelection() == self.editListEntry:
         self.session.open(ParentalControlEditor)
     elif self["config"].l.getCurrentSelection(
     ) == self.editBouquetListEntry:
         self.session.open(ParentalControlBouquetEditor)
     elif self["config"].l.getCurrentSelection() == self.changePin:
         if config.ParentalControl.mode.value == "complex":
             pass
         else:
             self.session.open(ParentalControlChangePin,
                               config.ParentalControl.servicepin[0],
                               _("service PIN"))
     elif self["config"].l.getCurrentSelection() == self.changeSetupPin:
         self.session.open(ParentalControlChangePin,
                           config.ParentalControl.setuppin, _("setup PIN"))
     elif self["config"].l.getCurrentSelection() == self.reloadLists:
         from Components.ParentalControl import parentalControl
         parentalControl.open()
         self.session.open(MessageBox,
                           _("Lists reloaded!"),
                           MessageBox.TYPE_INFO,
                           timeout=3)
     else:
         ConfigListScreen.keyRight(self)
         self.createSetup()
Example #5
0
	def keyOK(self):
		if self["config"].l.getCurrentSelection() == self.editListEntry:
			self.session.open(ParentalControlEditor)
		elif self["config"].l.getCurrentSelection() == self.editBouquetListEntry:
			self.session.open(ParentalControlBouquetEditor)
		elif self["config"].l.getCurrentSelection() == self.changePin:
			if config.ParentalControl.mode.value == "complex":
				pass
			else:
				self.session.open(ParentalControlChangePin, config.ParentalControl.servicepin[0], _("service PIN"))
		elif self["config"].l.getCurrentSelection() == self.changeSetupPin:
			self.session.open(ParentalControlChangePin, config.ParentalControl.setuppin, _("setup PIN"))
		elif self["config"].l.getCurrentSelection() == self.changeMoviePin:
			self.session.open(ParentalControlChangePin, config.ParentalControl.moviepin, _("movie / directory PIN"))
		elif self["config"].l.getCurrentSelection() == self.resetMoviePinCache:
			if not parentalControlFolder.configInitialized:
				parentalControlFolder.getConfigValues()
			parentalControlFolder.resetSessionPin()
			self.keyCancel()
		elif self["config"].l.getCurrentSelection() == self.changeDeletePin:
			self.session.open(ParentalControlChangePin, config.ParentalControl.deletepin, _("movie-delete PIN"))
		elif self["config"].l.getCurrentSelection() == self.resetDeletePinCache:
			if not parentalControlFolder.configInitialized:
				parentalControlFolder.getConfigValues()
			parentalControlFolder.resetSessionDeletePin()
			self.keyCancel()
		elif self["config"].l.getCurrentSelection() == self.reloadLists:
			from Components.ParentalControl import parentalControl
			parentalControl.open()
		else:
			ConfigListScreen.keyRight(self)
			self.createSetup()
	def keyOK(self):
		if self["config"].l.getCurrentSelection() == self.changePin:
			self.session.open(ParentalControlChangePin, config.ParentalControl.servicepin[0], _("service PIN"))
		elif self["config"].l.getCurrentSelection() == self.reloadLists:
			from Components.ParentalControl import parentalControl
			parentalControl.open()
			self.session.open(MessageBox, _("Lists reloaded!"), MessageBox.TYPE_INFO, timeout=3)
		else:
			ConfigListScreen.keyRight(self)
			self.createSetup()
	def command(self):
		print "ParentControl was called"

		if config.ParentalControl.servicepinactive.value:
			parentalControl.open()
			servicelist = parentalControl.blacklist

			list = [(str(service_ref), ServiceReference(service_ref).getServiceName()) for service_ref in servicelist]
		else:
			list = []

		print "list", list
		return list
	def keyOK(self):
		if self["config"].l.getCurrentSelection() == self.changePin:
			if config.ParentalControl.servicepin[0].value:
				self.session.openWithCallback(self.oldPinEntered, PinInput, pinList=[x.value for x in config.ParentalControl.servicepin], triesEntry=config.ParentalControl.retries.servicepin, title=_("Please enter the old PIN code"), windowTitle=_("Enter PIN code"))
			else:
				self.oldPinEntered(True)
		elif self["config"].l.getCurrentSelection() == self.reloadLists:
			from Components.ParentalControl import parentalControl
			parentalControl.open(True)
			self.session.open(MessageBox, _("Lists reloaded!"), MessageBox.TYPE_INFO, timeout=3)
		else:
			ConfigListScreen.keyRight(self)
			self.createSetup()
	def keyOK(self):
		if self["config"].l.getCurrentSelection() == self.changePin:
			if config.ParentalControl.servicepin[0].value:
				self.session.openWithCallback(self.oldPinEntered, PinInput, pinList=[x.value for x in config.ParentalControl.servicepin], triesEntry=config.ParentalControl.retries.servicepin, title=_("Please enter the old PIN code"), windowTitle=_("Enter pin code"))
			else:
				self.oldPinEntered(True)
		elif self["config"].l.getCurrentSelection() == self.reloadLists:
			from Components.ParentalControl import parentalControl
			parentalControl.open()
			self.session.open(MessageBox, _("Lists reloaded!"), MessageBox.TYPE_INFO, timeout=3)
		else:
			ConfigListScreen.keyRight(self)
			self.createSetup()
Example #10
0
 def requestClose(self):
     if self.plugins_changed:
         plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
     if self.reload_settings:
         self["text"].setText(_("Reloading bouquets and services..."))
         eDVBDB.getInstance().reloadBouquets()
         eDVBDB.getInstance().reloadServicelist()
         from Components.ParentalControl import parentalControl
         parentalControl.open()
         refreshServiceList()
     plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
     self.container.appClosed.remove(self.runFinished)
     self.container.dataAvail.remove(self.dataAvail)
     self.close()
def getParentalControlList():
    if not config.ParentalControl.configured.value:
        return {"result": True, "services": []}
    parentalControl.open()
    if config.ParentalControl.type.value == "whitelist":
        tservices = parentalControl.whitelist
    else:
        tservices = parentalControl.blacklist
    services = []
    if tservices is not None:
        for service in tservices:
            tservice = ServiceReference(service)
            services.append({"servicereference": service, "servicename": tservice.getServiceName()})
    return {"result": True, "type": config.ParentalControl.type.value, "services": services}
	def command(self):
		print "ParentControl was called"

		if config.ParentalControl.configured.value:
			parentalControl.open()
			if config.ParentalControl.type.value == "whitelist":
				servicelist = parentalControl.whitelist
			else:
				servicelist = parentalControl.blacklist

			list = [(str(service_ref), ServiceReference(service_ref).getServiceName()) for service_ref in servicelist]
		else:
			list = []

		print "list", list
		return list
Example #13
0
	def requestClose(self):
		if self.plugins_changed:
			plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
		if self.reload_settings:
			self["text"].setText(_("Reloading bouquets and services..."))
			eDVBDB.getInstance().reloadBouquets()
			eDVBDB.getInstance().reloadServicelist()
			from Components.ParentalControl import parentalControl
			parentalControl.open()
			refreshServiceList()
		if self.check_softcams:
			SystemInfo["HasSoftcamInstalled"] = hassoftcaminstalled()
		plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
		self.container.appClosed.remove(self.runFinished)
		self.container.dataAvail.remove(self.dataAvail)
		self.close()
Example #14
0
 def keyOK(self):
     print 'self["config"].l.getCurrentSelection()', self["config"].l.getCurrentSelection()
     if self["config"].l.getCurrentSelection() == self.editListEntry:
         self.session.open(ParentalControlEditor)
     elif self["config"].l.getCurrentSelection() == self.editBouquetListEntry:
         self.session.open(ParentalControlBouquetEditor)
     elif self["config"].l.getCurrentSelection() == self.changePin:
         if config.ParentalControl.mode.value == "complex":
             pass
         else:
             self.session.open(ParentalControlChangePin, config.ParentalControl.servicepin[0], _("service PIN"))
     elif self["config"].l.getCurrentSelection() == self.changeSetupPin:
         self.session.open(ParentalControlChangePin, config.ParentalControl.setuppin, _("setup PIN"))
     elif self["config"].l.getCurrentSelection() == self.reloadLists:
         parentalControl.open()
     else:
         ConfigListScreen.keyRight(self)
         print "current selection:", self["config"].l.getCurrentSelection()
         self.createSetup()
	def keyOK(self):
		if self["config"].l.getCurrentSelection() == self.editListEntry:
			self.session.open(ParentalControlEditor)
		elif self["config"].l.getCurrentSelection() == self.editBouquetListEntry:
			self.session.open(ParentalControlBouquetEditor)
		elif self["config"].l.getCurrentSelection() == self.changePin:
			if config.ParentalControl.mode.value == "complex":
				pass
			else:
				self.session.open(ParentalControlChangePin, config.ParentalControl.servicepin[0], _("service PIN"))
		elif self["config"].l.getCurrentSelection() == self.changeSetupPin:
			self.session.open(ParentalControlChangePin, config.ParentalControl.setuppin, _("setup PIN"))
		elif self["config"].l.getCurrentSelection() == self.reloadLists:
			from Components.ParentalControl import parentalControl
			parentalControl.open()
			self.session.open(MessageBox, _("Lists reloaded!"), MessageBox.TYPE_INFO, timeout=3)
		else:
			ConfigListScreen.keyRight(self)
			self.createSetup()
Example #16
0
def getParentalControlList():
    if config.ParentalControl.configured.value:
        return {"result": True, "services": []}
    parentalControl.open()
    if config.ParentalControl.type.value == "whitelist":
        tservices = parentalControl.whitelist
    else:
        tservices = parentalControl.blacklist
    services = []
    if tservices is not None:
        for service in tservices:
            tservice = ServiceReference(service)
            services.append({
                "servicereference": service,
                "servicename": tservice.getServiceName()
            })
    return {
        "result": True,
        "type": config.ParentalControl.type.value,
        "services": services
    }