]> www.vanbest.org Git - motioneye-debian/commitdiff
admin password change now triggers a reboot (if reboot enabled)
authorCalin Crisan <ccrisan@gmail.com>
Tue, 24 Feb 2015 19:50:22 +0000 (21:50 +0200)
committerCalin Crisan <ccrisan@gmail.com>
Tue, 24 Feb 2015 19:50:22 +0000 (21:50 +0200)
src/handlers.py
src/wifictl.py
templates/main.html

index 9d617b404912f768543267ab7bc09cfe8c45a900..767c6aa5b275985794d734bd4a16a4e6c1198592 100644 (file)
@@ -295,6 +295,7 @@ class ConfigHandler(BaseHandler):
 
             additional_configs = config.get_additional_structure(camera=False)[1]           
             reboot_config_names = [('@_' + c['name']) for c in additional_configs.values() if c.get('reboot')]
+            reboot_config_names.append('@admin_password')
             reboot = bool([k for k in reboot_config_names if old_main_config.get(k) != main_config.get(k)])
 
             config.set_main(main_config)
@@ -305,8 +306,8 @@ class ConfigHandler(BaseHandler):
                 logging.debug('admin credentials changed, reload needed')
                 
                 reload = True
-            
-            if reboot:
+
+            if reboot and settings.ENABLE_REBOOT:
                 logging.debug('system settings changed, reboot needed')
                 
                 reboot = True
index dd7dd9f1ca0461b4f57b578eb6738f651cf0eda2..ad3f8e6721e95f8f011947fc2a95c0037b4020e8 100644 (file)
@@ -72,14 +72,20 @@ def _get_wifi_settings():
     if ssid:
         logging.debug('wifi is enabled (ssid = "%s")' % ssid)
     
+        return {
+            'wifiEnabled': True,
+            'wifiNetworkName': ssid,
+            'wifiNetworkKey': psk
+        }
+
     else:
         logging.debug('wifi is disabled')
 
-    return {
-        'wifiEnabled': False,
-        'wifiNetworkName': ssid,
-        'wifiNetworkKey': psk
-    }
+        return {
+            'wifiEnabled': False,
+            'wifiNetworkName': ssid,
+            'wifiNetworkKey': psk
+        }
 
 
 def _set_wifi_settings(s):
@@ -180,7 +186,6 @@ def network():
     }
 
 
-
 @additional_config
 def wifiEnabled():
     if not WPA_SUPPLICANT_CONF:
index b7119184f900fbc1031f65217f7a2bec5412fc46..75466b5cca283599c137d50ec9a598068684e964 100644 (file)
                         <td class="settings-item-value"><input type="text" class="styled general main-config" id="adminUsernameEntry" readonly="readonly"></td>
                         <td><span class="help-mark" title="the username supplied to configure motionEye">?</span></td>
                     </tr>
-                    <tr class="settings-item" strip="true">
+                    <tr class="settings-item" strip="true" reboot="true">
                         <td class="settings-item-label"><span class="settings-item-label">Administrator Password</span></td>
                         <td class="settings-item-value"><input type="password" class="styled general main-config" id="adminPasswordEntry"></td>
                         <td><span class="help-mark" title="administrator's password">?</span></td>