Browse code

Ersetze die Zertifikats-infos bim Update

Bernd Wurst authored on 28/01/2013 15:25:40
Showing 1 changed files
... ...
@@ -204,6 +204,8 @@ function refresh_cert($id, $info, $cert, $key = NULL)
204 204
   $id = (int) $id;
205 205
   $oldcert = cert_details($id);
206 206
   $cert = mysql_real_escape_string($cert);
207
+  $subject = mysql_real_escape_string(filter_input_general($info['subject']));
208
+  $cn = mysql_real_escape_string(filter_input_general($info['cn']));
207 209
   
208 210
   $valid_from = mysql_real_escape_string($info['valid_from']);
209 211
   $valid_until = mysql_real_escape_string($info['valid_until']);
... ...
@@ -213,7 +215,7 @@ function refresh_cert($id, $info, $cert, $key = NULL)
213 215
     openssl_pkey_export($key, $key);
214 216
     $keyop = ", `key`='".mysql_real_escape_string($key)."'";
215 217
   }
216
-  db_query("UPDATE vhosts.certs SET cert='{$cert}'{$keyop}, valid_from='{$valid_from}', valid_until='{$valid_until}', chain={$chain} WHERE id={$id} LIMIT 1");
218
+  db_query("UPDATE vhosts.certs SET subject='{$subject}', cn='{$cn}', cert='{$cert}'{$keyop}, valid_from='{$valid_from}', valid_until='{$valid_until}', chain={$chain} WHERE id={$id} LIMIT 1");
217 219
 }
218 220
 
219 221