本文整理匯總了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;