Rushabh Mehta | e67d1fb | 2013-08-05 14:59:54 +0530 | [diff] [blame] | 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. |
| 2 | # License: GNU General Public License v3. See license.txt |
| 3 | |
Anand Doshi | 486f9df | 2012-07-19 13:40:31 +0530 | [diff] [blame] | 4 | from __future__ import unicode_literals |
Rushabh Mehta | 2d7cb22 | 2012-07-13 15:07:07 +0530 | [diff] [blame] | 5 | import webnotes |
| 6 | def execute(): |
| 7 | webnotes.conn.commit() |
| 8 | |
| 9 | from webnotes.install_lib.install import Installer |
| 10 | Installer(None, None).create_auth_table() |
| 11 | |
| 12 | webnotes.conn.begin() |
| 13 | |
| 14 | for user, password in webnotes.conn.sql("""select name, password from tabProfile"""): |
Rushabh Mehta | 49dc5da | 2012-08-03 16:02:24 +0530 | [diff] [blame] | 15 | if password: |
| 16 | webnotes.conn.sql("""insert into __Auth (user, `password`) values (%s, %s)""", |
| 17 | (user, password)) |