def index():
    if current_app.config.get('DB_FALL', None):
        try:
            apply_db_settings(current_app)
            current_app.config['DB_FALL'] = 0
        except:
            return render_template('err_conf.html',
                                   message='MySQL database is not configured'
                                   if current_app.config['DB_FALL'] == 1 else
                                   'MySQL connection refused')

    status, _, error_str = get_block_status()
    if status != 2:
        return render_template('blocks.html', error_message=error_str)

    serial = request.environ.get('SSL_CLIENT_M_SERIAL')

    set_password = password_not_set()

    return redirect(url_for('emcweb.wallet')) \
        if current_user.is_authenticated else render_template('index.html',
                                                              form=LoginForm(),
                                                              create_form=CreateLoginForm(),
                                                              set_password=set_password,
                                                              enable_ssl=True if serial else False)
def sign():
    if current_app.config.get('DB_FALL', None):
        return redirect(url_for('emcweb.index'))

    status, _, error_str = get_block_status()
    if status != 2:
        return redirect(url_for('emcweb.index'))
    confirm_login()
    endpoint_list = get_tools_endpoint_list()
    return render_template('sign.html', endpoint_list=endpoint_list)
Exemple #3
0
def receive():
    if current_app.config.get('DB_FALL', None):
        return redirect(url_for('emcweb.index'))

    status, _, error_str = get_block_status()
    if status != 2:
        return redirect(url_for('emcweb.index'))
    confirm_login()
    endpoint_list = get_tools_endpoint_list()
    return render_template('receive.html', mailer=current_app.config.get('EMAIL_ENABLED', False),
                           endpoint_list=endpoint_list)
Exemple #4
0
    def get():
        """
        Get blocks loading status
        """
        status, blocks, error_str = get_block_status()

        if error_str:
            return {'result_status': False, 'message': error_str}, 500

        return {'result_status': True, 'result': {'blocks_ready': status,
                                                  'blocks': blocks}}
Exemple #5
0
def minfo():
    if current_app.config.get('DB_FALL', None):
        return redirect(url_for('emcweb.index'))

    status, _, error_str = get_block_status()
    if status != 2:
        return redirect(url_for('emcweb.index'))
    confirm_login()
    endpoint_list = get_tools_endpoint_list()
    return render_template('minfo.html',
                           endpoint_list=endpoint_list)
Exemple #6
0
def settings():
    if current_app.config.get('DB_FALL', None):
        return redirect(url_for('emcweb.index'))

    status, _, error_str = get_block_status()
    if status != 2:
        return redirect(url_for('emcweb.index'))
    confirm_login()
    live_coin = False if not current_app.config.get('LIVECOIN_ENABLE', False) else True
    endpoint_list = get_tools_endpoint_list()
    return render_template('settings.html', live_coin=live_coin,
                           endpoint_list=endpoint_list)
def receive():
    if current_app.config.get('DB_FALL', None):
        return redirect(url_for('emcweb.index'))

    status, _, error_str = get_block_status()
    if status != 2:
        return redirect(url_for('emcweb.index'))
    confirm_login()
    endpoint_list = get_tools_endpoint_list()
    return render_template('receive.html',
                           mailer=current_app.config.get(
                               'EMAIL_ENABLED', False),
                           endpoint_list=endpoint_list)
Exemple #8
0
def settings():
    if current_app.config.get('DB_FALL', None):
        return redirect(url_for('emcweb.index'))

    status, _, error_str = get_block_status()
    if status != 2:
        return redirect(url_for('emcweb.index'))
    confirm_login()
    live_coin = False if not current_app.config.get('LIVECOIN_ENABLE',
                                                    False) else True
    endpoint_list = get_tools_endpoint_list()
    return render_template('settings.html',
                           live_coin=live_coin,
                           endpoint_list=endpoint_list)
    def get():
        """
        Get blocks loading status
        """
        status, blocks, error_str = get_block_status()

        if error_str:
            return {'result_status': False, 'message': error_str}, 500

        return {
            'result_status': True,
            'result': {
                'blocks_ready': status,
                'blocks': blocks
            }
        }
Exemple #10
0
def wallets():
    if current_app.config.get('DB_FALL', None):
        return redirect(url_for('emcweb.index'))

    status, _, error_str = get_block_status()
    if status != 2:
        return redirect(url_for('emcweb.index'))

    confirm_login()
    endpoint_list = get_tools_endpoint_list()
    return render_template('wallets.html',
                           google=os.path.exists(
                               os.path.join(os.path.dirname(__file__), '..',
                                            '..', '..', 'static',
                                            'google_secrets.json')),
                           endpoint_list=endpoint_list)
Exemple #11
0
def wallets():
    if current_app.config.get('DB_FALL', None):
        return redirect(url_for('emcweb.index'))

    status, _, error_str = get_block_status()
    if status != 2:
        return redirect(url_for('emcweb.index'))

    confirm_login()
    endpoint_list = get_tools_endpoint_list()
    return render_template(
        'wallets.html',
        google=os.path.exists(os.path.join(os.path.dirname(__file__),
                                           '..', '..', '..', 'static',
                                           'google_secrets.json')),
        endpoint_list=endpoint_list
    )
Exemple #12
0
def index():
    if current_app.config.get('DB_FALL', None):
        try:
            apply_db_settings(current_app)
            current_app.config['DB_FALL'] = 0
        except:
            return render_template('err_conf.html',
                                   message='MySQL database is not configured'
                                   if current_app.config['DB_FALL'] == 1 else 'MySQL connection refused')

    status, _, error_str = get_block_status()
    if status != 2:
        return render_template('blocks.html', error_message=error_str)

    serial = request.environ.get('SSL_CLIENT_M_SERIAL')

    set_password = password_not_set()

    return redirect(url_for('emcweb.wallet')) \
        if current_user.is_authenticated else render_template('index.html',
                                                              form=LoginForm(),
                                                              create_form=CreateLoginForm(),
                                                              set_password=set_password,
                                                              enable_ssl=True if serial else False)
def blocks():
    status, blocks, error_str = get_block_status()
    return ujson.dumps({'status': status, 'blocks': blocks})