From 0835144ad17e4414dc4062ca310d7d4f0cb39e39 Mon Sep 17 00:00:00 2001 From: lars Date: Wed, 6 Sep 2006 13:13:17 +0000 Subject: [PATCH] some comments and changes for the previous commit --- pythonrewrite/bin2/CryptoBoxWebserverSettings.py | 3 ++- pythonrewrite/bin2/CryptoBoxWebserverSites.py | 11 +++++++---- pythonrewrite/scripts/userdocexport.sh | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/pythonrewrite/bin2/CryptoBoxWebserverSettings.py b/pythonrewrite/bin2/CryptoBoxWebserverSettings.py index 21c92cf..0bfb561 100644 --- a/pythonrewrite/bin2/CryptoBoxWebserverSettings.py +++ b/pythonrewrite/bin2/CryptoBoxWebserverSettings.py @@ -12,7 +12,8 @@ class CryptoBoxWebserverSettings: ## put all found WebSettings values in the dictionary ## RFC: arbitrarily importing all available keys does not sound very secure [l] ## RFC: settings with the same names in different sections (Log, Main, ...) will collide silently - right? [l] - ## yep, we'll have to divide between settings for clearsilver and settings we need for other webstuff [a] + ## yep, we'll have to divide between settings for clearsilver and settings we need for other webstuff [a] + ## I think it would be better to expose only the necessary settings (manually - not just everything) [l] for key in self.cbxPrefs["WebSettings"].keys(): website.settings["Settings."+key] = self.cbxPrefs["WebSettings"][key] ## also all Log values diff --git a/pythonrewrite/bin2/CryptoBoxWebserverSites.py b/pythonrewrite/bin2/CryptoBoxWebserverSites.py index a09ee4a..a3404a0 100755 --- a/pythonrewrite/bin2/CryptoBoxWebserverSites.py +++ b/pythonrewrite/bin2/CryptoBoxWebserverSites.py @@ -47,7 +47,8 @@ class CryptoBoxWebserverSites(CryptoBox.CryptoBoxProps, CryptoBoxWebserverSettin what about the unnamed place, where 'exposed' attributes are set? [l] ''' # RFC: this dictionary is not sufficient for arbitrary text inputs (e.g.: names) or numbers [l] - # what way would we sanizite such input? just exclude forbidden elements? [a] + # what way would we sanizite such input? just exclude forbidden elements? [a] + # I would prefer a seperate function for each possible setting [l] niceparams = { 'weblang': ["Settings.Language", self.settings["Settings.AvailableLanguages"]], 'loglevel': ["Log.Level", ('','info', 'warn', 'debug', 'error')], @@ -63,7 +64,8 @@ class CryptoBoxWebserverSites(CryptoBox.CryptoBoxProps, CryptoBoxWebserverSettin #self.log.warn(niceparams[nicekey][1]) if evilparams[nicekey] and evilparams[nicekey] in niceparams[nicekey][1]: # RFC: isn't "self.settings" a non-obvious name for user input? [l] - # self.settings is used by clearsilver [a] + # self.settings is used by clearsilver [a] + # yes, but why should clearsilver have access to the user input? [l] self.settings[niceparams[nicekey][0]] = evilparams[nicekey] #self.log.warn(niceparams[nicekey][0]) #self.log.warn(evilparams[nicekey]) @@ -155,9 +157,10 @@ class CryptoBoxWebserverSites(CryptoBox.CryptoBoxProps, CryptoBoxWebserverSettin if len(self.settings["Settings.AvailableDocLanguages"]) < 1: self.settings["Data.Error"] = "NoDocumentation" # TODO: what should be done, if there is an error? - # do you mean this is not an error? [a] + # do you mean this is not an error? [a] + # it is, but the current action is still "show_doc" - despite the error - maybe "blank" would be better? [l] ## set doclang to weblang, otherwise the default weblang from the config will be used for doclang - elif self.settings["Settings.Language"] in ["Settings.AvailableDocLanguages"]: + elif self.settings["Settings.Language"] in self.settings["Settings.AvailableDocLanguages"]: self.settings["Settings.DocLang"] = self.settings["Settings.Language"] # TODO: missing 'else'? diff --git a/pythonrewrite/scripts/userdocexport.sh b/pythonrewrite/scripts/userdocexport.sh index 4fa3acd..299df52 100755 --- a/pythonrewrite/scripts/userdocexport.sh +++ b/pythonrewrite/scripts/userdocexport.sh @@ -29,7 +29,7 @@ WIKI_HOST="https://systemausfall.org" # the trailing slash is important WIKI_URL=/trac/cryptobox/wiki/ -CBOX_CGI="?page=" +CBOX_CGI="/doc?page=" LANGUAGES="de en"