Ejemplo n.º 1
0
    login_key = form_entries.getvalue("login_key")
    login_key_confirm = form_entries.getvalue("login_key_confirm")
    account_number = form_entries.getvalue("account_number")
    bank_name = form_entries.getvalue("bank_name")
    branch_name = form_entries.getvalue("branch_name")
    ifsc_code = form_entries.getvalue("ifsc_code")
except Exception as e:
    mlog.error(TAG,"Error: " + str(e))

#if invalid attributes, show error and eixt.
error_message = None
if(full_name == None or login_name == None or login_key == None or login_key_confirm == None or account_number == None or bank_name == None or branch_name == None or ifsc_code == None) :
    error_message = "<br><p>Failed to register! Invalid attributes provided. Register again with valid attributes</p>"
else:
    register_validator = Validator()
    if register_validator.validate_generic_name(full_name,6,15) == False:
        error_message = register_validator.message
    elif register_validator.validate_login_name(login_name,6,15) == False:
        error_message = register_validator.message
    elif register_validator.validate_login_key(login_key,6,12) == False:
        error_message = register_validator.message
    elif login_key != login_key_confirm:
        error_message = "<P>Passwords do not match!</p>"
    elif int(account_number)<10000 or int(account_number) > 999999:
        error_message = "<P>Account number must be greater than 10000 and less than 999999!</p>"
    elif register_validator.validate_bank_name(bank_name,3,10) == False:
        error_message = register_validator.message
    elif register_validator.validate_branch_name(branch_name,5,10) == False:
        error_message = register_validator.message
    elif register_validator.validate_ifsc_code(ifsc_code) == False:
        error_message = register_validator.message
Ejemplo n.º 2
0
            <a id="dashboard_menu_a" href="show_money_transfer.py">Money Transfer</a>
            <a id="dashboard_menu_a" href="logout.py">Logout</a>
        </div>
    ''')
print("<div id=\"entry\" >")
print("<h4> Add Payee status:</h4><br><br>")
print("</div>")
#------------------------------------------------------------------------------------------------------------

error_message = None
if (payee_name == None or payee_account == None or payee_bank == None
        or payee_branch == None) or payee_ifsc_code == None:
    error_message = "<br><p>Failed to add payee! Invalid attributes provided. Add payee again with valid attributes</p>"
else:
    payee_validator = Validator()
    if payee_validator.validate_generic_name(payee_name, 6, 15) == False:
        error_message = payee_validator.message
    elif int(payee_account) < 10000 or int(payee_account) > 999999:
        error_message = "<P>Account number must be greater than 10000 and less than 999999!</p>"
    elif payee_validator.validate_bank_name(payee_bank, 3, 10) == False:
        error_message = payee_validator.message
    elif payee_validator.validate_branch_name(payee_branch, 5, 10) == False:
        error_message = payee_validator.message
    elif payee_validator.validate_ifsc_code(payee_ifsc_code) == False:
        error_message = payee_validator.message

mlog.error(TAG, "Add payee validator error message: " + str(error_message))
if error_message != None:
    print('''
        <div id="entry" >        
            <p>Failed to add payee:</p>
Ejemplo n.º 3
0
    ''')
print("<div id=\"entry\" >")
print("<h4> Transfer money status:</h4><br><br>")
print("</div>")

#--------------------------------------------MENU DETAILS----------------------------------------------------

mlog.debug(TAG, "Evaluating input attributes..")
error_message = None
if (beneficiery_name == None or beneficiery_account == None
        or beneficiery_bank == None or beneficiery_branch == None
        or beneficiery_ifsc_code == None or transfer_amount == None):
    error_message = "<br><p>Failed to do money transfer! Invalid attributes provided. Try to transfer again with valid attributes</p>"
else:
    transfer_validator = Validator()
    if transfer_validator.validate_generic_name(beneficiery_name, 4,
                                                15) == False:
        error_message = transfer_validator.message
    elif int(beneficiery_account) < 10000 or int(beneficiery_account) > 999999:
        error_message = "<P>Beneficiary Account number must be greater than 10000 and less than 999999!</p>"
    elif transfer_validator.validate_bank_name(beneficiery_bank, 3,
                                               10) == False:
        error_message = transfer_validator.message
    elif transfer_validator.validate_branch_name(beneficiery_branch, 4,
                                                 10) == False:
        error_message = transfer_validator.message
    elif transfer_validator.validate_ifsc_code(beneficiery_ifsc_code) == False:
        error_message = transfer_validator.message
    elif int(transfer_amount) < 0 or int(transfer_amount) > 100000:
        error_message = "<P>Transfer amount must be greater than 0 and less than 100000!</p>"

mlog.error(TAG,