mirror of https://github.com/tp4a/teleport
Merge branch 'feature/v3' of github.com:eomsoft/teleport into feature/v3
commit
bcaa877187
|
@ -789,6 +789,7 @@ $app.create_dlg_edit_user = function () {
|
|||
|
||||
if (_.isUndefined(user)) {
|
||||
dlg.dom.dlg_title.html('创建用户账号');
|
||||
dlg.field_id = -1;
|
||||
|
||||
dlg.dom.edit_username.val('');
|
||||
dlg.dom.edit_surname.val('');
|
||||
|
|
|
@ -228,7 +228,7 @@ def update_host(handler, args):
|
|||
return TPE_NOT_EXISTS
|
||||
|
||||
sql_list = []
|
||||
sql = 'UPDATE `{}host` SET `os_type`="{os_type}", `name`="{name}", `ip`="{ip}", `router_ip`="{router_ip}", ' \
|
||||
sql = 'UPDATE `{}host` SET `os_type`={os_type}, `name`="{name}", `ip`="{ip}", `router_ip`="{router_ip}", ' \
|
||||
'`router_port`={router_port}, `cid`="{cid}", `desc`="{desc}" WHERE `id`={host_id};' \
|
||||
''.format(db.table_prefix,
|
||||
os_type=args['os_type'], name=args['name'], ip=args['ip'], router_ip=args['router_ip'], router_port=args['router_port'],
|
||||
|
@ -245,7 +245,7 @@ def update_host(handler, args):
|
|||
_name = args['ip']
|
||||
if len(args['name']) > 0:
|
||||
_name = '{} [{}]'.format(args['name'], args['ip'])
|
||||
sql_list = []
|
||||
|
||||
# 运维授权
|
||||
sql = 'UPDATE `{}ops_auz` SET `name`="{name}" WHERE (`rtype`={rtype} AND `rid`={rid});' \
|
||||
''.format(db.table_prefix, name=_name, rtype=TP_HOST, rid=args['id'])
|
||||
|
|
|
@ -267,7 +267,7 @@ def update_user(handler, args):
|
|||
db = get_db()
|
||||
|
||||
# 1. 判断此账号是否已经存在
|
||||
sql = 'SELECT `username` FROM {dbtp}user WHERE id={dbph};'.format(dbtp=db.table_prefix, dbph=db.place_holder)
|
||||
sql = 'SELECT `username` FROM {dbtp}user WHERE `id`={dbph};'.format(dbtp=db.table_prefix, dbph=db.place_holder)
|
||||
db_ret = db.query(sql, (args['id'], ))
|
||||
if db_ret is None or len(db_ret) == 0:
|
||||
return TPE_NOT_EXISTS
|
||||
|
@ -275,7 +275,7 @@ def update_user(handler, args):
|
|||
old_username = db_ret[0][0]
|
||||
if old_username != args['username']:
|
||||
# 如果要更新用户登录名,则需要判断是否已经存在了
|
||||
sql = 'SELECT `id` FROM {dbtp}user WHERE username={dbph};'.format(dbtp=db.table_prefix, dbph=db.place_holder)
|
||||
sql = 'SELECT `id` FROM {dbtp}user WHERE `username`={dbph};'.format(dbtp=db.table_prefix, dbph=db.place_holder)
|
||||
db_ret = db.query(sql, (args['username'],))
|
||||
if db_ret is not None and len(db_ret) > 0:
|
||||
return TPE_EXISTS
|
||||
|
|
Loading…
Reference in New Issue