def perform_operation_post(self, op, repo_id): repo = get_repo(repo_id) if not repo: raise web.seeother('/repos/') if op == 'modify-relay': relay_id = web.webapi.input(relay_id="").relay_id if relay_id != repo.props.relay_id: seafile_rpc.set_repo_property(repo.props.id, "relay-id", relay_id) elif op == 'set-passwd': passwd = web.webapi.input(passwd="").passwd if passwd: seafile_rpc.set_repo_passwd(repo.props.id, passwd) referer = web.ctx.env.get('HTTP_REFERER', '/home/') raise web.seeother(referer)
def perform_operation_post(self, op, repo_id): repo = get_repo(repo_id) if not repo: raise web.seeother('/repos/') if op == 'modify-relay': relay_id = web.webapi.input(relay_id="").relay_id if relay_id != repo.props.relay_id: seafile_rpc.set_repo_property(repo.props.id, "relay-id", relay_id) elif op == 'set-passwd': passwd = web.webapi.input(passwd="").passwd if passwd: seafile_rpc.set_repo_passwd(repo.props.id, passwd) referer = web.ctx.env.get('HTTP_REFERER', '/home/') raise web.seeother(referer)
def perform_operation_post(self, op, repo_id): repo = get_repo(repo_id) if not repo: raise web.seeother("/repos/") if op == "modify-relay": relay_id = web.webapi.input(relay_id="").relay_id if relay_id != repo.props.relay_id: seafile_rpc.set_repo_property(repo.props.id, "relay-id", relay_id) elif op == "set-passwd": passwd = web.webapi.input(passwd="").passwd if passwd: seafile_rpc.set_repo_passwd(repo.props.id, passwd) elif op == "edit-relay": inputs = web.webapi.input(relay_addr="", relay_port="") if inputs.relay_addr and inputs.relay_port: seafile_rpc.update_repo_relay_info(repo_id, inputs.relay_addr, inputs.relay_port) referer = web.ctx.env.get("HTTP_REFERER", "/home/") raise web.seeother(referer)