Merge branch 'master' of github.com:jumpserver/jumpserver

pull/195/head 0.3.2
liuzheng712 2016-04-05 10:53:47 +08:00
commit bb7a3ea053
1 changed files with 3 additions and 1 deletions

View File

@ -233,7 +233,9 @@ class ExecHandler(tornado.websocket.WebSocketHandler):
def open(self):
logger.debug('Websocket: Open exec request')
role_name = self.get_argument('role', 'sb')
self.remote_ip = self.request.remote_ip
self.remote_ip = self.request.headers.get("X-Real-IP")
if not self.remote_ip:
self.remote_ip = self.request.remote_ip
logger.debug('Web执行命令: 请求系统用户 %s' % role_name)
self.role = get_object(PermRole, name=role_name)
self.perm = get_group_user_perm(self.user)