equal
deleted
inserted
replaced
1 from __future__ import print_function |
|
2 |
|
3 from logilab.common.shellutils import generate_password |
|
4 from cubicweb.server.utils import crypt_password |
|
5 |
|
6 for user in rql('CWUser U WHERE U cw_source S, S name "system", U upassword P, U login L').entities(): |
|
7 salt = user.upassword.getvalue() |
|
8 if crypt_password('', salt) == salt: |
|
9 passwd = generate_password() |
|
10 print('setting random password for user %s' % user.login) |
|
11 user.set_attributes(upassword=passwd) |
|
12 |
|
13 commit() |
|