Example #1
0
def user_box(the_user):
    which_user = User.query.filter(User.name == str(the_user)).first()
    if which_user is None:
        return redirect(url_for("index"))
    if current_user.name is not which_user.name:
        return redirect(url_for("index"))
    dhbox_username = which_user.name
    port_info = DockerBackend.get_all_exposed_ports(dhbox_username)
    hostname = DockerBackend.get_hostname()
    resp = make_response(render_template('my_dhbox.html', user=the_user, apps=all_apps))
    return resp
Example #2
0
def user_box(the_user):
    which_user = User.query.filter(User.name == str(the_user)).first()
    if which_user is None:
        return redirect(url_for("index"))
    if current_user.name is not which_user.name:
        return redirect(url_for("index"))
    email_domain = which_user.email.split("@",1)[1]
    if email_domain == 'demo.com':
        demo = True
    else:
        demo = False
    dhbox_username = which_user.name
    port_info = DockerBackend.get_all_exposed_ports(dhbox_username)
    hostname = DockerBackend.get_hostname()
    resp = make_response(render_template('my_dhbox.html',
                                         user=the_user,
                                         apps=filter(lambda app: app.get('hide', False) != True, all_apps),
                                         demo=demo
                                         )
                         )
    return resp