本文整理汇总了PHP中Institution::findByWwwroot方法的典型用法代码示例。如果您正苦于以下问题:PHP Institution::findByWwwroot方法的具体用法?PHP Institution::findByWwwroot怎么用?PHP Institution::findByWwwroot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Institution
的用法示例。
在下文中一共展示了Institution::findByWwwroot方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dirname
define('PUBLIC', 1);
require dirname(dirname(dirname(__FILE__))) . '/init.php';
// If networking is turned off, it's safer to die immediately
if (!get_config('enablenetworking')) {
throw new AccessTotallyDeniedException(get_string('networkingdisabledonthissite', 'auth.xmlrpc'));
}
require_once get_config('docroot') . 'api/xmlrpc/client.php';
require_once get_config('docroot') . 'auth/xmlrpc/lib.php';
require_once get_config('libroot') . 'institution.php';
$token = param_variable('token');
$remotewwwroot = param_variable('idp');
$wantsurl = param_variable('wantsurl', '/');
$remoteurl = param_boolean('remoteurl');
$institution = new Institution();
try {
$institution->findByWwwroot($remotewwwroot);
} catch (ParamOutOfRangeException $e) {
throw new ParameterException(get_string('errnoxmlrpcwwwroot', 'auth', $remotewwwroot));
}
$instances = auth_get_auth_instances_for_wwwroot($remotewwwroot);
if (empty($instances)) {
throw new ParameterException(get_string('errnoauthinstances', 'auth', $remotewwwroot));
}
// If the user is already logged in as someone, log them out. That way, if
// XMLRPC authentication fails, the system isn't left looking stupid as it
// reports that the user couldn't log in while they actually are.
if ($USER->is_logged_in()) {
$USER->logout();
}
$SESSION->set('messages', array());
$rpcconfigured = false;