bug 893: adjusted preg_match and cert duration check
bug 893: fixed query for check_certificates
bug 893: replaced some * by 1 in select statments
bug 893: fixed check of certificate retension time
bug 893: Fix type in table name