From 7f9c7361161fe508a0b9a14cd9a83f1b0eaaaf16 Mon Sep 17 00:00:00 2001 From: age Date: Wed, 6 Sep 2006 07:14:27 +0000 Subject: [PATCH] * removed hardcoded doclangs * truly removed '?action' * some RFC comments --- pythonrewrite/bin2/CryptoBoxWebserverSettings.py | 3 ++- pythonrewrite/bin2/CryptoBoxWebserverSites.py | 9 +++++---- pythonrewrite/scripts/userdocexport.sh | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/pythonrewrite/bin2/CryptoBoxWebserverSettings.py b/pythonrewrite/bin2/CryptoBoxWebserverSettings.py index 0524035..21c92cf 100644 --- a/pythonrewrite/bin2/CryptoBoxWebserverSettings.py +++ b/pythonrewrite/bin2/CryptoBoxWebserverSettings.py @@ -11,7 +11,8 @@ class CryptoBoxWebserverSettings: #TODO: this is nessessary since the last config split in different sections ## 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] + ## 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] 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 aa991de..a09ee4a 100755 --- a/pythonrewrite/bin2/CryptoBoxWebserverSites.py +++ b/pythonrewrite/bin2/CryptoBoxWebserverSites.py @@ -47,6 +47,7 @@ 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] niceparams = { 'weblang': ["Settings.Language", self.settings["Settings.AvailableLanguages"]], 'loglevel': ["Log.Level", ('','info', 'warn', 'debug', 'error')], @@ -62,6 +63,7 @@ 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[niceparams[nicekey][0]] = evilparams[nicekey] #self.log.warn(niceparams[nicekey][0]) #self.log.warn(evilparams[nicekey]) @@ -137,10 +139,9 @@ class CryptoBoxWebserverSites(CryptoBox.CryptoBoxProps, CryptoBoxWebserverSettin # TODO: add "doclang" - it is selected by each link in the doc pages + # according to scripts/docexport it's weblang [a] def doc(self,page="",weblang=""): '''prints the offline wikipage - - TODO: "action" is unnessessary, remove it from all html files in doc/html/[de|en]/* ''' self.__prepare("show_doc") # TODO: single pagenames should be sanitized @@ -154,9 +155,9 @@ 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] ## set doclang to weblang, otherwise the default weblang from the config will be used for doclang - # TODO: hard coded languages? - elif self.settings["Settings.Language"] in ("en","de"): + elif self.settings["Settings.Language"] in ["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 192c296..4fa3acd 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="?action=doc\&page=" +CBOX_CGI="?page=" LANGUAGES="de en"