tbrehm
2013-01-31 90489cf59ab961814da4b417e070873372450a3c
Fixed: FS#2629 - SSL Key field empty after upgrade from 3.0.4 to 3.0.5
1 files modified
12 ■■■■■ changed files
server/plugins-available/apache2_plugin.inc.php 12 ●●●●● patch | view | raw | blame | history
server/plugins-available/apache2_plugin.inc.php
@@ -243,7 +243,17 @@
            if(trim($data["new"]["ssl_request"]) != '') $app->system->file_put_contents($csr_file,$data["new"]["ssl_request"]);
            if(trim($data["new"]["ssl_cert"]) != '') $app->system->file_put_contents($crt_file,$data["new"]["ssl_cert"]);
            if(trim($data["new"]["ssl_bundle"]) != '') $app->system->file_put_contents($bundle_file,$data["new"]["ssl_bundle"]);
            if(trim($data["new"]["ssl_key"]) != '') $app->system->file_put_contents($key_file2,$data["new"]["ssl_key"]);
            //* Write the key file, if field is empty then import the key into the db
            if(trim($data["new"]["ssl_key"]) != '') {
                $app->system->file_put_contents($key_file2,$data["new"]["ssl_key"]);
            } else {
                $ssl_key2 = $app->db->quote($app->system->file_get_contents($key_file2));
                /* Update the DB of the (local) Server */
                $app->db->query("UPDATE web_domain SET ssl_key = '$ssl_key2' WHERE domain = '".$data['new']['domain']."'");
                /* Update also the master-DB of the Server-Farm */
                $app->dbmaster->query("UPDATE web_domain SET ssl_key = '$ssl_key2' WHERE domain = '".$data['new']['domain']."'");
            }
            
            /* Update the DB of the (local) Server */
            $app->db->query("UPDATE web_domain SET ssl_action = '' WHERE domain = '".$data['new']['domain']."'");