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


PHP SimpleSAML_Logger::critical方法代码示例

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


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

示例1: Exception

                $authlogattr = $config->getValue('statistics.authlogattr', null);
                if ($authlogattr && array_key_exists($authlogattr, $attributes)) {
                    SimpleSAML_Logger::stats('AUTH-login-radius OK ' . $attributes[$authlogattr][0]);
                } else {
                    SimpleSAML_Logger::stats('AUTH-login-radius OK');
                }
                SimpleSAML_Utilities::redirectTrustedURL($relaystate);
            case RADIUS_ACCESS_REJECT:
                SimpleSAML_Logger::info('AUTH - radius: ' . $_POST['username'] . ' failed to authenticate');
                throw new Exception('Radius authentication error: Bad credentials ');
                break;
            case RADIUS_ACCESS_CHALLENGE:
                SimpleSAML_Logger::critical('AUTH - radius: Challenge requested: ' . radius_strerror($radius));
                throw new Exception('Radius authentication error: Challenge requested');
                break;
            default:
                SimpleSAML_Logger::critical('AUTH  -radius: General radius error: ' . radius_strerror($radius));
                throw new Exception('Error during radius authentication: ' . radius_strerror($radius));
        }
    } catch (Exception $e) {
        $error = $e->getMessage();
    }
}
$t = new SimpleSAML_XHTML_Template($config, 'login.php', 'login');
$t->data['header'] = 'simpleSAMLphp: Enter username and password';
$t->data['relaystate'] = $relaystate;
$t->data['error'] = $error;
if (isset($error)) {
    $t->data['username'] = $_POST['username'];
}
$t->show();
开发者ID:shirlei,项目名称:simplesaml,代码行数:31,代码来源:login-radius.php

示例2: findTemplatePath

 /**
  * Find template path.
  *
  * This function locates the given template based on the template name. It will first search for the template in
  * the current theme directory, and then the default theme.
  *
  * The template name may be on the form <module name>:<template path>, in which case it will search for the
  * template file in the given module.
  *
  * @param string $template The relative path from the theme directory to the template file.
  *
  * @return string The absolute path to the template file.
  *
  * @throws Exception If the template file couldn't be found.
  */
 private function findTemplatePath($template)
 {
     assert('is_string($template)');
     $tmp = explode(':', $template, 2);
     if (count($tmp) === 2) {
         $templateModule = $tmp[0];
         $templateName = $tmp[1];
     } else {
         $templateModule = 'default';
         $templateName = $tmp[0];
     }
     $tmp = explode(':', $this->configuration->getString('theme.use', 'default'), 2);
     if (count($tmp) === 2) {
         $themeModule = $tmp[0];
         $themeName = $tmp[1];
     } else {
         $themeModule = null;
         $themeName = $tmp[0];
     }
     // first check the current theme
     if ($themeModule !== null) {
         // .../module/<themeModule>/themes/<themeName>/<templateModule>/<templateName>
         $filename = SimpleSAML_Module::getModuleDir($themeModule) . '/themes/' . $themeName . '/' . $templateModule . '/' . $templateName;
     } elseif ($templateModule !== 'default') {
         // .../module/<templateModule>/templates/<themeName>/<templateName>
         $filename = SimpleSAML_Module::getModuleDir($templateModule) . '/templates/' . $templateName;
     } else {
         // .../templates/<theme>/<templateName>
         $filename = $this->configuration->getPathValue('templatedir', 'templates/') . $templateName;
     }
     if (file_exists($filename)) {
         return $filename;
     }
     // not found in current theme
     SimpleSAML_Logger::debug($_SERVER['PHP_SELF'] . ' - Template: Could not find template file [' . $template . '] at [' . $filename . '] - now trying the base template');
     // try default theme
     if ($templateModule !== 'default') {
         // .../module/<templateModule>/templates/<templateName>
         $filename = SimpleSAML_Module::getModuleDir($templateModule) . '/templates/' . $templateName;
     } else {
         // .../templates/<templateName>
         $filename = $this->configuration->getPathValue('templatedir', 'templates/') . '/' . $templateName;
     }
     if (file_exists($filename)) {
         return $filename;
     }
     // not found in default template - log error and throw exception
     $error = 'Template: Could not find template file [' . $template . '] at [' . $filename . ']';
     SimpleSAML_Logger::critical($_SERVER['PHP_SELF'] . ' - ' . $error);
     throw new Exception($error);
 }
开发者ID:mrvanes,项目名称:simplesamlphp,代码行数:66,代码来源:Template.php

示例3: Exception

if (empty($userids)) {
    throw new Exception('Could not generate useridentifier for storing consent. Attribute [' . $userid_attributename . '] was not available.');
}
$userid = $userids[0];
// Get all SP metadata
$all_sp_metadata = $metadata->getList('saml20-sp-remote');
// Parse action, if any
$action = null;
$sp_entityid = null;
if (!empty($_GET['cv'])) {
    $sp_entityid = $_GET['cv'];
}
if (!empty($_GET['action'])) {
    $action = $_GET["action"];
}
SimpleSAML_Logger::critical('consentAdmin: sp: ' . $sp_entityid . ' action: ' . $action);
// Remove services, whitch have consent disabled
if (isset($idp_metadata['consent.disable'])) {
    foreach ($idp_metadata['consent.disable'] as $disable) {
        if (array_key_exists($disable, $all_sp_metadata)) {
            unset($all_sp_metadata[$disable]);
        }
    }
}
SimpleSAML_Logger::info('consentAdmin: ' . $idp_entityid);
// Calc correct source
$source = $idp_metadata['metadata-set'] . '|' . $idp_entityid;
// Parse consent config
$consent_storage = sspmod_consent_Store::parseStoreConfig($cA_config->getValue('consentadmin'));
// Calc correct user ID hash
$hashed_user_id = sspmod_consent_Auth_Process_Consent::getHashedUserID($userid, $source);
开发者ID:filonuse,项目名称:fedlab,代码行数:31,代码来源:consentAdmin.php

示例4: log

 /**
  * Logs with an arbitrary level.
  *
  * @param mixed $level
  * @param string $message
  * @param array $context
  * @return NULL
  */
 public function log($level, $message, array $context = array())
 {
     switch ($level) {
         case SimpleSAML_Logger::ALERT:
             SimpleSAML_Logger::alert($message);
             break;
         case SimpleSAML_Logger::CRIT:
             SimpleSAML_Logger::critical($message);
             break;
         case SimpleSAML_Logger::DEBUG:
             SimpleSAML_Logger::debug($message);
             break;
         case SimpleSAML_Logger::EMERG:
             SimpleSAML_Logger::emergency($message);
             break;
         case SimpleSAML_Logger::ERR:
             SimpleSAML_Logger::error($message);
             break;
         case SimpleSAML_Logger::INFO:
             SimpleSAML_Logger::info($message);
             break;
         case SimpleSAML_Logger::NOTICE:
             SimpleSAML_Logger::notice($message);
             break;
         case SimpleSAML_Logger::WARNING:
             SimpleSAML_Logger::warning($message);
     }
 }
开发者ID:Stony-Brook-University,项目名称:doitsbu,代码行数:36,代码来源:Logger.php

示例5: show

 /**
  * Show the template to the user.
  */
 public function show()
 {
     $filename = $this->configuration->getPathValue('templatedir') . $this->configuration->getValue('theme.use') . '/' . $this->template;
     if (!file_exists($filename)) {
         SimpleSAML_Logger::warning($_SERVER['PHP_SELF'] . ' - Template: Could not find template file [' . $this->template . '] at [' . $filename . '] - now trying the base template');
         $filename = $this->configuration->getPathValue('templatedir') . $this->configuration->getValue('theme.base') . '/' . $this->template;
         if (!file_exists($filename)) {
             SimpleSAML_Logger::critical($_SERVER['PHP_SELF'] . ' - Template: Could not find template file [' . $this->template . '] at [' . $filename . ']');
             echo 'Fatal error: Could not find template file [' . $this->template . '] at [' . $filename . ']';
             exit(0);
         }
     }
     require_once $filename;
 }
开发者ID:stefanotirati,项目名称:moodle-google-apps,代码行数:17,代码来源:Template.php

示例6: critical

 /**
  * Critical conditions.
  *
  * Example: Application component unavailable, unexpected exception.
  *
  * @param string $message
  * @param array $context
  * @return NULL
  */
 public function critical($message, array $context = array())
 {
     SimpleSAML_Logger::critical($message . var_export($context, TRUE));
 }
开发者ID:danielkjfrog,项目名称:docker,代码行数:13,代码来源:Logger.php


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