@@ -1119,14 +1119,7 @@ function update($event_name, $data) {
11191119 }
11201120 */
11211121
1122- //* Generate Let's Encrypt SSL certificat
1123- if ($ data ['new ' ]['ssl ' ] == 'y ' && $ data ['new ' ]['ssl_letsencrypt ' ] == 'y ' && ( // ssl and let's encrypt is active
1124- ($ data ['old ' ]['ssl ' ] == 'n ' || $ data ['old ' ]['ssl_letsencrypt ' ] == 'n ' ) // we have new let's encrypt configuration
1125- || ($ data ['old ' ]['domain ' ] != $ data ['new ' ]['domain ' ]) // we have domain update
1126- || ($ data ['old ' ]['subdomain ' ] != $ data ['new ' ]['subdomain ' ]) // we have new or update on "auto" subdomain
1127- || ($ data ['new ' ]['type ' ] == 'subdomain ' ) // we have new or update on subdomain
1128- || ($ data ['old ' ]['type ' ] == 'alias ' || $ data ['new ' ]['type ' ] == 'alias ' ) // we have new or update on aliasdomain
1129- )) {
1122+ if ($ data ['new ' ]['ssl ' ] == 'y ' && $ data ['new ' ]['ssl_letsencrypt ' ] == 'y ' ) {
11301123 if (substr ($ domain , 0 , 2 ) === '*. ' ) {
11311124 // wildcard domain not yet supported by letsencrypt!
11321125 $ app ->log ('Wildcard domains not yet supported by letsencrypt, so changing ' . $ domain . ' to ' . substr ($ domain , 2 ), LOGLEVEL_WARN );
@@ -1135,7 +1128,16 @@ function update($event_name, $data) {
11351128
11361129 $ data ['new ' ]['ssl_domain ' ] = $ domain ;
11371130 $ vhost_data ['ssl_domain ' ] = $ domain ;
1131+ }
11381132
1133+ //* Generate Let's Encrypt SSL certificat
1134+ if ($ data ['new ' ]['ssl ' ] == 'y ' && $ data ['new ' ]['ssl_letsencrypt ' ] == 'y ' && ( // ssl and let's encrypt is active
1135+ ($ data ['old ' ]['ssl ' ] == 'n ' || $ data ['old ' ]['ssl_letsencrypt ' ] == 'n ' ) // we have new let's encrypt configuration
1136+ || ($ data ['old ' ]['domain ' ] != $ data ['new ' ]['domain ' ]) // we have domain update
1137+ || ($ data ['old ' ]['subdomain ' ] != $ data ['new ' ]['subdomain ' ]) // we have new or update on "auto" subdomain
1138+ || ($ data ['new ' ]['type ' ] == 'subdomain ' ) // we have new or update on subdomain
1139+ || ($ data ['old ' ]['type ' ] == 'alias ' || $ data ['new ' ]['type ' ] == 'alias ' ) // we have new or update on aliasdomain
1140+ )) {
11391141 // default values
11401142 $ temp_domains = array ();
11411143 $ lddomain = $ domain ;
0 commit comments