diff --git a/cas_server/views.py b/cas_server/views.py index c2b18b4..9f8c83c 100644 --- a/cas_server/views.py +++ b/cas_server/views.py @@ -61,7 +61,7 @@ class LogoutMixin(object): username = self.request.session.get("username") if username: if all_session: - logger.info("Logging out user %s from all of they sessions." % username) + logger.info("Logging out user %s from all sessions." % username) else: logger.info("Logging out user %s." % username) users = [] @@ -143,7 +143,7 @@ class LogoutView(View, LogoutMixin): def get(self, request, *args, **kwargs): """ - methode called on GET request on this view + method called on GET request on this view :param django.http.HttpRequest request: The current request object """ @@ -184,7 +184,7 @@ class LogoutView(View, LogoutMixin): logout_msg = _( "

Logout successful

" "You have successfully logged out from the Central Authentication Service. " - "For security reasons, exit your web browser." + "For security reasons, close your web browser." ) elif session_nb > 1: logout_msg = _( @@ -197,7 +197,7 @@ class LogoutView(View, LogoutMixin): logout_msg = _( "

Logout successful

" "You were already logged out from the Central Authentication Service. " - "For security reasons, exit your web browser." + "For security reasons, close your web browser." ) # depending of settings, redirect to the login page with a logout message or display @@ -261,7 +261,7 @@ class FederateAuth(CsrfExemptView): """ # if settings.CAS_FEDERATE is not True redirect to the login page if not settings.CAS_FEDERATE: - logger.warning("CAS_FEDERATE is False, set it to True to use the federated mode") + logger.warning("CAS_FEDERATE is False, set it to True to use federation") return redirect("cas_server:login") # POST with a provider suffix, this is probably an SLO request. csrf is disabled for # allowing SLO requests reception @@ -305,13 +305,13 @@ class FederateAuth(CsrfExemptView): """ # if settings.CAS_FEDERATE is not True redirect to the login page if not settings.CAS_FEDERATE: - logger.warning("CAS_FEDERATE is False, set it to True to use the federated mode") + logger.warning("CAS_FEDERATE is False, set it to True to use federation") return redirect("cas_server:login") renew = bool(request.GET.get('renew') and request.GET['renew'] != "False") # Is the user is already authenticated, no need to request authentication to the user # identity provider. if self.request.session.get("authenticated") and not renew: - logger.warning("User already authenticated, dropping federate authentication request") + logger.warning("User already authenticated, dropping federated authentication request") return redirect("cas_server:login") try: # get the identity provider from its suffix @@ -320,7 +320,7 @@ class FederateAuth(CsrfExemptView): auth = self.get_cas_client(request, provider, renew) # if no ticket submited, redirect to the identity provider CAS login page if 'ticket' not in request.GET: - logger.info("Trying to authenticate again %s" % auth.provider.server_url) + logger.info("Trying to authenticate %s again" % auth.provider.server_url) return HttpResponseRedirect(auth.get_login_url()) else: ticket = request.GET['ticket'] @@ -360,8 +360,8 @@ class FederateAuth(CsrfExemptView): else: logger.info( ( - "Got a invalid ticket %s from %s for service %s. " - "Retrying to authenticate" + "Got an invalid ticket %s from %s for service %s. " + "Retrying authentication" ) % ( ticket, auth.provider.server_url, @@ -485,7 +485,7 @@ class LoginView(View, LogoutMixin): def post(self, request, *args, **kwargs): """ - methode called on POST request on this view + method called on POST request on this view :param django.http.HttpRequest request: The current request object """ @@ -497,7 +497,7 @@ class LoginView(View, LogoutMixin): messages.add_message( self.request, messages.ERROR, - _(u"Invalid login ticket, please retry to login") + _(u"Invalid login ticket, please try to log in again") ) elif ret == self.USER_LOGIN_OK: # On successful login, update the :class:`models.User` ``date`` @@ -554,7 +554,7 @@ class LoginView(View, LogoutMixin): """ if not self.check_lt(): self.init_form(self.request.POST) - logger.warning("Receive an invalid login ticket") + logger.warning("Received an invalid login ticket") return self.INVALID_LOGIN_TICKET elif not self.request.session.get("authenticated") or self.renew: # authentication request receive, initialize the form to use @@ -569,10 +569,10 @@ class LoginView(View, LogoutMixin): logger.info("User %s successfully authenticated" % self.request.session["username"]) return self.USER_LOGIN_OK else: - logger.warning("A logging attemps failed") + logger.warning("A login attempt failed") return self.USER_LOGIN_FAILURE else: - logger.warning("Receuve a logging attempt whereas the user is already logged") + logger.warning("Received a login attempt for an already-active user") return self.USER_ALREADY_LOGGED def init_get(self, request): @@ -600,7 +600,7 @@ class LoginView(View, LogoutMixin): def get(self, request, *args, **kwargs): """ - methode called on GET request on this view + method called on GET request on this view :param django.http.HttpRequest request: The current request object """ @@ -667,7 +667,7 @@ class LoginView(View, LogoutMixin): def service_login(self): """ - Perform login agains a service + Perform login against a service :return: * The rendering of the ``settings.CAS_WARN_TEMPLATE`` if the user asked to be @@ -949,7 +949,7 @@ class Auth(CsrfExemptView): @staticmethod def post(request): """ - methode called on POST request on this view + method called on POST request on this view :param django.http.HttpRequest request: The current request object :return: ``HttpResponse(u"yes\\n")`` if the POSTed tuple (username, password, service) @@ -1005,7 +1005,7 @@ class Validate(View): @staticmethod def get(request): """ - methode called on GET request on this view + method called on GET request on this view :param django.http.HttpRequest request: The current request object :return: @@ -1116,7 +1116,7 @@ class ValidateService(View): def get(self, request): """ - methode called on GET request on this view + method called on GET request on this view :param django.http.HttpRequest request: The current request object: :return: The rendering of ``cas_server/serviceValidate.xml`` if no errors is raised, @@ -1284,7 +1284,7 @@ class Proxy(View): def get(self, request): """ - methode called on GET request on this view + method called on GET request on this view :param django.http.HttpRequest request: The current request object: :return: The returned value of :meth:`process_proxy` if no error is raised, @@ -1323,7 +1323,7 @@ class Proxy(View): if not pattern.proxy: raise ValidateError( u'UNAUTHORIZED_SERVICE', - u'the service %s do not allow proxy ticket' % self.target_service + u'the service %s does not allow proxy tickets' % self.target_service ) # is the proxy granting ticket valid ticket = ProxyGrantingTicket.get(self.pgt) @@ -1387,7 +1387,7 @@ class SamlValidate(CsrfExemptView): def post(self, request): """ - methode called on POST request on this view + method called on POST request on this view :param django.http.HttpRequest request: The current request object :return: the rendering of ``cas_server/samlValidate.xml`` if no error is raised, @@ -1417,7 +1417,7 @@ class SamlValidate(CsrfExemptView): ) ) logger.debug( - "SamlValidate: User attributs are:\n%s" % pprint.pformat(self.ticket.attributs) + "SamlValidate: User attributes are:\n%s" % pprint.pformat(self.ticket.attributs) ) return render( @@ -1446,7 +1446,7 @@ class SamlValidate(CsrfExemptView): if ticket.service != self.target: raise SamlValidateError( u'AuthnFailed', - u'TARGET %s do not match ticket service' % self.target + u'TARGET %s does not match ticket service' % self.target ) return ticket except (IndexError, KeyError):