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