Project

General

Profile

Revision 870b9bb7

ID870b9bb73c9b4c1e43dd96813366fde730d74be0
Parent b42cc707
Child e492d895

Added by Francois POIROTTE about 14 years ago

Suppression des url() dans les méthodes login, post_login & post_logout de toutes les applications !TurboGears
pour contourner un bug : http://trac.turbogears.org/ticket/2471 & http://vigilo-dev.si.c-s.fr/trac/ticket/40

git-svn-id: https://vigilo-dev.si.c-s.fr/svn@2221 b22e2e97-25c9-44ff-b637-2e5ceca36478

View differences:

vigiboard/controllers/vigiboard_controller.py
4 4
Controller for authentification
5 5
"""
6 6

  
7
from tg import expose, flash, url, request, redirect
7
from tg import expose, flash, request, redirect
8 8

  
9 9
from pylons.i18n import ugettext as _
10 10

  
......
31 31
    error = ErrorController()
32 32

  
33 33
    @expose('login.html')
34
    def login(self, came_from=url('/')):
34
    def login(self, came_from='/'):
35 35
        """Start the user login."""
36 36
        login_counter = request.environ['repoze.who.logins']
37 37
        if login_counter > 0:
......
40 40
                    came_from=came_from)
41 41

  
42 42
    @expose()
43
    def post_login(self, came_from=url('/')):
43
    def post_login(self, came_from='/'):
44 44
        """
45 45
        Redirect the user to the initially requested page on successful
46 46
        authentication or redirect her back to the login page if login failed.
47 47
        """
48 48
        if not request.identity:
49 49
            login_counter = request.environ['repoze.who.logins'] + 1
50
            redirect(url('/login', came_from=came_from, __logins=login_counter))
50
            redirect('/login', came_from=came_from, __logins=login_counter)
51 51
        userid = request.identity['repoze.who.userid']
52 52
        ApplicationLog.add_login(userid, request.remote_addr, u'Vigiboard')
53 53
        flash(_('Welcome back, %s!') % userid)
54 54
        redirect(came_from)
55 55

  
56 56
    @expose()
57
    def post_logout(self, came_from=url('/')):
57
    def post_logout(self, came_from='/'):
58 58
        """
59 59
        Redirect the user to the initially requested page on logout and say
60 60
        goodbye as well.

Also available in: Unified diff