From 3785c9e221fcb6ca3bb749c38f6401b2b4361257 Mon Sep 17 00:00:00 2001 From: jerome mouneyrac Date: Mon, 18 Jan 2010 07:41:53 +0000 Subject: [PATCH] webservice MDL-21351 token error message more explicit --- lang/en_utf8/webservice.php | 6 +++++- webservice/lib.php | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lang/en_utf8/webservice.php b/lang/en_utf8/webservice.php index 9fdc63c55d8..c356bc10a2c 100644 --- a/lang/en_utf8/webservice.php +++ b/lang/en_utf8/webservice.php @@ -1,7 +1,7 @@ get_record('external_tokens', array('token'=>$this->token, 'tokentype'=>EXTERNAL_TOKEN_PERMANENT))) { // TODO: MDL-12886 log failed login attempts - throw new webservice_access_exception('Invalid token'); + throw new webservice_access_exception(get_string('invalidtoken', 'webservice')); } if ($token->validuntil and $token->validuntil < time()) { - throw new webservice_access_exception('Invalid token'); + throw new webservice_access_exception(get_string('invalidtimedtoken', 'webservice')); } if ($token->iprestriction and !address_in_subnet(getremoteaddr(), $token->iprestriction)) { - throw new webservice_access_exception('Invalid token'); + throw new webservice_access_exception(get_string('invalidiptoken', 'webservice')); } $this->restricted_context = get_context_instance_by_id($token->contextid);