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


PHP SimpleSAML_Utilities::resolveURL方法代码示例

本文整理汇总了PHP中SimpleSAML_Utilities::resolveURL方法的典型用法代码示例。如果您正苦于以下问题:PHP SimpleSAML_Utilities::resolveURL方法的具体用法?PHP SimpleSAML_Utilities::resolveURL怎么用?PHP SimpleSAML_Utilities::resolveURL使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SimpleSAML_Utilities的用法示例。


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

示例1: showEntry

function showEntry($t, $metadata, $favourite = FALSE)
{
    $basequerystring = '?' . 'entityID=' . urlencode($t->data['entityID']) . '&' . 'return=' . urlencode($t->data['return']) . '&' . 'returnIDParam=' . urlencode($t->data['returnIDParam']) . '&idpentityid=';
    $extra = $favourite ? ' favourite' : '';
    $html = '<a class="metaentry' . $extra . '" href="' . $basequerystring . urlencode($metadata['entityid']) . '">';
    $html .= '' . htmlspecialchars(getTranslatedName($t, $metadata)) . '';
    #print_r($metadata['scopes']);
    // if (!empty($idpentry['description'])) {
    // 	$html .= '	<p>' . htmlspecialchars($t->t('idpdesc_' . $metadata['entityid'])) . '<br />';
    // }
    if (array_key_exists('icon', $metadata) && $metadata['icon'] !== NULL) {
        $iconUrl = SimpleSAML_Utilities::resolveURL($metadata['icon']);
        $html .= '<img alt="Icon for identity provider" class="entryicon" src="' . htmlspecialchars($iconUrl) . '" />';
    }
    // $html .= '<input id="preferredidp" type="submit" name="idp_' .
    // 	htmlspecialchars($metadata['entityid']) . '" value="' .
    // 	$t->t('select') . '" /></p>';
    $html .= '</a>';
    return $html;
}
开发者ID:ravi-sharma,项目名称:saml-sso-integration,代码行数:20,代码来源:disco-tpl.php

示例2: normalizeURL

 /**
  * Normalizes a URL to an absolute URL and validate it.
  *
  * In addition to resolving the URL, this function makes sure that it is
  * a link to a http or https site.
  *
  * @param string $url  The relative URL.
  * @return string  An absolute URL for the given relative URL.
  */
 public static function normalizeURL($url)
 {
     assert('is_string($url)');
     $url = SimpleSAML_Utilities::resolveURL($url, SimpleSAML_Utilities::selfURL());
     /* Verify that the URL is to a http or https site. */
     if (!preg_match('@^https?://@i', $url)) {
         throw new SimpleSAML_Error_Exception('Invalid URL: ' . $url);
     }
     return $url;
 }
开发者ID:shirlei,项目名称:simplesaml,代码行数:19,代码来源:Utilities.php

示例3: htmlspecialchars

    echo '<div class="preferredidp">';
    echo '	<img src="/' . $this->data['baseurlpath'] . 'resources/icons/experience/gtk-about.64x64.png" style="float: right" alt="' . $this->t('icon_prefered_idp') . '" />';
    if (array_key_exists('icon', $idpentry) && $idpentry['icon'] !== NULL) {
        $iconUrl = SimpleSAML_Utilities::resolveURL($idpentry['icon']);
        echo '<img style="float: left; margin: 1em; padding: 3px; border: 1px solid #999" src="' . htmlspecialchars($iconUrl) . '" />';
    }
    echo "\n" . '	<h3 style="margin-top: 8px">' . htmlspecialchars($this->t('idpname_' . $idpentry['entityid'])) . '</h3>';
    if (!empty($idpentry['description'])) {
        echo '	<p>' . htmlspecialchars($this->t('idpdesc_' . $idpentry['entityid'])) . '<br />';
    }
    echo '<input id="preferredidp" type="submit" name="idp_' . htmlspecialchars($idpentry['entityid']) . '" value="' . $this->t('select') . '" /></p>';
    echo '</div>';
}
foreach ($this->data['idplist'] as $idpentry) {
    if ($idpentry['entityid'] != $this->data['preferredidp']) {
        if (array_key_exists('icon', $idpentry) && $idpentry['icon'] !== NULL) {
            $iconUrl = SimpleSAML_Utilities::resolveURL($idpentry['icon']);
            echo '<img style="clear: both; float: left; margin: 1em; padding: 3px; border: 1px solid #999" src="' . htmlspecialchars($iconUrl) . '" />';
        }
        echo "\n" . '	<h3 style="margin-top: 8px">' . htmlspecialchars($this->t('idpname_' . $idpentry['entityid'])) . '</h3>';
        if (!empty($idpentry['description'])) {
            echo '	<p>' . htmlspecialchars($this->t('idpdesc_' . $idpentry['entityid'])) . '<br />';
        }
        echo '<input type="submit" name="idp_' . htmlspecialchars($idpentry['entityid']) . '" value="' . $this->t('select') . '" /></p>';
    }
}
?>
		</form>
		
<?php 
$this->includeAtTemplateBase('includes/footer.php');
开发者ID:filonuse,项目名称:fedlab,代码行数:31,代码来源:selectidp-links.php


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