瀏覽代碼

fixes in install: store password in __Auth

version-14
Anand Doshi 13 年之前
父節點
當前提交
0116eaea56
共有 3 個檔案被更改,包括 6 行新增7 行删除
  1. +1
    -1
      js/legacy/widgets/form/form.js
  2. +4
    -5
      py/webnotes/install_lib/install.py
  3. +1
    -1
      py/webnotes/model/db_schema.py

+ 1
- 1
js/legacy/widgets/form/form.js 查看文件

@@ -668,7 +668,7 @@ _f.Frm.prototype.refresh_fields = function() {
f.df = wn.meta.get_docfield(this.doctype, fn, this.docname);
if(f.df.fieldtype!='Section Break' && f.refresh) {
f.refresh();
f.refresh();
}
}



+ 4
- 5
py/webnotes/install_lib/install.py 查看文件

@@ -107,8 +107,8 @@ class Installer:

# set the basic passwords
webnotes.conn.begin()
webnotes.conn.sql("""update tabProfile set password = password('admin')
where name='Administrator'""")
webnotes.conn.sql("""update __Auth set password = password('admin')
where user='Administrator'""")
webnotes.conn.commit()

def create_sessions_table(self):
@@ -145,7 +145,7 @@ class Installer:
def create_cache_item(self):
import webnotes
self.dbman.drop_table('__CacheItem')
webnotes.conn.sql("""create table __CacheItem(
webnotes.conn.sql("""create table __CacheItem (
`key` VARCHAR(180) NOT NULL PRIMARY KEY,
`value` LONGTEXT,
`expires_on` DATETIME
@@ -153,8 +153,7 @@ class Installer:
def create_auth_table(self):
import webnotes
self.dbman.drop_table('__Auth')
webnotes.conn.sql("""create table __Auth(
webnotes.conn.sql("""create table if not exists __Auth (
`user` VARCHAR(180) NOT NULL PRIMARY KEY,
`password` VARCHAR(180) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8""")

+ 1
- 1
py/webnotes/model/db_schema.py 查看文件

@@ -346,7 +346,7 @@ class DbManager:

def grant_all_privileges(self,target,user):
try:
self.conn.sql("GRANT ALL PRIVILEGES ON `%s` . * TO '%s'@'localhost';" % (target, user))
self.conn.sql("GRANT ALL PRIVILEGES ON `%s`.* TO '%s'@'localhost';" % (target, user))
except Exception,e:
raise e



Loading…
取消
儲存