Created
June 30, 2015 10:13
-
-
Save leblanc-simon/a9831c0eb827eb9ad237 to your computer and use it in GitHub Desktop.
Get password from Odoo session
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import os | |
from werkzeug.contrib.sessions import FilesystemSessionStore | |
session_store = FilesystemSessionStore(os.path.expanduser('~/.local/share/Odoo/sessions')) | |
passwds = [] | |
for sid in session_store.list(): | |
session = session_store.get(sid) | |
if session.get('password'): | |
passwds.append({ | |
'login': session.get('login'), | |
'password': session.get('password'), | |
'database': session.get('db') | |
}) | |
passwds.sort(key=lambda tup: tup['login']) | |
for passwd in passwds: | |
print passwd['login'] + ' : ' + passwd['password'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment