Roxen.git / server / base_server / roxen.pike

version» Context lines:

Roxen.git/server/base_server/roxen.pike:2485:    res += ({ "<td colspan='2'><b>" +    LOC_C(0, "Invalid certificate") +    ".</b>" });    } else {    mapping(Standards.ASN1.Types.Identifier:string) dn =    parse_dn(tbs->subject);       string tmp;    if ((tmp = dn[Standards.PKCS.Identifiers.at_ids.commonName])) {    res += ({ -  sprintf("<td style='white-space:nowrap'>%s</td>" +  sprintf("<td class='prewrap'>%s</td>"    "<td><b><tt>%s</tt></b>",    LOC_C(0, "Common Name"),    Roxen.html_encode_string(tmp)),    });    } else {    res += ({ "<td colspan='2'>" });    }       res[-1] += sprintf(" (%s, " + LOC_C(0, "%d bits") + ")</td>",    Roxen.html_encode_string(private_key->name()),    private_key->key_size());       if (tmp = dn[Standards.PKCS.Identifiers.at_ids.organizationName]) {    if (dn[Standards.PKCS.Identifiers.at_ids.organizationUnitName]) {    tmp += "/" +    dn[Standards.PKCS.Identifiers.at_ids.organizationUnitName];    }    res += ({ -  sprintf("<td style='white-space:nowrap'>%s</td><td>%s</td>", +  sprintf("<td class='prewrap'>%s</td><td>%s</td>",    LOC_C(0, "Issued To"),    Roxen.html_encode_string(tmp)),    });    } else if (tmp = dn[Standards.PKCS.Identifiers.at_ids.organizationUnitName]) {    res += ({ -  sprintf("<td style='white-space:nowrap'>%s</td><td>%s</td>", +  sprintf("<td class='prewrap'>%s</td><td>%s</td>",    LOC_C(0, "Issued To"),    Roxen.html_encode_string(tmp)),    });    }       if (tbs->issuer->get_der() == tbs->subject->get_der()) {    res += ({ -  sprintf("<td style='white-space:nowrap'>" + +  sprintf("<td class='prewrap'>" +    LOC_C(0, "Issued By") +    "</td><td>%s</td>",    LOC_C(0, "Self-signed"))    });    } else {    dn = parse_dn(tbs->issuer);    tmp = dn[Standards.PKCS.Identifiers.at_ids.organizationName];    if (dn[Standards.PKCS.Identifiers.at_ids.organizationUnitName]) {    tmp = (tmp?(tmp + "/"):"") +    dn[Standards.PKCS.Identifiers.at_ids.organizationUnitName];
Roxen.git/server/base_server/roxen.pike:2540:    string tmp2 = dn[Standards.PKCS.Identifiers.at_ids.commonName];    if (tmp2) {    if (tmp) {    tmp = tmp2 + " (" + tmp + ")";    } else {    tmp = tmp2;    }    }    if (tmp) {    res += ({ -  sprintf("<td style='white-space:nowrap;vertical-align:top'>" + +  sprintf("<td class='valign-top prewrap'>" +    LOC_C(0, "Issued By") +    "</td><td>%s</td>",    Roxen.html_encode_string(tmp)),    });    }    }       tmp = Roxen.html_encode_string(Calendar.Second(tbs->not_after)->    format_time());    if (tbs->not_after < time(1)) {    // Already expired.    res += ({    sprintf("<td>%s</td>" -  "<td><font color='&usr.warncolor;'>%s</font>\n" -  "<img src='&usr.err-3;' /></td>", +  "<td><span class='notify error inline'>%s</span></td>",    LOC_C(0, "Expired"),    tmp),    });    } else if (tbs->not_after < time(1) + (3600 * 24 * 30)) {    // Expires within 30 days.    res += ({    sprintf("<td>%s</td>" -  "<td><font color='&usr.warncolor;'>%s</font>\n" -  "<img src='&usr.err-2;' /></td>", +  "<td><span class='notify warn inline'>%s</span></td>",    LOC_C(0, "Expires"),    tmp),    });    } else {    res += ({    sprintf("<td>%s</td><td>%s</td>", LOC_C(0, "Expires"), tmp),    });    }       mapping keypair_metadata = CertDB.get_keypair_metadata(keypair_id);       array(string) paths =    keypair_metadata->certs->pem_path +    ({ keypair_metadata->key->pem_path });    paths = Array.uniq(paths);    paths = replace(paths, 0, "__LOST__");    paths = map(paths, lfile_path);    res += ({ -  sprintf("<td style='vertical-align:top'>%s</td><td>%s</td>", +  sprintf("<td class='valign-top'>%s</td><td>%s</td>",    LOC_C(0, "Path(s)"),    map(paths, lambda(string p) {    if (p)    return "<tt>" + Roxen.html_encode_string(p) + "</tt>";    else    return -  "<font color='&usr.warncolor;'>" + +  "<span class='notify warn inline'>" +    LOC_C(0, "Lost file") + -  "</font>"; +  "</span>";    }) * "<br/>")    });    }    -  return res; +  int n; +  return map(res, lambda (string row) { +  if (n++ > 0) { +  return "<td></td>" + row;    }    -  +  return row; +  }); +  } +     string render_form(RequestID id, void|mapping additional_args) {    array(string) current = map(query(), _name); -  string res = "<table width='100%'>\n"; +  string res = "<table>\n";    foreach( get_choice_list(); int i; mixed elem ) {    if (i != 0) {    res += "<tr><td colspan='3'><hr/></td></tr>\n";    }    mapping m = ([    "type": "checkbox",    "name": path(),    "value": _name(elem),    ]);    if(has_value(current, m->value)) {    m->checked="checked";    current -= ({ m->value });    }    array(string) el_rows = render_element(elem); -  res += sprintf("<tr><td rowspan='%d'>%s</td>" +  res += sprintf("<tr><td class='valign-top'>%s</td>"    "%s"    "</tr>\n", -  sizeof(el_rows), +  // sizeof(el_rows),    Roxen.make_tag( "input", m),    el_rows[0]);    foreach(el_rows[1..], string row) {    res += sprintf("<tr>%s</tr>", row);    }    }    // Make an entry for the current values if they're not in the list,    // to ensure that the value doesn't change as a side-effect by    // another change.    foreach(current, string value) {