fixed: default form was never visible (no return value specified)

This commit is contained in:
lars 2007-01-20 19:33:56 +00:00
parent 1714b4ded9
commit c18cec2107

View file

@ -49,11 +49,14 @@ class network(cryptobox.plugins.base.CryptoBoxPlugin):
if redirected == "1":
self.cbox.log.debug("network plugin: redirected")
return "form_network"
## check possible actions
if store is None:
pass
## request for IP change?
## no action was requested -> just show the form
self.cbox.log.debug("network plugin: show form")
self.__prepare_form_data()
return "form_network"
elif store == "set_ip":
## change ip address
self.cbox.log.debug("network plugin: changing IP")
try:
for ip_in in (ip1, ip2, ip3, ip4):
@ -76,6 +79,7 @@ class network(cryptobox.plugins.base.CryptoBoxPlugin):
self.cbox.prefs.plugin_conf.write()
except IOError:
self.cbox.log.warn("Could not write plugin configuration")
self.__prepare_form_data()
return "form_network"
else:
self.cbox.log.warn("failed to change IP address to: %s" % new_ip)
@ -87,8 +91,8 @@ class network(cryptobox.plugins.base.CryptoBoxPlugin):
## TODO: route add default gw ...
pass
else:
self.cbox.log.debug("network plugin: show form")
## just show the form
## invalid action was requested -> show default form
self.cbox.log.debug("network plugin: invalid request (%s)" % str(store))
self.__prepare_form_data()
return "form_network"