Project

General

Profile

« Previous | Next » 

Revision 70130225

Added by Thomas Noël over 12 years ago

[ezldap] send mail when remove a user

We don't use the good email template, but it works.

+ delete the session and redirect to login page

View differences:

extra/modules/ezldap_ui.ptl
19 19
except ImportError:
20 20
    from sha import sha
21 21

  
22
from quixote import get_publisher, get_request, redirect, get_session
22
from quixote import get_publisher, get_request, redirect, get_session, get_session_manager
23 23
from quixote.directory import Directory
24 24

  
25 25
from qommon import get_cfg, template, emails
......
28 28
from qommon.admin.texts import TextsDirectory
29 29
from qommon.form import *
30 30
from qommon.ident.password import check_password, make_password
31
from qommon import errors
31 32

  
32 33
from wcs.formdef import FormDef
33 34
from wcs.users import User
......
253 254
            return TextsDirectory.get_html_text('new-password-sent-by-email')
254 255
        elif action == 'remove':
255 256
            template.html_top(_('Removing Account'))
257
            # email (just before remove)
258
            email_to_admins(dn, 'notification-of-removed-account')
256 259
            # delete all related forms
257 260
            formdefs = FormDef.select()
258 261
            user_forms = []
......
262 265
                formdata.remove_self()
263 266
            # delete the user in ldap
264 267
            ezldap.get_ldap_conn().delete_s(dn)
265
            # FIXME : hack for vincennes only...
266
            return redirect('../../logout')
268
            # delete session and redirect to login page
269
            get_session_manager().expire_session()
270
            root_url = get_publisher().get_root_url()
271
            return redirect('%slogin' % root_url)
267 272

  
268 273
    def cancel(self):
269 274
        token = get_request().form.get('token')

Also available in: Unified diff