Exemplo n.º 1
0
def users_config():
    if request.form['config'] == 'Load_Runtime':
        user_config_load()
        x = session.get('host', 'not set')
        return render_template('mysqlusers.html', userlists=users_print(x))
    elif request.form['config'] == 'Save_Disk':
        user_config_save()
        x = session.get('host', 'not set')
        return render_template('/printers/mysqlusers.html',
                               userlists=users_print(x))
    else:
        pass
Exemplo n.º 2
0
def addeduser():
    form = UserForm(request.form)  # UserForm imported from user_form.py
    if request.method == "POST":
        adduser(form)
        x = session.get('host', 'not set')
        return render_template('/printers/mysqlusers.html',
                               userlists=users_print(x))
    else:
        print('Formda sorun var')
Exemplo n.º 3
0
def updated_mysql_user(uname, bckend, frntend):
    form = UserForm(request.form)
    try:
        update_user(form, uname, bckend, frntend)
        x = session.get('host', 'not set')
        return render_template('/printers/mysqlusers.html',
                               userlists=users_print(x))
    except Exception as e:
        print(e)
        return render_template('/errors/update_error.html', error=e)
Exemplo n.º 4
0
def users():
    pools = populate_pools_session()
    servers = populate_proxy_session()

    y = session.get('host', 'not set')
    try:
        return render_template('/printers/mysqlusers.html',
                               userlists=users_print(y),
                               pools=pools,
                               servers=servers)
    except:
        return render_template('/errors/connect_error.html')
Exemplo n.º 5
0
def user_operation():
    if request.method == 'POST':
        if request.form['user_button'] == 'Add':
            return render_template('/insert/adduser.html')
        elif request.form['user_button'] == 'Remove':
            degerler = request.form.getlist('selectbox')
            if degerler:
                for item in degerler:
                    username, backend, frontend = item.split(':')
                    rmuser(username, backend, frontend)
            else:
                flash('Please select one in order to remove')

        elif request.form['user_button'] == 'Active':
            degerler = request.form.getlist('selectbox')
            if degerler:
                for item in degerler:
                    username, backend, frontend = item.split(':')
                    activeuser(username, backend, frontend)
            else:
                flash('Please select one for active')

        elif request.form['user_button'] == 'Deactive':
            degerler = request.form.getlist('selectbox')
            if degerler:
                for item in degerler:
                    username, backend, frontend = item.split(':')
                    deactiveuser(username, backend, frontend)
            else:
                flash('Please select one for deactive')

        elif request.form['user_button'] == 'Update':
            degerler = request.form.getlist('selectbox')
            if degerler:
                for item in degerler:
                    u, b, f = item.split(':')
                try:
                    return render_template('/update/updatemysqluser.html',
                                           username=u,
                                           backend=b,
                                           frontend=f)
                except:
                    flash(' Please select one in order to update !', 'message')

        else:
            pass
    x = session.get('host', 'not set')
    return render_template('mysqlusers.html', userlists=users_print(x))