Add support for updating identities on each login

It allows to automatically add new e-mail addresses when user's account is modified in LDAP. Useful especially with $config['identities_level']=1
Code style, the { bracket should be on the same line with foreach