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


PHP SimpleSAML_Utilities::getFirstPathElement方法代码示例

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


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

示例1: getBaseURL

 public function getBaseURL()
 {
     if (preg_match('/^\\*(.*)$/', $this->getValue('baseurlpath', ''), $matches)) {
         return SimpleSAML_Utilities::getFirstPathElement(false) . $matches[1];
     }
     return $this->getValue('baseurlpath', '');
 }
开发者ID:stefanotirati,项目名称:moodle-google-apps,代码行数:7,代码来源:Configuration.php

示例2: array

<?php

require_once '../_include.php';
/* Load simpleSAMLphp, configuration */
$config = SimpleSAML_Configuration::getInstance();
$session = SimpleSAML_Session::getInstance();
/* Check if valid local session exists.. */
SimpleSAML_Utilities::requireAdmin();
$attributes = array();
$attributes['HTTP_HOST'] = array($_SERVER['HTTP_HOST']);
$attributes['HTTPS'] = array($_SERVER['HTTPS']);
$attributes['SERVER_PROTOCOL'] = array($_SERVER['SERVER_PROTOCOL']);
$attributes['SERVER_PORT'] = array($_SERVER['SERVER_PORT']);
$attributes['Utilities_getBaseURL()'] = array(SimpleSAML_Utilities::getBaseURL());
$attributes['Utilities_getSelfHost()'] = array(SimpleSAML_Utilities::getSelfHost());
$attributes['Utilities_selfURLhost()'] = array(SimpleSAML_Utilities::selfURLhost());
$attributes['Utilities_selfURLNoQuery()'] = array(SimpleSAML_Utilities::selfURLNoQuery());
$attributes['Utilities_getSelfHostWithPath()'] = array(SimpleSAML_Utilities::getSelfHostWithPath());
$attributes['Utilities_getFirstPathElement()'] = array(SimpleSAML_Utilities::getFirstPathElement());
$attributes['Utilities_selfURL()'] = array(SimpleSAML_Utilities::selfURL());
$et = new SimpleSAML_XHTML_Template($config, 'status.php');
$et->data['header'] = '{status:header_diagnostics}';
$et->data['remaining'] = 'na';
$et->data['attributes'] = $attributes;
$et->data['valid'] = 'na';
$et->data['logout'] = null;
$et->show();
开发者ID:danielkjfrog,项目名称:docker,代码行数:27,代码来源:hostnames.php

示例3: getBaseURL

 /**
  * Retrieve the absolute path of the simpleSAMLphp installation,
  * relative to the root of the website.
  *
  * For example: simplesaml/
  *
  * The path will always end with a '/' and never have a leading slash.
  *
  * @return string  The absolute path relative to the root of the website.
  */
 public function getBaseURL()
 {
     $baseURL = $this->getString('baseurlpath', 'simplesaml/');
     if (preg_match('/^\\*(.*)$/D', $baseURL, $matches)) {
         /* deprecated behaviour, will be removed in the future */
         return SimpleSAML_Utilities::getFirstPathElement(false) . $matches[1];
     }
     if (preg_match('#^https?://[^/]*/(.*)$#', $baseURL, $matches)) {
         /* we have a full url, we need to strip the path */
         return $matches[1];
     } elseif ($baseURL === '' || $baseURL === '/') {
         /* Root directory of site. */
         return '';
     } elseif (preg_match('#^/?([^/]?.*/)#D', $baseURL, $matches)) {
         /* local path only */
         return $matches[1];
     } else {
         /* invalid format */
         throw new SimpleSAML_Error_Exception('Incorrect format for option \'baseurlpath\'. Value is: "' . $this->getString('baseurlpath', 'simplesaml/') . '". Valid format is in the form' . ' [(http|https)://(hostname|fqdn)[:port]]/[path/to/simplesaml/].');
     }
 }
开发者ID:Stony-Brook-University,项目名称:doitsbu,代码行数:31,代码来源:Configuration.php

示例4: SimpleSAML_Error_BadRequest

}
if (!array_key_exists('token', $_REQUEST)) {
    throw new SimpleSAML_Error_BadRequest('Missing authToken.');
}
$token = $_REQUEST['token'];
if ($token !== $authTokenContactsSP) {
    throw new SimpleSAML_Error_Exception('Invalid AuthToken');
}
$ldapconfig = SimpleSAML_Configuration::getConfig('config-login-feide.php');
$ldapStatusConfig = SimpleSAML_Configuration::getConfig('module_ldapstatus.php');
$debug = $ldapconfig->getValue('ldapDebug', FALSE);
$orgs = $ldapconfig->getValue('organizations');
$locationTemplate = $ldapconfig->getValue('locationTemplate');
$isAdmin = FALSE;
$secretURL = NULL;
$ignore = '';
if (array_key_exists('ignore', $_REQUEST)) {
    $ignore = '&ignore=' . $_REQUEST['ignore'];
}
$secretKey = sha1('ldapstatus|' . SimpleSAML_Utilities::getSecretSalt() . '|hobbit');
$secretURL = SimpleSAML_Utilities::addURLparameter(SimpleSAML_Utilities::selfURLNoQuery(), array('key' => $secretKey));
function generateSecret($salt, $orgtest)
{
    $secretKey = sha1('ldapstatus|' . $salt . '|' . $orgtest);
    return $secretKey;
}
header('Content-Type: text/plain');
foreach ($orgs as $orgkey => $org) {
    $url = SimpleSAML_Utilities::addURLparameter(SimpleSAML_Utilities::selfURLhost() . SimpleSAML_Utilities::getFirstPathElement() . '/module.php/ldapstatus/', array('orgtest' => $orgkey, 'output' => 'text', 'key' => generateSecret(SimpleSAML_Utilities::getSecretSalt(), $orgkey)));
    echo "0.0.0.0 " . $orgkey . " # noconn  feidesjekk:" . $url . $ignore . ";OOOKKK\n";
}
开发者ID:hukumonline,项目名称:yii,代码行数:31,代码来源:hobbit.php


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