add password strength check for manual mailboxes
Bernd Wurst

Bernd Wurst commited on 2019-04-10 12:28:57
Zeige 1 geänderte Dateien mit 8 Einfügungen und 0 Löschungen.

... ...
@@ -85,6 +85,10 @@ function change_mailaccount($id, $arr)
85 85
     }
86 86
 
87 87
     if (isset($arr['password'])) {
88
+        $result = strong_password($arr['password']);
89
+        if ($result !== true) {
90
+            system_failure("Unsicheres Passwort: ".$result);
91
+        }
88 92
         $encpw = encrypt_mail_password($arr['password']);
89 93
         array_push($conditions, "`password`=:password");
90 94
         $values[":password"] = $encpw;
... ...
@@ -135,6 +139,10 @@ function create_mailaccount($arr)
135 139
 
136 140
 
137 141
     if (isset($arr['password'])) {
142
+        $result = strong_password($arr['password']);
143
+        if ($result !== true) {
144
+            system_failure("Unsicheres Passwort: ".$result);
145
+        }
138 146
         $values[':password'] = encrypt_mail_password($arr['password']);
139 147
     }
140 148
 
141 149