1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-vps-admin.git synced 2025-03-09 15:40:05 +00:00

Fix remove user

This commit is contained in:
Ycarus (Yannick Chabanois) 2024-10-25 11:52:12 +02:00
parent bec293d6b7
commit 8caecd236d
2 changed files with 9 additions and 3 deletions

View file

@ -3369,10 +3369,10 @@ def remove_user(*, params: RemoveUser, current_user: User = Depends(get_current_
return {'result': 'permission', 'reason': 'Need admin user', 'route': 'remove_user'}
with open('/etc/openmptcprouter-vps-admin/omr-admin-config.json') as f:
content = json.load(f)
shadowsocks_port = content['users'][0][params.username]['shadowsocks_port']
userid = int(content['users'][0][params.username]['userid'])
del content['users'][0][params.username]
if os.path.isfile('/etc/shadowsocks-libev/manager.json'):
shadowsocks_port = content['users'][0][params.username]['shadowsocks_port']
remove_ss_user(str(shadowsocks_port))
if os.path.isfile('/etc/shadowsocks-go/server.json'):
remove_ss_go_user(params.username)