webservice MDL-17135 do not check if ws authentication plugin is enabled for the ws token method, it is only useful for username/password method.

This commit is contained in:
jerome mouneyrac 2010-02-01 03:38:28 +00:00
parent 83d50b79cd
commit 1839e2f094

View File

@ -129,17 +129,18 @@ abstract class webservice_server implements webservice_server_interface {
throw new coding_exception('Cookies must be disabled in WS servers!');
}
if (!is_enabled_auth('webservice')) {
throw new webservice_access_exception(get_string('wsauthnotenabled', 'webservice'));
}
if (!$auth = get_auth_plugin('webservice')) {
throw new webservice_access_exception(get_string('wsauthmissing', 'webservice'));
}
// NOTE: the exception details are here for debugging only, it is controlled via the $CFG->degug
if ($this->simple) {
//we check that authentication plugin is enabled
//it is only required by simple authentication
if (!is_enabled_auth('webservice')) {
throw new webservice_access_exception(get_string('wsauthnotenabled', 'webservice'));
}
if (!$auth = get_auth_plugin('webservice')) {
throw new webservice_access_exception(get_string('wsauthmissing', 'webservice'));
}
$this->restricted_context = get_context_instance(CONTEXT_SYSTEM);
if (!$this->username) {