当前位置: 首页>>代码示例>>PHP>>正文


PHP lookup_cert函数代码示例

本文整理汇总了PHP中lookup_cert函数的典型用法代码示例。如果您正苦于以下问题:PHP lookup_cert函数的具体用法?PHP lookup_cert怎么用?PHP lookup_cert使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了lookup_cert函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: gettext

         $input_errors[] = gettext("Please select a valid Key Length.");
     }
     if ($pconfig['certmethod'] != "external" && !in_array($pconfig["digest_alg"], $openssl_digest_algs)) {
         $input_errors[] = gettext("Please select a valid Digest Algorithm.");
     }
     if ($pconfig['certmethod'] == "external" && isset($pconfig["csr_keylen"]) && !in_array($pconfig["csr_keylen"], $cert_keylens)) {
         $input_errors[] = gettext("Please select a valid Key Length.");
     }
     if ($pconfig['certmethod'] == "external" && !in_array($pconfig["csr_digest_alg"], $openssl_digest_algs)) {
         $input_errors[] = gettext("Please select a valid Digest Algorithm.");
     }
 }
 /* save modifications */
 if (count($input_errors) == 0) {
     if ($pconfig['certmethod'] == "existing") {
         $cert = lookup_cert($pconfig['certref']);
         if ($cert && !empty($userid)) {
             $a_user[$userid]['cert'][] = $cert['refid'];
         }
     } else {
         $cert = array();
         $cert['refid'] = uniqid();
         if (isset($id) && $a_cert[$id]) {
             $cert = $a_cert[$id];
         }
         $cert['descr'] = $pconfig['descr'];
         $old_err_level = error_reporting(0);
         /* otherwise openssl_ functions throw warings directly to a page screwing menu tab */
         if ($pconfig['certmethod'] == "import") {
             cert_import($cert, $pconfig['cert'], $pconfig['key']);
         }
开发者ID:paudam,项目名称:opnsense-core,代码行数:31,代码来源:system_certmanager.php

示例2: build_cert_table

function build_cert_table()
{
    global $a_user, $id;
    $certhtml = '<div class="table-responsive">';
    $certhtml .= '<table class="table table-striped table-hover table-condensed">';
    $certhtml .= '<thead>';
    $certhtml .= '<tr>';
    $certhtml .= '<th>' . gettext('Name') . '</th>';
    $certhtml .= '<th>' . gettext('CA') . '</th>';
    $certhtml .= '<th></th>';
    $certhtml .= '</tr>';
    $certhtml .= '</thead>';
    $certhtml .= '<tbody>';
    $a_cert = $a_user[$id]['cert'];
    if (is_array($a_cert)) {
        $i = 0;
        foreach ($a_cert as $certref) {
            $cert = lookup_cert($certref);
            $ca = lookup_ca($cert['caref']);
            $revokedstr = is_cert_revoked($cert) ? '<b> Revoked</b>' : '';
            $certhtml .= '<tr>';
            $certhtml .= '<td>' . htmlspecialchars($cert['descr']) . $revokedstr . '</td>';
            $certhtml .= '<td>' . htmlspecialchars($ca['descr']) . '</td>';
            $certhtml .= '<td>';
            $certhtml .= '<a id="delcert' . $i . '" class="fa fa-trash no-confirm icon-pointer" title="';
            $certhtml .= gettext('Remove this certificate association? (Certificate will not be deleted)') . '"></a>';
            $certhtml .= '</td>';
            $certhtml .= '</tr>';
            $i++;
        }
    }
    $certhtml .= '</tbody>';
    $certhtml .= '</table>';
    $certhtml .= '</div>';
    $certhtml .= '<nav class="action-buttons">';
    $certhtml .= '<a href="system_certmanager.php?act=new&amp;userid=' . $id . '" class="btn btn-success">' . gettext("Add") . '</a>';
    $certhtml .= '</nav>';
    return $certhtml;
}
开发者ID:sjourdois,项目名称:pfsense,代码行数:39,代码来源:system_usermanager.php

示例3: gettext

                                    <td width="45%" class="listhdrr"><?php 
        echo gettext("Name");
        ?>
</td>
                                    <td width="45%" class="listhdrr"><?php 
        echo gettext("CA");
        ?>
</td>
                                    <td class="list"></td>
                                </tr>
				<?php 
        $a_cert = $a_user[$id]['cert'];
        if (is_array($a_cert)) {
            $i = 0;
            foreach ($a_cert as $certref) {
                $cert = lookup_cert($certref);
                $ca = lookup_ca($cert['caref']);
                ?>
                        <tr>
                            <td class="listlr">
                                <?php 
                echo htmlspecialchars($cert['descr']);
                ?>
				<?php 
                if (is_cert_revoked($cert)) {
                    ?>
                    (<b>Revoked</b>)
				<?php 
                }
                ?>
                            </td>
开发者ID:karawan,项目名称:core,代码行数:31,代码来源:system_usermanager.php

示例4: get_frontend_acls

					$acls = get_frontend_acls($frontend);
					$isaclset = "";
					foreach ($acls as $acl) {
						$isaclset .= "&#10;" . htmlspecialchars($acl['descr']);
					}
					if ($isaclset) 
						echo "<img src=\"$img_acl\" title=\"" . gettext("acl's used") . ": {$isaclset}\" border=\"0\" />";
						
					if (get_frontend_uses_ssl($frontend)) {
						$cert = lookup_cert($frontend['ssloffloadcert']);
						$descr = htmlspecialchars($cert['descr']);
						if (is_array($frontend['ha_certificates']) && is_array($frontend['ha_certificates']['item'])) {
							$certs = $frontend['ha_certificates']['item'];
							if (count($certs) > 0){
								foreach($certs as $certitem){
									$cert = lookup_cert($certitem['ssl_certificate']);
									$descr .= "\n".htmlspecialchars($cert['descr']);
								}
							}
						}
						echo '<img src="'.$img_cert.'" title="SSL offloading cert: '.$descr.'" alt="SSL offloading" border="0" height="16" width="16" />';
					}
					
					$isadvset = "";
					if ($frontend['advanced_bind']) $isadvset .= "Advanced bind: ".htmlspecialchars($frontend['advanced_bind'])."\r\n";
					if ($frontend['advanced']) $isadvset .= "Advanced pass thru setting used\r\n";
					if ($isadvset)
						echo "<img src=\"$img_adv\" title=\"" . gettext("Advanced settings set") . ": {$isadvset}\" border=\"0\" />";
					
					$backend_serverpool_hint = "";
					$backend_serverpool = $frontend['backend_serverpool'];
开发者ID:randyqx,项目名称:pfsense-packages,代码行数:31,代码来源:haproxy_listeners.php

示例5: array

        continue;
    }
    $ras_user = array();
    $ras_certs = array();
    if (stripos($server['mode'], "server") === false) {
        continue;
    }
    if (($server['mode'] == "server_tls_user") && ($server['authmode'] == "Local Database")) {
        foreach ($a_user as $uindex => $user) {
            if (!is_array($user['cert'])) {
                continue;
            }
            foreach ($user['cert'] as $cindex => $cert) {
                // If $cert is not an array, it's a certref not a cert.
                if (!is_array($cert)) {
                    $cert = lookup_cert($cert);
                }

                if ($cert['caref'] != $server['caref']) {
                    continue;
                }
                $ras_userent = array();
                $ras_userent['uindex'] = $uindex;
                $ras_userent['cindex'] = $cindex;
                $ras_userent['name'] = $user['name'];
                $ras_userent['certname'] = $cert['descr'];
                $ras_user[] = $ras_userent;
            }
        }
    } elseif (($server['mode'] == "server_tls") || (($server['mode'] == "server_tls_user") && ($server['authmode'] != "Local Database"))) {
        foreach ($a_cert as $cindex => $cert) {
开发者ID:Toudix,项目名称:core,代码行数:31,代码来源:vpn_openvpn_export.php


注:本文中的lookup_cert函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。